chore(client): 🏷️ Update client types, add TOS and Privacy Policy APIs

This commit is contained in:
Jesse Wierzbinski 2024-06-11 14:54:21 -10:00
parent 24c5f3effd
commit 6f717fcccd
No known key found for this signature in database
4 changed files with 34 additions and 3 deletions

View file

@ -29,7 +29,8 @@ on:
options: options:
- npm - npm
- jsr - jsr
default: "npm" - both
default: "both"
permissions: permissions:
contents: read contents: read
@ -60,11 +61,11 @@ jobs:
run: 'sed -i ''s/"version": ".*"/"version": "${{ github.event.inputs.version }}"/'' package.json ${{ github.event.inputs.package }}/package.json ${{ github.event.inputs.package }}/jsr.jsonc' run: 'sed -i ''s/"version": ".*"/"version": "${{ github.event.inputs.version }}"/'' package.json ${{ github.event.inputs.package }}/package.json ${{ github.event.inputs.package }}/jsr.jsonc'
- name: Publish to NPM - name: Publish to NPM
if: ${{ github.event.inputs.registry == 'npm' }} if: ${{ github.event.inputs.registry == 'npm' }} || ${{ github.event.inputs.registry == 'both' }}
run: cd ${{ github.event.inputs.package }} && npm publish --provenance --tag ${{ github.event.inputs.tag }} --access public run: cd ${{ github.event.inputs.package }} && npm publish --provenance --tag ${{ github.event.inputs.tag }} --access public
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to JSR - name: Publish to JSR
if: ${{ github.event.inputs.registry == 'jsr' }} if: ${{ github.event.inputs.registry == 'jsr' }} || ${{ github.event.inputs.registry == 'both' }}
run: cd ${{ github.event.inputs.package }} && bun install --frozen-lockfile && bunx jsr publish --allow-slow-types --allow-dirty run: cd ${{ github.event.inputs.package }} && bun install --frozen-lockfile && bunx jsr publish --allow-slow-types --allow-dirty

View file

@ -1039,6 +1039,33 @@ export class LysandClient extends BaseClient {
return this.get<string[]>("/api/v1/instance/peers", extra); return this.get<string[]>("/api/v1/instance/peers", extra);
} }
/**
* GET /api/v1/instance/privacy_policy
*
* Lysand API only.
* @returns
*/
public getInstancePrivacyPolicy(
extra?: RequestInit,
): Promise<Output<ExtendedDescription>> {
return this.get<ExtendedDescription>(
"/api/v1/instance/privacy_policy",
extra,
);
}
/**
* GET /api/v1/instance/tos
*
* Lysand API only.
* @returns
*/
public getInstanceTermsOfService(
extra?: RequestInit,
): Promise<Output<ExtendedDescription>> {
return this.get<ExtendedDescription>("/api/v1/instance/tos", extra);
}
/** /**
* GET /api/v1/trends * GET /api/v1/trends
* *

View file

@ -1,5 +1,6 @@
import type { Emoji } from "./emoji"; import type { Emoji } from "./emoji";
import type { Field } from "./field"; import type { Field } from "./field";
import type { LysandRole } from "./lysand";
import type { Role } from "./role"; import type { Role } from "./role";
import type { Source } from "./source"; import type { Source } from "./source";
@ -30,5 +31,6 @@ export type Account = {
bot: boolean | null; bot: boolean | null;
source?: Source; source?: Source;
role?: Role; role?: Role;
roles: LysandRole[];
mute_expires_at?: string; mute_expires_at?: string;
}; };

View file

@ -7,6 +7,7 @@ export type Relationship = {
muting: boolean; muting: boolean;
muting_notifications: boolean; muting_notifications: boolean;
requested: boolean; requested: boolean;
requested_by: boolean;
domain_blocking: boolean; domain_blocking: boolean;
showing_reblogs: boolean; showing_reblogs: boolean;
endorsed: boolean; endorsed: boolean;