@nmtjs/contract 0.4.8 → 0.5.1
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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/schemas/event.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/schemas/event.ts"],"sourcesContent":["import type { BaseType } from '@nmtjs/type'\nimport { type ContractSchemaOptions, createSchema } from '../utils.ts'\n\nexport const EventKind = 'NeemataEvent'\n\nexport interface TEventContract<\n Payload extends BaseType = BaseType,\n Name extends string | undefined = string | undefined,\n ServiceName extends string | undefined = string | undefined,\n SubscriptionName extends string | undefined = string | undefined,\n> {\n type: 'neemata:event'\n name: Name\n serviceName: ServiceName\n subscriptionName: SubscriptionName\n payload: Payload\n}\n\nexport const EventContract = <Payload extends BaseType>(\n payload: Payload,\n schemaOptions: ContractSchemaOptions = {} as ContractSchemaOptions,\n) => {\n return createSchema<TEventContract<Payload>>({\n ...schemaOptions,\n type: 'neemata:event',\n payload,\n name: undefined,\n serviceName: undefined,\n subscriptionName: undefined,\n })\n}\n"],"names":["createSchema","EventKind","EventContract","payload","schemaOptions","type","name","undefined","serviceName","subscriptionName"],"mappings":"AACA,SAAqCA,YAAY,QAAQ,cAAa;AAEtE,OAAO,MAAMC,YAAY,eAAc;AAevC,OAAO,MAAMC,gBAAgB,CAC3BC,SACAC,gBAAuC,CAAC,CAA0B;IAElE,OAAOJ,aAAsC;QAC3C,GAAGI,aAAa;QAChBC,MAAM;QACNF;QACAG,MAAMC;QACNC,aAAaD;QACbE,kBAAkBF;IACpB;AACF,EAAC"}
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@nmtjs/
|
|
13
|
-
"@nmtjs/
|
|
12
|
+
"@nmtjs/type": "0.5.1",
|
|
13
|
+
"@nmtjs/common": "0.5.1"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"src",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"LICENSE.md",
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
|
-
"version": "0.
|
|
22
|
+
"version": "0.5.1",
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "neemata-build -p neutral --root=./src './**/*.ts'",
|
|
25
25
|
"type-check": "tsc --noEmit"
|
package/src/schemas/event.ts
CHANGED