@di-framework/bindings 6.0.9 → 6.0.10

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.
@@ -1,9 +1,13 @@
1
- import { type WasmCloudBindingOptions } from './metadata.js';
2
- export type { WasmCloudBindingOptions };
1
+ import { type PlatformBindingOptions, type WasmCloudBindingOptions } from './metadata.js';
2
+ export type { PlatformBindingOptions, WasmCloudBindingOptions };
3
3
  /**
4
- * Declares a named wasmCloud host-interface binding on a concrete class.
4
+ * Declares a named platform host-interface binding on a concrete class.
5
5
  * Class identity is the DI token; `name` is the WIT import and hostInterfaces name.
6
6
  */
7
- export declare function WasmCloudBinding(name: string, options?: WasmCloudBindingOptions): <T extends {
7
+ export declare function PlatformBinding(name: string, options?: PlatformBindingOptions): <T extends {
8
8
  new (...args: any[]): object;
9
9
  }>(ctor: T) => T;
10
+ /**
11
+ * @deprecated Use `PlatformBinding` instead. This alias will be removed in the next major version.
12
+ */
13
+ export declare const WasmCloudBinding: typeof PlatformBinding;
package/dist/decorator.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { Postgres } from './bindings/postgres.js';
2
2
  import { defineBindingMetadata, isWitIdentifier, rejectsPlaintextSecret, } from './metadata.js';
3
3
  /**
4
- * Declares a named wasmCloud host-interface binding on a concrete class.
4
+ * Declares a named platform host-interface binding on a concrete class.
5
5
  * Class identity is the DI token; `name` is the WIT import and hostInterfaces name.
6
6
  */
7
- export function WasmCloudBinding(name, options = {}) {
7
+ export function PlatformBinding(name, options = {}) {
8
8
  // biome-ignore lint/suspicious/noExplicitAny: class decorator constructor
9
9
  return (ctor) => {
10
10
  if (!isWitIdentifier(name)) {
11
- throw new Error(`WasmCloud binding name "${name}" must be a WIT identifier matching /^[a-z][a-z0-9-]*$/`);
11
+ throw new Error(`Platform binding name "${name}" must be a WIT identifier matching /^[a-z][a-z0-9-]*$/`);
12
12
  }
13
13
  if (options.serviceName !== undefined) {
14
14
  if (typeof options.serviceName !== 'string' ||
@@ -26,9 +26,13 @@ export function WasmCloudBinding(name, options = {}) {
26
26
  }
27
27
  const secretProblem = rejectsPlaintextSecret(options.config);
28
28
  if (secretProblem !== undefined) {
29
- throw new Error(`WasmCloud binding "${name}": ${secretProblem}`);
29
+ throw new Error(`Platform binding "${name}": ${secretProblem}`);
30
30
  }
31
31
  defineBindingMetadata(ctor, { name, options });
32
32
  return ctor;
33
33
  };
34
34
  }
35
+ /**
36
+ * @deprecated Use `PlatformBinding` instead. This alias will be removed in the next major version.
37
+ */
38
+ export const WasmCloudBinding = PlatformBinding;
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { OutgoingHttp, type OutgoingHttpGuest } from './bindings/outgoing-http.j
6
6
  export { Postgres, type PostgresGuest } from './bindings/postgres.js';
7
7
  export { Secrets, type SecretsGuest } from './bindings/secrets.js';
8
8
  export { BINDING_CATALOG, BINDING_KINDS, type BindingKind, type CatalogEntry, isBindingKind, } from './catalog.js';
9
- export { WasmCloudBinding, type WasmCloudBindingOptions } from './decorator.js';
9
+ export { PlatformBinding, type PlatformBindingOptions, WasmCloudBinding, type WasmCloudBindingOptions, } from './decorator.js';
10
10
  export { type GuestModules, resetGuests, setGuests, tryGetGuest, WASMCLOUD_GUESTS_GLOBAL, } from './guests.js';
11
- export { getBindingMetadata, isWitIdentifier, WASMCLOUD_BINDING_KEY, type WasmCloudBindingMetadata, } from './metadata.js';
11
+ export { getBindingMetadata, isWitIdentifier, type PlatformBindingMetadata, WASMCLOUD_BINDING_KEY, type WasmCloudBindingMetadata, } from './metadata.js';
12
12
  export { getWorkload, getWorkloadComponent, getWorkloadService, WORKLOAD_COMPONENT_KEY, WORKLOAD_KEY, WORKLOAD_SERVICE_KEY, Workload, WorkloadComponent, type WorkloadComponentOptions, type WorkloadFetchHandler, type WorkloadMetadata, type WorkloadRunHandler, WorkloadService, type WorkloadServiceOptions, } from './workload.js';
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ export { OutgoingHttp } from './bindings/outgoing-http.js';
6
6
  export { Postgres } from './bindings/postgres.js';
7
7
  export { Secrets } from './bindings/secrets.js';
8
8
  export { BINDING_CATALOG, BINDING_KINDS, isBindingKind, } from './catalog.js';
9
- export { WasmCloudBinding } from './decorator.js';
9
+ export { PlatformBinding, WasmCloudBinding, } from './decorator.js';
10
10
  export { resetGuests, setGuests, tryGetGuest, WASMCLOUD_GUESTS_GLOBAL, } from './guests.js';
11
11
  export { getBindingMetadata, isWitIdentifier, WASMCLOUD_BINDING_KEY, } from './metadata.js';
12
12
  export { getWorkload, getWorkloadComponent, getWorkloadService, WORKLOAD_COMPONENT_KEY, WORKLOAD_KEY, WORKLOAD_SERVICE_KEY, Workload, WorkloadComponent, WorkloadService, } from './workload.js';
@@ -1,5 +1,5 @@
1
1
  export declare const WASMCLOUD_BINDING_KEY = "di:wasmcloud-binding";
2
- export type WasmCloudBindingOptions = {
2
+ export type PlatformBindingOptions = {
3
3
  /** Same-namespace managed PostgreSQL BackingService. */
4
4
  serviceName?: string;
5
5
  interfaces?: string[];
@@ -7,11 +7,19 @@ export type WasmCloudBindingOptions = {
7
7
  configFrom?: string;
8
8
  config?: Record<string, string>;
9
9
  };
10
- export type WasmCloudBindingMetadata = {
10
+ /**
11
+ * @deprecated Use `PlatformBindingOptions` instead. This alias will be removed in the next major version.
12
+ */
13
+ export type WasmCloudBindingOptions = PlatformBindingOptions;
14
+ export type PlatformBindingMetadata = {
11
15
  name: string;
12
- options: WasmCloudBindingOptions;
16
+ options: PlatformBindingOptions;
13
17
  };
18
+ /**
19
+ * @deprecated Use `PlatformBindingMetadata` instead. This alias will be removed in the next major version.
20
+ */
21
+ export type WasmCloudBindingMetadata = PlatformBindingMetadata;
14
22
  export declare function isWitIdentifier(name: string): boolean;
15
23
  export declare function rejectsPlaintextSecret(config: Record<string, string> | undefined): string | undefined;
16
- export declare function defineBindingMetadata(target: object, metadata: WasmCloudBindingMetadata): void;
17
- export declare function getBindingMetadata(target: object): WasmCloudBindingMetadata | undefined;
24
+ export declare function defineBindingMetadata(target: object, metadata: PlatformBindingMetadata): void;
25
+ export declare function getBindingMetadata(target: object): PlatformBindingMetadata | undefined;
@@ -41,8 +41,7 @@ export interface AutocommitDatabase extends SqlDatabase {
41
41
  * (line 190) calls `client.batch_execute` with that string (line 191). The named
42
42
  * import does the same (`query_batch`, line 407; `id.client()`, line 412;
43
43
  * `batch_with_client`, line 416). `crates/provider-sqldb-postgres` is not in that
44
- * tag. The invocation-lease patch does not split this string, so it still
45
- * reaches one `batch_execute`.
44
+ * tag. Upstream does not split this string, so it reaches one `batch_execute`.
46
45
  */
47
46
  atomicBatch(statements: readonly AtomicStatement[]): Promise<void>;
48
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@di-framework/bindings",
3
- "version": "6.0.9",
3
+ "version": "6.0.10",
4
4
  "description": "Native platform WIT service bindings for DI Framework applications.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",