Skip to content

Commit

Permalink
Add absoluteId() to get the absolute ID of an InngestFunction (#804)
Browse files Browse the repository at this point in the history
## Summary
<!-- Succinctly describe your change, providing context, what you've
changed, and why. -->

Add `InngestFunction#absoluteId()` to fetch the full ID using the
client.

## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by
wrapping it in "~~"" and suffix it with "N/A My reason for skipping
this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [ ] ~Added a [docs PR](https://github.com/inngest/website) that
references this PR~ N/A Used internally
- [ ] ~Added unit/integration tests~ N/A
- [x] Added changesets if applicable
  • Loading branch information
jpwilliams authored Jan 16, 2025
1 parent 9f4244f commit 7459239
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-rings-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": minor
---

Add `InngestFunction#absoluteId()` to get the absolute ID of an `InngestFunction`
8 changes: 8 additions & 0 deletions packages/inngest/src/components/InngestFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ export class InngestFunction<
return [prefix, this.opts.id].filter(Boolean).join("-");
}

/**
* The generated or given ID for this function, prefixed with the app ID. This
* is used for routing invokes and identifying the function across apps.
*/
protected get absoluteId(): string {
return this.id(this.client.id);
}

/**
* The name of this function as it will appear in the Inngest Cloud UI.
*/
Expand Down

0 comments on commit 7459239

Please sign in to comment.