@alienplatform/bindings 3.3.0 → 3.3.2

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
@@ -6,6 +6,64 @@ in-process [napi-rs](https://napi.rs) addon. The addon itself lives in the Rust
6
6
  crate `crates/alien-bindings-node`; this package is the published JavaScript
7
7
  wrapper that loads it.
8
8
 
9
+ ## Remote Storage
10
+
11
+ Use `Bindings.forRemoteDeployment` from a trusted backend to access a Storage
12
+ resource in an existing deployment. Never put the Alien API token in browser,
13
+ mobile, or other client-side code. The token must have write access to the
14
+ deployment; read-only tokens cannot resolve cloud credentials.
15
+
16
+ ```ts
17
+ import { Bindings } from "@alienplatform/bindings"
18
+
19
+ const bindings = await Bindings.forRemoteDeployment({
20
+ deploymentId: process.env.ALIEN_DEPLOYMENT_ID!,
21
+ token: process.env.ALIEN_API_TOKEN!,
22
+ })
23
+
24
+ const archive = bindings.storage("archive")
25
+ const write = await archive.put("reports/latest.json", Buffer.from(JSON.stringify({ ready: true })), {
26
+ attributes: {
27
+ contentType: "application/json",
28
+ cacheControl: "private, max-age=60",
29
+ metadata: { schema: "report-v1" },
30
+ },
31
+ })
32
+
33
+ const head = await archive.head("reports/latest.json")
34
+ const object = await archive.get("reports/latest.json")
35
+ const report = JSON.parse(object.data.toString())
36
+ console.log(write.eTag, head.meta, head.attributes, report)
37
+ const reports = await archive.list("reports/")
38
+
39
+ await archive.delete("reports/latest.json")
40
+ ```
41
+
42
+ Cloud storage providers persist these object attributes. The local filesystem
43
+ provider rejects attribute-bearing writes because it cannot represent them.
44
+ GCS also rejects `contentEncoding: "gzip"`: its decompressive transcoding omits
45
+ the response length required for byte-exact reads. Other GCS encodings, such as
46
+ `br`, are preserved.
47
+
48
+ Remote Storage exposes `get`, `put`, `head`, `list`, and `delete`. It does not
49
+ expose copy or signed URLs. The same `Bindings` and Storage handles remain valid
50
+ while the native client refreshes short-lived cloud credentials and periodically
51
+ rediscovers the deployment's assigned manager. Rotating the Alien API token
52
+ requires constructing a new `Bindings` value. Pass `apiBaseUrl` only when
53
+ targeting a non-default Alien API endpoint; plain HTTP is accepted only on a
54
+ loopback address for local development.
55
+
56
+ The named resource must be a Running, Frozen S3, GCS, or Azure Blob Storage
57
+ resource with remote access enabled. Enabling remote access adds concrete
58
+ object read/write/list/delete access for that bucket or container to the
59
+ deployment's dedicated Remote Bindings identity. Generate and apply updated customer setup when
60
+ enabling it on an existing deployment. The endpoint returns a short-lived lease
61
+ for that Remote Bindings identity only after it validates the named resource, so the
62
+ Alien token and all returned provider credentials must be treated as backend
63
+ secrets.
64
+
65
+ ## Linked containers
66
+
9
67
  The same factories are re-exported by `@alienplatform/sdk` for Worker apps.
10
68
  Long-running Container and Daemon apps can import this package directly. A
11
69
  linked container is read-only service discovery:
@@ -60,8 +118,11 @@ opt-out for a plaintext-only server; missing legacy configuration defaults to
60
118
 
61
119
  ## Native addon resolution
62
120
 
63
- The addon is loaded lazily on the first binding operation (never at import — the
64
- package is `sideEffects: false`). `src/loader.ts` resolves it in order:
121
+ Importing the package never loads the addon, so the package remains
122
+ `sideEffects: false`. Environment-backed factories load it on the first binding
123
+ operation. `Bindings.forRemoteDeployment` loads it immediately because manager
124
+ discovery is part of that async constructor. `src/loader.ts` resolves it in
125
+ order:
65
126
 
66
127
  1. `ALIEN_BINDINGS_ADDON_PATH` — an explicit path to a `.node` file. A dev/test
67
128
  escape hatch only; never set in a published install.
@@ -12,8 +12,8 @@
12
12
  * Handle methods are closures (not `this`-bound class methods), so they behave
13
13
  * correctly even when destructured off the handle (`const { get } = storage(x)`).
14
14
  */
15
- import type { NativeAddon } from "./loader.js";
16
- import type { Container, Kv, Postgres, Queue, Storage, Vault } from "./types.js";
15
+ import type { NativeAddon, RawRemoteBindingsHandle } from "./loader.js";
16
+ import type { Container, Kv, Postgres, Queue, RemoteStorage, Storage, Vault } from "./types.js";
17
17
  /** The public factory surface. */
18
18
  export interface Factories {
19
19
  storage(name: string): Storage;
@@ -25,4 +25,6 @@ export interface Factories {
25
25
  }
26
26
  /** Build the factories bound to a given addon provider. */
27
27
  export declare function createFactories(getAddon: () => NativeAddon): Factories;
28
+ /** Build the remote-only storage factory around one native bindings handle. */
29
+ export declare function createRemoteStorageFactory(bindings: RawRemoteBindingsHandle): (name: string) => RemoteStorage;
28
30
  //# sourceMappingURL=factories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../src/factories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,KAAK,EACV,WAAW,EASZ,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EACV,SAAS,EACT,EAAE,EAGF,QAAQ,EAIR,KAAK,EAGL,OAAO,EACP,KAAK,EACN,MAAM,YAAY,CAAA;AA8PnB,kCAAkC;AAClC,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9B,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,EAAE,CAAA;IACpB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAA;IAC1B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAA;IAC1B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CACjC;AAED,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,WAAW,GAAG,SAAS,CAStE"}
1
+ {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../src/factories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,OAAO,KAAK,EACV,WAAW,EAOX,uBAAuB,EAIxB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EACV,SAAS,EACT,EAAE,EAGF,QAAQ,EAIR,KAAK,EAEL,aAAa,EAEb,OAAO,EAEP,KAAK,EACN,MAAM,YAAY,CAAA;AA0QnB,kCAAkC;AAClC,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IAC9B,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,EAAE,CAAA;IACpB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAA;IAC1B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAA;IAC1B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CACjC;AAED,2DAA2D;AAC3D,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,WAAW,GAAG,SAAS,CAUtE;AAED,+EAA+E;AAC/E,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,uBAAuB,IAElE,MAAM,MAAM,KAAG,aAAa,CAQrC"}
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@
8
8
  * against a binding with no `ALIEN_<NAME>_BINDING` in the environment throws
9
9
  * {@link BindingNotConfiguredError}.
10
10
  */
11
+ export { Bindings } from "./remote.js";
12
+ export type { RemoteDeploymentBindingsOptions } from "./remote.js";
11
13
  /** Resolve the storage binding named `name`. */
12
14
  export declare const storage: (name: string) => import("./types.js").Storage;
13
15
  /** Resolve the key-value binding named `name`. */
@@ -21,5 +23,5 @@ export declare const container: (name: string) => import("./types.js").Container
21
23
  /** Resolve the Postgres binding named `name`. */
22
24
  export declare const postgres: (name: string) => import("./types.js").Postgres;
23
25
  export { AlienError, BindingNotConfiguredError, BindingNotFoundError, defineError, InvalidPostgresTlsConfigError, UnknownPostgresSslModeError, } from "./errors.js";
24
- export type { Container, Kv, KvScanItem, KvScanResult, KvSetOptions, ObjectMeta, Postgres, PostgresConnection, PostgresSslMode, PostgresTlsOptions, PresignedRequest, Queue, QueueMessage, SignedUrlMethod, SignedUrlOptions, Storage, Vault, } from "./types.js";
26
+ export type { Container, Kv, KvScanItem, KvScanResult, KvSetOptions, ObjectMeta, Postgres, PostgresConnection, PostgresSslMode, PostgresTlsOptions, PresignedRequest, Queue, QueueMessage, RemoteStorage, SignedUrlMethod, SignedUrlOptions, Storage, StorageGetResult, StorageHeadResult, StorageObjectAttributes, StoragePutAttributes, StoragePutOptions, StoragePutResult, Vault, } from "./types.js";
25
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,gDAAgD;AAChD,eAAO,MAAM,OAAO,gDAAoB,CAAA;AACxC,kDAAkD;AAClD,eAAO,MAAM,EAAE,2CAAe,CAAA;AAC9B,8CAA8C;AAC9C,eAAO,MAAM,KAAK,8CAAkB,CAAA;AACpC,8CAA8C;AAC9C,eAAO,MAAM,KAAK,8CAAkB,CAAA;AACpC,yDAAyD;AACzD,eAAO,MAAM,SAAS,kDAAsB,CAAA;AAC5C,iDAAiD;AACjD,eAAO,MAAM,QAAQ,iDAAqB,CAAA;AAE1C,OAAO,EACL,UAAU,EACV,yBAAyB,EACzB,oBAAoB,EACpB,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,SAAS,EACT,EAAE,EACF,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,KAAK,GACN,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,YAAY,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAA;AAIlE,gDAAgD;AAChD,eAAO,MAAM,OAAO,gDAAoB,CAAA;AACxC,kDAAkD;AAClD,eAAO,MAAM,EAAE,2CAAe,CAAA;AAC9B,8CAA8C;AAC9C,eAAO,MAAM,KAAK,8CAAkB,CAAA;AACpC,8CAA8C;AAC9C,eAAO,MAAM,KAAK,8CAAkB,CAAA;AACpC,yDAAyD;AACzD,eAAO,MAAM,SAAS,kDAAsB,CAAA;AAC5C,iDAAiD;AACjD,eAAO,MAAM,QAAQ,iDAAqB,CAAA;AAE1C,OAAO,EACL,UAAU,EACV,yBAAyB,EACzB,oBAAoB,EACpB,WAAW,EACX,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AAEpB,YAAY,EACV,SAAS,EACT,EAAE,EACF,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,26 @@
1
- import { a as BindingNotConfiguredError, c as UnknownPostgresSslModeError, i as AlienError, l as defineError, o as BindingNotFoundError, r as createFactories, s as InvalidPostgresTlsConfigError, t as loadAddon } from "./loader.js";
1
+ import { a as AlienError, c as InvalidPostgresTlsConfigError, d as unwrapNapiError, i as createRemoteStorageFactory, l as UnknownPostgresSslModeError, o as BindingNotConfiguredError, r as createFactories, s as BindingNotFoundError, t as loadAddon, u as defineError } from "./loader.js";
2
+ //#region src/remote.ts
3
+ /** Remote bindings for an existing deployment. */
4
+ var Bindings = class Bindings {
5
+ #storage;
6
+ constructor(storage) {
7
+ this.#storage = storage;
8
+ }
9
+ /** Discover the deployment's manager and prepare remote Storage bindings. */
10
+ static async forRemoteDeployment(options) {
11
+ try {
12
+ const bindings = await loadAddon().RemoteBindingsHandle.forDeployment(options.deploymentId, options.token, options.apiBaseUrl);
13
+ return new Bindings(createRemoteStorageFactory(bindings));
14
+ } catch (error) {
15
+ throw unwrapNapiError(error);
16
+ }
17
+ }
18
+ /** Resolve a remote Storage binding by resource name. */
19
+ storage(name) {
20
+ return this.#storage(name);
21
+ }
22
+ };
23
+ //#endregion
2
24
  //#region src/index.ts
3
25
  /**
4
26
  * `@alienplatform/bindings` — direct TypeScript bindings for Alien storage, kv,
@@ -24,4 +46,4 @@ const container = factories.container;
24
46
  /** Resolve the Postgres binding named `name`. */
25
47
  const postgres = factories.postgres;
26
48
  //#endregion
27
- export { AlienError, BindingNotConfiguredError, BindingNotFoundError, InvalidPostgresTlsConfigError, UnknownPostgresSslModeError, container, defineError, kv, postgres, queue, storage, vault };
49
+ export { AlienError, BindingNotConfiguredError, BindingNotFoundError, Bindings, InvalidPostgresTlsConfigError, UnknownPostgresSslModeError, container, defineError, kv, postgres, queue, storage, vault };
package/dist/loader.d.ts CHANGED
@@ -29,6 +29,7 @@
29
29
  * package safe to mark `sideEffects: false` — importing it performs no I/O and
30
30
  * requires no addon.
31
31
  */
32
+ import type { StorageGetResult, StorageHeadResult, StoragePutOptions, StoragePutResult } from "./types.js";
32
33
  /** Raw napi scan page. */
33
34
  export interface RawKvItem {
34
35
  key: string;
@@ -44,6 +45,8 @@ export interface RawObjectMeta {
44
45
  location: string;
45
46
  size: number;
46
47
  lastModified: string;
48
+ eTag?: string;
49
+ version?: string;
47
50
  }
48
51
  /** Raw napi presigned request. */
49
52
  export interface RawPresignedRequest {
@@ -60,14 +63,22 @@ export interface RawQueueMessage {
60
63
  }
61
64
  /** Raw napi storage handle. */
62
65
  export interface RawStorageHandle {
63
- get(path: string): Promise<Buffer>;
64
- put(path: string, data: Buffer): Promise<void>;
66
+ get(path: string): Promise<StorageGetResult>;
67
+ put(path: string, data: Buffer, options?: StoragePutOptions | null): Promise<StoragePutResult>;
65
68
  delete(path: string): Promise<void>;
66
69
  list(prefix?: string | null): Promise<RawObjectMeta[]>;
67
- head(path: string): Promise<RawObjectMeta>;
70
+ head(path: string): Promise<StorageHeadResult>;
68
71
  copy(from: string, to: string): Promise<void>;
69
72
  signedUrl(method: string, path: string, expiresInSecs: number): Promise<RawPresignedRequest>;
70
73
  }
74
+ /** Raw napi remote Storage v0 handle. */
75
+ export interface RawRemoteStorageHandle {
76
+ get(path: string): Promise<StorageGetResult>;
77
+ put(path: string, data: Buffer, options?: StoragePutOptions | null): Promise<StoragePutResult>;
78
+ delete(path: string): Promise<void>;
79
+ list(prefix?: string | null): Promise<RawObjectMeta[]>;
80
+ head(path: string): Promise<StorageHeadResult>;
81
+ }
71
82
  /** Raw napi key-value handle. */
72
83
  export interface RawKvHandle {
73
84
  get(key: string): Promise<Buffer | null>;
@@ -76,7 +87,7 @@ export interface RawKvHandle {
76
87
  exists(key: string): Promise<boolean>;
77
88
  scan(prefix: string, limit?: number | null, cursor?: string | null): Promise<RawScanResult>;
78
89
  }
79
- /** Raw napi queue handle. Every method takes the queue name as its first arg. */
90
+ /** Raw napi queue handle, already scoped to its configured queue. */
80
91
  export interface RawQueueHandle {
81
92
  sendJson(jsonString: string): Promise<void>;
82
93
  sendText(text: string): Promise<void>;
@@ -127,9 +138,22 @@ export interface RawBindingsHandle {
127
138
  container(name: string): Promise<RawContainerHandle>;
128
139
  postgres(name: string): Promise<RawPostgresHandle>;
129
140
  }
141
+ /** Raw napi remote bindings entry point. Storage is the entire v0 surface. */
142
+ export interface RawRemoteBindingsHandle {
143
+ storage(name: string): Promise<RawRemoteStorageHandle>;
144
+ }
145
+ /** Native environment-backed bindings class. */
146
+ export interface RawBindingsHandleConstructor {
147
+ new (): RawBindingsHandle;
148
+ }
149
+ /** Native remote bindings class. */
150
+ export interface RawRemoteBindingsHandleConstructor {
151
+ forDeployment(deploymentId: string, token: string, apiBaseUrl?: string): Promise<RawRemoteBindingsHandle>;
152
+ }
130
153
  /** The complete napi addon module surface consumed by the wrapper. */
131
154
  export interface NativeAddon {
132
- BindingsHandle: new () => RawBindingsHandle;
155
+ BindingsHandle: RawBindingsHandleConstructor;
156
+ RemoteBindingsHandle: RawRemoteBindingsHandleConstructor;
133
157
  version(): string;
134
158
  }
135
159
  /** The Linux C library a prebuild is compiled against. */
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AASH,0BAA0B;AAC1B,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd;AAED,4BAA4B;AAC5B,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,gCAAgC;AAChC,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,kCAAkC;AAClC,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,+BAA+B;AAC/B,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAClC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EA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ACX,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,uBAAuB,CAAC,CAAA;CACpC;AAED,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,cAAc,EAAE,4BAA4B,CAAA;IAC5C,oBAAoB,EAAE,kCAAkC,CAAA;IACxD,OAAO,IAAI,MAAM,CAAA;CAClB;AAED,0DAA0D;AAC1D,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAA;AAEtC;;;;;;;;;GASG;AACH,wBAAgB,eAAe,IAAI,SAAS,CAW3C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAC5C,IAAI,GAAE,MAAM,CAAC,YAA2B,EACxC,IAAI,GAAE,SAA4D,GACjE,MAAM,CAaR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE,MAAgD,GACzD,MAAM,GAAG,SAAS,CAWpB;AASD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAO7F;AAKD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAE9D;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,WAAW,CA0DvC"}
package/dist/loader.js CHANGED
@@ -3488,21 +3488,24 @@ function unwrapNapiError(err) {
3488
3488
  */
3489
3489
  /**
3490
3490
  * Build a lazy, cached resolver for one resource handle. The returned function
3491
- * loads the addon, constructs a `BindingsHandle`, and resolves the resource
3492
- * handle on first call; subsequent calls reuse the cached handle.
3491
+ * obtains a `BindingsHandle` and resolves the resource handle on first call;
3492
+ * subsequent calls reuse the cached handle.
3493
3493
  */
3494
- function lazyHandle(getAddon, name, resolve) {
3494
+ function lazyHandle(resolve) {
3495
3495
  let pending;
3496
3496
  return () => {
3497
- if (!pending) pending = (async () => {
3498
- return await resolve(new (getAddon()).BindingsHandle(), name);
3499
- })().catch((err) => {
3497
+ if (!pending) pending = resolve().catch((err) => {
3500
3498
  pending = void 0;
3501
3499
  throw err;
3502
3500
  });
3503
3501
  return pending;
3504
3502
  };
3505
3503
  }
3504
+ function bindingsFromAddon(getAddon) {
3505
+ return async () => {
3506
+ return new (getAddon()).BindingsHandle();
3507
+ };
3508
+ }
3506
3509
  function toBuffer(data) {
3507
3510
  return Buffer.isBuffer(data) ? data : Buffer.from(data);
3508
3511
  }
@@ -3517,7 +3520,7 @@ async function guard(handle, op) {
3517
3520
  function makeStorage(handle) {
3518
3521
  return {
3519
3522
  get: (path) => guard(handle, (raw) => raw.get(path)),
3520
- put: (path, data) => guard(handle, (raw) => raw.put(path, toBuffer(data))),
3523
+ put: (path, data, options) => guard(handle, (raw) => raw.put(path, toBuffer(data), options ?? null)),
3521
3524
  delete: (path) => guard(handle, (raw) => raw.delete(path)),
3522
3525
  list: (prefix) => guard(handle, (raw) => raw.list(prefix ?? null)),
3523
3526
  head: (path) => guard(handle, (raw) => raw.head(path)),
@@ -3525,6 +3528,15 @@ function makeStorage(handle) {
3525
3528
  signedUrl: (options) => guard(handle, (raw) => raw.signedUrl(options.method, options.path, options.expiresIn))
3526
3529
  };
3527
3530
  }
3531
+ function makeRemoteStorage(handle) {
3532
+ return {
3533
+ get: (path) => guard(handle, (raw) => raw.get(path)),
3534
+ put: (path, data, options) => guard(handle, (raw) => raw.put(path, toBuffer(data), options ?? null)),
3535
+ delete: (path) => guard(handle, (raw) => raw.delete(path)),
3536
+ list: (prefix) => guard(handle, (raw) => raw.list(prefix ?? null)),
3537
+ head: (path) => guard(handle, (raw) => raw.head(path))
3538
+ };
3539
+ }
3528
3540
  function makeKv(handle) {
3529
3541
  return {
3530
3542
  get: (key) => guard(handle, (raw) => raw.get(key)),
@@ -3661,13 +3673,26 @@ function makePostgres(handle) {
3661
3673
  }
3662
3674
  /** Build the factories bound to a given addon provider. */
3663
3675
  function createFactories(getAddon) {
3676
+ const getBindings = bindingsFromAddon(getAddon);
3664
3677
  return {
3665
- storage: (name) => makeStorage(lazyHandle(getAddon, name, (b, n) => b.storage(n))),
3666
- kv: (name) => makeKv(lazyHandle(getAddon, name, (b, n) => b.kv(n))),
3667
- queue: (name) => makeQueue(lazyHandle(getAddon, name, (b, n) => b.queue(n))),
3668
- vault: (name) => makeVault(lazyHandle(getAddon, name, (b, n) => b.vault(n))),
3669
- container: (name) => makeContainer(lazyHandle(getAddon, name, (b, n) => b.container(n))),
3670
- postgres: (name) => makePostgres(lazyHandle(getAddon, name, (b, n) => b.postgres(n)))
3678
+ storage: (name) => makeStorage(lazyHandle(async () => (await getBindings()).storage(name))),
3679
+ kv: (name) => makeKv(lazyHandle(async () => (await getBindings()).kv(name))),
3680
+ queue: (name) => makeQueue(lazyHandle(async () => (await getBindings()).queue(name))),
3681
+ vault: (name) => makeVault(lazyHandle(async () => (await getBindings()).vault(name))),
3682
+ container: (name) => makeContainer(lazyHandle(async () => (await getBindings()).container(name))),
3683
+ postgres: (name) => makePostgres(lazyHandle(async () => (await getBindings()).postgres(name)))
3684
+ };
3685
+ }
3686
+ /** Build the remote-only storage factory around one native bindings handle. */
3687
+ function createRemoteStorageFactory(bindings) {
3688
+ const storages = /* @__PURE__ */ new Map();
3689
+ return (name) => {
3690
+ let storage = storages.get(name);
3691
+ if (!storage) {
3692
+ storage = makeRemoteStorage(lazyHandle(() => bindings.storage(name)));
3693
+ storages.set(name, storage);
3694
+ }
3695
+ return storage;
3671
3696
  };
3672
3697
  }
3673
3698
  //#endregion
@@ -3836,4 +3861,4 @@ function loadAddon() {
3836
3861
  throw new Error(`Cannot load the @alienplatform/bindings native addon for '${triple}'. Install the '${pkg}' prebuild, or build it locally with \`napi build --platform\` in crates/alien-bindings-node, or set ALIEN_BINDINGS_ADDON_PATH to a built .node file.`);
3837
3862
  }
3838
3863
  //#endregion
3839
- export { BindingNotConfiguredError as a, UnknownPostgresSslModeError as c, AlienError as i, defineError as l, registerEmbeddedAddon as n, BindingNotFoundError as o, createFactories as r, InvalidPostgresTlsConfigError as s, loadAddon as t };
3864
+ export { AlienError as a, InvalidPostgresTlsConfigError as c, unwrapNapiError as d, createRemoteStorageFactory as i, UnknownPostgresSslModeError as l, registerEmbeddedAddon as n, BindingNotConfiguredError as o, createFactories as r, BindingNotFoundError as s, loadAddon as t, defineError as u };
package/dist/native.d.ts CHANGED
@@ -41,5 +41,5 @@ export declare const container: (name: string) => import("./types.js").Container
41
41
  /** Resolve the Postgres binding named `name`. */
42
42
  export declare const postgres: (name: string) => import("./types.js").Postgres;
43
43
  export { AlienError, BindingNotConfiguredError, defineError, InvalidPostgresTlsConfigError, UnknownPostgresSslModeError, } from "./errors.js";
44
- export type { Container, Kv, KvScanItem, KvScanResult, KvSetOptions, ObjectMeta, Postgres, PostgresConnection, PostgresSslMode, PostgresTlsOptions, PresignedRequest, Queue, QueueMessage, SignedUrlMethod, SignedUrlOptions, Storage, Vault, } from "./types.js";
44
+ export type { Container, Kv, KvScanItem, KvScanResult, KvSetOptions, ObjectMeta, Postgres, PostgresConnection, PostgresSslMode, PostgresTlsOptions, PresignedRequest, Queue, QueueMessage, SignedUrlMethod, SignedUrlOptions, Storage, StorageGetResult, StorageHeadResult, StorageObjectAttributes, StoragePutAttributes, StoragePutOptions, StoragePutResult, Vault, } from "./types.js";
45
45
  //# sourceMappingURL=native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../src/native.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAID,gDAAgD;AAChD,eAAO,MAAM,OAAO,gDAAoB,CAAA;AACxC,kDAAkD;AAClD,eAAO,MAAM,EAAE,2CAA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UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,GACN,MAAM,YAAY,CAAA"}
package/dist/native.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as BindingNotConfiguredError, c as UnknownPostgresSslModeError, i as AlienError, l as defineError, n as registerEmbeddedAddon, r as createFactories, s as InvalidPostgresTlsConfigError } from "./loader.js";
1
+ import { a as AlienError, c as InvalidPostgresTlsConfigError, l as UnknownPostgresSslModeError, n as registerEmbeddedAddon, o as BindingNotConfiguredError, r as createFactories, u as defineError } from "./loader.js";
2
2
  import addon from "./alien-bindings.node";
3
3
  //#region src/native.ts
4
4
  /**
@@ -0,0 +1,20 @@
1
+ import type { RemoteStorage } from "./types.js";
2
+ /** Options for accessing Storage resources in an existing deployment. */
3
+ export interface RemoteDeploymentBindingsOptions {
4
+ /** Deployment to access. */
5
+ deploymentId: string;
6
+ /** Alien API token authorized for remote bindings. */
7
+ token: string;
8
+ /** Override the Alien API base URL. */
9
+ apiBaseUrl?: string;
10
+ }
11
+ /** Remote bindings for an existing deployment. */
12
+ export declare class Bindings {
13
+ #private;
14
+ private constructor();
15
+ /** Discover the deployment's manager and prepare remote Storage bindings. */
16
+ static forRemoteDeployment(options: RemoteDeploymentBindingsOptions): Promise<Bindings>;
17
+ /** Resolve a remote Storage binding by resource name. */
18
+ storage(name: string): RemoteStorage;
19
+ }
20
+ //# sourceMappingURL=remote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../src/remote.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,yEAAyE;AACzE,MAAM,WAAW,+BAA+B;IAC9C,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAA;IACb,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,kDAAkD;AAClD,qBAAa,QAAQ;;IAGnB,OAAO;IAIP,6EAA6E;WAChE,mBAAmB,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,QAAQ,CAAC;IAc7F,yDAAyD;IACzD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa;CAGrC"}
package/dist/types.d.ts CHANGED
@@ -11,6 +11,10 @@ export interface ObjectMeta {
11
11
  size: number;
12
12
  /** Last-modified timestamp as an RFC 3339 string. */
13
13
  lastModified: string;
14
+ /** Provider entity tag, when available. */
15
+ eTag?: string;
16
+ /** Provider object version, when available. */
17
+ version?: string;
14
18
  }
15
19
  /** HTTP method a presigned request may be issued for. */
16
20
  export type SignedUrlMethod = "GET" | "PUT" | "DELETE";
@@ -33,23 +37,77 @@ export interface PresignedRequest {
33
37
  method: string;
34
38
  headers: Record<string, string>;
35
39
  }
40
+ /** Provider-neutral attributes returned with a stored object. */
41
+ export interface StorageObjectAttributes {
42
+ /** Stored MIME type. */
43
+ contentType?: string;
44
+ /** Stored browser content-disposition behavior. */
45
+ contentDisposition?: string;
46
+ /** Stored content encoding. */
47
+ contentEncoding?: string;
48
+ /** Stored content language. */
49
+ contentLanguage?: string;
50
+ /** Stored cache-control policy. */
51
+ cacheControl?: string;
52
+ /** Provider storage class, when reported. */
53
+ storageClass?: string;
54
+ /** User-defined object metadata. */
55
+ metadata: Record<string, string>;
56
+ }
57
+ /** Provider-neutral object attributes accepted by {@link Storage.put}. */
58
+ export interface StoragePutAttributes {
59
+ /** MIME type to store with the object. */
60
+ contentType?: string;
61
+ /** Browser content-disposition behavior to store with the object. */
62
+ contentDisposition?: string;
63
+ /** Content encoding to store. GCS rejects `gzip` because it transcodes gzip responses. */
64
+ contentEncoding?: string;
65
+ /** Content language to store with the object. */
66
+ contentLanguage?: string;
67
+ /** Cache-control policy to store with the object. */
68
+ cacheControl?: string;
69
+ /** User-defined object metadata to store. */
70
+ metadata?: Record<string, string>;
71
+ }
72
+ /** Options for {@link Storage.put}. */
73
+ export interface StoragePutOptions {
74
+ attributes?: StoragePutAttributes;
75
+ }
76
+ /** Result of reading a stored object. */
77
+ export interface StorageGetResult {
78
+ data: Buffer;
79
+ meta: ObjectMeta;
80
+ attributes: StorageObjectAttributes;
81
+ }
82
+ /** Result of reading object information without its payload. */
83
+ export interface StorageHeadResult {
84
+ meta: ObjectMeta;
85
+ attributes: StorageObjectAttributes;
86
+ }
87
+ /** Provider identifiers returned after a successful storage write. */
88
+ export interface StoragePutResult {
89
+ eTag?: string;
90
+ version?: string;
91
+ }
36
92
  /** A resolved object-storage binding. */
37
93
  export interface Storage {
38
94
  /** Fetch the object at `path`. */
39
- get(path: string): Promise<Buffer>;
40
- /** Store `data` at `path`. */
41
- put(path: string, data: Buffer | Uint8Array): Promise<void>;
95
+ get(path: string): Promise<StorageGetResult>;
96
+ /** Store `data` at `path`, optionally with provider-neutral object attributes. */
97
+ put(path: string, data: Buffer | Uint8Array, options?: StoragePutOptions): Promise<StoragePutResult>;
42
98
  /** Delete the object at `path`. */
43
99
  delete(path: string): Promise<void>;
44
100
  /** List objects, optionally filtered by `prefix`. */
45
101
  list(prefix?: string): Promise<ObjectMeta[]>;
46
- /** Fetch metadata for the object at `path`. */
47
- head(path: string): Promise<ObjectMeta>;
102
+ /** Fetch metadata and attributes for `path` without downloading its payload. */
103
+ head(path: string): Promise<StorageHeadResult>;
48
104
  /** Copy the object at `from` to `to`. */
49
105
  copy(from: string, to: string): Promise<void>;
50
106
  /** Create a presigned request for `path`. */
51
107
  signedUrl(options: SignedUrlOptions): Promise<PresignedRequest>;
52
108
  }
109
+ /** Storage operations available from an external deployment binding. */
110
+ export type RemoteStorage = Pick<Storage, "get" | "put" | "delete" | "list" | "head">;
53
111
  /** Options for {@link Kv.set}. */
54
112
  export interface KvSetOptions {
55
113
  /** Time-to-live, in seconds. */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,2CAA2C;AAC3C,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,qDAAqD;IACrD,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,CAAA;AAEtD,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC/B,wDAAwD;IACxD,MAAM,EAAE,eAAe,CAAA;IACvB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED,yCAAyC;AACzC,MAAM,WAAW,OAAO;IACtB,kCAAkC;IAClC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAClC,8BAA8B;IAC9B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3D,mCAAmC;IACnC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,qDAAqD;IACrD,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IAC5C,+CAA+C;IAC/C,I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AAED,UAAU,4BAA6B,SAAQ,wBAAwB;IACrE,OAAO,EAAE,aAAa,CAAA;IACtB,GAAG,EAAE,4BAA4B,CAAA;CAClC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,kBAAkB,GAC1B,yBAAyB,GACzB,0BAA0B,GAC1B,4BAA4B,CAAA;AAEhC;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;;OAMG;IACH,UAAU,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAA;CAC1C;AAED,0CAA0C;AAC1C,MAAM,WAAW,KAAK;IACpB,+CAA+C;IAC/C,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAClC,mDAAmD;IACnD,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAC9C,oEAAoE;IACpE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/C,oEAAoE;IACpE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD,sCAAsC;IACtC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACnC,mDAAmD;IACnD,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;CAC1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alienplatform/bindings",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "types": "./dist/index.d.ts",
@@ -54,13 +54,13 @@
54
54
  "@alienplatform/typescript-config": "^1.0.0"
55
55
  },
56
56
  "dependencies": {
57
- "@alienplatform/core": "^3.3.0"
57
+ "@alienplatform/core": "^3.3.2"
58
58
  },
59
59
  "optionalDependencies": {
60
- "@alienplatform/bindings-darwin-arm64": "3.3.0",
61
- "@alienplatform/bindings-darwin-x64": "3.3.0",
62
- "@alienplatform/bindings-linux-x64-gnu": "3.3.0",
63
- "@alienplatform/bindings-linux-arm64-gnu": "3.3.0"
60
+ "@alienplatform/bindings-darwin-arm64": "3.3.2",
61
+ "@alienplatform/bindings-darwin-x64": "3.3.2",
62
+ "@alienplatform/bindings-linux-x64-gnu": "3.3.2",
63
+ "@alienplatform/bindings-linux-arm64-gnu": "3.3.2"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "tsdown && tsc -p tsconfig.build.json --emitDeclarationOnly",
@@ -69,6 +69,7 @@
69
69
  "test:bun": "bun scripts/run-bun-tests.mjs",
70
70
  "test:ts": "tsc --noEmit",
71
71
  "smoke": "node scripts/smoke-envelope.mjs",
72
+ "smoke:remote-storage": "node scripts/remote-storage-smoke.mjs",
72
73
  "format-and-lint": "biome check .",
73
74
  "format-and-lint:fix": "biome check . --write"
74
75
  }