Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type-safe module calling on ctx #2

Closed
NathanFlurry opened this issue Feb 14, 2024 — with Linear · 1 comment
Closed

Type-safe module calling on ctx #2

NathanFlurry opened this issue Feb 14, 2024 — with Linear · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

Copy link
Member

NathanFlurry commented Feb 14, 2024

Example: ctx.users.get({ … })

This should only make the listed dependencies available in the given context. If using a context that's not ModuleContext, then all modules are available. Should be easy to do using a Partial.

Any module names that conflict with the core types (e.g. db) will be renamed with an underscore. e.g. calling the db module looks like ctx._db.doSomething({})

This needs to have a type-safe req/res format. This will require generating types in the runtime_config.ts file.

@NathanFlurry NathanFlurry added the enhancement New feature or request label Feb 14, 2024 — with Linear
Copy link

linear bot commented Feb 14, 2024

OGSE-1 Call modules using Proxies

Would be fun to use lol with Proxys, probably not as intuitive
ctx.call("users", "get")
ctx.users.get()

@NathanFlurry NathanFlurry changed the title Call modules using Proxies Type-safe module calling on ctx Feb 19, 2024
@linear linear bot assigned Blckbrry-Pi and jog1t and unassigned jog1t and Blckbrry-Pi Feb 21, 2024
Blckbrry-Pi added a commit that referenced this issue Feb 24, 2024
Addresses #2.

Does not address `dependencies` restrictions in #31
Blckbrry-Pi added a commit that referenced this issue Feb 24, 2024
…call("name", "script", req)`) (#51)

Along with PR 50, Addresses #2.

Does not address `dependencies` restrictions in #31
@linear linear bot closed this as completed Feb 24, 2024
@linear linear bot reopened this Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants