@edifice.io/application-nest-client 0.0.0-stage → 0.1.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.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/nats/client.d.ts +18 -0
- package/dist/nats/client.d.ts.map +1 -0
- package/package.json +55 -3
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var p = (t, e, n) => e in t ? c(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var l = (t, e, n) => (p(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { Injectable as v, Logger as g } from "@nestjs/common";
|
|
5
|
+
var C = Object.getOwnPropertyDescriptor, d = (t, e, n, a) => {
|
|
6
|
+
for (var s = a > 1 ? void 0 : a ? C(e, n) : e, i = t.length - 1, o; i >= 0; i--)
|
|
7
|
+
(o = t[i]) && (s = o(s) || s);
|
|
8
|
+
return s;
|
|
9
|
+
};
|
|
10
|
+
let r = class {
|
|
11
|
+
constructor(t) {
|
|
12
|
+
l(this, "logger", new g(r.name));
|
|
13
|
+
this.natsClient = t, this.logger.log("Creating events service ApplicationNatsServiceClient");
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Publishes a notification that the application has started.
|
|
17
|
+
* The 'application' parameter of the subject is provided when the publisher is created.
|
|
18
|
+
*/
|
|
19
|
+
async notifyStarted(t, e) {
|
|
20
|
+
const n = "application." + e + ".start";
|
|
21
|
+
this.natsClient.emit(n, t);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Publishes a notification that the application has stopped.
|
|
25
|
+
* The 'application' parameter of the subject is provided when the publisher is created.
|
|
26
|
+
*/
|
|
27
|
+
async notifyStopped(t, e) {
|
|
28
|
+
const n = "application." + e + ".stop";
|
|
29
|
+
this.natsClient.emit(n, t);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
r = d([
|
|
33
|
+
v()
|
|
34
|
+
], r);
|
|
35
|
+
export {
|
|
36
|
+
r as ApplicationNatsServiceClient
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@nestjs/common")):typeof define=="function"&&define.amd?define(["exports","@nestjs/common"],t):(e=typeof globalThis<"u"?globalThis:e||self,t((e["@edifice"]=e["@edifice"]||{},e["@edifice"]["io/application-nest-client"]={}),e.NestjsCommon))})(this,function(e,t){"use strict";var f=Object.defineProperty;var v=(e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var l=(e,t,n)=>(v(e,typeof t!="symbol"?t+"":t,n),n);var n=Object.getOwnPropertyDescriptor,d=(a,i,c,s)=>{for(var o=s>1?void 0:s?n(i,c):i,r=a.length-1,p;r>=0;r--)(p=a[r])&&(o=p(o)||o);return o};e.ApplicationNatsServiceClient=class{constructor(i){l(this,"logger",new t.Logger(e.ApplicationNatsServiceClient.name));this.natsClient=i,this.logger.log("Creating events service ApplicationNatsServiceClient")}async notifyStarted(i,c){const s="application."+c+".start";this.natsClient.emit(s,i)}async notifyStopped(i,c){const s="application."+c+".stop";this.natsClient.emit(s,i)}},e.ApplicationNatsServiceClient=d([t.Injectable()],e.ApplicationNatsServiceClient),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClientProxy } from '@nestjs/microservices';
|
|
2
|
+
import { ApplicationStatus } from '@edifice.io/application-nest-api';
|
|
3
|
+
export declare class ApplicationNatsServiceClient {
|
|
4
|
+
private readonly natsClient;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(natsClient: ClientProxy);
|
|
7
|
+
/**
|
|
8
|
+
* Publishes a notification that the application has started.
|
|
9
|
+
* The 'application' parameter of the subject is provided when the publisher is created.
|
|
10
|
+
*/
|
|
11
|
+
notifyStarted(request: ApplicationStatus, application: string): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Publishes a notification that the application has stopped.
|
|
14
|
+
* The 'application' parameter of the subject is provided when the publisher is created.
|
|
15
|
+
*/
|
|
16
|
+
notifyStopped(request: ApplicationStatus, application: string): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/nats/client.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAG1E,qBACa,4BAA4B;IAI3B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAFvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiD;gBAE3C,UAAU,EAAE,WAAW;IAMpD;;;OAGG;IACG,aAAa,CAAC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM;IAOnE;;;OAGG;IACG,aAAa,CAAC,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM;CAOpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/application-nest-client",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Clients to interact with application-nats-service",
|
|
5
|
+
"private": false,
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "Edifice",
|
|
11
|
+
"license": "AGPL-3.0",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": "22"
|
|
14
|
+
},
|
|
15
|
+
"engineStrict": true,
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"require": "./dist/index.umd.cjs",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"main": "dist/index.umd.cjs",
|
|
25
|
+
"module": "dist/index.js",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@edifice.io/application-nest-api": "0.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"husky": "9.0.11",
|
|
35
|
+
"prettier": "3.2.5",
|
|
36
|
+
"semantic-release": "23.0.2",
|
|
37
|
+
"typescript": "5.2.2",
|
|
38
|
+
"vite": "5.1.4",
|
|
39
|
+
"vite-plugin-dts": "4.3.0",
|
|
40
|
+
"rxjs": "7.8.1",
|
|
41
|
+
"@nestjs/common": "11.0.20",
|
|
42
|
+
"@nestjs/microservices": "11.0.20"
|
|
43
|
+
},
|
|
44
|
+
"lint-staged": {
|
|
45
|
+
"*.{js,ts,jsx,tsx,json,css,md}": "pnpm format"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"dev": "vite",
|
|
49
|
+
"build": "tsc && vite build",
|
|
50
|
+
"build:types": "tsc --build",
|
|
51
|
+
"preview": "vite preview",
|
|
52
|
+
"clean": "rm -Rf dist",
|
|
53
|
+
"format": "pnpm run format:write && pnpm run format:check",
|
|
54
|
+
"format:check": "npx prettier --check \"src/**/*.ts\"",
|
|
55
|
+
"format:write": "npx prettier --write \"src/**/*.ts\"",
|
|
56
|
+
"pre-commit": "pnpm run format"
|
|
57
|
+
}
|
|
6
58
|
}
|
package/README.md
DELETED