Skip to content

Commit 4261416

Browse files
authored
feat: extend PluginContext model and regenerate client (#240)
* feat: extend PluginContext model and regenerate client * chore: rebuild client with fixes * chore: regenerate client
1 parent da23d8c commit 4261416

File tree

9 files changed

+1986
-1247
lines changed

9 files changed

+1986
-1247
lines changed

.github/workflows/codeql.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: "CodeQL Advanced"
1+
name: 'CodeQL Advanced'
22

33
on:
44
push:
5-
branches: ["main", "release-v*"]
5+
branches: ['main', 'release-v*']
66
pull_request:
7-
branches: ["main"]
7+
branches: ['main']
88
schedule:
9-
- cron: "40 12 * * 3"
9+
- cron: '40 12 * * 3'
1010

1111
permissions:
1212
contents: read
@@ -53,4 +53,4 @@ jobs:
5353
- name: Perform CodeQL Analysis
5454
uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
5555
with:
56-
category: "/language:${{matrix.language}}"
56+
category: '/language:${{matrix.language}}'

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020

2121
jobs:
2222
provenance:
23-
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@f7dd8c54c2067bafc12ca7a55595d5ee9b75204a # v2.1.0
23+
uses: slsa-framework/slsa-github-generator/.github/workflows/builder_nodejs_slsa3.yml@f7dd8c54c2067bafc12ca7a55595d5ee9b75204a # v2.1.0
2424
with:
2525
run-scripts: 'install-pnpm, install-deps, style, nx-build-skip-cache, nx-test-skip-cache, generate'
2626
node-version: '22.14.0'

custom-models/plugin-api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ export interface PluginContext {
198198
kv: PluginKVStore;
199199
headers: PluginHeaders;
200200
params: any;
201+
route: string;
202+
config?: Record<string, any>;
203+
method: string;
204+
query: Record<string, string[]>;
201205
}
202206

203207
export interface PluginAPI {

examples/plugins/callPlugin.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@ const config = new Configuration({
2323

2424
const pluginsApi = new PluginsApi(config);
2525

26-
const plugin_id = 'example';
26+
const plugin_id = 'plugin-example'; // replace with your actual plugin id
2727

28-
pluginsApi.callPlugin(plugin_id, {
29-
// these params will be passed to the plugin.
30-
params: {
31-
foo: 'bar',
32-
baz: 123,
33-
},
34-
});
28+
pluginsApi
29+
.callPlugin(plugin_id, {
30+
// these params will be passed to the plugin.
31+
params: {
32+
foo: 'bar',
33+
baz: 123,
34+
},
35+
})
36+
.then((response) => console.log(JSON.stringify(response.data, null, 2)))
37+
.catch(console.error);

examples/relayers/stellar/pnpm-lock.yaml

Lines changed: 214 additions & 134 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-lock.yaml

Lines changed: 1745 additions & 1097 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/models/plugin-api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ export interface PluginContext {
198198
kv: PluginKVStore;
199199
headers: PluginHeaders;
200200
params: any;
201+
route: string;
202+
config?: Record<string, any>;
203+
method: string;
204+
query: Record<string, string[]>;
201205
}
202206

203207
export interface PluginAPI {

tsconfig.build.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
},
66
"include": ["src/**/*"],
77
"exclude": ["node_modules", "dist", "examples", "custom-models"]
8-
}
8+
}

tsconfig.build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
},
66
"include": ["src/**/*"],
77
"exclude": ["node_modules", "dist", "examples", "custom-models"]
8-
}
8+
}

0 commit comments

Comments
 (0)