Merge pull request #130 from LemmyNet/add_taglines_to_site_res

This commit is contained in:
SleeplessOne1917 2023-06-06 13:17:23 +00:00 committed by GitHub
commit bad0ec49db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 8 deletions

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# First re-generate the types by running cargo test on lemmy # First re-generate the types by running cargo test on lemmy
cd ../lemmy/scripts pushd ../lemmy/scripts
./test.sh ./test.sh
cd ../crates cd ../crates
@ -13,7 +13,13 @@ cp db_views/bindings/* ../../lemmy-js-client/src/types/
cp db_views_actor/bindings/* ../../lemmy-js-client/src/types/ cp db_views_actor/bindings/* ../../lemmy-js-client/src/types/
cp db_views_moderator/bindings/* ../../lemmy-js-client/src/types/ cp db_views_moderator/bindings/* ../../lemmy-js-client/src/types/
# Change all the bigints to numbers popd
find ../../lemmy-js-client/src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} +
# Remove the Sensitive type
rm src/types/Sensitive.ts
# Change all the bigints to numbers
find src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} +
node putTypesInIndex.js
node ../../lemmy-js-client/putTypesInIndex.js

View file

@ -1,6 +1,6 @@
{ {
"name": "lemmy-js-client", "name": "lemmy-js-client",
"version": "0.17.2-rc.23", "version": "0.17.2-rc.24",
"description": "A javascript / typescript client for Lemmy", "description": "A javascript / typescript client for Lemmy",
"repository": "https://github.com/LemmyNet/lemmy-js-client", "repository": "https://github.com/LemmyNet/lemmy-js-client",
"license": "AGPL-3.0", "license": "AGPL-3.0",

View file

@ -3,7 +3,7 @@ const path = require("path");
const exportRegex = /export\s+(?:enum|interface|type)\s+([A-Za-z0-9_]+)/g; const exportRegex = /export\s+(?:enum|interface|type)\s+([A-Za-z0-9_]+)/g;
const baseExports = ['export * from "./http";', 'export * from "./websocket";']; const baseExports = ['export * from "./http";'];
async function putTypesInIndex() { async function putTypesInIndex() {
const typeFiles = await fs.readdir(path.resolve("./src/types")); const typeFiles = await fs.readdir(path.resolve("./src/types"));

View file

@ -252,4 +252,3 @@ export {
UploadImageResponse, UploadImageResponse,
UserOperation, UserOperation,
} from "./types/others"; } from "./types/others";
export * from "./websocket";

View file

@ -10,5 +10,4 @@ export interface GetCommunityResponse {
moderators: Array<CommunityModeratorView>; moderators: Array<CommunityModeratorView>;
online: number; online: number;
discussion_languages: Array<LanguageId>; discussion_languages: Array<LanguageId>;
default_post_language?: LanguageId;
} }

View file

@ -1,6 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { SiteView } from "./SiteView"; import type { SiteView } from "./SiteView";
import type { Tagline } from "./Tagline";
export interface SiteResponse { export interface SiteResponse {
site_view: SiteView; site_view: SiteView;
taglines: Array<Tagline>;
} }