@abyss-project/main 37.5.0 → 37.6.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/api/billing-account.admin.api.js.map +1 -1
- package/dist/api/organization-billing.api.d.ts +2 -3
- package/dist/api/organization-billing.api.js +1 -5
- package/dist/api/organization-billing.api.js.map +1 -1
- package/dist/billing-metric-label/billing-metric-label.labels.d.ts +0 -6
- package/dist/billing-metric-label/billing-metric-label.labels.js +0 -6
- package/dist/billing-metric-label/billing-metric-label.labels.js.map +1 -1
- package/dist/constants/billing-catalog.constants.js +0 -28
- package/dist/constants/billing-catalog.constants.js.map +1 -1
- package/dist/constants/catalog-plan-quotas.constants.js +0 -9
- package/dist/constants/catalog-plan-quotas.constants.js.map +1 -1
- package/dist/constants/enforcement-registry.constants.js +2 -20
- package/dist/constants/enforcement-registry.constants.js.map +1 -1
- package/dist/constants/metric-price-scale.constants.js +0 -8
- package/dist/constants/metric-price-scale.constants.js.map +1 -1
- package/dist/constants/module-catalog.constants.d.ts +0 -2
- package/dist/constants/module-catalog.constants.js +0 -24
- package/dist/constants/module-catalog.constants.js.map +1 -1
- package/dist/constants/overage-base-rates.constants.js +0 -1
- package/dist/constants/overage-base-rates.constants.js.map +1 -1
- package/dist/constants/public-plans.constants.js +0 -81
- package/dist/constants/public-plans.constants.js.map +1 -1
- package/dist/constants/quota-metric-kind.constants.js +0 -3
- package/dist/constants/quota-metric-kind.constants.js.map +1 -1
- package/dist/constants/tests/billing-catalog.constants.spec.js +1 -114
- package/dist/constants/tests/billing-catalog.constants.spec.js.map +1 -1
- package/dist/constants/tests/catalog-plan-quotas.coherence.spec.js +0 -16
- package/dist/constants/tests/catalog-plan-quotas.coherence.spec.js.map +1 -1
- package/dist/constants/tests/metric-price-scale.constants.spec.js +1 -5
- package/dist/constants/tests/metric-price-scale.constants.spec.js.map +1 -1
- package/dist/constants/tests/module-calibration.constants.spec.js +0 -1
- package/dist/constants/tests/module-calibration.constants.spec.js.map +1 -1
- package/dist/constants/tests/module-catalog.constants.spec.js +2 -58
- package/dist/constants/tests/module-catalog.constants.spec.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/translate/en.translate.d.ts +0 -4
- package/dist/translate/en.translate.js +0 -4
- package/dist/translate/en.translate.js.map +1 -1
- package/dist/translate/fr.translate.d.ts +0 -4
- package/dist/translate/fr.translate.js +0 -4
- package/dist/translate/fr.translate.js.map +1 -1
- package/dist/types/enum/email-type.enum.d.ts +0 -1
- package/dist/types/enum/email-type.enum.js +0 -1
- package/dist/types/enum/email-type.enum.js.map +1 -1
- package/dist/types/enum/index.d.ts +0 -1
- package/dist/types/enum/index.js +0 -1
- package/dist/types/enum/index.js.map +1 -1
- package/dist/types/enum/organization-billing.enum.d.ts +0 -3
- package/dist/types/enum/organization-billing.enum.js +0 -3
- package/dist/types/enum/organization-billing.enum.js.map +1 -1
- package/dist/types/enum/user-notification-category.enum.js +0 -1
- package/dist/types/enum/user-notification-category.enum.js.map +1 -1
- package/dist/types/enum/user-notification-content-type.enum.d.ts +0 -10
- package/dist/types/enum/user-notification-content-type.enum.js +1 -2
- package/dist/types/enum/user-notification-content-type.enum.js.map +1 -1
- package/dist/types/interface/api/requests/organization-billing.request.d.ts +2 -28
- package/dist/types/interface/api/requests/user-billing.request.d.ts +1 -0
- package/dist/types/interface/api/responses/organization-billing.response.d.ts +0 -4
- package/package.json +1 -1
- package/dist/api/tests/sdk-resource-alert.spec.d.ts +0 -1
- package/dist/api/tests/sdk-resource-alert.spec.js +0 -38
- package/dist/api/tests/sdk-resource-alert.spec.js.map +0 -1
- package/dist/types/enum/resource-alert-kind.enum.d.ts +0 -18
- package/dist/types/enum/resource-alert-kind.enum.js +0 -11
- package/dist/types/enum/resource-alert-kind.enum.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BillingInterval, BillingMetric, BillingQuotaCapAction, BillingQuotaCapMode, BillingService, QuotaCeilingMode, QuotaGrantScope,
|
|
1
|
+
import { BillingInterval, BillingMetric, BillingQuotaCapAction, BillingQuotaCapMode, BillingService, QuotaCeilingMode, QuotaGrantScope, StorageSubtotalSource, UsageResourceType } from '../../../enum';
|
|
2
2
|
import { IBillingAddress } from '../../models/billing-account.model';
|
|
3
3
|
import { BillingModuleId } from '../../../../constants/module-catalog.constants';
|
|
4
4
|
import type { ICancellationFlowContext } from './subscription-retention.request';
|
|
@@ -137,6 +137,7 @@ export interface IRecordUsageOrganizationBody {
|
|
|
137
137
|
idempotencyKey?: string | null;
|
|
138
138
|
resourceType?: UsageResourceType;
|
|
139
139
|
resourceId?: string;
|
|
140
|
+
usedAt?: string;
|
|
140
141
|
}
|
|
141
142
|
export interface IGetProjectQuotaOrganizationParams {
|
|
142
143
|
organizationId: string;
|
|
@@ -244,30 +245,3 @@ export interface IListOrgDailySnapshotsQuery {
|
|
|
244
245
|
from: string;
|
|
245
246
|
to: string;
|
|
246
247
|
}
|
|
247
|
-
export interface IReportResourceAlertOrganizationParams {
|
|
248
|
-
organizationId: string;
|
|
249
|
-
}
|
|
250
|
-
export interface IReportResourceAlertOrganizationBase {
|
|
251
|
-
metric: BillingMetric;
|
|
252
|
-
resourceId: string;
|
|
253
|
-
resourceLabel: string;
|
|
254
|
-
threshold: number;
|
|
255
|
-
period: string;
|
|
256
|
-
actionUrl: string;
|
|
257
|
-
channels: {
|
|
258
|
-
email: boolean;
|
|
259
|
-
inApp: boolean;
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
export type IReportResourceAlertOrganizationBody = IReportResourceAlertOrganizationBase & ({
|
|
263
|
-
kind: ResourceAlertKind.USAGE_THRESHOLD;
|
|
264
|
-
} | {
|
|
265
|
-
kind: ResourceAlertKind.RATE_REJECTED;
|
|
266
|
-
} | {
|
|
267
|
-
kind: ResourceAlertKind.SPEND_CAP_THRESHOLD;
|
|
268
|
-
spendCapCents: number;
|
|
269
|
-
} | {
|
|
270
|
-
kind: ResourceAlertKind.RATE_ALLOCATION_REDUCED;
|
|
271
|
-
lotsBefore: number;
|
|
272
|
-
lotsAfter: number;
|
|
273
|
-
});
|
|
@@ -115,10 +115,6 @@ export interface IImportQuotaOrganizationData {
|
|
|
115
115
|
swept: number;
|
|
116
116
|
}
|
|
117
117
|
export type IImportQuotaOrganizationResponse = IResponse<IImportQuotaOrganizationData>;
|
|
118
|
-
export interface IReportResourceAlertOrganizationData {
|
|
119
|
-
sent: boolean;
|
|
120
|
-
}
|
|
121
|
-
export type IReportResourceAlertOrganizationResponse = IResponse<IReportResourceAlertOrganizationData>;
|
|
122
118
|
export interface ISetStorageSubtotalOrganizationData {
|
|
123
119
|
poolBytes: number;
|
|
124
120
|
limitBytes: number;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const __1 = require("../..");
|
|
4
|
-
describe('SDK — per-resource alerts (#844)', () => {
|
|
5
|
-
it('posts the alert to the admin resource-alert route of the organization', async () => {
|
|
6
|
-
const post = jest
|
|
7
|
-
.spyOn(__1.AbyssCore.axios, 'post')
|
|
8
|
-
.mockResolvedValue({ data: { data: { sent: true } } });
|
|
9
|
-
const body = {
|
|
10
|
-
kind: __1.ResourceAlertKind.SPEND_CAP_THRESHOLD,
|
|
11
|
-
spendCapCents: 1250,
|
|
12
|
-
metric: __1.BillingMetric.REFLEX_CREDITS_MONTH,
|
|
13
|
-
resourceId: 'bot-1',
|
|
14
|
-
resourceLabel: 'My bot',
|
|
15
|
-
threshold: 80,
|
|
16
|
-
period: '2026-11-21',
|
|
17
|
-
actionUrl: 'https://abyss.example/reflex/bot-1',
|
|
18
|
-
channels: { email: true, inApp: false },
|
|
19
|
-
};
|
|
20
|
-
const res = await __1.AbyssCore.sdk.organizationBilling.reportResourceAlertAdmin({ organizationId: 'org-1' }, body);
|
|
21
|
-
expect(post).toHaveBeenCalledWith('admin/organization/org-1/quota/resource-alert', body);
|
|
22
|
-
expect(res.data.sent).toBe(true);
|
|
23
|
-
});
|
|
24
|
-
it('declares the notification type, its category and the e-mail type', () => {
|
|
25
|
-
expect(__1.UserNotificationContentType.BILLING_RESOURCE_THRESHOLD).toBe('billing-resource-threshold');
|
|
26
|
-
expect(__1.USER_NOTIFICATION_CONTENT_TYPE_CATEGORY[__1.UserNotificationContentType.BILLING_RESOURCE_THRESHOLD]).toBe(__1.UserNotificationCategory.OPERATIONAL);
|
|
27
|
-
expect(__1.EmailType.BILLING_RESOURCE_WARNING).toBe('BILLING_RESOURCE_WARNING');
|
|
28
|
-
});
|
|
29
|
-
it('names the four kinds of alert, each worded on its own', () => {
|
|
30
|
-
expect(Object.values(__1.ResourceAlertKind)).toEqual([
|
|
31
|
-
'USAGE_THRESHOLD',
|
|
32
|
-
'RATE_REJECTED',
|
|
33
|
-
'SPEND_CAP_THRESHOLD',
|
|
34
|
-
'RATE_ALLOCATION_REDUCED',
|
|
35
|
-
]);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=sdk-resource-alert.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-resource-alert.spec.js","sourceRoot":"","sources":["../../../src/api/tests/sdk-resource-alert.spec.ts"],"names":[],"mappings":";;AAAA,6BASe;AAEf,QAAQ,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAChD,EAAE,CAAC,uEAAuE,EAAE,KAAK,IAAI,EAAE;QACrF,MAAM,IAAI,GAAG,IAAI;aACd,KAAK,CAAC,aAAS,CAAC,KAAK,EAAE,MAAM,CAAC;aAC9B,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACzD,MAAM,IAAI,GAAyC;YACjD,IAAI,EAAE,qBAAiB,CA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@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare enum ResourceAlertKind {
|
|
2
|
-
USAGE_THRESHOLD = "USAGE_THRESHOLD",
|
|
3
|
-
RATE_REJECTED = "RATE_REJECTED",
|
|
4
|
-
SPEND_CAP_THRESHOLD = "SPEND_CAP_THRESHOLD",
|
|
5
|
-
RATE_ALLOCATION_REDUCED = "RATE_ALLOCATION_REDUCED"
|
|
6
|
-
}
|
|
7
|
-
export type ResourceAlertKindData = {
|
|
8
|
-
kind: ResourceAlertKind.USAGE_THRESHOLD;
|
|
9
|
-
} | {
|
|
10
|
-
kind: ResourceAlertKind.RATE_REJECTED;
|
|
11
|
-
} | {
|
|
12
|
-
kind: ResourceAlertKind.SPEND_CAP_THRESHOLD;
|
|
13
|
-
spendCapCents: string;
|
|
14
|
-
} | {
|
|
15
|
-
kind: ResourceAlertKind.RATE_ALLOCATION_REDUCED;
|
|
16
|
-
lotsBefore: string;
|
|
17
|
-
lotsAfter: string;
|
|
18
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResourceAlertKind = void 0;
|
|
4
|
-
var ResourceAlertKind;
|
|
5
|
-
(function (ResourceAlertKind) {
|
|
6
|
-
ResourceAlertKind["USAGE_THRESHOLD"] = "USAGE_THRESHOLD";
|
|
7
|
-
ResourceAlertKind["RATE_REJECTED"] = "RATE_REJECTED";
|
|
8
|
-
ResourceAlertKind["SPEND_CAP_THRESHOLD"] = "SPEND_CAP_THRESHOLD";
|
|
9
|
-
ResourceAlertKind["RATE_ALLOCATION_REDUCED"] = "RATE_ALLOCATION_REDUCED";
|
|
10
|
-
})(ResourceAlertKind || (exports.ResourceAlertKind = ResourceAlertKind = {}));
|
|
11
|
-
//# sourceMappingURL=resource-alert-kind.enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resource-alert-kind.enum.js","sourceRoot":"","sources":["../../../src/types/enum/resource-alert-kind.enum.ts"],"names":[],"mappings":";;;AAKA,IAAY,iBASX;AATD,WAAY,iBAAiB;IAE3B,wDAAmC,CAAA;IAEnC,oDAA+B,CAAA;IAE/B,gEAA2C,CAAA;IAE3C,wEAAmD,CAAA;AACrD,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B"}
|