MCPcopy Index your code
hub / github.com/simstudioai/sim / getChangeIndicator

Function getChangeIndicator

apps/sim/connectors/jsm/jsm.ts:172–180  ·  view source on GitHub ↗

* Resolves the best available "change indicator" timestamp for a request. * * The JSM list endpoint does NOT return an updated/last-modified field — only * `createdDate` and `currentStatus.statusDate` are present. We use * `statusDate` (the time the request last changed status) when available, a

(request: JsmRequest)

Source from the content-addressed store, hash-verified

170 * not reflected here, so such changes may not trigger a re-sync.
171 */
172function getChangeIndicator(request: JsmRequest): string {
173 const statusDate = request.currentStatus?.statusDate
174 if (statusDate?.epochMillis != null) return String(statusDate.epochMillis)
175 if (statusDate?.iso8601) return statusDate.iso8601
176 const created = request.createdDate
177 if (created?.epochMillis != null) return String(created.epochMillis)
178 if (created?.iso8601) return created.iso8601
179 return ''
180}
181
182/**
183 * Builds a stub ExternalDocument from a request returned by the list endpoint.

Callers 1

requestToStubFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected