@alienplatform/sdk 1.14.1 → 2.0.1

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 (160) hide show
  1. package/dist/dist.js +371 -275
  2. package/dist/index.d.ts +22 -28
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3 -14356
  5. package/dist/native.d.ts +26 -0
  6. package/dist/native.d.ts.map +1 -0
  7. package/dist/native.js +2 -0
  8. package/dist/worker-runtime/channel.d.ts +25 -0
  9. package/dist/worker-runtime/channel.d.ts.map +1 -0
  10. package/dist/worker-runtime/errors.d.ts +79 -0
  11. package/dist/worker-runtime/errors.d.ts.map +1 -0
  12. package/dist/worker-runtime/event-loop.d.ts +43 -0
  13. package/dist/worker-runtime/event-loop.d.ts.map +1 -0
  14. package/dist/{generated → worker-runtime/generated}/control.d.ts +15 -15
  15. package/dist/worker-runtime/generated/control.d.ts.map +1 -0
  16. package/dist/worker-runtime/generated/google/protobuf/duration.d.ts.map +1 -0
  17. package/dist/worker-runtime/generated/google/protobuf/timestamp.d.ts.map +1 -0
  18. package/dist/{generated → worker-runtime/generated}/wait_until.d.ts +29 -29
  19. package/dist/worker-runtime/generated/wait_until.d.ts.map +1 -0
  20. package/dist/worker-runtime/grpc-utils.d.ts +23 -0
  21. package/dist/worker-runtime/grpc-utils.d.ts.map +1 -0
  22. package/dist/worker-runtime/index.d.ts +33 -0
  23. package/dist/worker-runtime/index.d.ts.map +1 -0
  24. package/dist/{src.js → worker-runtime/index.js} +9370 -4035
  25. package/dist/worker-runtime/registry.d.ts +169 -0
  26. package/dist/worker-runtime/registry.d.ts.map +1 -0
  27. package/dist/worker-runtime/service-definitions.d.ts +12 -0
  28. package/dist/worker-runtime/service-definitions.d.ts.map +1 -0
  29. package/dist/worker-runtime/wait-until-manager.d.ts +34 -0
  30. package/dist/worker-runtime/wait-until-manager.d.ts.map +1 -0
  31. package/package.json +18 -38
  32. package/.turbo/turbo-build.log +0 -30
  33. package/AGENTS.md +0 -70
  34. package/dist/bearerTokenAuthenticationPolicy.js +0 -3028
  35. package/dist/bindings/artifact-registry.d.ts +0 -88
  36. package/dist/bindings/artifact-registry.d.ts.map +0 -1
  37. package/dist/bindings/build.d.ts +0 -67
  38. package/dist/bindings/build.d.ts.map +0 -1
  39. package/dist/bindings/index.d.ts +0 -13
  40. package/dist/bindings/index.d.ts.map +0 -1
  41. package/dist/bindings/kv.d.ts +0 -113
  42. package/dist/bindings/kv.d.ts.map +0 -1
  43. package/dist/bindings/postgres.d.ts +0 -90
  44. package/dist/bindings/postgres.d.ts.map +0 -1
  45. package/dist/bindings/postgres.test.d.ts +0 -2
  46. package/dist/bindings/postgres.test.d.ts.map +0 -1
  47. package/dist/bindings/queue.d.ts +0 -81
  48. package/dist/bindings/queue.d.ts.map +0 -1
  49. package/dist/bindings/service-account.d.ts +0 -46
  50. package/dist/bindings/service-account.d.ts.map +0 -1
  51. package/dist/bindings/storage.d.ts +0 -164
  52. package/dist/bindings/storage.d.ts.map +0 -1
  53. package/dist/bindings/vault.d.ts +0 -65
  54. package/dist/bindings/vault.d.ts.map +0 -1
  55. package/dist/bindings/worker.d.ts +0 -72
  56. package/dist/bindings/worker.d.ts.map +0 -1
  57. package/dist/channel.d.ts +0 -39
  58. package/dist/channel.d.ts.map +0 -1
  59. package/dist/checksum.js +0 -6176
  60. package/dist/commands/client.d.ts +0 -47
  61. package/dist/commands/client.d.ts.map +0 -1
  62. package/dist/commands/errors.d.ts +0 -198
  63. package/dist/commands/errors.d.ts.map +0 -1
  64. package/dist/commands/index.d.ts +0 -23
  65. package/dist/commands/index.d.ts.map +0 -1
  66. package/dist/commands/index.js +0 -387
  67. package/dist/commands/types.d.ts +0 -40
  68. package/dist/commands/types.d.ts.map +0 -1
  69. package/dist/commands.d.ts +0 -55
  70. package/dist/commands.d.ts.map +0 -1
  71. package/dist/context.d.ts +0 -182
  72. package/dist/context.d.ts.map +0 -1
  73. package/dist/dist-cjs.js +0 -15258
  74. package/dist/dist2.js +0 -1239
  75. package/dist/errors.d.ts +0 -359
  76. package/dist/errors.d.ts.map +0 -1
  77. package/dist/es5.js +0 -1720
  78. package/dist/esm.js +0 -18068
  79. package/dist/esm2.js +0 -3166
  80. package/dist/event-streams.js +0 -770
  81. package/dist/events.d.ts +0 -163
  82. package/dist/events.d.ts.map +0 -1
  83. package/dist/generated/artifact_registry.d.ts +0 -302
  84. package/dist/generated/artifact_registry.d.ts.map +0 -1
  85. package/dist/generated/build.d.ts +0 -184
  86. package/dist/generated/build.d.ts.map +0 -1
  87. package/dist/generated/container.d.ts +0 -101
  88. package/dist/generated/container.d.ts.map +0 -1
  89. package/dist/generated/control.d.ts.map +0 -1
  90. package/dist/generated/google/protobuf/duration.d.ts.map +0 -1
  91. package/dist/generated/google/protobuf/timestamp.d.ts.map +0 -1
  92. package/dist/generated/kv.d.ts +0 -182
  93. package/dist/generated/kv.d.ts.map +0 -1
  94. package/dist/generated/queue.d.ts +0 -127
  95. package/dist/generated/queue.d.ts.map +0 -1
  96. package/dist/generated/service_account.d.ts +0 -112
  97. package/dist/generated/service_account.d.ts.map +0 -1
  98. package/dist/generated/storage.d.ts +0 -784
  99. package/dist/generated/storage.d.ts.map +0 -1
  100. package/dist/generated/vault.d.ts +0 -107
  101. package/dist/generated/vault.d.ts.map +0 -1
  102. package/dist/generated/wait_until.d.ts.map +0 -1
  103. package/dist/generated/worker.d.ts +0 -107
  104. package/dist/generated/worker.d.ts.map +0 -1
  105. package/dist/global.d.ts +0 -208
  106. package/dist/global.d.ts.map +0 -1
  107. package/dist/grpc-utils.d.ts +0 -25
  108. package/dist/grpc-utils.d.ts.map +0 -1
  109. package/dist/jws.js +0 -611
  110. package/dist/open.js +0 -461
  111. package/dist/rolldown-runtime.js +0 -44
  112. package/dist/src2.js +0 -114032
  113. package/dist/types.d.ts +0 -337
  114. package/dist/types.d.ts.map +0 -1
  115. package/dist/wait-until.d.ts +0 -115
  116. package/dist/wait-until.d.ts.map +0 -1
  117. package/scripts/generate-proto.sh +0 -46
  118. package/src/bindings/AGENTS.md +0 -105
  119. package/src/bindings/artifact-registry.ts +0 -317
  120. package/src/bindings/build.ts +0 -195
  121. package/src/bindings/index.ts +0 -13
  122. package/src/bindings/kv.ts +0 -240
  123. package/src/bindings/postgres.test.ts +0 -17
  124. package/src/bindings/postgres.ts +0 -446
  125. package/src/bindings/queue.ts +0 -191
  126. package/src/bindings/service-account.ts +0 -113
  127. package/src/bindings/storage.ts +0 -536
  128. package/src/bindings/vault.ts +0 -133
  129. package/src/bindings/worker.ts +0 -164
  130. package/src/channel.ts +0 -102
  131. package/src/commands/client.ts +0 -446
  132. package/src/commands/errors.ts +0 -126
  133. package/src/commands/index.ts +0 -41
  134. package/src/commands/types.ts +0 -52
  135. package/src/commands.ts +0 -76
  136. package/src/context.ts +0 -368
  137. package/src/errors.ts +0 -280
  138. package/src/events.ts +0 -511
  139. package/src/generated/artifact_registry.ts +0 -2096
  140. package/src/generated/build.ts +0 -1311
  141. package/src/generated/container.ts +0 -503
  142. package/src/generated/control.ts +0 -2018
  143. package/src/generated/google/protobuf/duration.ts +0 -196
  144. package/src/generated/google/protobuf/timestamp.ts +0 -226
  145. package/src/generated/kv.ts +0 -1169
  146. package/src/generated/queue.ts +0 -753
  147. package/src/generated/service_account.ts +0 -814
  148. package/src/generated/storage.ts +0 -3820
  149. package/src/generated/vault.ts +0 -543
  150. package/src/generated/wait_until.ts +0 -829
  151. package/src/generated/worker.ts +0 -759
  152. package/src/global.ts +0 -287
  153. package/src/grpc-utils.ts +0 -159
  154. package/src/index.ts +0 -160
  155. package/src/types.ts +0 -397
  156. package/src/wait-until.ts +0 -273
  157. package/tsconfig.json +0 -8
  158. package/tsdown.config.ts +0 -17
  159. /package/dist/{generated → worker-runtime/generated}/google/protobuf/duration.d.ts +0 -0
  160. /package/dist/{generated → worker-runtime/generated}/google/protobuf/timestamp.d.ts +0 -0
