@hexaijs/contracts 0.1.0 → 0.1.2

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.
@@ -0,0 +1,6 @@
1
+ import { Message } from "@hexaijs/core";
2
+ export declare class Command<Payload = unknown, ResultType = unknown> extends Message<Payload> {
3
+ readonly ResultType: ResultType;
4
+ static getIntent(): string;
5
+ }
6
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,qBAAa,OAAO,CAAC,OAAO,GAAG,OAAO,EAAE,UAAU,GAAG,OAAO,CAAE,SAAQ,OAAO,CAAC,OAAO,CAAC;IAClF,SAAiB,UAAU,EAAE,UAAU,CAAC;IAExC,OAAgB,SAAS,IAAI,MAAM,CAElC;CACJ"}
@@ -0,0 +1,7 @@
1
+ import { Message } from "@hexaijs/core";
2
+ export class Command extends Message {
3
+ static getIntent() {
4
+ return "command";
5
+ }
6
+ }
7
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,OAAO,OAAiD,SAAQ,OAAgB;IAGlF,MAAM,CAAU,SAAS;QACrB,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ"}
@@ -1,4 +1,4 @@
1
- interface PublicEventOptions {
1
+ export interface PublicEventOptions {
2
2
  /**
3
3
  * Event version for versioned events
4
4
  * @example @PublicEvent({ version: 2 })
@@ -11,7 +11,7 @@ interface PublicEventOptions {
11
11
  */
12
12
  context?: string;
13
13
  }
14
- interface PublicCommandOptions {
14
+ export interface PublicCommandOptions {
15
15
  /**
16
16
  * Business context this command belongs to.
17
17
  * If not specified, inferred from package name.
@@ -25,7 +25,7 @@ interface PublicCommandOptions {
25
25
  */
26
26
  response?: string;
27
27
  }
28
- interface PublicQueryOptions {
28
+ export interface PublicQueryOptions {
29
29
  /**
30
30
  * Business context this query belongs to.
31
31
  * If not specified, inferred from package name.
@@ -39,8 +39,7 @@ interface PublicQueryOptions {
39
39
  */
40
40
  response?: string;
41
41
  }
42
- declare function PublicEvent(_options?: PublicEventOptions): ClassDecorator;
43
- declare function PublicCommand(_options?: PublicCommandOptions): ClassDecorator;
44
- declare function PublicQuery(_options?: PublicQueryOptions): ClassDecorator;
45
-
46
- export { PublicCommand, type PublicCommandOptions, PublicEvent, type PublicEventOptions, PublicQuery, type PublicQueryOptions };
42
+ export declare function PublicEvent(_options?: PublicEventOptions): ClassDecorator;
43
+ export declare function PublicCommand(_options?: PublicCommandOptions): ClassDecorator;
44
+ export declare function PublicQuery(_options?: PublicQueryOptions): ClassDecorator;
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,WAAW,CAAC,QAAQ,GAAE,kBAAuB,GAAG,cAAc,CAE7E;AAED,wBAAgB,aAAa,CAC3B,QAAQ,GAAE,oBAAyB,GAClC,cAAc,CAEhB;AAED,wBAAgB,WAAW,CAAC,QAAQ,GAAE,kBAAuB,GAAG,cAAc,CAE7E"}
@@ -1,14 +1,10 @@
1
- // src/decorators/index.ts
2
- function PublicEvent(_options = {}) {
3
- return (target) => target;
1
+ export function PublicEvent(_options = {}) {
2
+ return (target) => target;
4
3
  }
5
- function PublicCommand(_options = {}) {
6
- return (target) => target;
4
+ export function PublicCommand(_options = {}) {
5
+ return (target) => target;
7
6
  }
8
- function PublicQuery(_options = {}) {
9
- return (target) => target;
7
+ export function PublicQuery(_options = {}) {
8
+ return (target) => target;
10
9
  }
11
-
12
- export { PublicCommand, PublicEvent, PublicQuery };
13
- //# sourceMappingURL=index.js.map
14
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/decorators/index.ts"],"names":[],"mappings":";AA+CO,SAAS,WAAA,CAAY,QAAA,GAA+B,EAAC,EAAmB;AAC7E,EAAA,OAAO,CAAC,MAAA,KAAW,MAAA;AACrB;AAEO,SAAS,aAAA,CACd,QAAA,GAAiC,EAAC,EAClB;AAChB,EAAA,OAAO,CAAC,MAAA,KAAW,MAAA;AACrB;AAEO,SAAS,WAAA,CAAY,QAAA,GAA+B,EAAC,EAAmB;AAC7E,EAAA,OAAO,CAAC,MAAA,KAAW,MAAA;AACrB","file":"index.js","sourcesContent":["export interface PublicEventOptions {\n /**\n * Event version for versioned events\n * @example @PublicEvent({ version: 2 })\n */\n version?: number;\n\n /**\n * Business context this event belongs to.\n * If not specified, inferred from package name.\n * @example @PublicEvent({ context: 'lecture' })\n */\n context?: string;\n}\n\nexport interface PublicCommandOptions {\n /**\n * Business context this command belongs to.\n * If not specified, inferred from package name.\n * @example @PublicCommand({ context: 'auth' })\n */\n context?: string;\n\n /**\n * Explicit response type name for this command.\n * If specified, the parser will look for this type in the same file.\n * @example @PublicCommand({ response: 'CreateUserResult' })\n */\n response?: string;\n}\n\nexport interface PublicQueryOptions {\n /**\n * Business context this query belongs to.\n * If not specified, inferred from package name.\n * @example @PublicQuery({ context: 'catalog' })\n */\n context?: string;\n\n /**\n * Explicit response type name for this query.\n * If specified, the parser will look for this type in the same file.\n * @example @PublicQuery({ response: 'UserProfile' })\n */\n response?: string;\n}\n\nexport function PublicEvent(_options: PublicEventOptions = {}): ClassDecorator {\n return (target) => target;\n}\n\nexport function PublicCommand(\n _options: PublicCommandOptions = {}\n): ClassDecorator {\n return (target) => target;\n}\n\nexport function PublicQuery(_options: PublicQueryOptions = {}): ClassDecorator {\n return (target) => target;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":"AA+CA,MAAM,UAAU,WAAW,CAAC,QAAQ,GAAuB,EAAE;IAC3D,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,QAAQ,GAAyB,EAAE;IAEnC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAAQ,GAAuB,EAAE;IAC3D,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC;AAC5B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,14 +1,4 @@
1
- export { PublicCommand, PublicCommandOptions, PublicEvent, PublicEventOptions, PublicQuery, PublicQueryOptions } from './decorators/index.js';
2
- import { Message } from '@hexaijs/core';
3
-
4
- declare class Command<Payload = unknown, ResultType = unknown> extends Message<Payload> {
5
- readonly ResultType: ResultType;
6
- static getIntent(): string;
7
- }
8
-
9
- declare class Query<Payload = unknown, ResultType = unknown> extends Message<Payload> {
10
- readonly ResultType: ResultType;
11
- static getIntent(): string;
12
- }
13
-
14
- export { Command, Query };
1
+ export { PublicEvent, PublicCommand, PublicQuery, type PublicEventOptions, type PublicCommandOptions, type PublicQueryOptions, } from "./decorators/index.js";
2
+ export { Command } from "./command.js";
3
+ export { Query } from "./query.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,WAAW,EACX,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,26 +1,4 @@
1
- import { Message } from '@hexaijs/core';
2
-
3
- // src/decorators/index.ts
4
- function PublicEvent(_options = {}) {
5
- return (target) => target;
6
- }
7
- function PublicCommand(_options = {}) {
8
- return (target) => target;
9
- }
10
- function PublicQuery(_options = {}) {
11
- return (target) => target;
12
- }
13
- var Command = class extends Message {
14
- static getIntent() {
15
- return "command";
16
- }
17
- };
18
- var Query = class extends Message {
19
- static getIntent() {
20
- return "query";
21
- }
22
- };
23
-
24
- export { Command, PublicCommand, PublicEvent, PublicQuery, Query };
25
- //# sourceMappingURL=index.js.map
1
+ export { PublicEvent, PublicCommand, PublicQuery, } from "./decorators/index.js";
2
+ export { Command } from "./command.js";
3
+ export { Query } from "./query.js";
26
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/decorators/index.ts","../src/command.ts","../src/query.ts"],"names":["Message"],"mappings":";;;AA+CO,SAAS,WAAA,CAAY,QAAA,GAA+B,EAAC,EAAmB;AAC7E,EAAA,OAAO,CAAC,MAAA,KAAW,MAAA;AACrB;AAEO,SAAS,aAAA,CACd,QAAA,GAAiC,EAAC,EAClB;AAChB,EAAA,OAAO,CAAC,MAAA,KAAW,MAAA;AACrB;AAEO,SAAS,WAAA,CAAY,QAAA,GAA+B,EAAC,EAAmB;AAC7E,EAAA,OAAO,CAAC,MAAA,KAAW,MAAA;AACrB;ACzDO,IAAM,OAAA,GAAN,cAA+D,OAAA,CAAiB;AAAA,EAGnF,OAAgB,SAAA,GAAoB;AAChC,IAAA,OAAO,SAAA;AAAA,EACX;AACJ;ACNO,IAAM,KAAA,GAAN,cAA6DA,OAAAA,CAAiB;AAAA,EAGjF,OAAgB,SAAA,GAAoB;AAChC,IAAA,OAAO,OAAA;AAAA,EACX;AACJ","file":"index.js","sourcesContent":["export interface PublicEventOptions {\n /**\n * Event version for versioned events\n * @example @PublicEvent({ version: 2 })\n */\n version?: number;\n\n /**\n * Business context this event belongs to.\n * If not specified, inferred from package name.\n * @example @PublicEvent({ context: 'lecture' })\n */\n context?: string;\n}\n\nexport interface PublicCommandOptions {\n /**\n * Business context this command belongs to.\n * If not specified, inferred from package name.\n * @example @PublicCommand({ context: 'auth' })\n */\n context?: string;\n\n /**\n * Explicit response type name for this command.\n * If specified, the parser will look for this type in the same file.\n * @example @PublicCommand({ response: 'CreateUserResult' })\n */\n response?: string;\n}\n\nexport interface PublicQueryOptions {\n /**\n * Business context this query belongs to.\n * If not specified, inferred from package name.\n * @example @PublicQuery({ context: 'catalog' })\n */\n context?: string;\n\n /**\n * Explicit response type name for this query.\n * If specified, the parser will look for this type in the same file.\n * @example @PublicQuery({ response: 'UserProfile' })\n */\n response?: string;\n}\n\nexport function PublicEvent(_options: PublicEventOptions = {}): ClassDecorator {\n return (target) => target;\n}\n\nexport function PublicCommand(\n _options: PublicCommandOptions = {}\n): ClassDecorator {\n return (target) => target;\n}\n\nexport function PublicQuery(_options: PublicQueryOptions = {}): ClassDecorator {\n return (target) => target;\n}\n","import { Message } from \"@hexaijs/core\";\n\nexport class Command<Payload = unknown, ResultType = unknown> extends Message<Payload> {\n declare readonly ResultType: ResultType;\n\n static override getIntent(): string {\n return \"command\";\n }\n}\n","import { Message } from \"@hexaijs/core\";\n\nexport class Query<Payload = unknown, ResultType = unknown> extends Message<Payload> {\n declare readonly ResultType: ResultType;\n\n static override getIntent(): string {\n return \"query\";\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,WAAW,GAIZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { Message } from "@hexaijs/core";
2
+ export declare class Query<Payload = unknown, ResultType = unknown> extends Message<Payload> {
3
+ readonly ResultType: ResultType;
4
+ static getIntent(): string;
5
+ }
6
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,qBAAa,KAAK,CAAC,OAAO,GAAG,OAAO,EAAE,UAAU,GAAG,OAAO,CAAE,SAAQ,OAAO,CAAC,OAAO,CAAC;IAChF,SAAiB,UAAU,EAAE,UAAU,CAAC;IAExC,OAAgB,SAAS,IAAI,MAAM,CAElC;CACJ"}
package/dist/query.js ADDED
@@ -0,0 +1,7 @@
1
+ import { Message } from "@hexaijs/core";
2
+ export class Query extends Message {
3
+ static getIntent() {
4
+ return "query";
5
+ }
6
+ }
7
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,MAAM,OAAO,KAA+C,SAAQ,OAAgB;IAGhF,MAAM,CAAU,SAAS;QACrB,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,55 +1,56 @@
1
1
  {
2
- "name": "@hexaijs/contracts",
3
- "publishConfig": {
4
- "access": "public"
2
+ "name": "@hexaijs/contracts",
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "version": "0.1.2",
7
+ "type": "module",
8
+ "description": "Zero-dependency marker decorators for hexai contract definitions",
9
+ "license": "MIT",
10
+ "author": "Sangwoo Hyun <wkdny.hyun@gmail.com>",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/workingdanny911/hexai.git",
14
+ "directory": "packages/contracts"
15
+ },
16
+ "homepage": "https://github.com/workingdanny911/hexai#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/workingdanny911/hexai/issues"
19
+ },
20
+ "keywords": [
21
+ "hexai",
22
+ "hexagonal",
23
+ "clean-architecture",
24
+ "ddd",
25
+ "contracts",
26
+ "decorators",
27
+ "typescript"
28
+ ],
29
+ "files": [
30
+ "dist",
31
+ "LICENSE"
32
+ ],
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js"
5
37
  },
6
- "version": "0.1.0",
7
- "type": "module",
8
- "description": "Zero-dependency marker decorators for hexai contract definitions",
9
- "license": "MIT",
10
- "author": "Sangwoo Hyun <wkdny.hyun@gmail.com>",
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/workingdanny911/hexai.git",
14
- "directory": "packages/contracts"
38
+ "./decorators": {
39
+ "types": "./dist/decorators/index.d.ts",
40
+ "import": "./dist/decorators/index.js"
15
41
  },
16
- "homepage": "https://github.com/workingdanny911/hexai#readme",
17
- "bugs": {
18
- "url": "https://github.com/workingdanny911/hexai/issues"
19
- },
20
- "keywords": [
21
- "hexai",
22
- "hexagonal",
23
- "clean-architecture",
24
- "ddd",
25
- "contracts",
26
- "decorators",
27
- "typescript"
28
- ],
29
- "files": [
30
- "dist",
31
- "LICENSE"
32
- ],
33
- "exports": {
34
- ".": {
35
- "types": "./dist/index.d.ts",
36
- "import": "./dist/index.js"
37
- },
38
- "./decorators": {
39
- "types": "./dist/decorators/index.d.ts",
40
- "import": "./dist/decorators/index.js"
41
- },
42
- "./package.json": "./package.json"
43
- },
44
- "scripts": {
45
- "test": "vitest run",
46
- "build": "tsup"
47
- },
48
- "peerDependencies": {
49
- "@hexaijs/core": "^0.6.0"
50
- },
51
- "devDependencies": {
52
- "@hexaijs/core": "workspace:^",
53
- "@hexaijs/tooling": "workspace:*"
54
- }
55
- }
42
+ "./package.json": "./package.json"
43
+ },
44
+ "peerDependencies": {
45
+ "@hexaijs/core": "^0.9.0"
46
+ },
47
+ "devDependencies": {
48
+ "@typescript/native-preview": "^7.0.0-dev",
49
+ "@hexaijs/core": "^0.9.1",
50
+ "@hexaijs/tooling": "0.1.0"
51
+ },
52
+ "scripts": {
53
+ "test": "vitest run",
54
+ "build": "tsgo -p tsconfig.build.json"
55
+ }
56
+ }