ba-memorial-lobby-wallpaper-toolkit 0.5.0 → 0.6.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 CHANGED
@@ -1,10 +1,10 @@
1
1
  export * from "./checksums.js";
2
2
  export * from "./asset-preparation.js";
3
3
  export * from "./asset-layout.js";
4
+ export * from "./project-contract.js";
4
5
  export * from "./media.js";
5
6
  export * from "./distribution-validation.js";
6
7
  export * from "./model-assets.js";
7
- export * from "./model-assets.js";
8
8
  export * from "./offline-package.js";
9
9
  export * from "./spine-inspection.js";
10
10
  export * from "./template-initialization.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export * from "./checksums.js";
2
2
  export * from "./asset-preparation.js";
3
3
  export * from "./asset-layout.js";
4
+ export * from "./project-contract.js";
4
5
  export * from "./media.js";
5
6
  export * from "./distribution-validation.js";
6
7
  export * from "./model-assets.js";
7
- export * from "./model-assets.js";
8
8
  export * from "./offline-package.js";
9
9
  export * from "./spine-inspection.js";
10
10
  export * from "./template-initialization.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,15 @@
1
+ export declare function projectDefaultsFromProperties(properties: Record<string, {
2
+ value: any;
3
+ }>): Record<string, any>;
4
+ export declare function projectDefaultsIssues(properties: Record<string, {
5
+ value: any;
6
+ }>, runtimeDefaults: Record<string, any>): string[];
7
+ export declare function assertProjectDefaults(properties: Record<string, {
8
+ value: any;
9
+ }>, runtimeDefaults: Record<string, any>): void;
10
+ export interface WallpaperProjectMetadataOptions {
11
+ allowWorkshopMetadata?: boolean;
12
+ requireTags?: string[];
13
+ }
14
+ export declare function validateWallpaperProjectMetadata(project: Record<string, any>, options?: WallpaperProjectMetadataOptions): string[];
15
+ //# sourceMappingURL=project-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-contract.d.ts","sourceRoot":"","sources":["../src/project-contract.ts"],"names":[],"mappings":"AAAA,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAS7G;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,CAAC,EAAE,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAGhI;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,CAAC,EAAE,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAG5H;AAED,MAAM,WAAW,+BAA+B;IAC9C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAE,+BAAoC,GAAG,MAAM,EAAE,CAatI"}
@@ -0,0 +1,45 @@
1
+ export function projectDefaultsFromProperties(properties) {
2
+ return {
3
+ modelScale: properties.modelscale.value, modelX: properties.modelx.value, modelY: properties.modely.value, modelRotation: properties.modelrotation.value,
4
+ positionPreset: properties.positionpreset.value, panelPositionPreset: properties.panelpositionpreset.value, panelScale: properties.panelscale.value, panelX: properties.panelx.value, panelY: properties.panely.value,
5
+ interactionPreset: properties.interactionpreset.value, dialogueLanguagePreset: properties.dialoguelanguagepreset.value, muted: properties.muted.value, dialogueAutoPlay: properties.dialogueautoplay.value,
6
+ subtitlesEnabled: properties.showsubtitles.value, primarySubtitleLocale: properties.subtitlelanguage.value, secondarySubtitlesEnabled: properties.showsecondarysubtitles.value, secondarySubtitleLocale: properties.secondarysubtitlelanguage.value,
7
+ subtitleAlignment: properties.subtitlealignment.value, subtitlePosition: properties.subtitleposition.value, subtitleX: properties.subtitlex.value, subtitleY: properties.subtitley.value, debugPreset: properties.debugpreset.value,
8
+ bgmVolume: properties.bgmvolume.value / 100, voiceVolume: properties.voicevolume.value / 100, qualityPreset: properties.qualitypreset.value, renderResolution: properties.renderresolution.value, modelResolution: properties.modelresolution.value, fpsLimit: properties.fpslimit.value,
9
+ };
10
+ }
11
+ export function projectDefaultsIssues(properties, runtimeDefaults) {
12
+ const projectDefaults = projectDefaultsFromProperties(properties);
13
+ return Object.keys(projectDefaults).filter((key) => !Object.is(projectDefaults[key], runtimeDefaults[key]));
14
+ }
15
+ export function assertProjectDefaults(properties, runtimeDefaults) {
16
+ const issues = projectDefaultsIssues(properties, runtimeDefaults);
17
+ if (issues.length > 0)
18
+ throw new Error(`Project defaults differ from runtime defaults: ${issues.join(", ")}`);
19
+ }
20
+ export function validateWallpaperProjectMetadata(project, options = {}) {
21
+ const issues = [];
22
+ if (project.type !== "web")
23
+ issues.push("type");
24
+ if (project.file !== "index.html")
25
+ issues.push("file");
26
+ if (project.version !== 2)
27
+ issues.push("version");
28
+ if (project.preview !== "preview.gif")
29
+ issues.push("preview");
30
+ if (project.visibility !== "public")
31
+ issues.push("visibility");
32
+ if (project.contentrating !== "Everyone")
33
+ issues.push("contentrating");
34
+ if (project.ratingsex !== "none")
35
+ issues.push("ratingsex");
36
+ if (project.ratingviolence !== "none")
37
+ issues.push("ratingviolence");
38
+ for (const tag of options.requireTags ?? [])
39
+ if (!Array.isArray(project.tags) || !project.tags.includes(tag))
40
+ issues.push(`tag:${tag}`);
41
+ if (!options.allowWorkshopMetadata && (Object.prototype.hasOwnProperty.call(project, "workshopid") || Object.prototype.hasOwnProperty.call(project, "workshopurl")))
42
+ issues.push("workshop-metadata");
43
+ return issues;
44
+ }
45
+ //# sourceMappingURL=project-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-contract.js","sourceRoot":"","sources":["../src/project-contract.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,6BAA6B,CAAC,UAA0C;IACtF,OAAO;QACL,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK;QACxJ,cAAc,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,UAAU,CAAC,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK;QACrN,iBAAiB,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,EAAE,UAAU,CAAC,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK;QAC1M,gBAAgB,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE,qBAAqB,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,EAAE,yBAAyB,EAAE,UAAU,CAAC,sBAAsB,CAAC,KAAK,EAAE,uBAAuB,EAAE,UAAU,CAAC,yBAAyB,CAAC,KAAK;QACnP,iBAAiB,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,UAAU,CA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