feat(POSTV1-ASSET-ALL-16): 发布完整素材注册清单
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run
This commit is contained in:
@@ -3,25 +3,20 @@ import type { StaticStickerCatalog, StaticStickerCatalogItem } from "@dada/stati
|
||||
export const P0A_COMPLEX_RELEASE_VERSION = "p0a-complex-v1";
|
||||
export const P0A_STATIC_STICKER_RELEASE_VERSION = "p0a-static-v1";
|
||||
|
||||
export const P0A_TEXT_TEMPLATE_IDS = [
|
||||
"FLOWER001", "FLOWER002", "FLOWER003", "FLOWER004", "FLOWER005", "FLOWER006", "FLOWER007", "FLOWER008",
|
||||
"H001", "H002", "H003", "H004", "H005", "H006", "H007", "H008",
|
||||
"TAG001", "TAG002", "TAG003", "TAG004", "TAG005", "TAG006", "TAG007", "TAG051",
|
||||
"SIMPLE001", "SIMPLE002", "SIMPLE003", "SIMPLE004", "SIMPLE005", "SIMPLE006", "SIMPLE007", "SIMPLE008",
|
||||
] as const;
|
||||
function numberedIds(prefix: string, count: number) {
|
||||
return Object.freeze(Array.from({ length: count }, (_, index) => `${prefix}${String(index + 1).padStart(3, "0")}`));
|
||||
}
|
||||
|
||||
// Derived from exact package-hash matches between the 32 frozen templates and the 86-item font panel.
|
||||
export const P0A_REQUIRED_FONT_PANEL_IDS = [
|
||||
"FONT005", "FONT008", "FONT011", "FONT021", "FONT022", "FONT027",
|
||||
"FONT039", "FONT043", "FONT046", "FONT052", "FONT081",
|
||||
] as const;
|
||||
export const P0A_TEXT_TEMPLATE_IDS = Object.freeze([
|
||||
...numberedIds("FLOWER", 145),
|
||||
...numberedIds("H", 119),
|
||||
...numberedIds("TAG", 51),
|
||||
...numberedIds("SIMPLE", 17),
|
||||
]);
|
||||
|
||||
export const P0A_COLOR_CARD_IDS = ["COLOR001", "COLOR002", "COLOR008", "COLOR016"] as const;
|
||||
|
||||
export const P0A_DYNAMIC_STICKER_IDS = [
|
||||
"DYN001", "DYN002", "DYN003", "DYN004", "DYN007",
|
||||
"DYN008", "DYN011", "DYN012", "DYN015", "DYN016",
|
||||
] as const;
|
||||
export const P0A_REQUIRED_FONT_PANEL_IDS = numberedIds("FONT", 86);
|
||||
export const P0A_COLOR_CARD_IDS = numberedIds("COLOR", 16);
|
||||
export const P0A_DYNAMIC_STICKER_IDS = numberedIds("DYN", 35);
|
||||
|
||||
export const P0A_DYNAMIC_RUNTIME_FONT_SOURCES = [
|
||||
{ assetId: "15974853bc3294ef68e7e6d58fe74fd7", sourceReference: "fonts/15974853bc3294ef68e7e6d58fe74fd7", templateId: "DYN002" },
|
||||
@@ -76,12 +71,12 @@ export interface P0aPublicManifest {
|
||||
text_templates: PublicComplexAsset[];
|
||||
};
|
||||
counts: {
|
||||
color_cards: 4;
|
||||
dynamic_stickers: 10;
|
||||
font_panel_items: 11;
|
||||
color_cards: 16;
|
||||
dynamic_stickers: 35;
|
||||
font_panel_items: 86;
|
||||
static_parts: 25;
|
||||
static_stickers: 1407;
|
||||
text_templates: 32;
|
||||
text_templates: 332;
|
||||
};
|
||||
release_tier: "alpha_whitelist";
|
||||
release_version: string;
|
||||
@@ -140,15 +135,6 @@ function validateStaticCatalog(catalog: StaticStickerCatalog) {
|
||||
if (Object.keys(catalog.part_counts).length !== 25) throw new Error("static sticker part counts must contain 25 parts");
|
||||
}
|
||||
|
||||
function fontIdsForTemplates(templates: readonly RegisteredComplexAsset[]) {
|
||||
const referenced = new Set<string>();
|
||||
for (const template of templates) {
|
||||
for (const fontId of template.font_panel_references ?? []) referenced.add(fontId);
|
||||
}
|
||||
referenced.add("FONT081");
|
||||
return [...referenced].sort((left, right) => Number(left.slice(4)) - Number(right.slice(4)));
|
||||
}
|
||||
|
||||
export function createP0aPublicManifest(input: {
|
||||
complexManifest: ComplexRegistryManifest;
|
||||
staticCatalog: StaticStickerCatalog;
|
||||
@@ -157,11 +143,7 @@ export function createP0aPublicManifest(input: {
|
||||
validateStaticCatalog(input.staticCatalog);
|
||||
|
||||
const textTemplates = orderedItems(input.complexManifest.items, P0A_TEXT_TEMPLATE_IDS, "text_template");
|
||||
const derivedFontIds = fontIdsForTemplates(textTemplates);
|
||||
if (JSON.stringify(derivedFontIds) !== JSON.stringify(P0A_REQUIRED_FONT_PANEL_IDS)) {
|
||||
throw new Error(`P0-A referenced font panel mismatch: received ${derivedFontIds.join(",")}`);
|
||||
}
|
||||
const fontPanelItems = orderedItems(input.complexManifest.items, derivedFontIds, "font_panel");
|
||||
const fontPanelItems = orderedItems(input.complexManifest.items, P0A_REQUIRED_FONT_PANEL_IDS, "font_panel");
|
||||
const colorCards = orderedItems(input.complexManifest.items, P0A_COLOR_CARD_IDS, "color_card");
|
||||
const dynamicStickers = orderedItems(input.complexManifest.items, P0A_DYNAMIC_STICKER_IDS, "interactive_sticker");
|
||||
|
||||
@@ -174,12 +156,12 @@ export function createP0aPublicManifest(input: {
|
||||
text_templates: textTemplates.map(publicItem),
|
||||
},
|
||||
counts: {
|
||||
color_cards: 4,
|
||||
dynamic_stickers: 10,
|
||||
font_panel_items: 11,
|
||||
color_cards: 16,
|
||||
dynamic_stickers: 35,
|
||||
font_panel_items: 86,
|
||||
static_parts: 25,
|
||||
static_stickers: 1_407,
|
||||
text_templates: 32,
|
||||
text_templates: 332,
|
||||
},
|
||||
release_tier: "alpha_whitelist",
|
||||
release_version: input.complexManifest.release_version,
|
||||
|
||||
Reference in New Issue
Block a user