youmd 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/add.d.ts +2 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +66 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +48 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +25 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +112 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/keys.d.ts +11 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/keys.js +99 -0
- package/dist/commands/keys.js.map +1 -0
- package/dist/commands/link.d.ts +7 -0
- package/dist/commands/link.d.ts.map +1 -0
- package/dist/commands/link.js +152 -0
- package/dist/commands/link.js.map +1 -0
- package/dist/commands/login.d.ts +4 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +121 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/preview.d.ts +4 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/preview.js +26 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/publish.d.ts +2 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +146 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/register.d.ts +2 -0
- package/dist/commands/register.d.ts.map +1 -0
- package/dist/commands/register.js +105 -0
- package/dist/commands/register.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +165 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/whoami.d.ts +2 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +87 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api.d.ts +75 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +133 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/compiler.d.ts +42 -0
- package/dist/lib/compiler.d.ts.map +1 -0
- package/dist/lib/compiler.js +179 -0
- package/dist/lib/compiler.js.map +1 -0
- package/dist/lib/config.d.ts +25 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +102 -0
- package/dist/lib/config.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.whoamiCommand = whoamiCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const config_1 = require("../lib/config");
|
|
9
|
+
const api_1 = require("../lib/api");
|
|
10
|
+
async function whoamiCommand() {
|
|
11
|
+
const config = (0, config_1.readGlobalConfig)();
|
|
12
|
+
console.log("");
|
|
13
|
+
if (!config.token) {
|
|
14
|
+
console.log("not authenticated");
|
|
15
|
+
console.log("");
|
|
16
|
+
console.log("Run " + chalk_1.default.cyan("youmd login") + " to authenticate.");
|
|
17
|
+
console.log("");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
console.log("you.md -- current identity");
|
|
21
|
+
console.log("");
|
|
22
|
+
// Show cached info first
|
|
23
|
+
if (config.username) {
|
|
24
|
+
console.log(" user: " + chalk_1.default.green(config.username));
|
|
25
|
+
}
|
|
26
|
+
if (config.email) {
|
|
27
|
+
console.log(" email: " + config.email);
|
|
28
|
+
}
|
|
29
|
+
console.log(" token: " + config.token.slice(0, 8) + "..." + config.token.slice(-4));
|
|
30
|
+
// Fetch fresh info from the server
|
|
31
|
+
console.log("");
|
|
32
|
+
console.log(" " + chalk_1.default.dim("fetching from server..."));
|
|
33
|
+
try {
|
|
34
|
+
const res = await (0, api_1.getMe)();
|
|
35
|
+
if (!res.ok) {
|
|
36
|
+
const errData = res.data;
|
|
37
|
+
console.log(" " +
|
|
38
|
+
chalk_1.default.yellow("server error") +
|
|
39
|
+
" -- " +
|
|
40
|
+
(errData?.error || `status ${res.status}`));
|
|
41
|
+
if (res.status === 401) {
|
|
42
|
+
console.log("");
|
|
43
|
+
console.log(" Your API key may be invalid or revoked.");
|
|
44
|
+
console.log(" Run " +
|
|
45
|
+
chalk_1.default.cyan("youmd login --key <new-key>") +
|
|
46
|
+
" to re-authenticate.");
|
|
47
|
+
}
|
|
48
|
+
console.log("");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const me = res.data;
|
|
52
|
+
// Clear and reprint with server data
|
|
53
|
+
console.log("");
|
|
54
|
+
console.log(" user: " + chalk_1.default.green(me.username));
|
|
55
|
+
if (me.displayName) {
|
|
56
|
+
console.log(" name: " + me.displayName);
|
|
57
|
+
}
|
|
58
|
+
if (me.email) {
|
|
59
|
+
console.log(" email: " + me.email);
|
|
60
|
+
}
|
|
61
|
+
console.log(" plan: " + me.plan);
|
|
62
|
+
console.log(" joined: " + new Date(me.createdAt).toISOString().split("T")[0]);
|
|
63
|
+
console.log(" bundles: " + me.bundleCount);
|
|
64
|
+
if (me.publishedBundle) {
|
|
65
|
+
console.log(" live: v" +
|
|
66
|
+
me.publishedBundle.version);
|
|
67
|
+
}
|
|
68
|
+
console.log(" url: " +
|
|
69
|
+
chalk_1.default.cyan("https://you.md/" + me.username));
|
|
70
|
+
console.log("");
|
|
71
|
+
// Update cached config
|
|
72
|
+
config.username = me.username;
|
|
73
|
+
config.email = me.email;
|
|
74
|
+
// Avoid circular import -- just write directly
|
|
75
|
+
const { writeGlobalConfig } = require("../lib/config");
|
|
76
|
+
writeGlobalConfig(config);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
console.log(" " +
|
|
80
|
+
chalk_1.default.yellow("could not reach server"));
|
|
81
|
+
if (err instanceof Error) {
|
|
82
|
+
console.log(" " + chalk_1.default.dim(err.message));
|
|
83
|
+
}
|
|
84
|
+
console.log("");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=whoami.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../src/commands/whoami.ts"],"names":[],"mappings":";;;;;AAIA,sCAyGC;AA7GD,kDAA0B;AAC1B,0CAAiD;AACjD,oCAAmC;AAE5B,KAAK,UAAU,aAAa;IACjC,MAAM,MAAM,GAAG,IAAA,yBAAgB,GAAE,CAAC;IAElC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,eAAK,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,mBAAmB,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,yBAAyB;IACzB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,eAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC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,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CACT,IAAI;YACF,eAAK,CAAC,MAAM,CAAC,wBAAwB,CAAC,CACzC,CAAC;QACF,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,eAAK,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const init_1 = require("./commands/init");
|
|
6
|
+
const login_1 = require("./commands/login");
|
|
7
|
+
const register_1 = require("./commands/register");
|
|
8
|
+
const whoami_1 = require("./commands/whoami");
|
|
9
|
+
const status_1 = require("./commands/status");
|
|
10
|
+
const build_1 = require("./commands/build");
|
|
11
|
+
const publish_1 = require("./commands/publish");
|
|
12
|
+
const add_1 = require("./commands/add");
|
|
13
|
+
const diff_1 = require("./commands/diff");
|
|
14
|
+
const preview_1 = require("./commands/preview");
|
|
15
|
+
const link_1 = require("./commands/link");
|
|
16
|
+
const keys_1 = require("./commands/keys");
|
|
17
|
+
const program = new commander_1.Command();
|
|
18
|
+
program
|
|
19
|
+
.name("youmd")
|
|
20
|
+
.description("CLI for the You.md identity bundle platform")
|
|
21
|
+
.version("0.1.0");
|
|
22
|
+
program
|
|
23
|
+
.command("init")
|
|
24
|
+
.description("Initialize a local .youmd/ directory with empty bundle structure")
|
|
25
|
+
.action(init_1.initCommand);
|
|
26
|
+
program
|
|
27
|
+
.command("login")
|
|
28
|
+
.description("Authenticate with the You.md platform")
|
|
29
|
+
.option("-k, --key <apiKey>", "API key for authentication")
|
|
30
|
+
.action(login_1.loginCommand);
|
|
31
|
+
program
|
|
32
|
+
.command("register")
|
|
33
|
+
.description("Register a new You.md identity")
|
|
34
|
+
.action(register_1.registerCommand);
|
|
35
|
+
program
|
|
36
|
+
.command("whoami")
|
|
37
|
+
.description("Show current authenticated user")
|
|
38
|
+
.action(whoami_1.whoamiCommand);
|
|
39
|
+
program
|
|
40
|
+
.command("status")
|
|
41
|
+
.description("Show pipeline/build status")
|
|
42
|
+
.action(status_1.statusCommand);
|
|
43
|
+
program
|
|
44
|
+
.command("build")
|
|
45
|
+
.description("Compile local you.md bundle from profile/ and preferences/ files")
|
|
46
|
+
.action(build_1.buildCommand);
|
|
47
|
+
program
|
|
48
|
+
.command("publish")
|
|
49
|
+
.description("Push compiled bundle to the platform API")
|
|
50
|
+
.action(publish_1.publishCommand);
|
|
51
|
+
program
|
|
52
|
+
.command("add <source> <url>")
|
|
53
|
+
.description("Add a source URL to local config (website, linkedin, x, blog, youtube, github)")
|
|
54
|
+
.action(add_1.addCommand);
|
|
55
|
+
program
|
|
56
|
+
.command("diff")
|
|
57
|
+
.description("Show changes since last publish")
|
|
58
|
+
.action(diff_1.diffCommand);
|
|
59
|
+
program
|
|
60
|
+
.command("preview")
|
|
61
|
+
.description("Start a local preview server")
|
|
62
|
+
.option("-p, --port <port>", "Port number", "3333")
|
|
63
|
+
.action(preview_1.previewCommand);
|
|
64
|
+
const linkCmd = program
|
|
65
|
+
.command("link [subcommand]")
|
|
66
|
+
.description("Manage context links (create, list, revoke)")
|
|
67
|
+
.option("--scope <scope>", "Link scope: public or full", "public")
|
|
68
|
+
.option("--ttl <ttl>", "Time to live: 1h, 24h, 7d, 30d, 90d, never", "7d")
|
|
69
|
+
.option("--max-uses <n>", "Maximum number of uses")
|
|
70
|
+
.option("--id <id>", "Link ID (for revoke)");
|
|
71
|
+
linkCmd.action((subcommand, options) => {
|
|
72
|
+
return (0, link_1.linkCommand)(subcommand, options);
|
|
73
|
+
});
|
|
74
|
+
const keysCmd = program
|
|
75
|
+
.command("keys [subcommand]")
|
|
76
|
+
.description("Manage API keys (list, create, revoke)")
|
|
77
|
+
.option("--label <label>", "Label for new key")
|
|
78
|
+
.option("--id <id>", "Key ID (for revoke)");
|
|
79
|
+
keysCmd.action((subcommand, options) => {
|
|
80
|
+
return (0, keys_1.keysCommand)(subcommand, options);
|
|
81
|
+
});
|
|
82
|
+
program.parse(process.argv);
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,0CAA8C;AAC9C,4CAAgD;AAChD,kDAAsD;AACtD,8CAAkD;AAClD,8CAAkD;AAClD,4CAAgD;AAChD,gDAAoD;AACpD,wCAA4C;AAC5C,0CAA8C;AAC9C,gDAAoD;AACpD,0CAA8C;AAC9C,0CAA8C;AAE9C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,6CAA6C,CAAC;KAC1D,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,kEAAkE,CAAC;KAC/E,MAAM,CAAC,kBAAW,CAAC,CAAC;AAEvB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,uCAAuC,CAAC;KACpD,MAAM,CAAC,oBAAoB,EAAE,4BAA4B,CAAC;KAC1D,MAAM,CAAC,oBAAY,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,gCAAgC,CAAC;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M,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE;IACrC,OAAO,IAAA,kBAAW,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,OAAO;KACpB,OAAO,CAAC,mBAAmB,CAAC;KAC5B,WAAW,CAAC,wCAAwC,CAAC;KACrD,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;KAC9C,MAAM,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC;AAE9C,OAAO,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,EAAE;IACrC,OAAO,IAAA,kBAAW,EAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API client for communicating with the You.md Convex backend.
|
|
3
|
+
* Uses the HTTP action endpoints at the Convex site URL.
|
|
4
|
+
*/
|
|
5
|
+
interface ApiResponse<T = unknown> {
|
|
6
|
+
ok: boolean;
|
|
7
|
+
status: number;
|
|
8
|
+
data: T;
|
|
9
|
+
}
|
|
10
|
+
export declare function checkUsername(username: string): Promise<{
|
|
11
|
+
available: boolean;
|
|
12
|
+
reason: string | null;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function getPublicProfile(username: string): Promise<{
|
|
15
|
+
youJson: unknown;
|
|
16
|
+
youMd: string;
|
|
17
|
+
username: string;
|
|
18
|
+
displayName?: string;
|
|
19
|
+
} | null>;
|
|
20
|
+
export interface MeResponse {
|
|
21
|
+
username: string;
|
|
22
|
+
email: string;
|
|
23
|
+
displayName?: string;
|
|
24
|
+
plan: string;
|
|
25
|
+
createdAt: number;
|
|
26
|
+
latestBundle: {
|
|
27
|
+
version: number;
|
|
28
|
+
isPublished: boolean;
|
|
29
|
+
createdAt: number;
|
|
30
|
+
publishedAt?: number;
|
|
31
|
+
} | null;
|
|
32
|
+
publishedBundle: {
|
|
33
|
+
version: number;
|
|
34
|
+
publishedAt?: number;
|
|
35
|
+
} | null;
|
|
36
|
+
bundleCount: number;
|
|
37
|
+
}
|
|
38
|
+
export declare function getMe(): Promise<ApiResponse<MeResponse>>;
|
|
39
|
+
export interface RemoteStatus {
|
|
40
|
+
username: string;
|
|
41
|
+
bundleCount: number;
|
|
42
|
+
latestBundle: {
|
|
43
|
+
version: number;
|
|
44
|
+
isPublished: boolean;
|
|
45
|
+
createdAt: number;
|
|
46
|
+
} | null;
|
|
47
|
+
publishedBundle: {
|
|
48
|
+
version: number;
|
|
49
|
+
publishedAt?: number;
|
|
50
|
+
} | null;
|
|
51
|
+
}
|
|
52
|
+
export declare function getRemoteStatus(): Promise<ApiResponse<RemoteStatus>>;
|
|
53
|
+
export interface SaveBundleArgs {
|
|
54
|
+
manifest: unknown;
|
|
55
|
+
youJson: unknown;
|
|
56
|
+
youMd: string;
|
|
57
|
+
}
|
|
58
|
+
export declare function saveBundle(args: SaveBundleArgs): Promise<ApiResponse<{
|
|
59
|
+
bundleId: string;
|
|
60
|
+
version: number;
|
|
61
|
+
}>>;
|
|
62
|
+
export declare function uploadBundle(args: SaveBundleArgs): Promise<ApiResponse<any>>;
|
|
63
|
+
export interface PublishResult {
|
|
64
|
+
version: number;
|
|
65
|
+
username: string;
|
|
66
|
+
url?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare function publishLatest(): Promise<ApiResponse<PublishResult>>;
|
|
69
|
+
export declare function addSource(sourceType: string, sourceUrl: string): Promise<ApiResponse<{
|
|
70
|
+
sourceId: string;
|
|
71
|
+
}>>;
|
|
72
|
+
export declare function listSources(): Promise<ApiResponse<any[]>>;
|
|
73
|
+
export declare function getAnalytics(): Promise<ApiResponse<any>>;
|
|
74
|
+
export {};
|
|
75
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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js
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* API client for communicating with the You.md Convex backend.
|
|
4
|
+
* Uses the HTTP action endpoints at the Convex site URL.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.checkUsername = checkUsername;
|
|
8
|
+
exports.getPublicProfile = getPublicProfile;
|
|
9
|
+
exports.getMe = getMe;
|
|
10
|
+
exports.getRemoteStatus = getRemoteStatus;
|
|
11
|
+
exports.saveBundle = saveBundle;
|
|
12
|
+
exports.uploadBundle = uploadBundle;
|
|
13
|
+
exports.publishLatest = publishLatest;
|
|
14
|
+
exports.addSource = addSource;
|
|
15
|
+
exports.listSources = listSources;
|
|
16
|
+
exports.getAnalytics = getAnalytics;
|
|
17
|
+
const config_1 = require("./config");
|
|
18
|
+
const SITE_URL = "https://uncommon-chicken-142.convex.site";
|
|
19
|
+
async function request(path, options = {}) {
|
|
20
|
+
const { method = "GET", body, token, headers = {} } = options;
|
|
21
|
+
const reqHeaders = {
|
|
22
|
+
"Content-Type": "application/json",
|
|
23
|
+
...headers,
|
|
24
|
+
};
|
|
25
|
+
if (token) {
|
|
26
|
+
reqHeaders["Authorization"] = `Bearer ${token}`;
|
|
27
|
+
}
|
|
28
|
+
const fetchOptions = {
|
|
29
|
+
method,
|
|
30
|
+
headers: reqHeaders,
|
|
31
|
+
};
|
|
32
|
+
if (body && method !== "GET") {
|
|
33
|
+
fetchOptions.body = JSON.stringify(body);
|
|
34
|
+
}
|
|
35
|
+
const url = `${SITE_URL}${path}`;
|
|
36
|
+
const res = await fetch(url, fetchOptions);
|
|
37
|
+
let data;
|
|
38
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
39
|
+
if (contentType.includes("application/json")) {
|
|
40
|
+
data = (await res.json());
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
data = (await res.text());
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
ok: res.ok,
|
|
47
|
+
status: res.status,
|
|
48
|
+
data,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
// ─── Public endpoints ────────────────────────────────────────────────
|
|
52
|
+
async function checkUsername(username) {
|
|
53
|
+
const res = await request(`/api/v1/check-username?username=${encodeURIComponent(username)}`);
|
|
54
|
+
return res.data;
|
|
55
|
+
}
|
|
56
|
+
async function getPublicProfile(username) {
|
|
57
|
+
const res = await request(`/api/v1/profiles?username=${encodeURIComponent(username)}`);
|
|
58
|
+
if (!res.ok)
|
|
59
|
+
return null;
|
|
60
|
+
return res.data;
|
|
61
|
+
}
|
|
62
|
+
// ─── Authenticated endpoints ─────────────────────────────────────────
|
|
63
|
+
function getToken() {
|
|
64
|
+
const config = (0, config_1.readGlobalConfig)();
|
|
65
|
+
if (!config.token) {
|
|
66
|
+
throw new Error("Not authenticated. Run `youmd login` first.");
|
|
67
|
+
}
|
|
68
|
+
return config.token;
|
|
69
|
+
}
|
|
70
|
+
async function getMe() {
|
|
71
|
+
return request("/api/v1/me", {
|
|
72
|
+
token: getToken(),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
async function getRemoteStatus() {
|
|
76
|
+
return request("/api/v1/me", {
|
|
77
|
+
token: getToken(),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async function saveBundle(args) {
|
|
81
|
+
return request("/api/v1/me/bundle", {
|
|
82
|
+
method: "POST",
|
|
83
|
+
token: getToken(),
|
|
84
|
+
body: {
|
|
85
|
+
profileData: args, // the server-side saveBundleFromForm expects profileData
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
async function uploadBundle(args) {
|
|
90
|
+
// Upload raw bundle data - manifest, youJson, youMd
|
|
91
|
+
// The /api/v1/me/bundle endpoint expects profileData for server-side compilation.
|
|
92
|
+
// For CLI uploads where we already have compiled artifacts, we send them directly.
|
|
93
|
+
return request("/api/v1/me/bundle", {
|
|
94
|
+
method: "POST",
|
|
95
|
+
token: getToken(),
|
|
96
|
+
body: {
|
|
97
|
+
profileData: {
|
|
98
|
+
// Map our compiled bundle back to profile data shape
|
|
99
|
+
// This is a workaround since the endpoint does server-side compilation
|
|
100
|
+
_rawBundle: true,
|
|
101
|
+
manifest: args.manifest,
|
|
102
|
+
youJson: args.youJson,
|
|
103
|
+
youMd: args.youMd,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
async function publishLatest() {
|
|
109
|
+
return request("/api/v1/me/publish", {
|
|
110
|
+
method: "POST",
|
|
111
|
+
token: getToken(),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// ─── Sources ─────────────────────────────────────────────────────────
|
|
115
|
+
async function addSource(sourceType, sourceUrl) {
|
|
116
|
+
return request("/api/v1/me/sources", {
|
|
117
|
+
method: "POST",
|
|
118
|
+
token: getToken(),
|
|
119
|
+
body: { sourceType, sourceUrl },
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
async function listSources() {
|
|
123
|
+
return request("/api/v1/me/sources", {
|
|
124
|
+
token: getToken(),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// ─── Analytics ───────────────────────────────────────────────────────
|
|
128
|
+
async function getAnalytics() {
|
|
129
|
+
return request("/api/v1/me/analytics", {
|
|
130
|
+
token: getToken(),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA8DH,sCAOC;AAED,4CAQC;AA+BD,sBAIC;AAgBD,0CAIC;AAQD,gCAUC;AAED,oCAoBC;AAQD,sCAKC;AAID,8BASC;AAED,kCAIC;AAID,oCAIC;AApND,qCAA4C;AAE5C,MAAM,QAAQ,GAAG,0CAA0C,CAAC;AAQ5D,KAAK,UAAU,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ACjB,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,qDAAqD;gBACrD,uEAAuE;gBACvE,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB;SACF;KACF,CAAC,CAAC;AACL,CAAC;AAQM,KAAK,UAAU,aAAa;IACjC,OAAO,OAAO,CAAgB,oBAAoB,EAAE;QAClD,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,QAAQ,EAAE;KAClB,CAAC,CAAC;AACL,CAAC;AAED,wEAAwE;AAEjE,KAAK,UAAU,SAAS,CAC7B,UAAkB,EAClB,SAAiB;IAEjB,OAAO,OAAO,CAAuB,oBAAoB,EAAE;QACzD,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,QAAQ,EAAE;QACjB,IAAI,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;KAChC,CAAC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,WAAW;IAC/B,OAAO,OAAO,CAAQ,oBAAoB,EAAE;QAC1C,KAAK,EAAE,QAAQ,EAAE;KAClB,CAAC,CAAC;AACL,CAAC;AAED,wEAAwE;AAEjE,KAAK,UAAU,YAAY;IAChC,OAAO,OAAO,CAAM,sBAAsB,EAAE;QAC1C,KAAK,EAAE,QAAQ,EAAE;KAClB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface ProfileSection {
|
|
2
|
+
slug: string;
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
metadata: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface PreferenceSection {
|
|
8
|
+
slug: string;
|
|
9
|
+
title: string;
|
|
10
|
+
content: string;
|
|
11
|
+
metadata: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface YouBundle {
|
|
14
|
+
version: number;
|
|
15
|
+
generatedAt: string;
|
|
16
|
+
profile: ProfileSection[];
|
|
17
|
+
preferences: PreferenceSection[];
|
|
18
|
+
}
|
|
19
|
+
export interface ManifestEntry {
|
|
20
|
+
file: string;
|
|
21
|
+
type: "profile" | "preference";
|
|
22
|
+
slug: string;
|
|
23
|
+
hash: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Manifest {
|
|
26
|
+
version: number;
|
|
27
|
+
generatedAt: string;
|
|
28
|
+
entries: ManifestEntry[];
|
|
29
|
+
}
|
|
30
|
+
export declare function readDirectory(dirPath: string): string[];
|
|
31
|
+
export interface CompileResult {
|
|
32
|
+
bundle: YouBundle;
|
|
33
|
+
markdown: string;
|
|
34
|
+
manifest: Manifest;
|
|
35
|
+
filesRead: Array<{
|
|
36
|
+
type: "profile" | "preference";
|
|
37
|
+
file: string;
|
|
38
|
+
}>;
|
|
39
|
+
}
|
|
40
|
+
export declare function compileBundle(bundleDir: string): CompileResult;
|
|
41
|
+
export declare function writeBundle(bundleDir: string, result: CompileResult): void;
|
|
42
|
+
//# sourceMappingURL=compiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/lib/compiler.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,WAAW,EAAE,iBAAiB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,GAAG,YAAY,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B;AAqCD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAQvD;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,SAAS,GAAG,YAAY,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAwG9D;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAU1E"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.readDirectory = readDirectory;
|
|
40
|
+
exports.compileBundle = compileBundle;
|
|
41
|
+
exports.writeBundle = writeBundle;
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const path = __importStar(require("path"));
|
|
44
|
+
const gray_matter_1 = __importDefault(require("gray-matter"));
|
|
45
|
+
function simpleHash(content) {
|
|
46
|
+
let hash = 0;
|
|
47
|
+
for (let i = 0; i < content.length; i++) {
|
|
48
|
+
const char = content.charCodeAt(i);
|
|
49
|
+
hash = ((hash << 5) - hash) + char;
|
|
50
|
+
hash = hash & hash; // Convert to 32bit integer
|
|
51
|
+
}
|
|
52
|
+
return Math.abs(hash).toString(16).padStart(8, "0");
|
|
53
|
+
}
|
|
54
|
+
function slugFromFilename(filename) {
|
|
55
|
+
return path.basename(filename, ".md");
|
|
56
|
+
}
|
|
57
|
+
function titleFromSlug(slug) {
|
|
58
|
+
return slug
|
|
59
|
+
.split(/[-_]/)
|
|
60
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
61
|
+
.join(" ");
|
|
62
|
+
}
|
|
63
|
+
function readMarkdownFile(filePath) {
|
|
64
|
+
const raw = fs.readFileSync(filePath, "utf-8");
|
|
65
|
+
const { data, content } = (0, gray_matter_1.default)(raw);
|
|
66
|
+
const slug = slugFromFilename(filePath);
|
|
67
|
+
const title = data.title || titleFromSlug(slug);
|
|
68
|
+
return {
|
|
69
|
+
slug,
|
|
70
|
+
title,
|
|
71
|
+
content: content.trim(),
|
|
72
|
+
metadata: data,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function readDirectory(dirPath) {
|
|
76
|
+
if (!fs.existsSync(dirPath)) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
return fs
|
|
80
|
+
.readdirSync(dirPath)
|
|
81
|
+
.filter((f) => f.endsWith(".md"))
|
|
82
|
+
.sort();
|
|
83
|
+
}
|
|
84
|
+
function compileBundle(bundleDir) {
|
|
85
|
+
const profileDir = path.join(bundleDir, "profile");
|
|
86
|
+
const preferencesDir = path.join(bundleDir, "preferences");
|
|
87
|
+
const profileFiles = readDirectory(profileDir);
|
|
88
|
+
const preferenceFiles = readDirectory(preferencesDir);
|
|
89
|
+
const filesRead = [];
|
|
90
|
+
// Read profile sections
|
|
91
|
+
const profileSections = profileFiles.map((file) => {
|
|
92
|
+
filesRead.push({ type: "profile", file });
|
|
93
|
+
return readMarkdownFile(path.join(profileDir, file));
|
|
94
|
+
});
|
|
95
|
+
// Read preference sections
|
|
96
|
+
const preferenceSections = preferenceFiles.map((file) => {
|
|
97
|
+
filesRead.push({ type: "preference", file });
|
|
98
|
+
return readMarkdownFile(path.join(preferencesDir, file));
|
|
99
|
+
});
|
|
100
|
+
// Determine version
|
|
101
|
+
const manifestPath = path.join(bundleDir, "manifest.json");
|
|
102
|
+
let version = 1;
|
|
103
|
+
if (fs.existsSync(manifestPath)) {
|
|
104
|
+
try {
|
|
105
|
+
const existingManifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));
|
|
106
|
+
version = (existingManifest.version || 0) + 1;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// Start at version 1 if manifest is corrupted
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const generatedAt = new Date().toISOString();
|
|
113
|
+
// Build you.json bundle
|
|
114
|
+
const bundle = {
|
|
115
|
+
version,
|
|
116
|
+
generatedAt,
|
|
117
|
+
profile: profileSections,
|
|
118
|
+
preferences: preferenceSections,
|
|
119
|
+
};
|
|
120
|
+
// Build you.md composite markdown
|
|
121
|
+
const markdownParts = [];
|
|
122
|
+
markdownParts.push("# You.md Identity Bundle");
|
|
123
|
+
markdownParts.push("");
|
|
124
|
+
markdownParts.push(`> Generated at ${generatedAt} (v${version})`);
|
|
125
|
+
markdownParts.push("");
|
|
126
|
+
if (profileSections.length > 0) {
|
|
127
|
+
markdownParts.push("## Profile");
|
|
128
|
+
markdownParts.push("");
|
|
129
|
+
for (const section of profileSections) {
|
|
130
|
+
markdownParts.push(`### ${section.title}`);
|
|
131
|
+
markdownParts.push("");
|
|
132
|
+
markdownParts.push(section.content);
|
|
133
|
+
markdownParts.push("");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (preferenceSections.length > 0) {
|
|
137
|
+
markdownParts.push("## Preferences");
|
|
138
|
+
markdownParts.push("");
|
|
139
|
+
for (const section of preferenceSections) {
|
|
140
|
+
markdownParts.push(`### ${section.title}`);
|
|
141
|
+
markdownParts.push("");
|
|
142
|
+
markdownParts.push(section.content);
|
|
143
|
+
markdownParts.push("");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const markdown = markdownParts.join("\n").trimEnd() + "\n";
|
|
147
|
+
// Build manifest
|
|
148
|
+
const manifestEntries = [];
|
|
149
|
+
for (const file of profileFiles) {
|
|
150
|
+
const content = fs.readFileSync(path.join(profileDir, file), "utf-8");
|
|
151
|
+
manifestEntries.push({
|
|
152
|
+
file: `profile/${file}`,
|
|
153
|
+
type: "profile",
|
|
154
|
+
slug: slugFromFilename(file),
|
|
155
|
+
hash: simpleHash(content),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
for (const file of preferenceFiles) {
|
|
159
|
+
const content = fs.readFileSync(path.join(preferencesDir, file), "utf-8");
|
|
160
|
+
manifestEntries.push({
|
|
161
|
+
file: `preferences/${file}`,
|
|
162
|
+
type: "preference",
|
|
163
|
+
slug: slugFromFilename(file),
|
|
164
|
+
hash: simpleHash(content),
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
const manifest = {
|
|
168
|
+
version,
|
|
169
|
+
generatedAt,
|
|
170
|
+
entries: manifestEntries,
|
|
171
|
+
};
|
|
172
|
+
return { bundle, markdown, manifest, filesRead };
|
|
173
|
+
}
|
|
174
|
+
function writeBundle(bundleDir, result) {
|
|
175
|
+
fs.writeFileSync(path.join(bundleDir, "you.json"), JSON.stringify(result.bundle, null, 2) + "\n");
|
|
176
|
+
fs.writeFileSync(path.join(bundleDir, "you.md"), result.markdown);
|
|
177
|
+
fs.writeFileSync(path.join(bundleDir, "manifest.json"), JSON.stringify(result.manifest, null, 2) + "\n");
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=compiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/lib/compiler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,sCAQC;AASD,sCAwGC;AAED,kCAUC;AA9MD,uCAAyB;AACzB,2CAA6B;AAC7B,8DAAiC;AA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