Skip to content

Commit

Permalink
Merge branch 'pnpm' into framework-t3-example
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwilliams committed Jul 27, 2023
2 parents 66d720e + cf0042f commit b6d7fcd
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 200 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ jobs:
path: examples/apps/${{ matrix.example }}

# Install dependencies in the example repo
# Don't use "npm ci", "--immutable" etc., as example repos won't be
# shipped with lock files.
- name: Install example dependencies
run: ni
working-directory: examples/apps/${{ matrix.example }}
Expand Down
198 changes: 0 additions & 198 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
10 changes: 10 additions & 0 deletions packages/inngest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# inngest

## 2.4.0

### Minor Changes

- 6cb6719: Allow filtering of events within triggers

### Patch Changes

- 55c889c: Expose raw error message if status is unknown

## 2.3.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/inngest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inngest",
"version": "2.3.0",
"version": "2.4.0",
"description": "Official SDK for Inngest.com",
"main": "./index.js",
"types": "./index.d.ts",
Expand Down
19 changes: 18 additions & 1 deletion packages/inngest/src/components/Inngest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,11 @@ export class Inngest<TOpts extends ClientOptions = ClientOptions> {
case 500:
errorMessage = "Internal server error";
break;
default:
errorMessage = await response.text();
break;
}

return new Error(`Inngest API Error: ${response.status} ${errorMessage}`);
}

Expand Down Expand Up @@ -483,10 +487,23 @@ export class Inngest<TOpts extends ClientOptions = ClientOptions> {
keyof EventsFromOpts<TOpts> & string
>;

let sanitizedTrigger: FunctionTrigger<keyof EventsFromOpts<TOpts> & string>;

if (typeof trigger === "string") {
sanitizedTrigger = { event: trigger };
} else if (trigger.event) {
sanitizedTrigger = {
event: trigger.event,
expression: trigger.if,
};
} else {
sanitizedTrigger = trigger;
}

return new InngestFunction(
this,
sanitizedOpts,
typeof trigger === "string" ? { event: trigger } : trigger,
sanitizedTrigger,
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any
handler as any
);
Expand Down
1 change: 1 addition & 0 deletions packages/inngest/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ export type TriggerOptions<T extends string> =
| StrictUnion<
| {
event: T;
if?: string;
}
| {
cron: string;
Expand Down

0 comments on commit b6d7fcd

Please sign in to comment.