Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,15 @@ const [invoke] = useInvokeMarketplaceFunctionMutation();
await invoke({ functionViewId: 'func_4hT2b9QkLm3XcT1yRfGh7a', payload: { text: 'Order shipped' } });
```

`useGetMarketplaceFunctionRunsQuery` takes exactly one of `functionId` (a function's own runs from every source — invoke, trigger, scheduler — newest first, up to 50), `triggerId` or `taskId`. A row carries `status` (`ok` / `failed` / `skipped`), `durationMs`, `source`, `correlationId` and `hasDetails`; when `hasDetails` is true, the run's input, steps and response are in the project log — read them with `norbix.hub.code.getMarketplaceFunctionRunDetails(row.correlationId)` from `@norbix.ai/ts` 4.22.0.

```tsx
const { data } = useGetMarketplaceFunctionRunsQuery({
functionId: 'func_4hT2b9QkLm3XcT1yRfGh7a',
limit: 20,
});
```

## Working with terms

A **taxonomy** is a named tree of **terms** (labels). A term can have one parent (a clean hierarchy) or several parents (the same item under many categories). There is one read hook per scenario — pick the one that matches what you want:
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@commitlint/cli": "^21.2.2",
"@commitlint/config-conventional": "^21.2.2",
"@eslint/js": "^10.0.1",
"@norbix.ai/ts": "^4.21.0",
"@norbix.ai/ts": "^4.22.0",
"@reduxjs/toolkit": "^2.12.0",
"@semantic-release/commit-analyzer": "^13.0.1",
"@semantic-release/github": "^12.0.9",
Expand Down
22 changes: 22 additions & 0 deletions tests/marketplace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,26 @@ describe('marketplace hooks through the real SDK (fake fetch)', () => {
expect(body).toEqual(wire);
}
});

// Exactly one of functionId / triggerId / taskId (gateway item gw-runs, @norbix.ai/ts 4.22.0):
// a function's own runs from every source. The typed arg below only compiles on 4.22.0+.
it('getMarketplaceFunctionRuns takes functionId and sends it on the query, no body', async () => {
const args: NonNullable<Parameters<Norbix['hub']['code']['getMarketplaceFunctionRuns']>[0]> = {
functionId: 'func_1p4R3gTobGZpD6fXvHT4rd',
limit: 50,
};
const { seen, result } = run('getMarketplaceFunctionRuns', args);
expect(((await result) as { error?: unknown }).error).toBeUndefined();
expect(seen).toHaveLength(1);
expect(seen[0]!.method).toBe('GET');
const url = new URL(seen[0]!.url);
expect(`${url.origin}${url.pathname}`).toBe(`${HUB}/code/marketplace/functions/runs`);
expect(
Object.fromEntries([...url.searchParams.entries()].filter(([k]) => k !== 'env')),
).toEqual({
functionId: 'func_1p4R3gTobGZpD6fXvHT4rd',
limit: '50',
});
expect(seen[0]!.body).toBeUndefined();
});
});