@runtypelabs/sdk 9.11.0 → 9.12.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/dist/index.cjs CHANGED
@@ -5061,18 +5061,23 @@ var DispatchEndpoint = class {
5061
5061
  /**
5062
5062
  * Dispatch: create and/or execute flows on records atomically
5063
5063
  */
5064
- async execute(data) {
5064
+ async execute(data, admission) {
5065
5065
  const normalized = normalizeDispatchRequest(data);
5066
- return this.client.post("/dispatch", {
5067
- ...normalized,
5068
- options: {
5069
- ...normalized.options,
5070
- streamResponse: false
5071
- }
5072
- });
5066
+ const headers = buildAgentAdmissionHeaders(admission);
5067
+ return this.client.post(
5068
+ "/dispatch",
5069
+ {
5070
+ ...normalized,
5071
+ options: {
5072
+ ...normalized.options,
5073
+ streamResponse: false
5074
+ }
5075
+ },
5076
+ ...Object.keys(headers).length > 0 ? [headers] : []
5077
+ );
5073
5078
  }
5074
5079
  /** Start a dispatch and return its durable execution handle immediately. */
5075
- async executeAsync(data) {
5080
+ async executeAsync(data, admission) {
5076
5081
  const normalized = normalizeDispatchRequest(data);
5077
5082
  return this.client.post(
5078
5083
  "/dispatch",
@@ -5080,7 +5085,7 @@ var DispatchEndpoint = class {
5080
5085
  ...normalized,
5081
5086
  options: { ...normalized.options, streamResponse: false }
5082
5087
  },
5083
- { Prefer: "respond-async" }
5088
+ { Prefer: "respond-async", ...buildAgentAdmissionHeaders(admission) }
5084
5089
  );
5085
5090
  }
5086
5091
  /**
@@ -5093,8 +5098,10 @@ var DispatchEndpoint = class {
5093
5098
  */
5094
5099
  async executeStream(data, init) {
5095
5100
  const normalized = normalizeDispatchRequest(data);
5101
+ const headers = buildAgentAdmissionHeaders(init);
5096
5102
  const response = await this.client.requestStream("/dispatch", {
5097
5103
  method: "POST",
5104
+ ...Object.keys(headers).length > 0 ? { headers } : {},
5098
5105
  body: JSON.stringify({
5099
5106
  ...normalized,
5100
5107
  options: {
@@ -5196,6 +5203,11 @@ var ExecutionsEndpoint = class {
5196
5203
  `/executions/${encodeURIComponent(executionId)}/status`
5197
5204
  );
5198
5205
  }
5206
+ async getDelivery(executionId, deliveryId) {
5207
+ return this.client.get(
5208
+ `/executions/${encodeURIComponent(executionId)}/deliveries/${encodeURIComponent(deliveryId)}`
5209
+ );
5210
+ }
5199
5211
  };
5200
5212
  var ChatEndpoint = class {
5201
5213
  constructor(client) {
@@ -13553,7 +13565,7 @@ function transformQueryParams(params) {
13553
13565
 
13554
13566
  // src/version.ts
13555
13567
  var FALLBACK_VERSION = "0.0.0";
13556
- var SDK_VERSION = "9.11.0".length > 0 ? "9.11.0" : FALLBACK_VERSION;
13568
+ var SDK_VERSION = "9.12.0".length > 0 ? "9.12.0" : FALLBACK_VERSION;
13557
13569
  var RUNTYPE_CLIENT_KIND = "sdk";
13558
13570
  var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
13559
13571