//native
type Basistheory = {
apiKey: string;
};
/**
* Reactors Patch
* Reactors Patch
*/
export async function main(
auth: Basistheory,
id: string,
body: {
application?: {
created_at?: string;
created_by?: string;
id?: string;
key?: string;
keys?: {
created_at?: string;
created_by?: string;
id?: string;
key?: string;
version?: string;
}[];
modified_at?: string;
modified_by?: string;
name?: string;
permissions?: string[];
rules?: {
conditions?: {
attribute?: string;
operator?: string;
value?: string;
}[];
container?: string;
description?: string;
permissions?: string[];
priority?: string;
transform?: string;
}[];
tenant_id?: string;
type?: string;
};
code?: string;
configuration?: { dolore_4c?: string; est_f?: string; labore_4?: string };
name?: string;
},
) {
const url = new URL(`https://api.basistheory.com/reactors/${id}`);
const response = await fetch(url, {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"BT-API-KEY": auth.apiKey,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 235 days ago