@jakeschepis/outlook-cli 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.
Files changed (2) hide show
  1. package/bin/outlook +66 -0
  2. package/package.json +39 -0
package/bin/outlook ADDED
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // Launcher for the platform-specific `outlook` binary. The real Go executable
5
+ // ships in one of the @jakeschepis/outlook-cli-<platform> optional dependencies;
6
+ // npm installs only the package matching the host os/cpu. This shim resolves
7
+ // that package and execs the binary, forwarding argv, stdio, and exit code.
8
+
9
+ const { spawnSync } = require("node:child_process");
10
+ const os = require("node:os");
11
+
12
+ // Map Node's process.platform + os.arch() to the published platform package and
13
+ // the binary subpath inside it. Keys mirror the GOOS/GOARCH pairs built by
14
+ // scripts/release.sh (windows/amd64 → win32-x64, etc).
15
+ const PLATFORM_PACKAGES = {
16
+ "darwin x64": { pkg: "@jakeschepis/outlook-cli-darwin-x64", bin: "bin/outlook" },
17
+ "darwin arm64": { pkg: "@jakeschepis/outlook-cli-darwin-arm64", bin: "bin/outlook" },
18
+ "linux x64": { pkg: "@jakeschepis/outlook-cli-linux-x64", bin: "bin/outlook" },
19
+ "linux arm64": { pkg: "@jakeschepis/outlook-cli-linux-arm64", bin: "bin/outlook" },
20
+ "win32 x64": { pkg: "@jakeschepis/outlook-cli-win32-x64", bin: "outlook.exe" },
21
+ };
22
+
23
+ function resolveBinary() {
24
+ const key = `${process.platform} ${process.arch}`;
25
+ const target = PLATFORM_PACKAGES[key];
26
+ if (!target) {
27
+ throw new Error(
28
+ `outlook: unsupported platform ${key}. Supported: ${Object.keys(PLATFORM_PACKAGES).join(", ")}.`,
29
+ );
30
+ }
31
+ try {
32
+ return require.resolve(`${target.pkg}/${target.bin}`);
33
+ } catch (cause) {
34
+ throw new Error(
35
+ `outlook: the platform package "${target.pkg}" is not installed. ` +
36
+ "This usually means the install ran with --no-optional or a partial " +
37
+ "node_modules. Reinstall with optional dependencies enabled.",
38
+ { cause },
39
+ );
40
+ }
41
+ }
42
+
43
+ function main() {
44
+ let binPath;
45
+ try {
46
+ binPath = resolveBinary();
47
+ } catch (err) {
48
+ process.stderr.write(`${err.message}\n`);
49
+ process.exit(1);
50
+ }
51
+
52
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
53
+
54
+ if (result.error) {
55
+ process.stderr.write(`outlook: failed to launch binary: ${result.error.message}\n`);
56
+ process.exit(1);
57
+ }
58
+ if (typeof result.status === "number") {
59
+ process.exit(result.status);
60
+ }
61
+ // Terminated by a signal: exit with the conventional 128 + signal-number code.
62
+ const signalNumber = result.signal ? os.constants.signals[result.signal] : 0;
63
+ process.exit(signalNumber ? 128 + signalNumber : 1);
64
+ }
65
+
66
+ main();
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@jakeschepis/outlook-cli",
3
+ "version": "0.1.0",
4
+ "description": "Scriptable Microsoft Graph CLI for Outlook mail, calendar, contacts, and tasks. JSON-first output for AI agents and shell pipelines.",
5
+ "keywords": [
6
+ "outlook",
7
+ "microsoft-graph",
8
+ "cli",
9
+ "email",
10
+ "calendar",
11
+ "office365"
12
+ ],
13
+ "homepage": "https://github.com/jakeschepis/365-office#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/jakeschepis/365-office/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/jakeschepis/365-office.git"
20
+ },
21
+ "license": "MIT",
22
+ "author": "jakeschepis",
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "bin": {
27
+ "outlook": "bin/outlook"
28
+ },
29
+ "files": [
30
+ "bin/outlook"
31
+ ],
32
+ "optionalDependencies": {
33
+ "@jakeschepis/outlook-cli-darwin-x64": "0.1.0",
34
+ "@jakeschepis/outlook-cli-darwin-arm64": "0.1.0",
35
+ "@jakeschepis/outlook-cli-linux-x64": "0.1.0",
36
+ "@jakeschepis/outlook-cli-linux-arm64": "0.1.0",
37
+ "@jakeschepis/outlook-cli-win32-x64": "0.1.0"
38
+ }
39
+ }