@abyss-project/monitor 16.2.0 → 16.4.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/types/interface/api/requests/application-environment.request.d.ts +3 -1
- package/dist/types/interface/models/application-environment.model.d.ts +2 -0
- package/dist/types/interface/models/application-environment.model.js +2 -1
- package/dist/types/interface/models/application-environment.model.js.map +1 -1
- package/dist/utils/billing-quota-error.utils.d.ts +1 -0
- package/dist/utils/billing-quota-error.utils.js +9 -5
- package/dist/utils/billing-quota-error.utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,13 +8,15 @@ export interface ICreateApplicationEnvironmentParams {
|
|
|
8
8
|
export interface ICreateApplicationEnvironmentBody {
|
|
9
9
|
name: string;
|
|
10
10
|
kind: EnvironmentKind;
|
|
11
|
+
expiresAt?: Date | null;
|
|
11
12
|
}
|
|
12
13
|
export interface IUpdateApplicationEnvironmentParams {
|
|
13
14
|
applicationId: string;
|
|
14
15
|
applicationEnvironmentId: string;
|
|
15
16
|
}
|
|
16
17
|
export interface IUpdateApplicationEnvironmentBody {
|
|
17
|
-
kind
|
|
18
|
+
kind?: EnvironmentKind;
|
|
19
|
+
expiresAt?: Date | null;
|
|
18
20
|
}
|
|
19
21
|
export interface IDeleteApplicationEnvironmentParams {
|
|
20
22
|
applicationId: string;
|
|
@@ -2,11 +2,13 @@ import { EnvironmentKind } from '../../enum';
|
|
|
2
2
|
import { IApplication } from './application.model';
|
|
3
3
|
export declare const DEFAULT_ENVIRONMENT_NAME = "production";
|
|
4
4
|
export declare const ENVIRONMENT_NAME_PATTERN: RegExp;
|
|
5
|
+
export declare const ENVIRONMENT_EXPIRY_MAX_DAYS = 365;
|
|
5
6
|
export interface IApplicationEnvironment {
|
|
6
7
|
id: string;
|
|
7
8
|
applicationId: string;
|
|
8
9
|
name: string;
|
|
9
10
|
kind: EnvironmentKind;
|
|
11
|
+
expiresAt: Date | null;
|
|
10
12
|
rumEnabled?: boolean;
|
|
11
13
|
createdAt?: Date;
|
|
12
14
|
updatedAt?: Date;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ENVIRONMENT_NAME_PATTERN = exports.DEFAULT_ENVIRONMENT_NAME = void 0;
|
|
3
|
+
exports.ENVIRONMENT_EXPIRY_MAX_DAYS = exports.ENVIRONMENT_NAME_PATTERN = exports.DEFAULT_ENVIRONMENT_NAME = void 0;
|
|
4
4
|
exports.DEFAULT_ENVIRONMENT_NAME = 'production';
|
|
5
5
|
exports.ENVIRONMENT_NAME_PATTERN = /^[a-z0-9][a-z0-9-]{0,31}$/;
|
|
6
|
+
exports.ENVIRONMENT_EXPIRY_MAX_DAYS = 365;
|
|
6
7
|
//# sourceMappingURL=application-environment.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-environment.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/application-environment.model.ts"],"names":[],"mappings":";;;AAOa,QAAA,wBAAwB,GAAG,YAAY,CAAC;AAGxC,QAAA,wBAAwB,GAAG,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"application-environment.model.js","sourceRoot":"","sources":["../../../../src/types/interface/models/application-environment.model.ts"],"names":[],"mappings":";;;AAOa,QAAA,wBAAwB,GAAG,YAAY,CAAC;AAGxC,QAAA,wBAAwB,GAAG,2BAA2B,CAAC;AAMvD,QAAA,2BAA2B,GAAG,GAAG,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Code } from '../types';
|
|
2
2
|
export declare const QUOTA_MESSAGE_RE: RegExp;
|
|
3
3
|
export declare const buildQuotaMessage: (metric: string) => string;
|
|
4
|
+
export declare const carriesApiErrorCode: (error: unknown, code: string) => boolean;
|
|
4
5
|
export declare const isQuotaBlocked: (error: unknown) => error is {
|
|
5
6
|
code: typeof Code.accessNotAllowed;
|
|
6
7
|
message: string;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseQuotaMetric = exports.isQuotaBlocked = exports.buildQuotaMessage = exports.QUOTA_MESSAGE_RE = void 0;
|
|
3
|
+
exports.parseQuotaMetric = exports.isQuotaBlocked = exports.carriesApiErrorCode = exports.buildQuotaMessage = exports.QUOTA_MESSAGE_RE = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const QUOTA_MESSAGE_PREFIX = 'Quota reached for ';
|
|
6
6
|
const QUOTA_MESSAGE_SUFFIX = ' on the current plan';
|
|
7
7
|
exports.QUOTA_MESSAGE_RE = new RegExp(`^${QUOTA_MESSAGE_PREFIX}([A-Z0-9_]+)${QUOTA_MESSAGE_SUFFIX}$`);
|
|
8
8
|
const buildQuotaMessage = (metric) => `${QUOTA_MESSAGE_PREFIX}${metric}${QUOTA_MESSAGE_SUFFIX}`;
|
|
9
9
|
exports.buildQuotaMessage = buildQuotaMessage;
|
|
10
|
-
const
|
|
10
|
+
const carriesApiErrorCode = (error, code) => {
|
|
11
11
|
if (typeof error !== 'object' || error === null)
|
|
12
12
|
return false;
|
|
13
13
|
const candidate = error;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
return [candidate.code, candidate.response?.data?.error?.code].includes(code);
|
|
15
|
+
};
|
|
16
|
+
exports.carriesApiErrorCode = carriesApiErrorCode;
|
|
17
|
+
const isQuotaBlocked = (error) => {
|
|
18
|
+
if (!(0, exports.carriesApiErrorCode)(error, types_1.Code.accessNotAllowed))
|
|
17
19
|
return false;
|
|
20
|
+
const candidate = error;
|
|
21
|
+
const nestedError = candidate.response?.data?.error;
|
|
18
22
|
const messages = [candidate.message, nestedError?.message];
|
|
19
23
|
return messages.some((message) => typeof message === 'string' && exports.QUOTA_MESSAGE_RE.test(message));
|
|
20
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing-quota-error.utils.js","sourceRoot":"","sources":["../../src/utils/billing-quota-error.utils.ts"],"names":[],"mappings":";;;AAAA,oCAAgC;AAYhC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAClD,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AACvC,QAAA,gBAAgB,GAAG,IAAI,MAAM,CACxC,IAAI,oBAAoB,eAAe,oBAAoB,GAAG,CAC/D,CAAC;AAOK,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAC1D,GAAG,oBAAoB,GAAG,MAAM,GAAG,oBAAoB,EAAE,CAAC;AAD/C,QAAA,iBAAiB,qBAC8B;
|
|
1
|
+
{"version":3,"file":"billing-quota-error.utils.js","sourceRoot":"","sources":["../../src/utils/billing-quota-error.utils.ts"],"names":[],"mappings":";;;AAAA,oCAAgC;AAYhC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAClD,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AACvC,QAAA,gBAAgB,GAAG,IAAI,MAAM,CACxC,IAAI,oBAAoB,eAAe,oBAAoB,GAAG,CAC/D,CAAC;AAOK,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAU,EAAE,CAC1D,GAAG,oBAAoB,GAAG,MAAM,GAAG,oBAAoB,EAAE,CAAC;AAD/C,QAAA,iBAAiB,qBAC8B;AAgBrD,MAAM,mBAAmB,GAAG,CAAC,KAAc,EAAE,IAAY,EAAW,EAAE;IAC3E,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,SAAS,GAAG,KAAqB,CAAC;IACxC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChF,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B;AAOK,MAAM,cAAc,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