parent
c295115f1a
commit
473b33ff59
|
@ -7,7 +7,7 @@
|
||||||
"": {
|
"": {
|
||||||
"name": "@cadey/yasomi",
|
"name": "@cadey/yasomi",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"license": "SEE LICENSE IN LICENSE",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@atproto/api": "^0.2.8",
|
"@atproto/api": "^0.2.8",
|
||||||
"commander": "^10.0.0",
|
"commander": "^10.0.0",
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
"lint-staged": "^13.2.1",
|
"lint-staged": "^13.2.1",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"prettier": "2.8.7",
|
"prettier": "2.8.7",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^4.9.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@atproto/api": {
|
"node_modules/@atproto/api": {
|
||||||
|
@ -2093,16 +2093,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.0.4",
|
"version": "4.9.5",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
||||||
"integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==",
|
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12.20"
|
"node": ">=4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/uint8arrays": {
|
"node_modules/uint8arrays": {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"lint-staged": "^13.2.1",
|
"lint-staged": "^13.2.1",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"prettier": "2.8.7",
|
"prettier": "2.8.7",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^4.9.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@atproto/api": "^0.2.8",
|
"@atproto/api": "^0.2.8",
|
||||||
|
|
22
src/index.ts
22
src/index.ts
|
@ -1,4 +1,24 @@
|
||||||
import { } from "@atproto/api";
|
|
||||||
import * as dotenv from "dotenv";
|
import * as dotenv from "dotenv";
|
||||||
|
|
||||||
|
import bsky from "@atproto/api";
|
||||||
|
const { BskyAgent, RichText } = bsky;
|
||||||
|
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
|
const agent = new BskyAgent({
|
||||||
|
service: process.env.BLUESKY_ENDPOINT as string,
|
||||||
|
});
|
||||||
|
await agent.login({
|
||||||
|
identifier: process.env.BLUESKY_EMAIL as string,
|
||||||
|
password: process.env.BLUESKY_PASSWORD as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
const rt = new RichText({ text: "Hello Bluesky!" });
|
||||||
|
await rt.detectFacets(agent);
|
||||||
|
const postRecord = {
|
||||||
|
$type: "app.bsky.feed.post",
|
||||||
|
text: rt.text,
|
||||||
|
facets: rt.facets,
|
||||||
|
createdAt: new Date().toISOString(),
|
||||||
|
};
|
||||||
|
await agent.post(postRecord);
|
||||||
|
|
|
@ -3,13 +3,14 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"lib": ["es2020", "es2022", "dom"],
|
"lib": ["es2020", "es2022", "dom"],
|
||||||
"module": "es2022",
|
"module": "esnext",
|
||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node16",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"target": "es2022",
|
"target": "esnext",
|
||||||
"types": ["node"],
|
"types": ["node"],
|
||||||
|
"skipLibCheck": true,
|
||||||
"outDir": "dist"
|
"outDir": "dist"
|
||||||
},
|
},
|
||||||
"include": ["src/**/*", "tests/**/*", "types/**/*"],
|
"include": ["src/**/*", "tests/**/*", "types/**/*"],
|
||||||
|
|
Loading…
Reference in New Issue