@cuylabs/agent-runtime-dapr 0.9.0 → 0.10.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 +154 -19
- package/dist/{chunk-2CEICSJH.js → chunk-5CJIC4YB.js} +184 -38
- package/dist/chunk-MJKJT3ZO.js +11219 -0
- package/dist/{chunk-A34CHK2E.js → chunk-MQJ4LZOX.js} +30 -4
- package/dist/chunk-YQQTUE6B.js +993 -0
- package/dist/chunk-YS2CWYBQ.js +1358 -0
- package/dist/client-UsEIzDF6.d.ts +322 -0
- package/dist/dispatch/index.d.ts +9 -0
- package/dist/dispatch/index.js +17 -0
- package/dist/execution/index.d.ts +5 -4
- package/dist/execution/index.js +2 -2
- package/dist/host/index.d.ts +8 -4
- package/dist/host/index.js +28 -8
- package/dist/index-BEOwKSPI.d.ts +101 -0
- package/dist/{index-BCMkUMAf.d.ts → index-BmM58WZa.d.ts} +390 -182
- package/dist/index-CFm5LORU.d.ts +63 -0
- package/dist/index.d.ts +62 -14
- package/dist/index.js +76 -6
- package/dist/invoker-B1jvz9DG.d.ts +52 -0
- package/dist/{store-pRLGfYhN.d.ts → store-BXBIDz40.d.ts} +24 -3
- package/dist/team/index.d.ts +612 -0
- package/dist/team/index.js +30 -0
- package/dist/worker-CXq0IFGX.d.ts +42 -0
- package/dist/workflow/index.d.ts +4 -225
- package/dist/workflow/index.js +2 -2
- package/dist/{workflow-bridge-C8Z1yr0Y.d.ts → workflow-bridge-BcicHH1Y.d.ts} +4 -2
- package/dist/workflow-host-D6W6fXoL.d.ts +459 -0
- package/package.json +16 -6
- package/dist/chunk-DILON56B.js +0 -668
- package/dist/chunk-R47X4FG2.js +0 -2009
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
1
7
|
// src/client.ts
|
|
2
8
|
var _otelClient = null;
|
|
3
9
|
async function tryGetOtelPropagation() {
|
|
@@ -144,7 +150,7 @@ var DaprSidecarClient = class {
|
|
|
144
150
|
}
|
|
145
151
|
return {
|
|
146
152
|
value: parseJson(text),
|
|
147
|
-
etag: response.headers.get("etag")?.trim() ||
|
|
153
|
+
etag: response.headers.get("etag")?.trim() || void 0
|
|
148
154
|
};
|
|
149
155
|
}
|
|
150
156
|
async getState(key) {
|
|
@@ -170,11 +176,16 @@ var DaprSidecarClient = class {
|
|
|
170
176
|
true
|
|
171
177
|
);
|
|
172
178
|
}
|
|
173
|
-
async deleteState(key) {
|
|
179
|
+
async deleteState(key, options = {}) {
|
|
174
180
|
const stateStoreName = this.requireStateStoreName();
|
|
181
|
+
const headers = new Headers();
|
|
182
|
+
if (options.etag) {
|
|
183
|
+
headers.set("If-Match", options.etag);
|
|
184
|
+
}
|
|
185
|
+
const concurrencyParam = options.concurrency ? `?concurrency=${options.concurrency}` : "";
|
|
175
186
|
await this.request(
|
|
176
|
-
`/v1.0/state/${encodeURIComponent(stateStoreName)}/${encodeURIComponent(key)}`,
|
|
177
|
-
{ method: "DELETE" },
|
|
187
|
+
`/v1.0/state/${encodeURIComponent(stateStoreName)}/${encodeURIComponent(key)}${concurrencyParam}`,
|
|
188
|
+
{ method: "DELETE", headers },
|
|
178
189
|
[200, 204, 404]
|
|
179
190
|
);
|
|
180
191
|
}
|
|
@@ -189,6 +200,20 @@ var DaprSidecarClient = class {
|
|
|
189
200
|
[200, 204]
|
|
190
201
|
);
|
|
191
202
|
}
|
|
203
|
+
async publish(pubsubName, topic, data, metadata) {
|
|
204
|
+
const params = metadata ? "?" + new URLSearchParams(Object.entries(metadata).map(
|
|
205
|
+
([k, v]) => [`metadata.${k}`, v]
|
|
206
|
+
)).toString() : "";
|
|
207
|
+
await this.request(
|
|
208
|
+
`/v1.0/publish/${encodeURIComponent(pubsubName)}/${encodeURIComponent(topic)}${params}`,
|
|
209
|
+
{
|
|
210
|
+
method: "POST",
|
|
211
|
+
body: JSON.stringify(data)
|
|
212
|
+
},
|
|
213
|
+
[200, 204],
|
|
214
|
+
true
|
|
215
|
+
);
|
|
216
|
+
}
|
|
192
217
|
async requestJson(path, init, allowedStatusCodes) {
|
|
193
218
|
const response = await this.request(path, init, allowedStatusCodes, true);
|
|
194
219
|
const text = await response.text();
|
|
@@ -278,6 +303,7 @@ var DaprSidecarClient = class {
|
|
|
278
303
|
};
|
|
279
304
|
|
|
280
305
|
export {
|
|
306
|
+
__export,
|
|
281
307
|
isDaprConflictError,
|
|
282
308
|
DaprSidecarClient
|
|
283
309
|
};
|