初回コミット: AltStore PAL向けADPホスティングSaaS
- Fastify API・Node Worker・PostgreSQL・S3互換ストレージ構成
- ADP ZIPのマルチパートアップロードとManifest検証(パストラバーサル・ZIP爆弾等を拒否)
- manifest.json/signatureは再シリアライズせず元バイト列を保持
- Cloudflare風の運用向け管理ダッシュボード(shadcn/Radix・日本語UI・4ルート)
概要/Sources/アプリ/リリース + ルートランディングページ
- 汎用OIDC SSO・Workspace単位の認可・demo mode
- 匿名配布: /sources/{slug}/source.json, /artifacts/{releaseId}/manifest.json
- Docker Compose対応
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { buildSourceDocument } from "../packages/core/src/index.ts";
|
||||
|
||||
test("builds a PAL source with published releases only", () => {
|
||||
const source = {
|
||||
id: "source-1",
|
||||
workspaceId: "workspace-1",
|
||||
slug: "my-apps",
|
||||
name: "My Apps",
|
||||
subtitle: "Small iOS experiments",
|
||||
description: "A test source",
|
||||
tintColor: "#E9694B",
|
||||
visibility: "public",
|
||||
createdAt: "2026-01-01T00:00:00.000Z",
|
||||
updatedAt: "2026-01-01T00:00:00.000Z",
|
||||
};
|
||||
const app = {
|
||||
id: "app-1",
|
||||
sourceId: "source-1",
|
||||
name: "Orbit",
|
||||
bundleIdentifier: "com.example.orbit",
|
||||
marketplaceID: "123",
|
||||
developerName: "Example",
|
||||
subtitle: "",
|
||||
localizedDescription: "An orbit app",
|
||||
tintColor: "#E9694B",
|
||||
category: "utilities",
|
||||
screenshots: [],
|
||||
appPermissions: { entitlements: [], privacy: {} },
|
||||
createdAt: "2026-01-01T00:00:00.000Z",
|
||||
updatedAt: "2026-01-01T00:00:00.000Z",
|
||||
};
|
||||
const published = {
|
||||
id: "release-1",
|
||||
appId: "app-1",
|
||||
uploadId: "upload-1",
|
||||
version: "1.0",
|
||||
buildVersion: "1",
|
||||
appleItemId: "123",
|
||||
date: "2026-02-01T00:00:00.000Z",
|
||||
localizedDescription: "First release",
|
||||
sizeBytes: 1024,
|
||||
status: "published",
|
||||
manifest: { bundleId: "com.example.orbit", appleItemId: "123", shortVersionString: "1.0", bundleVersion: "1", variantPaths: [], deltaPaths: [], platforms: [], minimumSystemVersions: {} },
|
||||
createdAt: "2026-02-01T00:00:00.000Z",
|
||||
};
|
||||
const draft = { ...published, id: "release-2", version: "2.0", status: "ready" };
|
||||
const document = buildSourceDocument(source, [app], [published, draft], "https://example.test");
|
||||
assert.equal(document.apps.length, 1);
|
||||
assert.equal(document.apps[0].versions.length, 1);
|
||||
assert.equal(document.apps[0].versions[0].downloadURL, "https://example.test/artifacts/release-1/manifest.json");
|
||||
assert.deepEqual(document.featuredApps, ["com.example.orbit"]);
|
||||
});
|
||||
Reference in New Issue
Block a user