@pristine-ts/http 1.0.427 → 1.0.429
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/lib/cjs/interceptors/http-error-response-logging.interceptor.js +6 -4
- package/dist/lib/cjs/interceptors/http-error-response-logging.interceptor.js.map +1 -1
- package/dist/lib/cjs/interceptors/http-request-logging.interceptor.js +3 -3
- package/dist/lib/cjs/interceptors/http-request-logging.interceptor.js.map +1 -1
- package/dist/lib/cjs/interceptors/http-response-logging.interceptor.js +6 -4
- package/dist/lib/cjs/interceptors/http-response-logging.interceptor.js.map +1 -1
- package/dist/lib/esm/interceptors/http-error-response-logging.interceptor.js +6 -4
- package/dist/lib/esm/interceptors/http-error-response-logging.interceptor.js.map +1 -1
- package/dist/lib/esm/interceptors/http-request-logging.interceptor.js +3 -3
- package/dist/lib/esm/interceptors/http-request-logging.interceptor.js.map +1 -1
- package/dist/lib/esm/interceptors/http-response-logging.interceptor.js +6 -4
- package/dist/lib/esm/interceptors/http-response-logging.interceptor.js.map +1 -1
- package/package.json +5 -5
|
@@ -44,11 +44,13 @@ let HttpErrorResponseLoggingInterceptor = class HttpErrorResponseLoggingIntercep
|
|
|
44
44
|
interceptErrorResponse(request, options, response) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
if (this.loggingEnabled) {
|
|
47
|
-
|
|
47
|
+
// Eventually, add the execution time like this: `[OUTBOUND] GET https://api.stripe.com/v1/charges 200 112ms`
|
|
48
|
+
this.logHandler.info(`[OUTBOUND] ${request.httpMethod} ${request.url} ${response.status}`, {
|
|
48
49
|
highlights: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
requestBody: request.body,
|
|
51
|
+
requestHeaders: request.headers,
|
|
52
|
+
responseBody: response.body,
|
|
53
|
+
responseHeaders: response.headers
|
|
52
54
|
}, eventId: options.eventId, extra: { response, options }
|
|
53
55
|
});
|
|
54
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-error-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-error-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAgF;AAKhF,gEAAyD;AAGzD;;;;GAIG;AAII,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC9C,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;;OAKG;IACG,sBAAsB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACtH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"http-error-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-error-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAgF;AAKhF,gEAAyD;AAGzD;;;;GAIG;AAII,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC9C,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;;OAKG;IACG,sBAAsB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACtH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,6GAA6G;gBAC7G,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE;oBACzF,UAAU,EAAE;wBACV,WAAW,EAAE,OAAO,CAAC,IAAI;wBACzB,cAAc,EAAE,OAAO,CAAC,OAAO;wBAC/B,YAAY,EAAE,QAAQ,CAAC,IAAI;wBAC3B,eAAe,EAAE,QAAQ,CAAC,OAAO;qBAClC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC;iBACxD,CAAC,CAAC;YACL,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CAEF,CAAA;AA7BY,kFAAmC;8CAAnC,mCAAmC;IAH/C,IAAA,YAAG,EAAC,iCAAwB,CAAC,4BAA4B,CAAC;IAC1D,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;IAGR,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,iCAAiC,CAAC,CAAA;;GAHjC,mCAAmC,CA6B/C"}
|
|
@@ -43,11 +43,11 @@ let HttpRequestLoggingInterceptor = class HttpRequestLoggingInterceptor {
|
|
|
43
43
|
interceptRequest(request, options) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
if (this.loggingEnabled) {
|
|
46
|
-
this
|
|
46
|
+
// Eventually, add the execution time like this: `[OUTBOUND] GET https://api.stripe.com/v1/charges 200 112ms`
|
|
47
|
+
this.logHandler.debug(`[OUTBOUND-IN-PROGRESS] ${request.httpMethod} ${request.url}`, {
|
|
47
48
|
highlights: {
|
|
48
|
-
url: `[${request.httpMethod}] ${request.httpMethod}`,
|
|
49
49
|
body: request.body,
|
|
50
|
-
headers: request.headers
|
|
50
|
+
headers: request.headers,
|
|
51
51
|
}, eventId: options.eventId, extra: { request, options }
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,gDAAgF;AAIhF,gEAAyD;AAEzD;;;;GAIG;AAII,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACxC,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC/E,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAE5C,gDAAgF;AAIhF,gEAAyD;AAEzD;;;;GAIG;AAII,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACxC,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC/E,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,6GAA6G;gBAC7G,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,0BAA0B,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE;oBACnF,UAAU,EAAE;wBACV,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,OAAO,EAAE,OAAO,CAAC,OAAO;qBACzB,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC;iBACvD,CAAC,CAAC;YACL,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;CACF,CAAA;AAzBY,sEAA6B;wCAA7B,6BAA6B;IAHzC,IAAA,YAAG,EAAC,iCAAwB,CAAC,sBAAsB,CAAC;IACpD,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;IAGR,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,iCAAiC,CAAC,CAAA;;GAHjC,6BAA6B,CAyBzC"}
|
|
@@ -44,11 +44,13 @@ let HttpResponseLoggingInterceptor = class HttpResponseLoggingInterceptor {
|
|
|
44
44
|
interceptResponse(request, options, response) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
if (this.loggingEnabled) {
|
|
47
|
-
this
|
|
47
|
+
// Eventually, add the execution time like this: `[OUTBOUND] GET https://api.stripe.com/v1/charges 200 112ms`
|
|
48
|
+
this.logHandler.info(`[OUTBOUND] ${request.httpMethod} ${request.url} ${response.status}`, {
|
|
48
49
|
highlights: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
requestBody: request.body,
|
|
51
|
+
requestHeaders: request.headers,
|
|
52
|
+
responseBody: response.body,
|
|
53
|
+
responseHeaders: response.headers
|
|
52
54
|
}, eventId: options.eventId, extra: { response, options }
|
|
53
55
|
});
|
|
54
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAgF;AAMhF,gEAAyD;AAEzD;;;;GAIG;AAII,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;;OAKG;IACG,iBAAiB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACjH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA4C;AAC5C,gDAAgF;AAMhF,gEAAyD;AAEzD;;;;GAIG;AAII,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;;OAKG;IACG,iBAAiB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACjH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,6GAA6G;gBAC7G,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE;oBACzF,UAAU,EAAE;wBACV,WAAW,EAAE,OAAO,CAAC,IAAI;wBACzB,cAAc,EAAE,OAAO,CAAC,OAAO;wBAC/B,YAAY,EAAE,QAAQ,CAAC,IAAI;wBAC3B,eAAe,EAAE,QAAQ,CAAC,OAAO;qBAClC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC;iBACxD,CAAC,CAAC;YACL,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CAEF,CAAA;AA7BY,wEAA8B;yCAA9B,8BAA8B;IAH1C,IAAA,YAAG,EAAC,iCAAwB,CAAC,uBAAuB,CAAC;IACrD,IAAA,qBAAY,EAAC,uCAAiB,CAAC;IAC/B,IAAA,qBAAU,GAAE;IAGR,WAAA,IAAA,iBAAM,EAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,iCAAiC,CAAC,CAAA;;GAHjC,8BAA8B,CA6B1C"}
|
|
@@ -41,11 +41,13 @@ let HttpErrorResponseLoggingInterceptor = class HttpErrorResponseLoggingIntercep
|
|
|
41
41
|
interceptErrorResponse(request, options, response) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
if (this.loggingEnabled) {
|
|
44
|
-
|
|
44
|
+
// Eventually, add the execution time like this: `[OUTBOUND] GET https://api.stripe.com/v1/charges 200 112ms`
|
|
45
|
+
this.logHandler.info(`[OUTBOUND] ${request.httpMethod} ${request.url} ${response.status}`, {
|
|
45
46
|
highlights: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
requestBody: request.body,
|
|
48
|
+
requestHeaders: request.headers,
|
|
49
|
+
responseBody: response.body,
|
|
50
|
+
responseHeaders: response.headers
|
|
49
51
|
}, eventId: options.eventId, extra: { response, options }
|
|
50
52
|
});
|
|
51
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-error-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-error-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAKhF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAGzD;;;;GAIG;AAII,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAC9C,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;;OAKG;IACG,sBAAsB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACtH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"http-error-response-logging.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AA,MAAM,CAAC,iCAAiC,CAAC,CAAA;;GAHjC,mCAAmC,CA6B/C"}
|
|
@@ -40,11 +40,11 @@ let HttpRequestLoggingInterceptor = class HttpRequestLoggingInterceptor {
|
|
|
40
40
|
interceptRequest(request, options) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
if (this.loggingEnabled) {
|
|
43
|
-
this
|
|
43
|
+
// Eventually, add the execution time like this: `[OUTBOUND] GET https://api.stripe.com/v1/charges 200 112ms`
|
|
44
|
+
this.logHandler.debug(`[OUTBOUND-IN-PROGRESS] ${request.httpMethod} ${request.url}`, {
|
|
44
45
|
highlights: {
|
|
45
|
-
url: `[${request.httpMethod}] ${request.httpMethod}`,
|
|
46
46
|
body: request.body,
|
|
47
|
-
headers: request.headers
|
|
47
|
+
headers: request.headers,
|
|
48
48
|
}, eventId: options.eventId, extra: { request, options }
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAIhF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AAII,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACxC,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC/E,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"http-request-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-request-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAIhF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AAII,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IACxC,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;OAIG;IACG,gBAAgB,CAAC,OAA6B,EAAE,OAA2B;;YAC/E,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,6GAA6G;gBAC7G,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,0BAA0B,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE;oBACnF,UAAU,EAAE;wBACV,IAAI,EAAE,OAAO,CAAC,IAAI;wBAClB,OAAO,EAAE,OAAO,CAAC,OAAO;qBACzB,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,OAAO,EAAC;iBACvD,CAAC,CAAC;YACL,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;CACF,CAAA;AAzBY,6BAA6B;IAHzC,GAAG,CAAC,wBAAwB,CAAC,sBAAsB,CAAC;IACpD,YAAY,CAAC,iBAAiB,CAAC;IAC/B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,iCAAiC,CAAC,CAAA;;GAHjC,6BAA6B,CAyBzC"}
|
|
@@ -41,11 +41,13 @@ let HttpResponseLoggingInterceptor = class HttpResponseLoggingInterceptor {
|
|
|
41
41
|
interceptResponse(request, options, response) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
if (this.loggingEnabled) {
|
|
44
|
-
this
|
|
44
|
+
// Eventually, add the execution time like this: `[OUTBOUND] GET https://api.stripe.com/v1/charges 200 112ms`
|
|
45
|
+
this.logHandler.info(`[OUTBOUND] ${request.httpMethod} ${request.url} ${response.status}`, {
|
|
45
46
|
highlights: {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
requestBody: request.body,
|
|
48
|
+
requestHeaders: request.headers,
|
|
49
|
+
responseBody: response.body,
|
|
50
|
+
responseHeaders: response.headers
|
|
49
51
|
}, eventId: options.eventId, extra: { response, options }
|
|
50
52
|
});
|
|
51
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response-logging.interceptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAE,GAAG,EAAC,MAAM,qBAAqB,CAAC;AAMhF,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AAII,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YACkD,UAA+B,EACnB,cAAuB;QADnC,eAAU,GAAV,UAAU,CAAqB;QACnB,mBAAc,GAAd,cAAc,CAAS;IAErF,CAAC;IAED;;;;;OAKG;IACG,iBAAiB,CAAC,OAA6B,EAAE,OAA2B,EAAE,QAA+B;;YACjH,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"http-response-logging.interceptor.js","sourceRoot":"","sources":["../../../../src/interceptors/http-response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AA8B,CA6B1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pristine-ts/http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.429",
|
|
4
4
|
"description": "",
|
|
5
5
|
"module": "dist/lib/esm/http.module.js",
|
|
6
6
|
"main": "dist/lib/cjs/http.module.js",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@pristine-ts/class-validator": "^2.0.4",
|
|
19
|
-
"@pristine-ts/cli": "^1.0.
|
|
20
|
-
"@pristine-ts/common": "^1.0.
|
|
21
|
-
"@pristine-ts/logging": "^1.0.
|
|
19
|
+
"@pristine-ts/cli": "^1.0.429",
|
|
20
|
+
"@pristine-ts/common": "^1.0.429",
|
|
21
|
+
"@pristine-ts/logging": "^1.0.429",
|
|
22
22
|
"lodash": "^4.17.21",
|
|
23
23
|
"tsyringe": "^4.8.0"
|
|
24
24
|
},
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"src/*.{js,ts}"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "7f3bbf51ff4fd01b48a97de696f35d20d8a44312",
|
|
65
65
|
"repository": {
|
|
66
66
|
"type": "git",
|
|
67
67
|
"url": "https://github.com/magieno/pristine-ts.git",
|