-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec8b51b
commit 11bb706
Showing
10 changed files
with
73 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
|
||
import type { Action } from './action'; | ||
// import { Ambit } from './ambit'; | ||
import type { Input } from './input'; | ||
import type { Adapter } from './adapter'; | ||
import { Input } from './input'; | ||
import { Output } from './output'; | ||
|
||
export interface Context< | ||
Meta extends Record<string, unknown> = Record<string, unknown>, | ||
A extends Adapter = Adapter, | ||
AL extends Record<string, A> = Record<string, A>, | ||
I = Input<Action<string, unknown>>, | ||
> { | ||
meta: (input: I) => Promise<Meta>; | ||
adapter: AL; | ||
middleware: ((input: Input, next: (input: Input) => Output) => Output)[]; | ||
} | ||
|
||
/** | ||
* Constructs a full context object with placeholder values. | ||
*/ | ||
export function contextify< | ||
M extends Record<string, unknown>, | ||
A extends Adapter = Adapter, | ||
AL extends Record<string, A> = Record<string, A>, | ||
>({ | ||
meta = async () => ({} as M), | ||
adapter = {} as AL, | ||
}: Partial<Context<M, A, AL>>) { | ||
middleware = [], | ||
}: Partial<Context<A, AL>>) { | ||
return { | ||
meta, | ||
adapter, | ||
middleware | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/data/src/schema/join/permit.ts → ...s/data/src/schema/entity/entity_permit.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.