@hexaijs/contracts 0.1.1 → 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.
- package/dist/command.d.ts +6 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +7 -0
- package/dist/command.js.map +1 -0
- package/dist/decorators/index.d.ts +7 -8
- package/dist/decorators/index.d.ts.map +1 -0
- package/dist/decorators/index.js +6 -10
- package/dist/decorators/index.js.map +1 -1
- package/dist/index.d.ts +4 -14
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -25
- package/dist/index.js.map +1 -1
- package/dist/query.d.ts +6 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +7 -0
- package/dist/query.js.map +1 -0
- package/package.json +5 -4
- package/LICENSE +0 -21
|
@@ -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"}
|
package/dist/command.js
ADDED
|
@@ -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"}
|
package/dist/decorators/index.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (target) => target;
|
|
1
|
+
export function PublicEvent(_options = {}) {
|
|
2
|
+
return (target) => target;
|
|
4
3
|
}
|
|
5
|
-
function PublicCommand(_options = {}) {
|
|
6
|
-
|
|
4
|
+
export function PublicCommand(_options = {}) {
|
|
5
|
+
return (target) => target;
|
|
7
6
|
}
|
|
8
|
-
function PublicQuery(_options = {}) {
|
|
9
|
-
|
|
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":"
|
|
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 {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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,"
|
|
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"}
|
package/dist/query.d.ts
ADDED
|
@@ -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 @@
|
|
|
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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.2",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"description": "Zero-dependency marker decorators for hexai contract definitions",
|
|
9
9
|
"license": "MIT",
|
|
@@ -42,14 +42,15 @@
|
|
|
42
42
|
"./package.json": "./package.json"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@hexaijs/core": "^0.
|
|
45
|
+
"@hexaijs/core": "^0.9.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@
|
|
48
|
+
"@typescript/native-preview": "^7.0.0-dev",
|
|
49
|
+
"@hexaijs/core": "^0.9.1",
|
|
49
50
|
"@hexaijs/tooling": "0.1.0"
|
|
50
51
|
},
|
|
51
52
|
"scripts": {
|
|
52
53
|
"test": "vitest run",
|
|
53
|
-
"build": "
|
|
54
|
+
"build": "tsgo -p tsconfig.build.json"
|
|
54
55
|
}
|
|
55
56
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 Sangwoo Hyun
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|