@or-sdk/billing 21.1.1-beta.6220.0 → 22.0.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/api/thresholdAlertsApi/types.d.ts +2 -2
- package/dist/types/api/thresholdAlertsApi/types.d.ts.map +1 -1
- package/dist/types/api/thresholdSettingsApi/types.d.ts +5 -4
- package/dist/types/api/thresholdSettingsApi/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/api/thresholdAlertsApi/index.ts +3 -3
- package/src/api/thresholdAlertsApi/types.ts +2 -2
- package/src/api/thresholdSettingsApi/index.ts +2 -2
- package/src/api/thresholdSettingsApi/types.ts +5 -4
|
@@ -4,7 +4,7 @@ export type FindThresholdAlertDto = {
|
|
|
4
4
|
thresholdId?: string;
|
|
5
5
|
customerId?: string;
|
|
6
6
|
channelId?: string;
|
|
7
|
-
|
|
7
|
+
target?: string;
|
|
8
8
|
type?: string;
|
|
9
9
|
status?: string;
|
|
10
10
|
createdAtFrom?: Date;
|
|
@@ -14,7 +14,7 @@ export type CreateThresholdAlertDto = {
|
|
|
14
14
|
thresholdId: string;
|
|
15
15
|
customerId: string;
|
|
16
16
|
channelId: string;
|
|
17
|
-
|
|
17
|
+
target: string;
|
|
18
18
|
type: string;
|
|
19
19
|
status: string;
|
|
20
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/thresholdAlertsApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/thresholdAlertsApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB,GAAG,UAAU,CAAC;AAEf,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEvE,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;CAAE,GAAG,uBAAuB,CAAC"}
|
|
@@ -7,9 +7,10 @@ export declare enum UsageStrategyKey {
|
|
|
7
7
|
FALLBACK_AZURE_PRIMARY = "fallback:azure",
|
|
8
8
|
FALLBACK_DRUID_PRIMARY = "fallback:druid"
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
10
|
+
export type ActionItemDto = {
|
|
11
11
|
channel: string;
|
|
12
|
-
|
|
12
|
+
target: string;
|
|
13
|
+
params?: Record<string, unknown>;
|
|
13
14
|
};
|
|
14
15
|
export type FindThresholdsSettingsDto = {
|
|
15
16
|
id?: string;
|
|
@@ -25,7 +26,7 @@ export type FindThresholdsSettingsDto = {
|
|
|
25
26
|
maxValue?: number;
|
|
26
27
|
isActive?: boolean;
|
|
27
28
|
channel?: string;
|
|
28
|
-
|
|
29
|
+
target?: string;
|
|
29
30
|
search?: string;
|
|
30
31
|
} & RequestDto;
|
|
31
32
|
export type CreateThresholdSettingDto = {
|
|
@@ -38,7 +39,7 @@ export type CreateThresholdSettingDto = {
|
|
|
38
39
|
condition: string;
|
|
39
40
|
calculationType: CalculationType;
|
|
40
41
|
value: number;
|
|
41
|
-
|
|
42
|
+
actions: Array<ActionItemDto>;
|
|
42
43
|
isActive: boolean;
|
|
43
44
|
};
|
|
44
45
|
export type UpdateThresholdSettingDto = Partial<CreateThresholdSettingDto>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/thresholdSettingsApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,CAAC;AAElD,oBAAY,gBAAgB;IAC1B,IAAI,eAAe;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,sBAAsB,mBAAmB;IACzC,sBAAsB,mBAAmB;CAC1C;AAED,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/api/thresholdSettingsApi/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,CAAC;AAElD,oBAAY,gBAAgB;IAC1B,IAAI,eAAe;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,sBAAsB,mBAAmB;IACzC,sBAAsB,mBAAmB;CAC1C;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,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G;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,IAAI,CAAC;CAAE,GAAG,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@or-sdk/billing",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"dev": "pnpm build:watch:esm"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@onereach/billing-dto": "^
|
|
19
|
-
"@onereach/billing-shared": "^
|
|
18
|
+
"@onereach/billing-dto": "^22.0.0",
|
|
19
|
+
"@onereach/billing-shared": "^22.0.0",
|
|
20
20
|
"@or-sdk/base": "^0.42.4",
|
|
21
21
|
"@or-sdk/discovery": "1.10.6",
|
|
22
22
|
"@types/qs": "6.14.0",
|
|
@@ -17,7 +17,7 @@ export default class ThresholdAlertsApi extends BaseApi {
|
|
|
17
17
|
* @param {string} [params.thresholdId] - Filter by threshold setting ID.
|
|
18
18
|
* @param {string} [params.customerId] - Filter by customer ID.
|
|
19
19
|
* @param {string} [params.channelId] - Filter by notification channel (e.g., email, sms, slack).
|
|
20
|
-
* @param {string} [params.
|
|
20
|
+
* @param {string} [params.target] - Filter by target address or identifier.
|
|
21
21
|
* @param {string} [params.type] - Filter by alert type.
|
|
22
22
|
* @param {string} [params.status] - Filter by delivery status (sent, pending, failed).
|
|
23
23
|
* @param {Date} [params.createdAtFrom] - Filter for alerts created on or after this ISO 8601 timestamp.
|
|
@@ -56,7 +56,7 @@ export default class ThresholdAlertsApi extends BaseApi {
|
|
|
56
56
|
* @param {string} data.thresholdId - Threshold setting ID.
|
|
57
57
|
* @param {string} data.customerId - Customer ID.
|
|
58
58
|
* @param {string} data.channelId - Notification channel (email, sms, slack).
|
|
59
|
-
* @param {string} data.
|
|
59
|
+
* @param {string} data.target - Target address or identifier.
|
|
60
60
|
* @param {string} data.type - Alert type.
|
|
61
61
|
* @param {string} data.status - Initial delivery status.
|
|
62
62
|
* @returns {Promise<ThresholdAlertDto>}
|
|
@@ -79,7 +79,7 @@ export default class ThresholdAlertsApi extends BaseApi {
|
|
|
79
79
|
* @param {string} [data.thresholdId] - (Optional) New threshold setting ID.
|
|
80
80
|
* @param {string} [data.customerId] - (Optional) New customer ID.
|
|
81
81
|
* @param {string} [data.channelId] - (Optional) New notification channel.
|
|
82
|
-
* @param {string} [data.
|
|
82
|
+
* @param {string} [data.target] - (Optional) New target address.
|
|
83
83
|
* @param {string} [data.type] - (Optional) New alert type.
|
|
84
84
|
* @param {string} [data.status] - (Optional) New delivery status.
|
|
85
85
|
* @returns {Promise<ThresholdAlertDto>}
|
|
@@ -5,7 +5,7 @@ export type FindThresholdAlertDto = {
|
|
|
5
5
|
thresholdId?: string;
|
|
6
6
|
customerId?: string;
|
|
7
7
|
channelId?: string;
|
|
8
|
-
|
|
8
|
+
target?: string;
|
|
9
9
|
type?: string;
|
|
10
10
|
status?: string;
|
|
11
11
|
createdAtFrom?: Date;
|
|
@@ -16,7 +16,7 @@ export type CreateThresholdAlertDto = {
|
|
|
16
16
|
thresholdId: string;
|
|
17
17
|
customerId: string;
|
|
18
18
|
channelId: string;
|
|
19
|
-
|
|
19
|
+
target: string;
|
|
20
20
|
type: string;
|
|
21
21
|
status: string;
|
|
22
22
|
};
|
|
@@ -31,7 +31,7 @@ export default class ThresholdSettingsApi extends BaseApi {
|
|
|
31
31
|
* @param {number} [params.maxValue] - Filter by maximum threshold value.
|
|
32
32
|
* @param {boolean} [params.isActive] - Filter by active status.
|
|
33
33
|
* @param {string} [params.channel] - Filter by notification delivery channel.
|
|
34
|
-
* @param {string} [params.
|
|
34
|
+
* @param {string} [params.target] - Filter by target identifier.
|
|
35
35
|
* @param {string} [params.search] - A search term to filter results. This can match against names any text fields.
|
|
36
36
|
* @param {number} [params.page] - Page number.
|
|
37
37
|
* @param {number} [params.limit] - Limit of records per page.
|
|
@@ -68,7 +68,7 @@ export default class ThresholdSettingsApi extends BaseApi {
|
|
|
68
68
|
* @param {'units'|'pricing'} data.calculationType - The calculation type for the threshold.
|
|
69
69
|
* @param {number} data.value - The value associated with the threshold condition.
|
|
70
70
|
* @param {boolean} data.isActive - Whether the threshold is active.
|
|
71
|
-
* @param {Array<
|
|
71
|
+
* @param {Array<ActionItemDto>} data.actions - List of channels and targets to notify. Webhook actions can include optional request params.
|
|
72
72
|
* @returns {Promise<ThresholdSettingDto>} A promise resolving to the created threshold setting DTO.
|
|
73
73
|
*/
|
|
74
74
|
public async createThreshold(data: CreateThresholdSettingDto): Promise<ThresholdSettingDto> {
|
|
@@ -10,9 +10,10 @@ export enum UsageStrategyKey {
|
|
|
10
10
|
FALLBACK_DRUID_PRIMARY = 'fallback:druid',
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export type
|
|
13
|
+
export type ActionItemDto = {
|
|
14
14
|
channel: string;
|
|
15
|
-
|
|
15
|
+
target: string;
|
|
16
|
+
params?: Record<string, unknown>;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export type FindThresholdsSettingsDto = {
|
|
@@ -29,7 +30,7 @@ export type FindThresholdsSettingsDto = {
|
|
|
29
30
|
maxValue?: number;
|
|
30
31
|
isActive?: boolean;
|
|
31
32
|
channel?: string;
|
|
32
|
-
|
|
33
|
+
target?: string;
|
|
33
34
|
search?: string;
|
|
34
35
|
} & RequestDto;
|
|
35
36
|
|
|
@@ -43,7 +44,7 @@ export type CreateThresholdSettingDto = {
|
|
|
43
44
|
condition: string;
|
|
44
45
|
calculationType: CalculationType;
|
|
45
46
|
value: number;
|
|
46
|
-
|
|
47
|
+
actions: Array<ActionItemDto>;
|
|
47
48
|
isActive: boolean;
|
|
48
49
|
};
|
|
49
50
|
|