feat: add partner create endpoint (#21625)
Some checks failed
CLI Build / CLI Publish (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Docker / pre-job (push) Has been cancelled
Docs build / pre-job (push) Has been cancelled
Static Code Analysis / pre-job (push) Has been cancelled
Static Code Analysis / zizmor (push) Has been cancelled
Test / pre-job (push) Has been cancelled
Test / ShellCheck (push) Has been cancelled
Test / OpenAPI Clients (push) Has been cancelled
Test / SQL Schema Checks (push) Has been cancelled
CLI Build / Docker (push) Has been cancelled
Docker / Re-Tag ML () (push) Has been cancelled
Docker / Re-Tag ML (-armnn) (push) Has been cancelled
Docker / Re-Tag ML (-cuda) (push) Has been cancelled
Docker / Re-Tag ML (-openvino) (push) Has been cancelled
Docker / Re-Tag ML (-rknn) (push) Has been cancelled
Docker / Re-Tag ML (-rocm) (push) Has been cancelled
Docker / Re-Tag Server () (push) Has been cancelled
Docker / Build and Push ML (armnn, linux/arm64, -armnn) (push) Has been cancelled
Docker / Build and Push ML (cpu, ) (push) Has been cancelled
Docker / Build and Push ML (cuda, linux/amd64, -cuda) (push) Has been cancelled
Docker / Build and Push ML (openvino, linux/amd64, -openvino) (push) Has been cancelled
Docker / Build and Push ML (rknn, linux/arm64, -rknn) (push) Has been cancelled
Docker / Build and Push ML (rocm, linux/amd64, {"linux/amd64": "mich"}, -rocm) (push) Has been cancelled
Docker / Build and Push Server (push) Has been cancelled
Docker / Docker Build & Push Server Success (push) Has been cancelled
Docker / Docker Build & Push ML Success (push) Has been cancelled
Docs build / Docs Build (push) Has been cancelled
Static Code Analysis / Run Dart Code Analysis (push) Has been cancelled
Test / Test & Lint Server (push) Has been cancelled
Test / Unit Test CLI (push) Has been cancelled
Test / Unit Test CLI (Windows) (push) Has been cancelled
Test / Lint Web (push) Has been cancelled
Test / Test Web (push) Has been cancelled
Test / Test i18n (push) Has been cancelled
Test / End-to-End Lint (push) Has been cancelled
Test / Medium Tests (Server) (push) Has been cancelled
Test / End-to-End Tests (Server & CLI) (ubuntu-24.04-arm) (push) Has been cancelled
Test / End-to-End Tests (Server & CLI) (ubuntu-latest) (push) Has been cancelled
Test / End-to-End Tests (Web) (ubuntu-24.04-arm) (push) Has been cancelled
Test / End-to-End Tests (Web) (ubuntu-latest) (push) Has been cancelled
Test / End-to-End Tests Success (push) Has been cancelled
Test / Unit Test Mobile (push) Has been cancelled
Test / Unit Test ML (push) Has been cancelled
Test / .github Files Formatting (push) Has been cancelled

This commit is contained in:
Jason Rasmussen
2025-09-05 17:59:11 -04:00
committed by GitHub
parent db0ea0f3a8
commit 5a7042364b
18 changed files with 477 additions and 75 deletions

View File

@@ -811,7 +811,10 @@ export type PartnerResponseDto = {
profileChangedAt: string;
profileImagePath: string;
};
export type UpdatePartnerDto = {
export type PartnerCreateDto = {
sharedWithId: string;
};
export type PartnerUpdateDto = {
inTimeline: boolean;
};
export type PeopleResponseDto = {
@@ -3122,6 +3125,21 @@ export function getPartners({ direction }: {
...opts
}));
}
/**
* This endpoint requires the `partner.create` permission.
*/
export function createPartner({ partnerCreateDto }: {
partnerCreateDto: PartnerCreateDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 201;
data: PartnerResponseDto;
}>("/partners", oazapfts.json({
...opts,
method: "POST",
body: partnerCreateDto
})));
}
/**
* This endpoint requires the `partner.delete` permission.
*/
@@ -3134,9 +3152,9 @@ export function removePartner({ id }: {
}));
}
/**
* This endpoint requires the `partner.create` permission.
* This property was deprecated in v1.141.0. This endpoint requires the `partner.create` permission.
*/
export function createPartner({ id }: {
export function createPartnerDeprecated({ id }: {
id: string;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
@@ -3150,9 +3168,9 @@ export function createPartner({ id }: {
/**
* This endpoint requires the `partner.update` permission.
*/
export function updatePartner({ id, updatePartnerDto }: {
export function updatePartner({ id, partnerUpdateDto }: {
id: string;
updatePartnerDto: UpdatePartnerDto;
partnerUpdateDto: PartnerUpdateDto;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
@@ -3160,7 +3178,7 @@ export function updatePartner({ id, updatePartnerDto }: {
}>(`/partners/${encodeURIComponent(id)}`, oazapfts.json({
...opts,
method: "PUT",
body: updatePartnerDto
body: partnerUpdateDto
})));
}
/**