silgi 0.39.5 → 0.39.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.39.5";
4
+ const version = "0.39.7";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -121,7 +121,7 @@ declare function getEventContext<T extends SilgiRuntimeContext>(event?: SilgiEve
121
121
  *
122
122
  * @param params - Schema configuration parameters
123
123
  * @param params.path - Complete API path
124
- * @param params.method - HTTP method(s) as an array (required)
124
+ * @param params.method - HTTP method(s) as an array (optional)
125
125
  * @param params.setup - Schema definition for the specified methods
126
126
  * @returns Route schema object with complete type information
127
127
  *
@@ -140,8 +140,8 @@ declare function getEventContext<T extends SilgiRuntimeContext>(event?: SilgiEve
140
140
  declare function createSchema<Path extends keyof Routers, Method extends HTTPMethod & string, UsedMethod extends readonly Method[], Schema extends HasPathParams<Path> extends true ? BaseMethodSchema & WithPathParams<Path> : BaseMethodSchema>(params: {
141
141
  /** Complete API path */
142
142
  path: Path;
143
- /** HTTP method(s) this schema applies to (required) */
144
- method: UsedMethod;
143
+ /** HTTP method(s) this schema applies to (optional) */
144
+ method?: UsedMethod;
145
145
  /** Schema definition */
146
146
  setup: Schema;
147
147
  }): {
@@ -1030,6 +1030,9 @@ function getEventContext(event) {
1030
1030
  function createSchema(params) {
1031
1031
  const { path, method, setup } = params;
1032
1032
  const result = {};
1033
+ if (!method) {
1034
+ throw new Error("Method is required createSchema " + path);
1035
+ }
1033
1036
  for (let i = 0; i < method.length; i++) {
1034
1037
  const methodName = method[i];
1035
1038
  result[`${String(methodName)}:${path}`] = setup;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.39.5",
4
+ "version": "0.39.7",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {