@edifice.io/config-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 +34 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/nats/client.d.ts +13 -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,34 @@
|
|
|
1
|
+
var c = Object.defineProperty;
|
|
2
|
+
var l = (r, e, t) => e in r ? c(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var a = (r, e, t) => (l(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { Injectable as d, Logger as v } from "@nestjs/common";
|
|
5
|
+
import { firstValueFrom as f } from "rxjs";
|
|
6
|
+
var u = Object.getOwnPropertyDescriptor, m = (r, e, t, n) => {
|
|
7
|
+
for (var s = n > 1 ? void 0 : n ? u(e, t) : e, o = r.length - 1, g; o >= 0; o--)
|
|
8
|
+
(g = r[o]) && (s = g(s) || s);
|
|
9
|
+
return s;
|
|
10
|
+
};
|
|
11
|
+
let i = class {
|
|
12
|
+
constructor(r) {
|
|
13
|
+
a(this, "logger", new v(i.name));
|
|
14
|
+
this.natsClient = r, this.logger.log("Creating events service ConfigNatsServiceClient");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the redirect configuration from the shared server map.
|
|
18
|
+
* This includes loginUri, callbackParam, and per-host authLocations.
|
|
19
|
+
*/
|
|
20
|
+
async getRedirectConfig(r) {
|
|
21
|
+
const e = "config.redirect";
|
|
22
|
+
this.logger.debug({ messageAddress: e }, "Sending request to NATS subject");
|
|
23
|
+
const t = Date.now(), n = await f(this.natsClient.send(e, r)), s = Date.now() - t;
|
|
24
|
+
if (this.logger.debug({ brokerAddress: e, duration: s }, "[nats][mttr]"), !n)
|
|
25
|
+
throw this.logger.warn({ messageAddress: e }, "No reply received for subject"), new Error("No reply received");
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
i = m([
|
|
30
|
+
d()
|
|
31
|
+
], i);
|
|
32
|
+
export {
|
|
33
|
+
i as ConfigNatsServiceClient
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@nestjs/common"),require("rxjs")):typeof define=="function"&&define.amd?define(["exports","@nestjs/common","rxjs"],t):(e=typeof globalThis<"u"?globalThis:e||self,t((e["@edifice"]=e["@edifice"]||{},e["@edifice"]["io/config-nest-client"]={}),e.NestjsCommon,e.rxjs))})(this,function(e,t,n){"use strict";var l=Object.defineProperty;var C=(e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var g=(e,t,n)=>(C(e,typeof t!="symbol"?t+"":t,n),n);var a=Object.getOwnPropertyDescriptor,u=(d,s,r,c)=>{for(var i=c>1?void 0:c?a(s,r):s,o=d.length-1,f;o>=0;o--)(f=d[o])&&(i=f(i)||i);return i};e.ConfigNatsServiceClient=class{constructor(s){g(this,"logger",new t.Logger(e.ConfigNatsServiceClient.name));this.natsClient=s,this.logger.log("Creating events service ConfigNatsServiceClient")}async getRedirectConfig(s){const r="config.redirect";this.logger.debug({messageAddress:r},"Sending request to NATS subject");const c=Date.now(),i=await n.firstValueFrom(this.natsClient.send(r,s)),o=Date.now()-c;if(this.logger.debug({brokerAddress:r,duration:o},"[nats][mttr]"),!i)throw this.logger.warn({messageAddress:r},"No reply received for subject"),new Error("No reply received");return i}},e.ConfigNatsServiceClient=u([t.Injectable()],e.ConfigNatsServiceClient),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClientProxy } from '@nestjs/microservices';
|
|
2
|
+
import { GetRedirectConfigRequest, RedirectConfigResponse } from '@edifice.io/config-nest-api';
|
|
3
|
+
export declare class ConfigNatsServiceClient {
|
|
4
|
+
private readonly natsClient;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
constructor(natsClient: ClientProxy);
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves the redirect configuration from the shared server map.
|
|
9
|
+
* This includes loginUri, callbackParam, and per-host authLocations.
|
|
10
|
+
*/
|
|
11
|
+
getRedirectConfig(request: GetRedirectConfigRequest): Promise<RedirectConfigResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# 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,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAE5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAG1E,qBACa,uBAAuB;IAItB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAFvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;gBAEtC,UAAU,EAAE,WAAW;IAMpD;;;OAGG;IACG,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAgB5F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/config-nest-client",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Clients to interact with config-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/config-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