mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
add husky
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
node version/git-version.js
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
!/usr/bin/env sh
|
||||||
# . "$(dirname -- "$0")/_/husky.sh"
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
#npm run build:version && git add version/git-version.ts
|
npm run build:version && git add version/git-version.ts
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
{
|
||||||
|
"info": {
|
||||||
|
"_postman_id": "2be7c96a-9d34-45fe-9dc9-8fe62efaefbf",
|
||||||
|
"name": "gabinete",
|
||||||
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
|
||||||
|
"_exporter_id": "32154620"
|
||||||
|
},
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "send notification to perter's phone",
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"value": "key=AAAAum9znm8:APA91bFtKgVFS7XhJrYkn1m6If3pLwHqCVDcpotFbk8qFtAg_3FdptH7BvOGVRBlX-0wdbSIV9uKhF7iogLLAo1-bf02FwRbeofnC-6JGC2IzFbWK_zto8wp1f5q_zrwkmU0s3wqksv6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\r\n\"to\":\"fGrBJ52QRqG4rcuHur2_5l:APA91bGerKl6LcrqKjnG8Xvm-JaHxJfuMmKjYn7hJk-m5jhUAy2PIuhJ-yjkv0bGwPPKHeBAbYmDTB5zp_-D1sUetJJ8I8tPsP3pUl6nRRhDgPYO4N-97typ8wn5Le6xHK1ncFyOk2yR\",\r\n \"data\": {\r\n \"IdObject\": \"30847_101\",\r\n \"Service\": \"gabinete-digital\",\r\n \"Object\": \"despachos\",\r\n \"FolderId\": \"10469\"\r\n },\r\n \"notification\": {\r\n \"body\": \"Recebeu o Despacho nº 000025-0823 para vossa atenção\",\r\n \"title\": \"teste deferimento 11/02_1\"\r\n }\r\n}"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "https://fcm.googleapis.com/fcm/send",
|
||||||
|
"protocol": "https",
|
||||||
|
"host": [
|
||||||
|
"fcm",
|
||||||
|
"googleapis",
|
||||||
|
"com"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"fcm",
|
||||||
|
"send"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "send notification",
|
||||||
|
"request": {
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"value": "key=AAAAum9znm8:APA91bFtKgVFS7XhJrYkn1m6If3pLwHqCVDcpotFbk8qFtAg_3FdptH7BvOGVRBlX-0wdbSIV9uKhF7iogLLAo1-bf02FwRbeofnC-6JGC2IzFbWK_zto8wp1f5q_zrwkmU0s3wqksv6"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\r\n\"to\":\"ci3PSyhViJStOUiILtqYal:APA91bFJ-eGiCFeSt0ar2hC8UzNfRtcbAYN43frpmRfTBG4-vZO8Yxv1CoE2Bn5PJnmYo37s3RIp0s267p7Eq9V2ycbjBxRSdWVbuUSYHMFN-oqa5OXr6lsLqrSnNGVDwq_pNgGsIF7S\",\r\n\"notification\" : {\r\n \"body\" : \"Body of Your Notification\",\r\n \"title\": \"Title of Your Notification\"\r\n}\r\n}"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"raw": "https://fcm.googleapis.com/fcm/send",
|
||||||
|
"protocol": "https",
|
||||||
|
"host": [
|
||||||
|
"fcm",
|
||||||
|
"googleapis",
|
||||||
|
"com"
|
||||||
|
],
|
||||||
|
"path": [
|
||||||
|
"fcm",
|
||||||
|
"send"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Generated
+7
-7
@@ -153,7 +153,7 @@
|
|||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"howler": "^2.2.3",
|
"howler": "^2.2.3",
|
||||||
"http-server": "^14.1.1",
|
"http-server": "^14.1.1",
|
||||||
"husky": "^8.0.2",
|
"husky": "^8.0.3",
|
||||||
"ionic-angular": "^3.9.10",
|
"ionic-angular": "^3.9.10",
|
||||||
"ionic-image-loader": "^6.3.3",
|
"ionic-image-loader": "^6.3.3",
|
||||||
"ionic-image-loader-v5": "^1.0.2",
|
"ionic-image-loader-v5": "^1.0.2",
|
||||||
@@ -18342,9 +18342,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/husky": {
|
"node_modules/husky": {
|
||||||
"version": "8.0.2",
|
"version": "8.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
|
||||||
"integrity": "sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg==",
|
"integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
|
||||||
"bin": {
|
"bin": {
|
||||||
"husky": "lib/bin.js"
|
"husky": "lib/bin.js"
|
||||||
},
|
},
|
||||||
@@ -58132,9 +58132,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"version": "8.0.2",
|
"version": "8.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
|
||||||
"integrity": "sha512-Tkv80jtvbnkK3mYWxPZePGFpQ/tT3HNSs/sasF9P2YfkMezDl3ON37YN6jUUI4eTg5LcyVynlb6r4eyvOmspvg=="
|
"integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg=="
|
||||||
},
|
},
|
||||||
"iconv-lite": {
|
"iconv-lite": {
|
||||||
"version": "0.6.3",
|
"version": "0.6.3",
|
||||||
|
|||||||
+1
-1
@@ -169,7 +169,7 @@
|
|||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"howler": "^2.2.3",
|
"howler": "^2.2.3",
|
||||||
"http-server": "^14.1.1",
|
"http-server": "^14.1.1",
|
||||||
"husky": "^8.0.2",
|
"husky": "^8.0.3",
|
||||||
"ionic-angular": "^3.9.10",
|
"ionic-angular": "^3.9.10",
|
||||||
"ionic-image-loader": "^6.3.3",
|
"ionic-image-loader": "^6.3.3",
|
||||||
"ionic-image-loader-v5": "^1.0.2",
|
"ionic-image-loader-v5": "^1.0.2",
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const metricReader = new PeriodicExportingMetricReader({
|
|||||||
// }
|
// }
|
||||||
}),
|
}),
|
||||||
exportIntervalMillis: 1000,
|
exportIntervalMillis: 1000,
|
||||||
})
|
});
|
||||||
|
|
||||||
meterProvider.addMetricReader(metricReader);
|
meterProvider.addMetricReader(metricReader);
|
||||||
|
|
||||||
@@ -27,32 +27,29 @@ const requestCounter = meter.createCounter('post_requests', {
|
|||||||
description: 'Example of a Counter',
|
description: 'Example of a Counter',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MetricsInterceptor implements HttpInterceptor {
|
export class MetricsInterceptor implements HttpInterceptor {
|
||||||
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||||
|
|
||||||
|
|
||||||
return next.handle(req).pipe(
|
return next.handle(req).pipe(
|
||||||
tap(event => {
|
tap(event => {
|
||||||
if (event instanceof HttpResponse) {
|
if (event instanceof HttpResponse) {
|
||||||
// Capture the status code
|
// Capture the status code and check protocol
|
||||||
if (req.method !== 'GET' && !req.urlWithParams.includes('metrics')) {
|
if (req.method !== 'GET' && !req.urlWithParams.includes('metrics')) {
|
||||||
const path = req.urlWithParams;
|
const path = req.urlWithParams;
|
||||||
const url = new URL(path);
|
const url = new URL(path);
|
||||||
let attributes = { path: url.pathname, method: req.method };
|
if (!window.location.origin.includes('https:')) {
|
||||||
const statusCode = event.status;
|
let attributes = { path: url.pathname, method: req.method };
|
||||||
const extendedAttributes = { ...attributes, status: statusCode };
|
const statusCode = event.status;
|
||||||
requestCounter.add(1, extendedAttributes);
|
const extendedAttributes = { ...attributes, status: statusCode };
|
||||||
|
requestCounter.add(1, extendedAttributes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const metricsInterceptor = {
|
export const metricsInterceptor = {
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: MetricsInterceptor,
|
useClass: MetricsInterceptor,
|
||||||
|
|||||||
@@ -186,6 +186,13 @@ export class AgendaDataRepositoryService {
|
|||||||
|
|
||||||
updateEvent(eventId, eventData, editAllEvent, calendar: TableSharedCalendar) {
|
updateEvent(eventId, eventData, editAllEvent, calendar: TableSharedCalendar) {
|
||||||
|
|
||||||
|
let body;
|
||||||
|
if(typeof eventData?.Body == 'object') {
|
||||||
|
body = eventData?.Body?.Text
|
||||||
|
} else {
|
||||||
|
body = eventData?.Body
|
||||||
|
}
|
||||||
|
|
||||||
let eventInput = {
|
let eventInput = {
|
||||||
userId: calendar.wxUserId,
|
userId: calendar.wxUserId,
|
||||||
ownerType: this.utils.selectedCalendarOwner(calendar.role),
|
ownerType: this.utils.selectedCalendarOwner(calendar.role),
|
||||||
|
|||||||
Reference in New Issue
Block a user