@cosmicdrift/kumiko-bundled-features 0.364.0 → 0.365.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/audit/feature.js +1 -1
- package/dist/audit/run-escape-hatch-retention.d.ts +1 -0
- package/dist/audit/run-escape-hatch-retention.js +39 -12
- package/dist/auth-email-password/bootstrap.d.ts +1 -3
- package/dist/auth-email-password/feature.js +2 -0
- package/dist/auth-email-password/handlers/invite-accept-with-login.write.js +2 -3
- package/dist/auth-email-password/handlers/invite-create.write.d.ts +2 -3
- package/dist/auth-email-password/handlers/invite-create.write.js +4 -1
- package/dist/auth-email-password/handlers/switch-tenant-mfa-gate.write.d.ts +1 -0
- package/dist/auth-email-password/handlers/switch-tenant-mfa-gate.write.js +1 -1
- package/dist/auth-email-password/magic-link-mail.js +6 -3
- package/dist/auth-email-password/mail-i18n.d.ts +3 -0
- package/dist/auth-email-password/mail-i18n.js +10 -0
- package/dist/billing-foundation/consumer-protection/termination-record.js +8 -1
- package/dist/billing-foundation/i18n.js +6 -0
- package/dist/billing-foundation/subscription-tier-sync.js +8 -2
- package/dist/cap-counter/book-cap-usage.js +8 -0
- package/dist/cap-counter/cap-reservation.js +7 -3
- package/dist/cap-counter/handlers/increment-rolling.write.d.ts +1 -0
- package/dist/cap-counter/handlers/increment-rolling.write.js +2 -0
- package/dist/cap-overview/handlers/tenant-caps-list.query.js +3 -1
- package/dist/cap-overview/handlers/tenant-options.query.js +3 -1
- package/dist/channel-discord/discord-channel.js +3 -2
- package/dist/channel-email/email-channel.js +24 -19
- package/dist/channel-email/smtp-transport.js +6 -1
- package/dist/channel-slack/slack-channel.js +3 -2
- package/dist/channel-teams/teams-channel.js +3 -2
- package/dist/crypto-shredding/handlers/forget-subject.write.js +2 -2
- package/dist/custom-fields/db/queries/retention.d.ts +1 -1
- package/dist/custom-fields/db/queries/retention.js +2 -1
- package/dist/data-retention/run-retention-cleanup.js +4 -5
- package/dist/delivery/attachment-ref.js +16 -1
- package/dist/delivery/delivery-service.js +71 -82
- package/dist/feature-toggles/toggle-runtime.d.ts +5 -3
- package/dist/feature-toggles/toggle-runtime.js +25 -12
- package/dist/files-tenant-data/index.d.ts +1 -0
- package/dist/files-tenant-data/index.js +2 -1
- package/dist/form-draft/db/queries/owned-file-refs.d.ts +1 -1
- package/dist/form-draft/db/queries/owned-file-refs.js +9 -2
- package/dist/form-draft/handlers/discard.write.js +1 -1
- package/dist/jobs/job-run-logger.js +5 -2
- package/dist/metrics/filters.d.ts +16 -1
- package/dist/metrics/filters.js +27 -11
- package/dist/personal-access-tokens/revoke-for-user.js +3 -7
- package/dist/secrets/handlers/delete.write.js +3 -1
- package/dist/secrets/write-gate.d.ts +3 -1
- package/dist/secrets/write-gate.js +6 -3
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/index.js +1 -0
- package/dist/shared/resource-image-formats.d.ts +23 -0
- package/dist/shared/resource-image-formats.js +21 -0
- package/dist/shared/sharp-input-limits.js +7 -8
- package/dist/step-dispatcher/webhook-runner.js +2 -2
- package/dist/template-resolver/compile-document-body.d.ts +3 -0
- package/dist/template-resolver/compile-document-body.js +63 -12
- package/dist/template-resolver/compile-steps-block.d.ts +10 -0
- package/dist/template-resolver/compile-steps-block.js +45 -0
- package/dist/template-resolver/constants.d.ts +4 -1
- package/dist/template-resolver/constants.js +10 -1
- package/dist/template-resolver/document-sanitizer.js +3 -0
- package/dist/template-resolver/document-schema.d.ts +2 -1
- package/dist/template-resolver/document-schema.js +6 -1
- package/dist/template-resolver/document-steps.d.ts +17 -0
- package/dist/template-resolver/document-steps.js +93 -0
- package/dist/template-resolver/feature.js +9 -0
- package/dist/template-resolver/handlers/bundle-import.d.ts +7 -1
- package/dist/template-resolver/handlers/bundle-import.js +63 -38
- package/dist/template-resolver/handlers/collection-set.write.js +4 -3
- package/dist/template-resolver/handlers/copy-locale.write.d.ts +1 -1
- package/dist/template-resolver/handlers/copy-locale.write.js +83 -55
- package/dist/template-resolver/handlers/diff-to-system.query.js +1 -0
- package/dist/template-resolver/handlers/import-bundle-system.write.d.ts +1 -1
- package/dist/template-resolver/handlers/import-bundle-system.write.js +16 -5
- package/dist/template-resolver/handlers/import-bundle.write.d.ts +1 -1
- package/dist/template-resolver/handlers/import-bundle.write.js +11 -1
- package/dist/template-resolver/handlers/overview.query.d.ts +3 -0
- package/dist/template-resolver/handlers/overview.query.js +9 -1
- package/dist/template-resolver/handlers/resource-upload.write.d.ts +2 -2
- package/dist/template-resolver/handlers/resource-upload.write.js +35 -5
- package/dist/template-resolver/handlers/validate.query.js +4 -1
- package/dist/template-resolver/index.d.ts +3 -3
- package/dist/template-resolver/index.js +3 -3
- package/dist/template-resolver/layout-appearance.d.ts +1 -1
- package/dist/template-resolver/layout-appearance.js +19 -9
- package/dist/template-resolver/mail-constants.d.ts +2 -0
- package/dist/template-resolver/mail-constants.js +3 -0
- package/dist/template-resolver/resource-image.d.ts +2 -9
- package/dist/template-resolver/resource-image.js +2 -11
- package/dist/template-resolver/seeding.js +2 -0
- package/dist/template-resolver/store-template-resource.d.ts +53 -9
- package/dist/template-resolver/store-template-resource.js +250 -97
- package/dist/template-resolver/template-bundle.js +4 -0
- package/dist/template-resolver/template-draft.d.ts +3 -0
- package/dist/template-resolver/template-draft.js +1 -1
- package/dist/template-resolver/template-meta.d.ts +5 -1
- package/dist/template-resolver/template-meta.js +7 -0
- package/dist/template-resolver/template-preview.js +1 -2
- package/dist/template-resolver/template-resources.d.ts +0 -5
- package/dist/template-resolver/template-resources.js +2 -34
- package/dist/template-resolver/template-validation.js +12 -9
- package/dist/template-resolver/web/document-editor-extensions.d.ts +1 -0
- package/dist/template-resolver/web/document-editor-extensions.js +26 -1
- package/dist/template-resolver/web/document-editor.js +5 -1
- package/dist/template-resolver/web/document-tiptap-editor.js +30 -7
- package/dist/template-resolver/web/document-toolbar-blocks.d.ts +5 -5
- package/dist/template-resolver/web/document-toolbar-blocks.js +2 -0
- package/dist/template-resolver/web/i18n.js +5 -0
- package/dist/template-resolver/web/index.d.ts +1 -0
- package/dist/template-resolver/web/index.js +1 -0
- package/dist/template-resolver/web/placeholder-line-editor.d.ts +4 -2
- package/dist/template-resolver/web/placeholder-line-editor.js +8 -6
- package/dist/tenant/handlers/update-member-roles.write.js +3 -6
- package/dist/tenant/seeding.js +23 -24
- package/dist/tenant-handover/move-entity-graph.js +14 -4
- package/dist/tenant-lifecycle/run-tenant-destroy.d.ts +1 -0
- package/dist/tenant-lifecycle/run-tenant-destroy.js +8 -1
- package/dist/tenant-lifecycle/stages.js +3 -2
- package/dist/tier-engine/constants.d.ts +2 -0
- package/dist/tier-engine/constants.js +4 -0
- package/dist/tier-engine/entity.d.ts +15 -14
- package/dist/tier-engine/entity.js +4 -3
- package/dist/tier-engine/handlers/set-tenant-tier.write.d.ts +5 -0
- package/dist/tier-engine/handlers/set-tenant-tier.write.js +7 -4
- package/dist/tier-engine/index.d.ts +1 -1
- package/dist/tier-engine/index.js +1 -1
- package/dist/tier-engine/tier-resolver.d.ts +13 -13
- package/dist/user/constants.d.ts +1 -0
- package/dist/user/invited-global-roles.d.ts +2 -4
- package/dist/user-data-rights/email-templates.js +0 -1
- package/dist/user-data-rights/i18n.js +5 -0
- package/dist/user-data-rights/lib/update-user-lifecycle.d.ts +2 -0
- package/dist/user-data-rights/lib/update-user-lifecycle.js +6 -2
- package/dist/user-data-rights/run-forget-cleanup.js +2 -2
- package/dist/waitlist/feature.js +1 -1
- package/dist/waitlist/handlers/invite.write.js +21 -3
- package/dist/waitlist/handlers/reject.write.js +3 -16
- package/dist/waitlist/handlers/submit.write.js +29 -7
- package/dist/waitlist/i18n.js +9 -0
- package/dist/waitlist/lib.d.ts +2 -1
- package/dist/waitlist/lib.js +15 -0
- package/dist/workflow-runner/feature.js +1 -1
- package/package.json +10 -10
- package/src/audit/changes.json +12 -0
- package/src/auth-email-password/changes.json +18 -0
- package/src/billing-foundation/changes.json +12 -0
- package/src/cap-counter/changes.json +13 -0
- package/src/cap-overview/changes.json +6 -0
- package/src/channel-email/changes.json +18 -0
- package/src/delivery/changes.json +12 -0
- package/src/document-ingest-foundation/changes.json +6 -0
- package/src/feature-toggles/changes.json +7 -0
- package/src/jobs/changes.json +12 -0
- package/src/metrics/changes.json +6 -0
- package/src/personal-access-tokens/changes.json +6 -0
- package/src/secrets/changes.json +6 -0
- package/src/template-resolver/changes.json +81 -0
- package/src/tenant/changes.json +6 -0
- package/src/tenant-lifecycle/changes.json +6 -0
- package/src/tier-engine/changes.json +12 -0
- package/src/user-data-rights/changes.json +6 -0
- package/src/waitlist/changes.json +18 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createTemplateResolverApi, requireTemplateResolver, TemplateNotFoundError, } from "./api.js";
|
|
2
2
|
export { collectDocumentResourceKeys, compileDocumentBodyToHandlebars, toResourceDataUri, } from "./compile-document-body.js";
|
|
3
|
-
export { CONTENT_FORMATS, DEFAULT_MAIL_LAYOUT_SLUG, DOCUMENT_HTML_KINDS, FALLBACK_LOCALE, NON_RENDER_KINDS, PDF_DEFAULT_MARGIN_MM, PDF_FOOTER_MARGIN_MM, PDF_HEADER_MARGIN_MM, PDF_ORIENTATIONS, PDF_PAGE_FORMATS, RENDER_KINDS, SYSTEM_TENANT_ID, TEMPLATE_KINDS, TEMPLATE_SCOPES, TEMPLATE_STATUSES, TEXT_BLOCK_KIND, UPSERT_KINDS, } from "./constants.js";
|
|
3
|
+
export { CONTENT_FORMATS, DEFAULT_MAIL_LAYOUT_SLUG, DEFAULT_PDF_LAYOUT_SLUG, DOCUMENT_HTML_KINDS, FALLBACK_LOCALE, NON_RENDER_KINDS, PDF_DEFAULT_MARGIN_MM, PDF_FOOTER_MARGIN_MM, PDF_HEADER_MARGIN_MM, PDF_ORIENTATIONS, PDF_PAGE_FORMATS, RENDER_KINDS, SYSTEM_TENANT_ID, TEMPLATE_KINDS, TEMPLATE_SCOPES, TEMPLATE_STATUSES, TEXT_BLOCK_KIND, UPSERT_KINDS, } from "./constants.js";
|
|
4
4
|
export { documentViolationsToFieldIssues, sanitizeDocumentHtml, sanitizeTemplateBody, } from "./document-sanitizer.js";
|
|
5
5
|
export { DOCUMENT_NODE_NAMES, DOCUMENT_TEXT_ALIGNMENTS, DocumentButton, DocumentDivider, DocumentLink, DocumentPageBreak, DocumentResource, DocumentTable, DocumentTableCell, DocumentTableHeader, DocumentTableRow, DocumentTextAlign, DocumentVariable, documentExtensions, isAllowedDocumentLinkHref, isDocumentPlaceholderHref, isDocumentReferenceName, isDocumentResourceKey, } from "./document-schema.js";
|
|
6
6
|
export { createTemplateResolverFeature } from "./feature.js";
|
|
@@ -11,10 +11,10 @@ export { fileAttachmentsOf, imageLinksOf, parseLinkedResourceEntries, pdfAttachm
|
|
|
11
11
|
export { prepareDocumentForPrint } from "./print-document.js";
|
|
12
12
|
export { TEMPLATE_RESOLVER_FEATURE, TemplateResolverErrors, TemplateResolverHandlers, TemplateResolverQueries, } from "./qualified-names.js";
|
|
13
13
|
export { mapRecordToVariables } from "./record-mapping.js";
|
|
14
|
-
export { readTemplateResourceMaxBytes,
|
|
14
|
+
export { prepareTemplateResourceBeforeTransaction, readTemplateResourceMaxBytes, storePreparedTemplateResource, } from "./store-template-resource.js";
|
|
15
15
|
export { templateResourceEntity, templateResourcesTable, } from "./table.js";
|
|
16
16
|
export { templateBundleSchema } from "./template-bundle.js";
|
|
17
|
-
export { isMailTemplateMeta, MAIL_CATEGORIES, parseTemplateMeta, pdfAttachmentFileNamePatternSchema, readMailLayoutMeta, readPdfTemplateMeta, templateSlugSchema, } from "./template-meta.js";
|
|
17
|
+
export { isMailTemplateMeta, MAIL_CATEGORIES, MAIL_TONES, parseTemplateMeta, pdfAttachmentFileNamePatternSchema, readMailLayoutMeta, readPdfTemplateMeta, templateSlugSchema, } from "./template-meta.js";
|
|
18
18
|
export { evaluateDocumentDraft } from "./template-preview.js";
|
|
19
19
|
export { readTemplateResource } from "./template-resources.js";
|
|
20
20
|
export { collectTemplateUsage } from "./template-usage.js";
|
|
@@ -7,4 +7,4 @@ export type MailLayoutAppearance = {
|
|
|
7
7
|
readonly buttonStyle: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function isHexColor(value: string): boolean;
|
|
10
|
-
export declare function mailLayoutAppearance(meta: MailLayoutMeta | unknown): MailLayoutAppearance;
|
|
10
|
+
export declare function mailLayoutAppearance(meta: MailLayoutMeta | unknown, brandingAccentColor?: string): MailLayoutAppearance;
|
|
@@ -4,23 +4,33 @@ const FONT_FAMILIES = {
|
|
|
4
4
|
sans: "Arial, Helvetica, sans-serif",
|
|
5
5
|
serif: "Georgia, 'Times New Roman', serif",
|
|
6
6
|
};
|
|
7
|
-
const
|
|
7
|
+
const DEFAULT_BUTTON_COLOR = "#1f5468";
|
|
8
8
|
const BUTTON_BASE = "display:inline-block;padding:10px 20px;font-weight:600;text-decoration:none";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
function buttonStyleCss(style, color) {
|
|
10
|
+
switch (style) {
|
|
11
|
+
case "filled-rounded":
|
|
12
|
+
return `${BUTTON_BASE};border-radius:6px;background-color:${color};color:#ffffff`;
|
|
13
|
+
case "filled-square":
|
|
14
|
+
return `${BUTTON_BASE};background-color:${color};color:#ffffff`;
|
|
15
|
+
case "outline":
|
|
16
|
+
return `${BUTTON_BASE};border:2px solid ${color};border-radius:6px;color:${color}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
14
19
|
export function isHexColor(value) {
|
|
15
20
|
return HEX_COLOR_PATTERN.test(value);
|
|
16
21
|
}
|
|
17
|
-
|
|
22
|
+
// The branding accent colors the buttons only where the layout opted into the branding accent line.
|
|
23
|
+
export function mailLayoutAppearance(meta, brandingAccentColor) {
|
|
18
24
|
const parsed = readMailLayoutMeta(meta);
|
|
25
|
+
const accentLine = (parsed.accentLine ?? "none") === "branding";
|
|
26
|
+
const buttonColor = accentLine && brandingAccentColor !== undefined && isHexColor(brandingAccentColor)
|
|
27
|
+
? brandingAccentColor
|
|
28
|
+
: DEFAULT_BUTTON_COLOR;
|
|
19
29
|
return {
|
|
20
30
|
width: parsed.width ?? 600,
|
|
21
31
|
fontFamily: FONT_FAMILIES[parsed.font ?? "sans"],
|
|
22
32
|
outerBackground: parsed.outerBackground ?? "#f5f5f5",
|
|
23
|
-
accentLine
|
|
24
|
-
buttonStyle:
|
|
33
|
+
accentLine,
|
|
34
|
+
buttonStyle: buttonStyleCss(parsed.buttonStyle ?? "filled-rounded", buttonColor),
|
|
25
35
|
};
|
|
26
36
|
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
readonly png: "image/png";
|
|
3
|
-
readonly jpeg: "image/jpeg";
|
|
4
|
-
readonly gif: "image/gif";
|
|
5
|
-
readonly webp: "image/webp";
|
|
6
|
-
};
|
|
7
|
-
type ResourceImageFormat = keyof typeof CONTENT_TYPE_BY_FORMAT;
|
|
1
|
+
import { type ResourceImageContentType } from "../shared/index.js";
|
|
8
2
|
export type NormalizedResourceImage = {
|
|
9
3
|
readonly data: Uint8Array;
|
|
10
|
-
readonly contentType:
|
|
4
|
+
readonly contentType: ResourceImageContentType;
|
|
11
5
|
readonly width: number;
|
|
12
6
|
readonly height: number;
|
|
13
7
|
};
|
|
14
8
|
export declare function normalizeResourceImage(data: Uint8Array): Promise<NormalizedResourceImage>;
|
|
15
|
-
export {};
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import { assertNotSvg, SHARP_INPUT_OPTIONS } from "../shared/index.js";
|
|
1
|
+
import { assertNotSvg, isResourceImageFormat, RESOURCE_IMAGE_FORMATS, SHARP_INPUT_OPTIONS, } from "../shared/index.js";
|
|
2
2
|
const MAX_RESOURCE_WIDTH = 1200;
|
|
3
|
-
const CONTENT_TYPE_BY_FORMAT = {
|
|
4
|
-
png: "image/png",
|
|
5
|
-
jpeg: "image/jpeg",
|
|
6
|
-
gif: "image/gif",
|
|
7
|
-
webp: "image/webp",
|
|
8
|
-
};
|
|
9
|
-
function isResourceImageFormat(format) {
|
|
10
|
-
return format !== undefined && Object.hasOwn(CONTENT_TYPE_BY_FORMAT, format);
|
|
11
|
-
}
|
|
12
3
|
// Re-encodes an uploaded image: the stored content type comes from the decoded format, never
|
|
13
4
|
// from the client, and re-encoding drops metadata and anything appended to the file.
|
|
14
5
|
// sharp is imported lazily because every app loads template-resolver, few of them need an image decoder.
|
|
@@ -27,7 +18,7 @@ export async function normalizeResourceImage(data) {
|
|
|
27
18
|
const { data: output, info } = await pipeline.toBuffer({ resolveWithObject: true });
|
|
28
19
|
return {
|
|
29
20
|
data: new Uint8Array(output),
|
|
30
|
-
contentType:
|
|
21
|
+
contentType: RESOURCE_IMAGE_FORMATS[format].contentType,
|
|
31
22
|
width: info.width,
|
|
32
23
|
height: info.height,
|
|
33
24
|
};
|
|
@@ -95,6 +95,8 @@ export async function seedSystemTemplate(db, opts) {
|
|
|
95
95
|
current?.title === rowFields.title &&
|
|
96
96
|
current?.variableSchema === rowFields.variableSchema &&
|
|
97
97
|
current?.meta === rowFields.meta &&
|
|
98
|
+
current?.status === rowFields.status &&
|
|
99
|
+
current?.parentTemplateId === rowFields.parentTemplateId &&
|
|
98
100
|
(linkedResources === undefined || current?.linkedResources === linkedResources)) {
|
|
99
101
|
return { id: String(row.id) };
|
|
100
102
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ConfigAccessor, HandlerContext, Registry, SessionUser, TenantId, WriteResult } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import type
|
|
1
|
+
import type { BeforeTransactionResult, ConfigAccessor, HandlerContext, Registry, SessionUser, TenantId, WriteResult } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { type UploadedFileBytes } from "@cosmicdrift/kumiko-framework/files";
|
|
3
3
|
import { type LinkedResourceEntry } from "./linked-resources.js";
|
|
4
4
|
export declare function readTemplateResourceMaxBytes(config: ConfigAccessor | undefined, registry: Registry): Promise<number>;
|
|
5
5
|
export type StoredTemplateResource = {
|
|
@@ -10,7 +10,28 @@ export type StoredTemplateResource = {
|
|
|
10
10
|
readonly height: number;
|
|
11
11
|
readonly size: number;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type PreparedTemplateImage = {
|
|
14
|
+
readonly kind: "image";
|
|
15
|
+
readonly contentType: string;
|
|
16
|
+
readonly width: number;
|
|
17
|
+
readonly height: number;
|
|
18
|
+
readonly size: number;
|
|
19
|
+
readonly upload: UploadedFileBytes;
|
|
20
|
+
};
|
|
21
|
+
export type PreparedTemplateAttachment = {
|
|
22
|
+
readonly kind: "attachment";
|
|
23
|
+
readonly contentType: string;
|
|
24
|
+
readonly size: number;
|
|
25
|
+
readonly fileName: string;
|
|
26
|
+
readonly upload: UploadedFileBytes;
|
|
27
|
+
};
|
|
28
|
+
export type PreparedTemplateFile = PreparedTemplateImage | PreparedTemplateAttachment;
|
|
29
|
+
type TenantScope = {
|
|
30
|
+
readonly ctx: HandlerContext;
|
|
31
|
+
readonly user: SessionUser;
|
|
32
|
+
readonly tenantId: TenantId;
|
|
33
|
+
};
|
|
34
|
+
export declare function prepareTemplateResourceBeforeTransaction(args: {
|
|
14
35
|
readonly ctx: HandlerContext;
|
|
15
36
|
readonly user: SessionUser;
|
|
16
37
|
readonly tenantId: TenantId;
|
|
@@ -18,6 +39,28 @@ export declare function storeTemplateResource(args: {
|
|
|
18
39
|
readonly maxBytes: number;
|
|
19
40
|
readonly templateId?: string;
|
|
20
41
|
readonly key?: string;
|
|
42
|
+
}): Promise<BeforeTransactionResult<PreparedTemplateImage>>;
|
|
43
|
+
export type Release = () => Promise<void>;
|
|
44
|
+
export declare function releaseAll(releases: readonly Release[]): Promise<void>;
|
|
45
|
+
export type PreparedLinkedResourceCopy = {
|
|
46
|
+
readonly key: string;
|
|
47
|
+
readonly entry: LinkedResourceEntry;
|
|
48
|
+
readonly upload?: UploadedFileBytes;
|
|
49
|
+
};
|
|
50
|
+
export declare function prepareLinkedResourceCopiesBeforeTransaction(args: {
|
|
51
|
+
readonly ctx: HandlerContext;
|
|
52
|
+
readonly user: SessionUser;
|
|
53
|
+
readonly tenantId: TenantId;
|
|
54
|
+
readonly resources: Readonly<Record<string, LinkedResourceEntry>>;
|
|
55
|
+
}): Promise<BeforeTransactionResult<readonly PreparedLinkedResourceCopy[]>>;
|
|
56
|
+
export declare function createLinkedResourceCopies(scope: TenantScope, prepared: readonly PreparedLinkedResourceCopy[]): Promise<WriteResult<Record<string, LinkedResourceEntry>>>;
|
|
57
|
+
export declare function storePreparedTemplateResource(args: {
|
|
58
|
+
readonly ctx: HandlerContext;
|
|
59
|
+
readonly user: SessionUser;
|
|
60
|
+
readonly tenantId: TenantId;
|
|
61
|
+
readonly prepared: PreparedTemplateImage;
|
|
62
|
+
readonly templateId?: string;
|
|
63
|
+
readonly key?: string;
|
|
21
64
|
}): Promise<WriteResult<StoredTemplateResource>>;
|
|
22
65
|
export type StoredTemplateAttachment = {
|
|
23
66
|
readonly fileRefId: string;
|
|
@@ -29,7 +72,7 @@ export type StoredTemplateAttachment = {
|
|
|
29
72
|
export declare function attachmentNeedsMailTemplate(): WriteResult<never>;
|
|
30
73
|
export declare function attachmentLimitFailure(): WriteResult<never>;
|
|
31
74
|
export declare function otherAttachmentCount(linked: Readonly<Record<string, LinkedResourceEntry>>, key: string): number;
|
|
32
|
-
export declare function
|
|
75
|
+
export declare function prepareTemplateAttachmentBeforeTransaction(args: {
|
|
33
76
|
readonly ctx: HandlerContext;
|
|
34
77
|
readonly user: SessionUser;
|
|
35
78
|
readonly tenantId: TenantId;
|
|
@@ -37,16 +80,16 @@ export declare function storeBundleAttachment(args: {
|
|
|
37
80
|
readonly maxBytes: number;
|
|
38
81
|
readonly key: string;
|
|
39
82
|
readonly fileName: string;
|
|
40
|
-
|
|
41
|
-
|
|
83
|
+
readonly templateId?: string;
|
|
84
|
+
}): Promise<BeforeTransactionResult<PreparedTemplateAttachment>>;
|
|
85
|
+
export declare function createPreparedBundleResourceEntry(scope: TenantScope, prepared: PreparedTemplateFile): Promise<WriteResult<LinkedResourceEntry>>;
|
|
86
|
+
export declare function storePreparedTemplateAttachment(args: {
|
|
42
87
|
readonly ctx: HandlerContext;
|
|
43
88
|
readonly user: SessionUser;
|
|
44
89
|
readonly tenantId: TenantId;
|
|
45
|
-
readonly
|
|
46
|
-
readonly maxBytes: number;
|
|
90
|
+
readonly prepared: PreparedTemplateAttachment;
|
|
47
91
|
readonly templateId: string;
|
|
48
92
|
readonly key: string;
|
|
49
|
-
readonly fileName: string;
|
|
50
93
|
}): Promise<WriteResult<StoredTemplateAttachment>>;
|
|
51
94
|
export type LinkedTemplatePdfAttachment = {
|
|
52
95
|
readonly key: string;
|
|
@@ -62,3 +105,4 @@ export declare function linkTemplatePdfAttachment(args: {
|
|
|
62
105
|
readonly templateSlug: string;
|
|
63
106
|
readonly fileName: string;
|
|
64
107
|
}): Promise<WriteResult<LinkedTemplatePdfAttachment>>;
|
|
108
|
+
export {};
|