@supacloud/app 0.2.0 → 0.4.0

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.
@@ -23,6 +23,8 @@ export interface InjectableMeta {
23
23
  }
24
24
  export interface ModuleOptions {
25
25
  name: string;
26
+ /** Tags for architectural boundary governance (e.g. ['scope:case', 'type:feature']). */
27
+ tags?: string[];
26
28
  imports?: Array<Type<unknown>>;
27
29
  providers?: Provider[];
28
30
  controllers?: Array<Type<unknown>>;
@@ -30,7 +32,8 @@ export interface ModuleOptions {
30
32
  queries?: Array<Type<unknown>>;
31
33
  exports?: Token[];
32
34
  }
33
- export interface ModuleMeta extends Required<Omit<ModuleOptions, "exports">> {
35
+ export interface ModuleMeta extends Required<Omit<ModuleOptions, "exports" | "tags">> {
36
+ tags?: string[];
34
37
  exports: Token[];
35
38
  }
36
39
  export interface CommandOptions {
@@ -55,7 +58,7 @@ export type QueryMeta = QueryOptions;
55
58
  export interface ControllerMeta {
56
59
  path: string;
57
60
  }
58
- export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
61
+ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";
59
62
  export interface RouteOptions {
60
63
  /** TypeBox schema (or compatible) for the request body. */
61
64
  body?: unknown;
@@ -96,4 +99,6 @@ export declare const Post: (path: string, options?: RouteOptions) => MethodDecor
96
99
  export declare const Put: (path: string, options?: RouteOptions) => MethodDecorator;
97
100
  export declare const Patch: (path: string, options?: RouteOptions) => MethodDecorator;
98
101
  export declare const Delete: (path: string, options?: RouteOptions) => MethodDecorator;
102
+ export declare const Head: (path: string, options?: RouteOptions) => MethodDecorator;
103
+ export declare const Options: (path: string, options?: RouteOptions) => MethodDecorator;
99
104
  export declare function getRoutes(target: object): RouteDefinition[];
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export { InjectionToken } from "./token";
4
4
  export type { InjectionTokenOptions } from "./token";
5
5
  export { isClassProvider, isExistingProvider, isFactoryProvider, isValueProvider, } from "./provider";
6
6
  export type { ClassProvider, ExistingProvider, FactoryProvider, Provider, Token, Type, ValueProvider, } from "./provider";
7
- export { Command, Controller, Delete, Get, Inject, Injectable, Module, Patch, Post, Put, Query, getCommandMeta, getControllerMeta, getInjectParams, getInjectableMeta, getModuleMeta, getQueryMeta, getRoutes, COMMAND_METADATA, CONTROLLER_METADATA, INJECTABLE_METADATA, INJECT_PARAMS_METADATA, MODULE_METADATA, QUERY_METADATA, ROUTES_METADATA, } from "./decorators";
7
+ export { Command, Controller, Delete, Get, Head, Inject, Injectable, Module, Options, Patch, Post, Put, Query, getCommandMeta, getControllerMeta, getInjectParams, getInjectableMeta, getModuleMeta, getQueryMeta, getRoutes, COMMAND_METADATA, CONTROLLER_METADATA, INJECTABLE_METADATA, INJECT_PARAMS_METADATA, MODULE_METADATA, QUERY_METADATA, ROUTES_METADATA, } from "./decorators";
8
8
  export type { CommandMeta, CommandOptions, ControllerMeta, HttpMethod, InjectableMeta, InjectableOptions, ModuleMeta, ModuleOptions, QueryMeta, QueryOptions, RouteDefinition, RouteOptions, } from "./decorators";
9
9
  export { defineModule } from "./module";
10
10
  export { DB_CLIENT, JOB_CONTEXT, REQUEST_CONTEXT } from "./context";
package/dist/index.js CHANGED
@@ -86,6 +86,7 @@ function Module(options) {
86
86
  return (target) => {
87
87
  const meta = {
88
88
  name: options.name,
89
+ tags: options.tags ?? [],
89
90
  imports: options.imports ?? [],
90
91
  providers: options.providers ?? [],
91
92
  controllers: options.controllers ?? [],
@@ -147,6 +148,8 @@ var Post = createRouteDecorator("POST");
147
148
  var Put = createRouteDecorator("PUT");
148
149
  var Patch = createRouteDecorator("PATCH");
149
150
  var Delete = createRouteDecorator("DELETE");
151
+ var Head = createRouteDecorator("HEAD");
152
+ var Options = createRouteDecorator("OPTIONS");
150
153
  function getRoutes(target) {
151
154
  return readOwnOrInherited(target, ROUTES_METADATA) ?? [];
152
155
  }
@@ -180,6 +183,7 @@ export {
180
183
  DEFAULT_SCOPE,
181
184
  Delete,
182
185
  Get,
186
+ Head,
183
187
  INJECTABLE_METADATA,
184
188
  INJECT_PARAMS_METADATA,
185
189
  Inject,
@@ -188,6 +192,7 @@ export {
188
192
  JOB_CONTEXT,
189
193
  MODULE_METADATA,
190
194
  Module,
195
+ Options,
191
196
  Patch,
192
197
  Post,
193
198
  Put,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/app",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Angular-style application metadata for SupaCloud: modules, DI tokens, providers, scopes, controllers and commands",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",