refactor: 拆分品牌业务类型与页面方案
CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled

This commit is contained in:
que01 committed 2026-10-20 17:04:30 +08:00
1 parent f02e2cafbb
commit 0d9f4a7d6f
86 files changed
+4111 -1543

No files matched your search

+13
View File
@@ -11,10 +11,15 @@ export type {
export type {
AdminBrandMember,
AdminBrandMembership,
BrandCreationOptions,
BrandCreationOptionBusiness,
BrandCreationOptionPageScheme,
BrandPageSchemeOptions,
BrandPresentationUpdate,
BrandProfile,
BrandReleaseSummary,
BrandUpdate,
CreateBrandInput,
} from "./types/brand.js";
export type { MiniAppReleaseSettings, MiniAppReleaseTask } from "./types/brand.js";
export type { CapabilityInstallation } from "./types/capability.js";
@@ -192,6 +197,11 @@ export class ApiClient
this.resources.brand.getAdminBrand(...arguments_);
listAdminBrands = (...arguments_: Parameters<BrandMethods["listAdminBrands"]>) =>
this.resources.brand.listAdminBrands(...arguments_);
getAdminBrandCreationOptions = (
...arguments_: Parameters<BrandMethods["getAdminBrandCreationOptions"]>
) => this.resources.brand.getAdminBrandCreationOptions(...arguments_);
createAdminBrand = (...arguments_: Parameters<BrandMethods["createAdminBrand"]>) =>
this.resources.brand.createAdminBrand(...arguments_);
switchAdminBrand = (...arguments_: Parameters<BrandMethods["switchAdminBrand"]>) =>
this.resources.brand.switchAdminBrand(...arguments_);
listAdminMembers = (...arguments_: Parameters<BrandMethods["listAdminMembers"]>) =>
@@ -291,6 +301,9 @@ export class ApiClient
getAdminTemplateOperationFailures = (
...arguments_: Parameters<TemplateMethods["getAdminTemplateOperationFailures"]>
) => this.resources.template.getAdminTemplateOperationFailures(...arguments_);
getAdminPageSchemeOptions = (
...arguments_: Parameters<TemplateMethods["getAdminPageSchemeOptions"]>
) => this.resources.template.getAdminPageSchemeOptions(...arguments_);
getPublicOffering = (...arguments_: Parameters<OfferingMethods["getPublicOffering"]>) =>
this.resources.offering.getPublicOffering(...arguments_);
listPublicOfferings = (...arguments_: Parameters<OfferingMethods["listPublicOfferings"]>) =>
@@ -2,9 +2,11 @@ import type { RequestFn } from "../client/request.js";
import type {
AdminBrandMember,
AdminBrandMembership,
BrandCreationOptions,
BrandPresentationUpdate,
BrandProfile,
BrandReleaseSummary,
CreateBrandInput,
MiniAppReleaseTask,
MiniAppReleaseSettings,
BrandUpdate,
@@ -13,6 +15,11 @@ import type {
export interface BrandMethods {
getAdminBrand(): Promise<BrandProfile>;
listAdminBrands(): Promise<AdminBrandMembership[]>;
getAdminBrandCreationOptions(): Promise<BrandCreationOptions>;
createAdminBrand(body: CreateBrandInput): Promise<{
role: string;
brand: AdminBrandMembership["brand"];
}>;
switchAdminBrand(
brandId: string,
): Promise<{ role: string; brand: AdminBrandMembership["brand"] }>;
@@ -74,6 +81,8 @@ export function brandMethods({ request }: { request: RequestFn }): BrandMethods
return {
getAdminBrand: () => request("/admin/config/brand"),
listAdminBrands: () => request("/admin/brands"),
getAdminBrandCreationOptions: () => request("/admin/brands/creation-options"),
createAdminBrand: (body) => request("/admin/brands", { method: "POST", body }),
switchAdminBrand: (brandId) =>
request(`/admin/brands/${encodeURIComponent(brandId)}/switch`, { method: "POST" }),
listAdminMembers: () => request("/admin/brands/members"),
@@ -1,6 +1,6 @@
import type { BrandTemplateKey, RuntimeWorkspace } from "@personal-brand/types";
import type { RequestFn } from "../client/request.js";
import type { BrandProfile } from "../types/brand.js";
import type { BrandPageSchemeOptions, BrandProfile } from "../types/brand.js";
import type { CapabilityWithMetadata } from "../types/capability.js";
import type { BrandFieldDefinition } from "../types/field.js";
import type { Offering } from "../types/offering.js";
@@ -8,6 +8,7 @@ import type { AdminTemplateContent } from "../types/template.js";
import type { BrandTemplateDefinition } from "../types/template-definition.js";
export interface TemplateMethods {
getAdminPageSchemeOptions(): Promise<BrandPageSchemeOptions>;
listAdminTemplatePackages(params?: {
page?: number;
pageSize?: number;
@@ -310,6 +311,7 @@ export interface TemplatePackageImportResult {
export function templateMethods({ request }: { request: RequestFn }): TemplateMethods {
return {
getAdminPageSchemeOptions: () => request("/admin/workspace/template/options"),
listAdminTemplatePackages: (params = {}) => {
const query = [
params.page === undefined ? null : `page=${encodeURIComponent(String(params.page))}`,
+34 -2
View File
@@ -2,7 +2,7 @@ import type { BrandTemplateKey } from "@personal-brand/types";
export interface BrandProfile {
id: string;
slug?: string;
slug: string;
name: string;
templateKey: BrandTemplateKey;
tagline: string | null;
@@ -20,7 +20,39 @@ export interface BrandProfile {
export interface AdminBrandMembership {
id: string;
role: string;
brand: Pick<BrandProfile, "id" | "name" | "templateKey"> & { slug?: string };
brand: Pick<BrandProfile, "id" | "name" | "templateKey" | "slug">;
}
export interface BrandCreationOptionBusiness {
key: BrandTemplateKey;
name: string;
description: string;
}
export interface BrandCreationOptionPageScheme {
templatePackageVersionId: string;
name: string;
description: string;
version: string;
supportedBusinessTypes: BrandTemplateKey[];
isLatestForPackage: boolean;
}
export interface BrandCreationOptions {
businesses: BrandCreationOptionBusiness[];
pageSchemes: BrandCreationOptionPageScheme[];
}
export interface BrandPageSchemeOptions {
business: BrandCreationOptionBusiness;
pageSchemes: BrandCreationOptionPageScheme[];
}
export interface CreateBrandInput {
name: string;
slug: string;
businessType: BrandTemplateKey;
templatePackageVersionId: string;
}
export interface AdminBrandMember {