@@ -1,164 +0,0 @@
1
- /**
2
- * Storage binding implementation.
3
- *
4
- * Provides object storage operations with streaming support.
5
- */
6
- import { type Channel } from "nice-grpc";
7
- import type { SignedUrlOptions, SignedUrlResult, StorageGetOptions, StorageGetResult, StorageListResult, StorageObjectMeta, StoragePutOptions } from "../types.js";
8
- /**
9
- * Storage binding for object storage operations.
10
- *
11
- * @example
12
- * ```typescript
13
- * import { storage } from "@alienplatform/sdk"
14
- *
15
- * const bucket = storage("my-bucket")
16
- *
17
- * // Upload a file
18
- * await bucket.put("images/photo.jpg", imageData, { contentType: "image/jpeg" })
19
- *
20
- * // Download a file
21
- * const result = await bucket.get("images/photo.jpg")
22
- * console.log("Size:", result.meta.size)
23
- *
24
- * // List files
25
- * for await (const file of bucket.list("images/")) {
26
- * console.log(file.location)
27
- * }
28
- *
29
- * // Generate a signed URL
30
- * const { url } = await bucket.signedUrl("images/photo.jpg", { operation: "get" })
31
- * ```
32
- */
33
- export declare class Storage {
34
- private readonly client;
35
- private readonly bindingName;
36
- constructor(channel: Channel, bindingName: string);
37
- /**
38
- * Get an object from storage.
39
- *
40
- * @param path - Path to the object
41
- * @param options - Get options (range, conditionals)
42
- * @returns Object data and metadata
43
- */
44
- get(path: string, options?: StorageGetOptions): Promise<StorageGetResult>;
45
- /**
46
- * Get an object as a UTF-8 string.
47
- *
48
- * @param path - Path to the object
49
- * @param options - Get options
50
- * @returns Object content as string
51
- */
52
- getText(path: string, options?: StorageGetOptions): Promise<string>;
53
- /**
54
- * Get an object and parse as JSON.
55
- *
56
- * @param path - Path to the object
57
- * @param options - Get options
58
- * @returns Parsed JSON content
59
- */
60
- getJson<T = unknown>(path: string, options?: StorageGetOptions): Promise<T>;
61
- /**
62
- * Put an object to storage.
63
- *
64
- * @param path - Path to store the object
65
- * @param data - Object data
66
- * @param options - Put options (content type, metadata)
67
- */
68
- put(path: string, data: Uint8Array | string | object, options?: StoragePutOptions): Promise<void>;
69
- /**
70
- * Put an object using streaming (for large files).
71
- *
72
- * @param path - Path to store the object
73
- * @param chunks - Async iterable of data chunks
74
- * @param options - Put options
75
- */
76
- putMultipart(path: string, chunks: AsyncIterable<Uint8Array>, options?: StoragePutOptions): Promise<void>;
77
- /**
78
- * Delete an object from storage.
79
- *
80
- * @param path - Path to the object
81
- */
82
- delete(path: string): Promise<void>;
83
- /**
84
- * List objects in storage.
85
- *
86
- * @param prefix - Optional prefix filter
87
- * @param options - List options
88
- * @returns Async iterable of object metadata
89
- */
90
- list(prefix?: string, options?: {
91
- offset?: string;
92
- }): AsyncIterable<StorageObjectMeta>;
93
- /**
94
- * List objects with delimiter (for directory-like listing).
95
- *
96
- * @param prefix - Optional prefix filter
97
- * @returns List result with objects and common prefixes
98
- */
99
- listWithDelimiter(prefix?: string): Promise<StorageListResult>;
100
- /**
101
- * Get object metadata without downloading content.
102
- *
103
- * @param path - Path to the object
104
- * @returns Object metadata
105
- */
106
- head(path: string): Promise<StorageObjectMeta>;
107
- /**
108
- * Check if an object exists.
109
- *
110
- * @param path - Path to the object
111
- * @returns True if the object exists
112
- */
113
- exists(path: string): Promise<boolean>;
114
- /**
115
- * Get the base directory path for this storage binding.
116
- *
117
- * @returns Base directory path
118
- */
119
- getBaseDir(): Promise<string>;
120
- /**
121
- * Get the underlying URL for this storage binding.
122
- *
123
- * @returns Storage URL
124
- */
125
- getUrl(): Promise<string>;
126
- /**
127
- * Copy an object within the same storage binding.
128
- *
129
- * @param from - Source path
130
- * @param to - Destination path
131
- */
132
- copy(from: string, to: string): Promise<void>;
133
- /**
134
- * Rename (move) an object within the same storage binding.
135
- *
136
- * @param from - Source path
137
- * @param to - Destination path
138
- */
139
- rename(from: string, to: string): Promise<void>;
140
- /**
141
- * Copy an object only if the destination doesn't exist.
142
- *
143
- * @param from - Source path
144
- * @param to - Destination path
145
- */
146
- copyIfNotExists(from: string, to: string): Promise<void>;
147
- /**
148
- * Rename (move) an object only if the destination doesn't exist.
149
- *
150
- * @param from - Source path
151
- * @param to - Destination path
152
- */
153
- renameIfNotExists(from: string, to: string): Promise<void>;
154
- /**
155
- * Generate a signed URL for an object.
156
- *
157
- * @param path - Path to the object
158
- * @param options - Signed URL options
159
- * @returns Signed URL result
160
- */
161
- signedUrl(path: string, options: SignedUrlOptions): Promise<SignedUrlResult>;
162
- private fromProtoMeta;
163
- }
164
- //# sourceMappingURL=storage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/bindings/storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,WAAW,CAAA;AAUtD,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,aAAa,CAAA;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;gBAExB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM;IAKjD;;;;;;OAMG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA2D/E;;;;;;OAMG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKzE;;;;;;OAMG;IACG,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,CAAC;IAKjF;;;;;;OAMG;IACG,GAAG,CACP,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,EAClC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,IAAI,CAAC;IA8ChB;;;;;;OAMG;IACG,YAAY,CAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,EACjC,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,IAAI,CAAC;IA6ChB;;;;OAIG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAczC;;;;;;OAMG;IACI,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,aAAa,CAAC,iBAAiB,CAAC;IAY7F;;;;;OAKG;IACG,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAkBpE;;;;;OAKG;IACG,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAepD;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAY5C;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAcnC;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAc/B;;;;;OAKG;IACG,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAenD;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAerD;;;;;OAKG;IACG,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAe9D;;;;;OAKG;IACG,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAehE;;;;;;OAMG;IACG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAiClF,OAAO,CAAC,aAAa;CAStB"}
@@ -1,65 +0,0 @@
1
- /**
2
- * Vault binding implementation.
3
- *
4
- * Provides secure secret management operations.
5
- */
6
- import { type Channel } from "nice-grpc";
7
- /**
8
- * Vault binding for secret management operations.
9
- *
10
- * @example
11
- * ```typescript
12
- * import { vault } from "@alienplatform/sdk"
13
- *
14
- * const secrets = vault("app-secrets")
15
- *
16
- * // Get a secret
17
- * const apiKey = await secrets.get("API_KEY")
18
- *
19
- * // Set a secret
20
- * await secrets.set("DATABASE_URL", "postgres://...")
21
- *
22
- * // Delete a secret
23
- * await secrets.delete("OLD_KEY")
24
- * ```
25
- */
26
- export declare class Vault {
27
- private readonly client;
28
- private readonly bindingName;
29
- constructor(channel: Channel, bindingName: string);
30
- /**
31
- * Get a secret value.
32
- *
33
- * @param secretName - Name of the secret
34
- * @returns Secret value
35
- */
36
- get(secretName: string): Promise<string>;
37
- /**
38
- * Get a secret as JSON.
39
- *
40
- * @param secretName - Name of the secret
41
- * @returns Parsed JSON value
42
- */
43
- getJson<T = unknown>(secretName: string): Promise<T>;
44
- /**
45
- * Set a secret value.
46
- *
47
- * @param secretName - Name of the secret
48
- * @param value - Secret value (string or object for JSON)
49
- */
50
- set(secretName: string, value: string | object): Promise<void>;
51
- /**
52
- * Delete a secret.
53
- *
54
- * @param secretName - Name of the secret to delete
55
- */
56
- delete(secretName: string): Promise<void>;
57
- /**
58
- * Check if a secret exists.
59
- *
60
- * @param secretName - Name of the secret
61
- * @returns True if the secret exists
62
- */
63
- exists(secretName: string): Promise<boolean>;
64
- }
65
- //# sourceMappingURL=vault.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vault.d.ts","sourceRoot":"","sources":["../../src/bindings/vault.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,WAAW,CAAA;AAOtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,KAAK;IAChB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;gBAExB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM;IAKjD;;;;;OAKG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAe9C;;;;;OAKG;IACG,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAK1D;;;;;OAKG;IACG,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBpE;;;;OAIG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAc/C;;;;;OAKG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAWnD"}
@@ -1,72 +0,0 @@
1
- /**
2
- * Worker binding implementation.
3
- *
4
- * Provides direct worker-to-worker invocation.
5
- */
6
- import { type Channel } from "nice-grpc";
7
- import type { WorkerInvokeRequest, WorkerInvokeResponse } from "../types.js";
8
- /**
9
- * Worker binding for direct worker invocation.
10
- *
11
- * @example
12
- * ```typescript
13
- * import { worker } from "@alienplatform/sdk"
14
- *
15
- * const processor = worker("image-processor")
16
- *
17
- * // Invoke with JSON body
18
- * const response = await processor.invokeJson("resize-image", {
19
- * imageUrl: "https://...",
20
- * width: 800,
21
- * height: 600,
22
- * })
23
- *
24
- * // Get worker URL
25
- * const url = await processor.getUrl()
26
- * ```
27
- */
28
- export declare class WorkerBinding {
29
- private readonly client;
30
- private readonly bindingName;
31
- constructor(channel: Channel, bindingName: string);
32
- /**
33
- * Invoke a worker with raw request data.
34
- *
35
- * @param request - Invocation request
36
- * @returns Worker response
37
- */
38
- invoke(request: WorkerInvokeRequest): Promise<WorkerInvokeResponse>;
39
- /**
40
- * Invoke a worker with a JSON body.
41
- *
42
- * @param targetWorker - Target worker identifier
43
- * @param body - JSON body
44
- * @param options - Optional request options
45
- * @returns Parsed JSON response
46
- */
47
- invokeJson<TRequest, TResponse = unknown>(targetWorker: string, body: TRequest, options?: {
48
- method?: string;
49
- path?: string;
50
- headers?: Record<string, string>;
51
- timeoutMs?: number;
52
- }): Promise<TResponse>;
53
- /**
54
- * Invoke a worker with GET request.
55
- *
56
- * @param targetWorker - Target worker identifier
57
- * @param path - Request path
58
- * @param options - Optional request options
59
- * @returns Parsed JSON response
60
- */
61
- get<TResponse = unknown>(targetWorker: string, path?: string, options?: {
62
- headers?: Record<string, string>;
63
- timeoutMs?: number;
64
- }): Promise<TResponse>;
65
- /**
66
- * Get the public URL of the worker.
67
- *
68
- * @returns Worker URL if available
69
- */
70
- getUrl(): Promise<string | undefined>;
71
- }
72
- //# sourceMappingURL=worker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/bindings/worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,WAAW,CAAA;AAMtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;gBAExB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM;IAKjD;;;;;OAKG;IACG,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAwBzE;;;;;;;OAOG;IACG,UAAU,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,EAC5C,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,QAAQ,EACd,OAAO,CAAC,EAAE;QACR,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAChC,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,GACA,OAAO,CAAC,SAAS,CAAC;IAsBrB;;;;;;;OAOG;IACG,GAAG,CAAC,SAAS,GAAG,OAAO,EAC3B,YAAY,EAAE,MAAM,EACpB,IAAI,SAAM,EACV,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAChC,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,GACA,OAAO,CAAC,SAAS,CAAC;IAkBrB;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAa5C"}
package/dist/channel.d.ts DELETED
@@ -1,39 +0,0 @@
1
- /**
2
- * gRPC channel management for the Alien bindings SDK.
3
- */
4
- import { type Channel } from "nice-grpc";
5
- /** Re-export the Channel type */
6
- export type GrpcChannel = Channel;
7
- /**
8
- * Get the gRPC endpoint from environment variables.
9
- */
10
- export declare function getGrpcEndpoint(): string;
11
- /**
12
- * Create a gRPC channel to the specified address.
13
- *
14
- * @param address - The gRPC server address
15
- * @returns The created channel
16
- */
17
- export declare function createGrpcChannel(address: string): Promise<Channel>;
18
- /**
19
- * Get or create a cached gRPC channel to the specified address.
20
- *
21
- * @param address - The gRPC server address
22
- * @returns The cached or newly created channel
23
- */
24
- export declare function getOrCreateChannel(address: string): Promise<Channel>;
25
- /**
26
- * Get a gRPC channel to the alien-runtime using the default env var.
27
- * The channel is cached for reuse across all bindings.
28
- */
29
- export declare function getChannel(): Promise<Channel>;
30
- /**
31
- * Close all cached gRPC channels.
32
- * This should be called when shutting down the application.
33
- */
34
- export declare function closeChannel(): void;
35
- /**
36
- * Reset the cached channels (useful for testing).
37
- */
38
- export declare function resetChannel(): void;
39
- //# sourceMappingURL=channel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../src/channel.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,WAAW,CAAA;AAgBvD,iCAAiC;AACjC,MAAM,MAAM,WAAW,GAAG,OAAO,CAAA;AAEjC;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAYxC;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAWzE;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO1E;AAED;;;GAGG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAGnD;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAKnC;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}