feat: 实现小程序代码发布任务闭环
This commit is contained in:
1 parent
9b35b8e7a7
commit
526a9db789
14 files changed
+7242
-249
No files matched your search
@@ -5,6 +5,7 @@ import type {
|
||||
BrandPresentationUpdate,
|
||||
BrandProfile,
|
||||
BrandReleaseSummary,
|
||||
MiniAppReleaseTask,
|
||||
BrandUpdate,
|
||||
} from "../types/brand.js";
|
||||
|
||||
@@ -59,6 +60,20 @@ export interface BrandMethods {
|
||||
revokeAdminRelease(): Promise<
|
||||
Pick<BrandReleaseSummary, "id" | "version" | "status" | "revokedAt">
|
||||
>;
|
||||
listAdminMiniAppReleases(): Promise<MiniAppReleaseTask[]>;
|
||||
createAdminMiniAppRelease(releaseId?: string): Promise<MiniAppReleaseTask>;
|
||||
uploadAdminMiniAppRelease(
|
||||
id: string,
|
||||
body?: { version?: string; desc?: string; robot?: number },
|
||||
): Promise<MiniAppReleaseTask>;
|
||||
updateAdminMiniAppReleaseStatus(
|
||||
id: string,
|
||||
body: {
|
||||
status: MiniAppReleaseTask["status"];
|
||||
error?: string;
|
||||
weappUploadId?: string;
|
||||
},
|
||||
): Promise<MiniAppReleaseTask>;
|
||||
}
|
||||
|
||||
export function brandMethods({ request }: { request: RequestFn }): BrandMethods {
|
||||
@@ -94,5 +109,21 @@ export function brandMethods({ request }: { request: RequestFn }): BrandMethods
|
||||
body: note === undefined ? {} : { note },
|
||||
}),
|
||||
revokeAdminRelease: () => request("/admin/releases/revoke", { method: "POST" }),
|
||||
listAdminMiniAppReleases: () => request("/admin/miniapp-releases"),
|
||||
createAdminMiniAppRelease: (releaseId) =>
|
||||
request("/admin/miniapp-releases", {
|
||||
method: "POST",
|
||||
...(releaseId ? { body: { releaseId } } : { body: {} }),
|
||||
}),
|
||||
uploadAdminMiniAppRelease: (id, body) =>
|
||||
request(`/admin/miniapp-releases/${encodeURIComponent(id)}/upload`, {
|
||||
method: "POST",
|
||||
body: body ?? {},
|
||||
}),
|
||||
updateAdminMiniAppReleaseStatus: (id, body) =>
|
||||
request(`/admin/miniapp-releases/${encodeURIComponent(id)}/status`, {
|
||||
method: "PATCH",
|
||||
body,
|
||||
}),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user