@open-e2ee/oe 0.0.0-stage → 3.0.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/README.md CHANGED
@@ -1,3 +1,21 @@
1
- # Temporary Holding Version
1
+ # `@open-e2ee/oe`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ This package installs the `oe` command through an optional native package for
4
+ the current operating system and CPU. It does not download a binary during
5
+ installation.
6
+
7
+ Run `oe auth login` to log in with a browser and accept the terms for the
8
+ organization. Use `oe new` to create a project and its Sandbox environment,
9
+ and `oe config push` to apply the environment sections of the config.
10
+
11
+ `open-e2ee.config.ts` imports `defineConfig` and the config types from
12
+ `@open-e2ee/oe/config`. `oe` reads the file with Node.js 22.18 or later, and
13
+ the file loads without `node_modules`. Run `oe config pull` to write the Relay
14
+ policy of each active environment from the console into the file.
15
+
16
+ Run `oe help` for every command, its usage, the exit codes, and the environment
17
+ variables. Under a coding agent, or with `--agent yes`, `oe` writes JSON by
18
+ default: each run writes one JSON document to stdout with a stable `code` and,
19
+ when there is one, the `next` command. Run
20
+ `oe project connection --env sandbox` to print the Relay connection URL of an
21
+ environment.
package/bin/oe.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { createRequire } from "node:module";
4
+ import { spawnSync } from "node:child_process";
5
+
6
+ const platformPackages = {
7
+ "darwin-arm64": "@open-e2ee/oe-darwin-arm64",
8
+ "darwin-x64": "@open-e2ee/oe-darwin-x64",
9
+ "linux-arm64": "@open-e2ee/oe-linux-arm64",
10
+ "linux-x64": "@open-e2ee/oe-linux-x64",
11
+ "win32-arm64": "@open-e2ee/oe-win32-arm64",
12
+ "win32-x64": "@open-e2ee/oe-win32-x64",
13
+ };
14
+
15
+ const require = createRequire(import.meta.url);
16
+ const target = `${process.platform}-${process.arch}`;
17
+ const packageName = platformPackages[target];
18
+
19
+ if (!packageName) {
20
+ process.stderr.write(`OpenE2EE CLI does not support ${target}.\n`);
21
+ process.exit(1);
22
+ }
23
+
24
+ let binary;
25
+ try {
26
+ binary =
27
+ process.env.OE_BINARY_PATH ||
28
+ require.resolve(
29
+ `${packageName}/bin/oe${process.platform === "win32" ? ".exe" : ""}`,
30
+ );
31
+ } catch {
32
+ process.stderr.write(
33
+ `The optional package ${packageName} is missing. Reinstall @open-e2ee/oe with optional dependencies enabled.\n`,
34
+ );
35
+ process.exit(1);
36
+ }
37
+
38
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
39
+ if (result.error) {
40
+ process.stderr.write(`Could not run OpenE2EE CLI: ${result.error.message}\n`);
41
+ process.exit(1);
42
+ }
43
+ process.exit(result.status ?? 1);
@@ -0,0 +1,40 @@
1
+ /** A retention period that the managed Relay accepts. */
2
+ export type Retention =
3
+ "1h" | "6h" | "12h" | "1d" | "3d" | "7d" | "14d" | "30d";
4
+
5
+ /** The products that a project config can name. */
6
+ export type Product = "signal-relay";
7
+
8
+ /** How long the Relay keeps undelivered messages and attachments. */
9
+ export interface RelayPolicy {
10
+ deliveryRetention: Retention;
11
+ attachmentRetention: Retention;
12
+ }
13
+
14
+ /**
15
+ * One environment section. A field that the section leaves out takes the
16
+ * value of the shared `relay` policy. Sandbox accepts at most 7d.
17
+ */
18
+ export interface Environment {
19
+ relay?: Partial<RelayPolicy>;
20
+ }
21
+
22
+ /** The default export of `open-e2ee.config.ts`. */
23
+ export interface Config {
24
+ product: Product;
25
+ /** The project slug: lowercase letters, digits, and single hyphens. */
26
+ project: string;
27
+ /** The Relay policy that each environment shares. */
28
+ relay: RelayPolicy;
29
+ /**
30
+ * The environments that `oe` syncs. Add `production: {}` to put
31
+ * Production in the sync.
32
+ */
33
+ environments: {
34
+ sandbox: Environment;
35
+ production?: Environment;
36
+ };
37
+ }
38
+
39
+ /** Returns the project config unchanged, with its types checked. */
40
+ export declare function defineConfig(config: Config): Config;
@@ -0,0 +1,7 @@
1
+ // defineConfig returns the project config unchanged. The types are in
2
+ // index.d.ts. oe reads the value that open-e2ee.config.ts exports as its
3
+ // default, and it resolves this module to its own copy, so the file loads
4
+ // without node_modules.
5
+ export function defineConfig(config) {
6
+ return config;
7
+ }
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@open-e2ee/oe",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "3.0.0",
4
+ "description": "OpenE2EE project command-line interface",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "bin": {
8
+ "oe": "bin/oe.js"
9
+ },
10
+ "exports": {
11
+ "./bin/oe.js": "./bin/oe.js",
12
+ "./config": {
13
+ "types": "./config/index.d.ts",
14
+ "default": "./config/index.js"
15
+ },
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "bin",
20
+ "config",
21
+ "README.md"
22
+ ],
23
+ "optionalDependencies": {
24
+ "@open-e2ee/oe-darwin-arm64": "3.0.0",
25
+ "@open-e2ee/oe-darwin-x64": "3.0.0",
26
+ "@open-e2ee/oe-linux-arm64": "3.0.0",
27
+ "@open-e2ee/oe-linux-x64": "3.0.0",
28
+ "@open-e2ee/oe-win32-arm64": "3.0.0",
29
+ "@open-e2ee/oe-win32-x64": "3.0.0"
30
+ },
31
+ "engines": {
32
+ "node": ">=22.18"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/open-e2ee/oe.git"
37
+ }
38
+ }