@trayai/helix-sdk 0.88.0 → 0.89.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/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,18 @@ general availability, minor versions may include breaking changes.
|
|
|
9
9
|
The SDK and [`@trayai/helix-cli`](https://www.npmjs.com/package/@trayai/helix-cli) are
|
|
10
10
|
released together and share a version — install matching versions.
|
|
11
11
|
|
|
12
|
+
## 0.89.0
|
|
13
|
+
|
|
14
|
+
### Removed
|
|
15
|
+
|
|
16
|
+
- **`ctx.trigger.isRetry` for scheduled functions** (SUR-677). The flag was reserved and
|
|
17
|
+
always `false`: no platform signal reliably distinguishes a retried *execution* from a
|
|
18
|
+
redelivered *message* (SQS's receive count measures deliveries, not runs, and can under-
|
|
19
|
+
as well as over-report), so rather than promise a boolean the platform cannot honestly
|
|
20
|
+
populate, the contract now states retry-once semantics and requires idempotent handlers.
|
|
21
|
+
The runtime still accepts (and ignores) `isRetry` on the shim invocation payload, so
|
|
22
|
+
bundles built with older shims keep working.
|
|
23
|
+
|
|
12
24
|
## 0.87.0
|
|
13
25
|
|
|
14
26
|
No user-visible changes in this release — co-versioned with `@trayai/helix-cli`'s changes.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
2
|
import { ZodType } from 'zod';
|
|
3
|
-
import { F as FunctionHandler, D as DefineFunctionOptions, a as DefineScheduleConfig, S as ScheduleDefinition, T as TrayContext } from './types-
|
|
4
|
-
export { b as DbCallParameters, c as DbClient, d as FileSystemClient, H as HttpClient, K as KeyValueStore, L as Logger, e as ScheduleContext, f as ScheduleHandler, g as ScheduleTrigger, h as SqlBuilder, U as UnvalidatedInput } from './types-
|
|
3
|
+
import { F as FunctionHandler, D as DefineFunctionOptions, a as DefineScheduleConfig, S as ScheduleDefinition, T as TrayContext } from './types-CoD3x7L-.js';
|
|
4
|
+
export { b as DbCallParameters, c as DbClient, d as FileSystemClient, H as HttpClient, K as KeyValueStore, L as Logger, e as ScheduleContext, f as ScheduleHandler, g as ScheduleTrigger, h as SqlBuilder, U as UnvalidatedInput } from './types-CoD3x7L-.js';
|
|
5
5
|
import { T as TrayConfig, L as LoadedTrayConfig, W as WatchErrorPhase } from './sdk-config-_xIe9XvP.js';
|
|
6
6
|
export { P as ProvisionedTrayConfig, S as SdkRuntimeConfig, U as UnprovisionedTrayConfig, a as WORKSPACE_ID_REQUIRED_CODE, b as WorkspaceIdRequiredError, g as getSdkConfig, l as loadConfig, c as loadedTrayConfigSchema, p as projectIdSchema, r as requireWorkspaceId, d as resolveConfigFile, w as workspaceIdSchema } from './sdk-config-_xIe9XvP.js';
|
|
7
7
|
export { a as ENVIRONMENT_VALUES, E as Environment, e as environmentSchema } from './env-schema-DkgTG5b0.js';
|
package/dist/internal/index.d.ts
CHANGED
package/dist/internal/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as
|
|
1
|
+
import{B as D,a as H,b as f,c as J,d as L,e as T,f as U,g as m,h,i as g,j as p,k as S,l as E,m as y,n as x,p as A,q as b,r as w,s as I,t as v,u as te,v as re,w as oe,x as C}from"../chunk-3SDUCOAT.js";import{a as G,b as V,c as _,d as q,e as B,f as z,g as Q,h as W,i as X,j as Y,k as Z,m as ee}from"../chunk-H4L4UWIK.js";import{randomUUID as ne}from"crypto";import{SpanStatusCode as F,SpanKind as se}from"@opentelemetry/api";var t=class extends Error{constructor(e){super(`runScheduledFunction: ${e}`),this.name="ScheduleInvocationError"}};async function ie(s,e){if(typeof e!="object"||e===null)throw new t("`invocation` must be an object");let{schedulePath:r}=e;if(typeof r!="string"||r.length===0)throw new t("`schedulePath` must be a non-empty string");if(typeof e.isManual!="boolean")throw new t("`isManual` must be a boolean");if(!D(s))throw new t(`default export of "${r}" is not a defineSchedule definition`);let k=P("scheduledAt",e.scheduledAt),N=P("firedAt",e.firedAt),d=f(),a=d.executionId??ne(),l=d.deploymentId??null,O=Date.now(),M=new Date().toISOString(),j=b(),R=A();S();let i={hasDb:!1,hasExternal:!1,hasAuth:!1,hasError:!1},c=!1,u=null;try{await h.run(i,()=>m.run(a,()=>y.startActiveSpan("schedule",{root:!0,kind:se.SERVER,attributes:{method:"SCHEDULE",route:r,executionId:a,...l?{deploymentId:l}:{}}},async o=>{let $={type:"schedule",scheduledAt:k,firedAt:N,isManual:e.isManual},K={http:w(),db:n=>I(n),kv:()=>v(),files:()=>C(),log:R,config:j,state:{},executionId:a,deploymentId:l,traceId:o.spanContext().traceId,trigger:$};p(o,"input",{scheduledAt:e.scheduledAt,firedAt:e.firedAt,isManual:e.isManual});try{await s.handler(K)}catch(n){throw c=!0,u=n instanceof Error?n.message:String(n),g("hasError"),n}finally{o.setAttribute("hasAuth",i.hasAuth),o.setAttribute("hasExternal",i.hasExternal),o.setAttribute("hasDb",i.hasDb),o.setAttribute("status",c?"error":"success");let n=c||i.hasError;o.setStatus({code:n?F.ERROR:F.OK,...u?{message:u}:{}}),o.end()}})))}finally{x({executionId:a,deploymentId:l,triggerType:"schedule",routeOrJob:r,startedAt:M,startMs:O,errored:c,errorMessage:u,userId:null,flags:i}),await E()}}function P(s,e){if(typeof e!="string"||e.length===0)throw new t(`\`${s}\` must be a timestamp string; got ${JSON.stringify(e)}`);let r=new Date(e);if(Number.isNaN(r.getTime()))throw new t(`\`${s}\` must be a Date-parseable timestamp; got ${JSON.stringify(e)}`);return r}export{J as CONFIG_BRIDGE_CHANNEL,t as ScheduleInvocationError,te as assertValidPath,U as clearActiveConfig,re as contentFilePath,T as getActiveConfig,Y as getAdditionalEnvironmentProfiles,_ as getEnvironmentProfile,V as isKnownEnvironment,ee as isSdkError,B as listEnvironmentNames,z as listExposedEnvNames,oe as metaFilePath,Q as parseExposedEnvironment,G as registerEnvironmentProfile,q as requireEnvironmentProfile,Z as resetEnvironmentRegistryForTests,X as resolveForcedEnvironment,ie as runScheduledFunction,L as setActiveConfig,W as setForcedEnvironment,H as setSdkConfig};
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -169,8 +169,6 @@ interface ScheduleTrigger {
|
|
|
169
169
|
scheduledAt: Date;
|
|
170
170
|
/** When it actually executed (may differ due to cold start, retry, etc.). */
|
|
171
171
|
firedAt: Date;
|
|
172
|
-
/** True if this is a retry of a failed execution. */
|
|
173
|
-
isRetry: boolean;
|
|
174
172
|
/** True if triggered via `helix trigger` or the MCP tool. */
|
|
175
173
|
isManual: boolean;
|
|
176
174
|
}
|