@attraccess/database-entities 1.9.0 → 1.11.0-beta.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/package.json +6 -1
- package/src/index.d.ts +1 -0
- package/src/lib/entities/api-token-permission.entity.d.ts +10 -0
- package/src/lib/entities/api-token-permission.entity.js +40 -0
- package/src/lib/entities/api-token-permission.entity.js.map +1 -0
- package/src/lib/entities/api-token.entity.d.ts +15 -0
- package/src/lib/entities/api-token.entity.js +61 -0
- package/src/lib/entities/api-token.entity.js.map +1 -0
- package/src/lib/entities/attractap-credential-event.entity.d.ts +14 -0
- package/src/lib/entities/attractap-credential-event.entity.js +58 -0
- package/src/lib/entities/attractap-credential-event.entity.js.map +1 -0
- package/src/lib/entities/attractap-installation.entity.d.ts +12 -0
- package/src/lib/entities/attractap-installation.entity.js +45 -0
- package/src/lib/entities/attractap-installation.entity.js.map +1 -0
- package/src/lib/entities/attractap-secure-boot-key.entity.d.ts +21 -0
- package/src/lib/entities/attractap-secure-boot-key.entity.js +53 -0
- package/src/lib/entities/attractap-secure-boot-key.entity.js.map +1 -0
- package/src/lib/entities/attractap.entity.d.ts +11 -0
- package/src/lib/entities/attractap.entity.js +79 -0
- package/src/lib/entities/attractap.entity.js.map +1 -1
- package/src/lib/entities/attractapCrashReport.entity.js +2 -1
- package/src/lib/entities/attractapCrashReport.entity.js.map +1 -1
- package/src/lib/entities/audit-log.entity.d.ts +18 -0
- package/src/lib/entities/audit-log.entity.js +79 -0
- package/src/lib/entities/audit-log.entity.js.map +1 -0
- package/src/lib/entities/billing-transaction-item.entity.d.ts +3 -0
- package/src/lib/entities/billing-transaction-item.entity.js +23 -0
- package/src/lib/entities/billing-transaction-item.entity.js.map +1 -1
- package/src/lib/entities/billing-transaction.entity.d.ts +2 -0
- package/src/lib/entities/billing-transaction.entity.js +13 -0
- package/src/lib/entities/billing-transaction.entity.js.map +1 -1
- package/src/lib/entities/csv-export-template.entity.d.ts +23 -0
- package/src/lib/entities/csv-export-template.entity.js +110 -0
- package/src/lib/entities/csv-export-template.entity.js.map +1 -0
- package/src/lib/entities/flow.entity.d.ts +19 -0
- package/src/lib/entities/flow.entity.js +62 -0
- package/src/lib/entities/flow.entity.js.map +1 -0
- package/src/lib/entities/form.d.ts +1 -0
- package/src/lib/entities/form.js +5 -0
- package/src/lib/entities/form.js.map +1 -1
- package/src/lib/entities/mqttServer.entity.d.ts +4 -0
- package/src/lib/entities/mqttServer.entity.js +39 -0
- package/src/lib/entities/mqttServer.entity.js.map +1 -1
- package/src/lib/entities/nfcCardPendingChange.entity.d.ts +20 -0
- package/src/lib/entities/nfcCardPendingChange.entity.js +55 -0
- package/src/lib/entities/nfcCardPendingChange.entity.js.map +1 -0
- package/src/lib/entities/passkey.entity.d.ts +28 -0
- package/src/lib/entities/passkey.entity.js +109 -0
- package/src/lib/entities/passkey.entity.js.map +1 -0
- package/src/lib/entities/reader-ui-settings.entity.d.ts +32 -0
- package/src/lib/entities/reader-ui-settings.entity.js +101 -0
- package/src/lib/entities/reader-ui-settings.entity.js.map +1 -0
- package/src/lib/entities/resource-billing-configuration.entity.d.ts +1 -0
- package/src/lib/entities/resource-billing-configuration.entity.js +5 -0
- package/src/lib/entities/resource-billing-configuration.entity.js.map +1 -1
- package/src/lib/entities/resource-flow-node/companion-schemas.d.ts +15 -0
- package/src/lib/entities/resource-flow-node/companion-schemas.js +27 -0
- package/src/lib/entities/resource-flow-node/companion-schemas.js.map +1 -0
- package/src/lib/entities/resource-flow-node/external-effect-policy.d.ts +19 -0
- package/src/lib/entities/resource-flow-node/external-effect-policy.js +24 -0
- package/src/lib/entities/resource-flow-node/external-effect-policy.js.map +1 -0
- package/src/lib/entities/resource-flow-node/health-schemas.d.ts +18 -0
- package/src/lib/entities/resource-flow-node/health-schemas.js +34 -0
- package/src/lib/entities/resource-flow-node/health-schemas.js.map +1 -0
- package/src/lib/entities/resource-flow-node/http-schema.d.ts +25 -0
- package/src/lib/entities/resource-flow-node/http-schema.js +20 -0
- package/src/lib/entities/resource-flow-node/http-schema.js.map +1 -0
- package/src/lib/entities/resource-flow-node/metering-schemas.d.ts +27 -0
- package/src/lib/entities/resource-flow-node/metering-schemas.js +45 -0
- package/src/lib/entities/resource-flow-node/metering-schemas.js.map +1 -0
- package/src/lib/entities/resource-flow-node/mqtt-schemas.d.ts +33 -0
- package/src/lib/entities/resource-flow-node/mqtt-schemas.js +43 -0
- package/src/lib/entities/resource-flow-node/mqtt-schemas.js.map +1 -0
- package/src/lib/entities/resource-flow-node/node-type.d.ts +43 -0
- package/src/lib/entities/resource-flow-node/node-type.js +48 -0
- package/src/lib/entities/resource-flow-node/node-type.js.map +1 -0
- package/src/lib/entities/resource-flow-node/processing-schemas.d.ts +35 -0
- package/src/lib/entities/resource-flow-node/processing-schemas.js +32 -0
- package/src/lib/entities/resource-flow-node/processing-schemas.js.map +1 -0
- package/src/lib/entities/resource-flow-node/resource-schemas.d.ts +27 -0
- package/src/lib/entities/resource-flow-node/resource-schemas.js +44 -0
- package/src/lib/entities/resource-flow-node/resource-schemas.js.map +1 -0
- package/src/lib/entities/resource-flow-node/schema-registry.d.ts +179 -0
- package/src/lib/entities/resource-flow-node/schema-registry.js +80 -0
- package/src/lib/entities/resource-flow-node/schema-registry.js.map +1 -0
- package/src/lib/entities/resource-flow-node/variable-schemas.d.ts +38 -0
- package/src/lib/entities/resource-flow-node/variable-schemas.js +31 -0
- package/src/lib/entities/resource-flow-node/variable-schemas.js.map +1 -0
- package/src/lib/entities/resource-maintenance-schedule.entity.d.ts +6 -0
- package/src/lib/entities/resource-maintenance-schedule.entity.js +21 -1
- package/src/lib/entities/resource-maintenance-schedule.entity.js.map +1 -1
- package/src/lib/entities/resource-meter.entity.d.ts +12 -0
- package/src/lib/entities/resource-meter.entity.js +48 -0
- package/src/lib/entities/resource-meter.entity.js.map +1 -0
- package/src/lib/entities/resource-metering.entity.d.ts +69 -0
- package/src/lib/entities/resource-metering.entity.js +204 -0
- package/src/lib/entities/resource-metering.entity.js.map +1 -0
- package/src/lib/entities/resource-operating-interval.entity.d.ts +13 -0
- package/src/lib/entities/resource-operating-interval.entity.js +65 -0
- package/src/lib/entities/resource-operating-interval.entity.js.map +1 -0
- package/src/lib/entities/resource-usage-lifecycle-attempt.entity.d.ts +19 -0
- package/src/lib/entities/resource-usage-lifecycle-attempt.entity.js +58 -0
- package/src/lib/entities/resource-usage-lifecycle-attempt.entity.js.map +1 -0
- package/src/lib/entities/resource.entity.d.ts +23 -22
- package/src/lib/entities/resource.entity.js +108 -97
- package/src/lib/entities/resource.entity.js.map +1 -1
- package/src/lib/entities/resource.maintenance.js +2 -0
- package/src/lib/entities/resource.maintenance.js.map +1 -1
- package/src/lib/entities/resourceFlowEdge.d.ts +5 -2
- package/src/lib/entities/resourceFlowEdge.js +28 -3
- package/src/lib/entities/resourceFlowEdge.js.map +1 -1
- package/src/lib/entities/resourceFlowNode.d.ts +18 -184
- package/src/lib/entities/resourceFlowNode.js +76 -278
- package/src/lib/entities/resourceFlowNode.js.map +1 -1
- package/src/lib/entities/resourceHealthState.entity.js +2 -2
- package/src/lib/entities/resourceHealthState.entity.js.map +1 -1
- package/src/lib/entities/resourceIntroduction.entity.d.ts +1 -0
- package/src/lib/entities/resourceIntroduction.entity.js +5 -0
- package/src/lib/entities/resourceIntroduction.entity.js.map +1 -1
- package/src/lib/entities/resourceUsage.entity.d.ts +16 -4
- package/src/lib/entities/resourceUsage.entity.js +64 -5
- package/src/lib/entities/resourceUsage.entity.js.map +1 -1
- package/src/lib/entities/{nfcCard.entity.js → rfidCard.entity.js} +1 -1
- package/src/lib/entities/rfidCard.entity.js.map +1 -0
- package/src/lib/entities/session.entity.d.ts +6 -0
- package/src/lib/entities/session.entity.js +33 -1
- package/src/lib/entities/session.entity.js.map +1 -1
- package/src/lib/entities/ssoProvider.oidc.d.ts +7 -0
- package/src/lib/entities/ssoProvider.oidc.js +43 -1
- package/src/lib/entities/ssoProvider.oidc.js.map +1 -1
- package/src/lib/entities/ssoProvider.saml.d.ts +3 -0
- package/src/lib/entities/ssoProvider.saml.js +26 -0
- package/src/lib/entities/ssoProvider.saml.js.map +1 -1
- package/src/lib/entities/user.entity.d.ts +20 -16
- package/src/lib/entities/user.entity.js +83 -68
- package/src/lib/entities/user.entity.js.map +1 -1
- package/src/lib/entities-index.d.ts +146 -50
- package/src/lib/entities-index.js +322 -201
- package/src/lib/entities-index.js.map +1 -1
- package/src/lib/types/sso-session-context.d.ts +32 -0
- package/src/lib/types/sso-session-context.js +3 -0
- package/src/lib/types/sso-session-context.js.map +1 -0
- package/src/lib/entities/nfcCard.entity.js.map +0 -1
- package/src/lib/entities/password-policy-audit.entity.d.ts +0 -19
- package/src/lib/entities/password-policy-audit.entity.js +0 -83
- package/src/lib/entities/password-policy-audit.entity.js.map +0 -1
- package/src/lib/entities/resourceFlowLog.d.ts +0 -18
- package/src/lib/entities/resourceFlowLog.js +0 -96
- package/src/lib/entities/resourceFlowLog.js.map +0 -1
- /package/src/lib/entities/{nfcCard.entity.d.ts → rfidCard.entity.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable-schemas.js","sourceRoot":"","sources":["../../../../../../../libs/database-entities/src/lib/entities/resource-flow-node/variable-schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,mBAAmB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElE,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAElD,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,SAAS,EAAE,OAAC;SACT,KAAK,CACJ,OAAC,CAAC,MAAM,CAAC;QACP,GAAG,EAAE,iBAAiB;QACtB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC;QAC7E,KAAK,EAAE,2BAAmB;KAC3B,CAAC,CACH;SACA,GAAG,CAAC,CAAC,EAAE,mCAAmC,CAAC;CAC/C,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,SAAS,EAAE,OAAC;SACT,KAAK,CACJ,OAAC,CAAC,MAAM,CAAC;QACP,GAAG,EAAE,iBAAiB;QACtB,KAAK,EAAE,2BAAmB;QAC1B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;KAC3D,CAAC,CACH;SACA,GAAG,CAAC,CAAC,EAAE,mCAAmC,CAAC;CAC/C,CAAC,CAAC;AAEU,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,OAAO,EAAE,OAAC;SACP,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,iBAAiB,EAAE,KAAK,EAAE,2BAAmB,EAAE,CAAC,CAAC;SACvE,GAAG,CAAC,CAAC,EAAE,gCAAgC,CAAC;IAC3C,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;CACvD,CAAC,CAAC"}
|
|
@@ -8,6 +8,11 @@ export declare enum ResourceMaintenanceScheduleTriggerType {
|
|
|
8
8
|
/** Recurring (e.g. every N days) or one-off wall-clock threshold (e.g. after N hours since baseline). */
|
|
9
9
|
TIME_INTERVAL = "TIME_INTERVAL"
|
|
10
10
|
}
|
|
11
|
+
export declare enum ResourceMaintenanceScheduleDurationBasis {
|
|
12
|
+
SESSION_DURATION = "SESSION_DURATION",
|
|
13
|
+
/** All machine operation, including unattributed time. Keep the legacy storage/API value. */
|
|
14
|
+
ATTRIBUTABLE_OPERATING_DURATION = "ATTRIBUTABLE_OPERATING_DURATION"
|
|
15
|
+
}
|
|
11
16
|
export declare class ResourceMaintenanceSchedule {
|
|
12
17
|
id: number;
|
|
13
18
|
createdAt: Date;
|
|
@@ -16,6 +21,7 @@ export declare class ResourceMaintenanceSchedule {
|
|
|
16
21
|
resource: Resource;
|
|
17
22
|
name: string | null;
|
|
18
23
|
triggerType: ResourceMaintenanceScheduleTriggerType;
|
|
24
|
+
durationBasis: ResourceMaintenanceScheduleDurationBasis;
|
|
19
25
|
usageHoursConfig?: ResourceMaintenanceScheduleUsageHoursConfig | null;
|
|
20
26
|
usageCountConfig?: ResourceMaintenanceScheduleUsageCountConfig | null;
|
|
21
27
|
timeIntervalConfig?: ResourceMaintenanceScheduleTimeIntervalConfig | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResourceMaintenanceSchedule = exports.ResourceMaintenanceScheduleTriggerType = void 0;
|
|
3
|
+
exports.ResourceMaintenanceSchedule = exports.ResourceMaintenanceScheduleDurationBasis = exports.ResourceMaintenanceScheduleTriggerType = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const swagger_1 = require("@nestjs/swagger");
|
|
@@ -15,6 +15,12 @@ var ResourceMaintenanceScheduleTriggerType;
|
|
|
15
15
|
/** Recurring (e.g. every N days) or one-off wall-clock threshold (e.g. after N hours since baseline). */
|
|
16
16
|
ResourceMaintenanceScheduleTriggerType["TIME_INTERVAL"] = "TIME_INTERVAL";
|
|
17
17
|
})(ResourceMaintenanceScheduleTriggerType || (exports.ResourceMaintenanceScheduleTriggerType = ResourceMaintenanceScheduleTriggerType = {}));
|
|
18
|
+
var ResourceMaintenanceScheduleDurationBasis;
|
|
19
|
+
(function (ResourceMaintenanceScheduleDurationBasis) {
|
|
20
|
+
ResourceMaintenanceScheduleDurationBasis["SESSION_DURATION"] = "SESSION_DURATION";
|
|
21
|
+
/** All machine operation, including unattributed time. Keep the legacy storage/API value. */
|
|
22
|
+
ResourceMaintenanceScheduleDurationBasis["ATTRIBUTABLE_OPERATING_DURATION"] = "ATTRIBUTABLE_OPERATING_DURATION";
|
|
23
|
+
})(ResourceMaintenanceScheduleDurationBasis || (exports.ResourceMaintenanceScheduleDurationBasis = ResourceMaintenanceScheduleDurationBasis = {}));
|
|
18
24
|
let ResourceMaintenanceSchedule = class ResourceMaintenanceSchedule {
|
|
19
25
|
};
|
|
20
26
|
exports.ResourceMaintenanceSchedule = ResourceMaintenanceSchedule;
|
|
@@ -69,6 +75,20 @@ tslib_1.__decorate([
|
|
|
69
75
|
}),
|
|
70
76
|
tslib_1.__metadata("design:type", String)
|
|
71
77
|
], ResourceMaintenanceSchedule.prototype, "triggerType", void 0);
|
|
78
|
+
tslib_1.__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({
|
|
80
|
+
type: 'simple-enum',
|
|
81
|
+
enum: ResourceMaintenanceScheduleDurationBasis,
|
|
82
|
+
default: ResourceMaintenanceScheduleDurationBasis.SESSION_DURATION,
|
|
83
|
+
}),
|
|
84
|
+
(0, swagger_1.ApiProperty)({
|
|
85
|
+
description: 'The duration source used for USAGE_HOURS schedules',
|
|
86
|
+
enum: ResourceMaintenanceScheduleDurationBasis,
|
|
87
|
+
enumName: 'ResourceMaintenanceScheduleDurationBasis',
|
|
88
|
+
default: ResourceMaintenanceScheduleDurationBasis.SESSION_DURATION,
|
|
89
|
+
}),
|
|
90
|
+
tslib_1.__metadata("design:type", String)
|
|
91
|
+
], ResourceMaintenanceSchedule.prototype, "durationBasis", void 0);
|
|
72
92
|
tslib_1.__decorate([
|
|
73
93
|
(0, typeorm_1.OneToOne)(() => resource_maintenance_schedule_usage_hours_config_entity_1.ResourceMaintenanceScheduleUsageHoursConfig, (config) => config.schedule, { nullable: true }),
|
|
74
94
|
(0, swagger_1.ApiProperty)({ description: 'Config when triggerType is USAGE_HOURS', required: false }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-maintenance-schedule.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resource-maintenance-schedule.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAQiB;AACjB,6CAA8C;AAC9C,uDAA6C;AAC7C,uIAAwH;AACxH,uIAAwH;AACxH,2IAA4H;AAE5H,IAAY,sCAKX;AALD,WAAY,sCAAsC;IAChD,qEAA2B,CAAA;IAC3B,qEAA2B,CAAA;IAC3B,yGAAyG;IACzG,yEAA+B,CAAA;AACjC,CAAC,EALW,sCAAsC,sDAAtC,sCAAsC,QAKjD;AAGM,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;
|
|
1
|
+
{"version":3,"file":"resource-maintenance-schedule.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resource-maintenance-schedule.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAQiB;AACjB,6CAA8C;AAC9C,uDAA6C;AAC7C,uIAAwH;AACxH,uIAAwH;AACxH,2IAA4H;AAE5H,IAAY,sCAKX;AALD,WAAY,sCAAsC;IAChD,qEAA2B,CAAA;IAC3B,qEAA2B,CAAA;IAC3B,yGAAyG;IACzG,yEAA+B,CAAA;AACjC,CAAC,EALW,sCAAsC,sDAAtC,sCAAsC,QAKjD;AAED,IAAY,wCAIX;AAJD,WAAY,wCAAwC;IAClD,iFAAqC,CAAA;IACrC,6FAA6F;IAC7F,+GAAmE,CAAA;AACrE,CAAC,EAJW,wCAAwC,wDAAxC,wCAAwC,QAInD;AAGM,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;CAyFvC,CAAA;AAzFY,kEAA2B;AAMtC;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mDAAmD;QAChE,OAAO,EAAE,CAAC;KACX,CAAC;;uDACU;AAMZ;IAJC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX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,CAAC,qGAA2C,EACjD,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAC3B,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB;IACA,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCACrE,qGAA2C;qEAAQ;AAQtE;IANC,IAAA,kBAAQ,EACP,GAAG,EAAE,CAAC,qGAA2C,EACjD,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAC3B,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB;IACA,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCACrE,qGAA2C;qEAAQ;AAQtE;IANC,IAAA,kBAAQ,EACP,GAAG,EAAE,CAAC,yGAA6C,EACnD,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAC3B,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB;IACA,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0CAA0C,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCACrE,yGAA6C;uEAAQ;AAQ1E;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1C,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,iCAAiC;QAC9C,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KACd,CAAC;;4DACgB;sCAxFP,2BAA2B;IADvC,IAAA,gBAAM,GAAE;GACI,2BAA2B,CAyFvC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Resource } from './resource.entity';
|
|
2
|
+
/** A user-defined counter. Values use fixed-point billionths, with no physical unit. */
|
|
3
|
+
export declare class ResourceMeter {
|
|
4
|
+
id: number;
|
|
5
|
+
resourceId: number;
|
|
6
|
+
resource: Resource;
|
|
7
|
+
name: string;
|
|
8
|
+
creditsPerUnit: number;
|
|
9
|
+
lifetimeValue: string;
|
|
10
|
+
counterValue: string | null;
|
|
11
|
+
latestObservedAt: Date | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceMeter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const resource_entity_1 = require("./resource.entity");
|
|
7
|
+
/** A user-defined counter. Values use fixed-point billionths, with no physical unit. */
|
|
8
|
+
let ResourceMeter = class ResourceMeter {
|
|
9
|
+
};
|
|
10
|
+
exports.ResourceMeter = ResourceMeter;
|
|
11
|
+
tslib_1.__decorate([
|
|
12
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
13
|
+
tslib_1.__metadata("design:type", Number)
|
|
14
|
+
], ResourceMeter.prototype, "id", void 0);
|
|
15
|
+
tslib_1.__decorate([
|
|
16
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
17
|
+
tslib_1.__metadata("design:type", Number)
|
|
18
|
+
], ResourceMeter.prototype, "resourceId", void 0);
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, { onDelete: 'CASCADE' }),
|
|
21
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceId' }),
|
|
22
|
+
tslib_1.__metadata("design:type", resource_entity_1.Resource)
|
|
23
|
+
], ResourceMeter.prototype, "resource", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
27
|
+
], ResourceMeter.prototype, "name", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 0 }),
|
|
30
|
+
tslib_1.__metadata("design:type", Number)
|
|
31
|
+
], ResourceMeter.prototype, "creditsPerUnit", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: '0' }),
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
35
|
+
], ResourceMeter.prototype, "lifetimeValue", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
39
|
+
], ResourceMeter.prototype, "counterValue", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
42
|
+
tslib_1.__metadata("design:type", Date)
|
|
43
|
+
], ResourceMeter.prototype, "latestObservedAt", void 0);
|
|
44
|
+
exports.ResourceMeter = ResourceMeter = tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.Entity)(),
|
|
46
|
+
(0, typeorm_1.Index)('IDX_resource_meter_name', ['resourceId', 'name'], { unique: true })
|
|
47
|
+
], ResourceMeter);
|
|
48
|
+
//# sourceMappingURL=resource-meter.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-meter.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resource-meter.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA+F;AAC/F,uDAA6C;AAE7C,wFAAwF;AAGjF,IAAM,aAAa,GAAnB,MAAM,aAAa;CAyBzB,CAAA;AAzBY,sCAAa;AAExB;IADC,IAAA,gCAAsB,GAAE;;yCACb;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;iDACR;AAIpB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAClD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;sCACxB,0BAAQ;+CAAC;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;2CACd;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDAChB;AAGxB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;;oDACnB;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACf;AAG7B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC1B,IAAI;uDAAQ;wBAxBpB,aAAa;IAFzB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,yBAAyB,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GAC9D,aAAa,CAyBzB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ResourceMeter } from './resource-meter.entity';
|
|
2
|
+
import { Resource } from './resource.entity';
|
|
3
|
+
import { ResourceUsage } from './resourceUsage.entity';
|
|
4
|
+
export declare enum ResourceMeteringSessionStatus {
|
|
5
|
+
/** Metering is initialized; the usage is running (or being started). */
|
|
6
|
+
Active = "active",
|
|
7
|
+
/** The final total was collected and the meter charge is part of the usage bill. */
|
|
8
|
+
Settled = "settled",
|
|
9
|
+
/** The usage ended but no valid final total is available yet; retryable. */
|
|
10
|
+
Pending = "pending",
|
|
11
|
+
/** The final total can no longer be obtained (or was rejected); needs an operator decision. */
|
|
12
|
+
Failed = "failed",
|
|
13
|
+
/** An operator decided not to charge meter for this usage. */
|
|
14
|
+
Waived = "waived"
|
|
15
|
+
}
|
|
16
|
+
export type ResourceMeteringOperationKind = 'start' | 'interim' | 'final';
|
|
17
|
+
export type ResourceMeteringOperationStatus = 'pending' | 'completed' | 'failed' | 'expired';
|
|
18
|
+
/** Logical metering session: one per usage and meter. Meter values are integer billionths stored as text. */
|
|
19
|
+
export declare class ResourceMeteringSession {
|
|
20
|
+
id: string;
|
|
21
|
+
resourceId: number;
|
|
22
|
+
resource: Resource;
|
|
23
|
+
usageId: number;
|
|
24
|
+
usage: ResourceUsage;
|
|
25
|
+
status: ResourceMeteringSessionStatus;
|
|
26
|
+
meterId: number;
|
|
27
|
+
meter: ResourceMeter;
|
|
28
|
+
meterName: string;
|
|
29
|
+
/** Collection strategy captured at start, independent of later flow edits. */
|
|
30
|
+
collectionMode: 'requested' | 'increment';
|
|
31
|
+
/** Rate captured when the session started. */
|
|
32
|
+
creditsPerUnit: number;
|
|
33
|
+
/** Set when the start branch reported a lifetime-counter reading to subtract from later totals. */
|
|
34
|
+
baselineValue: string | null;
|
|
35
|
+
source: string | null;
|
|
36
|
+
/** Highest accepted total since the reset, used to reject counter decreases. */
|
|
37
|
+
latestValue: string | null;
|
|
38
|
+
latestObservedAt: Date | null;
|
|
39
|
+
consumedValue: string | null;
|
|
40
|
+
chargeCredits: number | null;
|
|
41
|
+
finalOperationId: string | null;
|
|
42
|
+
failureReason: string | null;
|
|
43
|
+
/** Set when the physical meter may have been reset for a different session; the total is unreliable. */
|
|
44
|
+
compromisedReason: string | null;
|
|
45
|
+
settledAt: Date | null;
|
|
46
|
+
createdAt: Date;
|
|
47
|
+
updatedAt: Date;
|
|
48
|
+
}
|
|
49
|
+
/** One request/reply to the flow-defined meter; the audit trail behind a charge. */
|
|
50
|
+
export declare class ResourceMeteringOperation {
|
|
51
|
+
id: string;
|
|
52
|
+
meterId: number;
|
|
53
|
+
meter: ResourceMeter;
|
|
54
|
+
sessionId: string | null;
|
|
55
|
+
session: ResourceMeteringSession;
|
|
56
|
+
resourceId: number;
|
|
57
|
+
kind: ResourceMeteringOperationKind;
|
|
58
|
+
status: ResourceMeteringOperationStatus;
|
|
59
|
+
requestedAt: Date;
|
|
60
|
+
completedAt: Date | null;
|
|
61
|
+
reportedValue: string | null;
|
|
62
|
+
readingMode: 'total' | 'increment' | null;
|
|
63
|
+
/** Total consumed since the session's reset (baseline already subtracted). */
|
|
64
|
+
totalValue: string | null;
|
|
65
|
+
observedAt: Date | null;
|
|
66
|
+
source: string | null;
|
|
67
|
+
error: string | null;
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceMeteringOperation = exports.ResourceMeteringSession = exports.ResourceMeteringSessionStatus = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const resource_meter_entity_1 = require("./resource-meter.entity");
|
|
7
|
+
const resource_entity_1 = require("./resource.entity");
|
|
8
|
+
const resourceUsage_entity_1 = require("./resourceUsage.entity");
|
|
9
|
+
var ResourceMeteringSessionStatus;
|
|
10
|
+
(function (ResourceMeteringSessionStatus) {
|
|
11
|
+
/** Metering is initialized; the usage is running (or being started). */
|
|
12
|
+
ResourceMeteringSessionStatus["Active"] = "active";
|
|
13
|
+
/** The final total was collected and the meter charge is part of the usage bill. */
|
|
14
|
+
ResourceMeteringSessionStatus["Settled"] = "settled";
|
|
15
|
+
/** The usage ended but no valid final total is available yet; retryable. */
|
|
16
|
+
ResourceMeteringSessionStatus["Pending"] = "pending";
|
|
17
|
+
/** The final total can no longer be obtained (or was rejected); needs an operator decision. */
|
|
18
|
+
ResourceMeteringSessionStatus["Failed"] = "failed";
|
|
19
|
+
/** An operator decided not to charge meter for this usage. */
|
|
20
|
+
ResourceMeteringSessionStatus["Waived"] = "waived";
|
|
21
|
+
})(ResourceMeteringSessionStatus || (exports.ResourceMeteringSessionStatus = ResourceMeteringSessionStatus = {}));
|
|
22
|
+
/** Logical metering session: one per usage and meter. Meter values are integer billionths stored as text. */
|
|
23
|
+
let ResourceMeteringSession = class ResourceMeteringSession {
|
|
24
|
+
};
|
|
25
|
+
exports.ResourceMeteringSession = ResourceMeteringSession;
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, typeorm_1.PrimaryColumn)({ type: 'varchar' }),
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
29
|
+
], ResourceMeteringSession.prototype, "id", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
32
|
+
tslib_1.__metadata("design:type", Number)
|
|
33
|
+
], ResourceMeteringSession.prototype, "resourceId", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, { onDelete: 'CASCADE' }),
|
|
36
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceId' }),
|
|
37
|
+
tslib_1.__metadata("design:type", resource_entity_1.Resource)
|
|
38
|
+
], ResourceMeteringSession.prototype, "resource", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
41
|
+
tslib_1.__metadata("design:type", Number)
|
|
42
|
+
], ResourceMeteringSession.prototype, "usageId", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, typeorm_1.ManyToOne)(() => resourceUsage_entity_1.ResourceUsage, { onDelete: 'CASCADE' }),
|
|
45
|
+
(0, typeorm_1.JoinColumn)({ name: 'usageId' }),
|
|
46
|
+
tslib_1.__metadata("design:type", resourceUsage_entity_1.ResourceUsage)
|
|
47
|
+
], ResourceMeteringSession.prototype, "usage", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], ResourceMeteringSession.prototype, "status", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
54
|
+
tslib_1.__metadata("design:type", Number)
|
|
55
|
+
], ResourceMeteringSession.prototype, "meterId", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.ManyToOne)(() => resource_meter_entity_1.ResourceMeter, { onDelete: 'CASCADE' }),
|
|
58
|
+
(0, typeorm_1.JoinColumn)({ name: 'meterId' }),
|
|
59
|
+
tslib_1.__metadata("design:type", resource_meter_entity_1.ResourceMeter)
|
|
60
|
+
], ResourceMeteringSession.prototype, "meter", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
63
|
+
tslib_1.__metadata("design:type", String)
|
|
64
|
+
], ResourceMeteringSession.prototype, "meterName", void 0);
|
|
65
|
+
tslib_1.__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: 'requested' }),
|
|
67
|
+
tslib_1.__metadata("design:type", String)
|
|
68
|
+
], ResourceMeteringSession.prototype, "collectionMode", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
71
|
+
tslib_1.__metadata("design:type", Number)
|
|
72
|
+
], ResourceMeteringSession.prototype, "creditsPerUnit", void 0);
|
|
73
|
+
tslib_1.__decorate([
|
|
74
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
75
|
+
tslib_1.__metadata("design:type", String)
|
|
76
|
+
], ResourceMeteringSession.prototype, "baselineValue", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
79
|
+
tslib_1.__metadata("design:type", String)
|
|
80
|
+
], ResourceMeteringSession.prototype, "source", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
83
|
+
tslib_1.__metadata("design:type", String)
|
|
84
|
+
], ResourceMeteringSession.prototype, "latestValue", void 0);
|
|
85
|
+
tslib_1.__decorate([
|
|
86
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
87
|
+
tslib_1.__metadata("design:type", Date)
|
|
88
|
+
], ResourceMeteringSession.prototype, "latestObservedAt", void 0);
|
|
89
|
+
tslib_1.__decorate([
|
|
90
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
91
|
+
tslib_1.__metadata("design:type", String)
|
|
92
|
+
], ResourceMeteringSession.prototype, "consumedValue", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
95
|
+
tslib_1.__metadata("design:type", Number)
|
|
96
|
+
], ResourceMeteringSession.prototype, "chargeCredits", void 0);
|
|
97
|
+
tslib_1.__decorate([
|
|
98
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
99
|
+
tslib_1.__metadata("design:type", String)
|
|
100
|
+
], ResourceMeteringSession.prototype, "finalOperationId", void 0);
|
|
101
|
+
tslib_1.__decorate([
|
|
102
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
103
|
+
tslib_1.__metadata("design:type", String)
|
|
104
|
+
], ResourceMeteringSession.prototype, "failureReason", void 0);
|
|
105
|
+
tslib_1.__decorate([
|
|
106
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
107
|
+
tslib_1.__metadata("design:type", String)
|
|
108
|
+
], ResourceMeteringSession.prototype, "compromisedReason", void 0);
|
|
109
|
+
tslib_1.__decorate([
|
|
110
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
111
|
+
tslib_1.__metadata("design:type", Date)
|
|
112
|
+
], ResourceMeteringSession.prototype, "settledAt", void 0);
|
|
113
|
+
tslib_1.__decorate([
|
|
114
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
115
|
+
tslib_1.__metadata("design:type", Date)
|
|
116
|
+
], ResourceMeteringSession.prototype, "createdAt", void 0);
|
|
117
|
+
tslib_1.__decorate([
|
|
118
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
119
|
+
tslib_1.__metadata("design:type", Date)
|
|
120
|
+
], ResourceMeteringSession.prototype, "updatedAt", void 0);
|
|
121
|
+
exports.ResourceMeteringSession = ResourceMeteringSession = tslib_1.__decorate([
|
|
122
|
+
(0, typeorm_1.Entity)(),
|
|
123
|
+
(0, typeorm_1.Index)('IDX_resource_metering_session_usage', ['usageId', 'meterId'], { unique: true }),
|
|
124
|
+
(0, typeorm_1.Index)('IDX_resource_metering_session_resource', ['resourceId'])
|
|
125
|
+
], ResourceMeteringSession);
|
|
126
|
+
/** One request/reply to the flow-defined meter; the audit trail behind a charge. */
|
|
127
|
+
let ResourceMeteringOperation = class ResourceMeteringOperation {
|
|
128
|
+
};
|
|
129
|
+
exports.ResourceMeteringOperation = ResourceMeteringOperation;
|
|
130
|
+
tslib_1.__decorate([
|
|
131
|
+
(0, typeorm_1.PrimaryColumn)({ type: 'varchar' }),
|
|
132
|
+
tslib_1.__metadata("design:type", String)
|
|
133
|
+
], ResourceMeteringOperation.prototype, "id", void 0);
|
|
134
|
+
tslib_1.__decorate([
|
|
135
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
136
|
+
tslib_1.__metadata("design:type", Number)
|
|
137
|
+
], ResourceMeteringOperation.prototype, "meterId", void 0);
|
|
138
|
+
tslib_1.__decorate([
|
|
139
|
+
(0, typeorm_1.ManyToOne)(() => resource_meter_entity_1.ResourceMeter, { onDelete: 'CASCADE' }),
|
|
140
|
+
(0, typeorm_1.JoinColumn)({ name: 'meterId' }),
|
|
141
|
+
tslib_1.__metadata("design:type", resource_meter_entity_1.ResourceMeter)
|
|
142
|
+
], ResourceMeteringOperation.prototype, "meter", void 0);
|
|
143
|
+
tslib_1.__decorate([
|
|
144
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
145
|
+
tslib_1.__metadata("design:type", String)
|
|
146
|
+
], ResourceMeteringOperation.prototype, "sessionId", void 0);
|
|
147
|
+
tslib_1.__decorate([
|
|
148
|
+
(0, typeorm_1.ManyToOne)(() => ResourceMeteringSession, { onDelete: 'CASCADE' }),
|
|
149
|
+
(0, typeorm_1.JoinColumn)({ name: 'sessionId' }),
|
|
150
|
+
tslib_1.__metadata("design:type", ResourceMeteringSession)
|
|
151
|
+
], ResourceMeteringOperation.prototype, "session", void 0);
|
|
152
|
+
tslib_1.__decorate([
|
|
153
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
154
|
+
tslib_1.__metadata("design:type", Number)
|
|
155
|
+
], ResourceMeteringOperation.prototype, "resourceId", void 0);
|
|
156
|
+
tslib_1.__decorate([
|
|
157
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
158
|
+
tslib_1.__metadata("design:type", String)
|
|
159
|
+
], ResourceMeteringOperation.prototype, "kind", void 0);
|
|
160
|
+
tslib_1.__decorate([
|
|
161
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
162
|
+
tslib_1.__metadata("design:type", String)
|
|
163
|
+
], ResourceMeteringOperation.prototype, "status", void 0);
|
|
164
|
+
tslib_1.__decorate([
|
|
165
|
+
(0, typeorm_1.Column)({ type: 'datetime' }),
|
|
166
|
+
tslib_1.__metadata("design:type", Date)
|
|
167
|
+
], ResourceMeteringOperation.prototype, "requestedAt", void 0);
|
|
168
|
+
tslib_1.__decorate([
|
|
169
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
170
|
+
tslib_1.__metadata("design:type", Date)
|
|
171
|
+
], ResourceMeteringOperation.prototype, "completedAt", void 0);
|
|
172
|
+
tslib_1.__decorate([
|
|
173
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
174
|
+
tslib_1.__metadata("design:type", String)
|
|
175
|
+
], ResourceMeteringOperation.prototype, "reportedValue", void 0);
|
|
176
|
+
tslib_1.__decorate([
|
|
177
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
178
|
+
tslib_1.__metadata("design:type", String)
|
|
179
|
+
], ResourceMeteringOperation.prototype, "readingMode", void 0);
|
|
180
|
+
tslib_1.__decorate([
|
|
181
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
182
|
+
tslib_1.__metadata("design:type", String)
|
|
183
|
+
], ResourceMeteringOperation.prototype, "totalValue", void 0);
|
|
184
|
+
tslib_1.__decorate([
|
|
185
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
186
|
+
tslib_1.__metadata("design:type", Date)
|
|
187
|
+
], ResourceMeteringOperation.prototype, "observedAt", void 0);
|
|
188
|
+
tslib_1.__decorate([
|
|
189
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
190
|
+
tslib_1.__metadata("design:type", String)
|
|
191
|
+
], ResourceMeteringOperation.prototype, "source", void 0);
|
|
192
|
+
tslib_1.__decorate([
|
|
193
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
194
|
+
tslib_1.__metadata("design:type", String)
|
|
195
|
+
], ResourceMeteringOperation.prototype, "error", void 0);
|
|
196
|
+
tslib_1.__decorate([
|
|
197
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
198
|
+
tslib_1.__metadata("design:type", Date)
|
|
199
|
+
], ResourceMeteringOperation.prototype, "createdAt", void 0);
|
|
200
|
+
exports.ResourceMeteringOperation = ResourceMeteringOperation = tslib_1.__decorate([
|
|
201
|
+
(0, typeorm_1.Entity)(),
|
|
202
|
+
(0, typeorm_1.Index)('IDX_resource_metering_operation_session', ['sessionId'])
|
|
203
|
+
], ResourceMeteringOperation);
|
|
204
|
+
//# sourceMappingURL=resource-metering.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-metering.entity.js","sourceRoot":"","sources":["../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ACnD,yBAAyB,CAsDrC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Resource } from './resource.entity';
|
|
2
|
+
export declare class ResourceOperatingInterval {
|
|
3
|
+
id: number;
|
|
4
|
+
resourceId: number;
|
|
5
|
+
startTime: Date;
|
|
6
|
+
endTime: Date | null;
|
|
7
|
+
startFlowNodeId: string | null;
|
|
8
|
+
startFlowRunId: string | null;
|
|
9
|
+
endFlowNodeId: string | null;
|
|
10
|
+
endFlowRunId: string | null;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
resource: Resource;
|
|
13
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceOperatingInterval = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const resource_entity_1 = require("./resource.entity");
|
|
8
|
+
let ResourceOperatingInterval = class ResourceOperatingInterval {
|
|
9
|
+
};
|
|
10
|
+
exports.ResourceOperatingInterval = ResourceOperatingInterval;
|
|
11
|
+
tslib_1.__decorate([
|
|
12
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
13
|
+
(0, swagger_1.ApiProperty)({ description: 'The unique identifier of the operating interval', example: 1 }),
|
|
14
|
+
tslib_1.__metadata("design:type", Number)
|
|
15
|
+
], ResourceOperatingInterval.prototype, "id", void 0);
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
18
|
+
(0, swagger_1.ApiProperty)({ description: 'The resource being operated', example: 1 }),
|
|
19
|
+
tslib_1.__metadata("design:type", Number)
|
|
20
|
+
], ResourceOperatingInterval.prototype, "resourceId", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: 'datetime' }),
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: 'UTC instant at which operation began', format: 'date-time' }),
|
|
24
|
+
tslib_1.__metadata("design:type", Date)
|
|
25
|
+
], ResourceOperatingInterval.prototype, "startTime", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
28
|
+
(0, swagger_1.ApiProperty)({ description: 'UTC instant at which operation ended', format: 'date-time', nullable: true }),
|
|
29
|
+
tslib_1.__metadata("design:type", Date)
|
|
30
|
+
], ResourceOperatingInterval.prototype, "endTime", void 0);
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
33
|
+
(0, swagger_1.ApiProperty)({ description: 'Flow node that opened this interval, if recorded', nullable: true }),
|
|
34
|
+
tslib_1.__metadata("design:type", String)
|
|
35
|
+
], ResourceOperatingInterval.prototype, "startFlowNodeId", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
38
|
+
(0, swagger_1.ApiProperty)({ description: 'Flow execution that opened this interval, if recorded', nullable: true }),
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
40
|
+
], ResourceOperatingInterval.prototype, "startFlowRunId", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
43
|
+
(0, swagger_1.ApiProperty)({ description: 'Flow node that closed this interval, if recorded', nullable: true }),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], ResourceOperatingInterval.prototype, "endFlowNodeId", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
48
|
+
(0, swagger_1.ApiProperty)({ description: 'Flow execution that closed this interval, if recorded', nullable: true }),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], ResourceOperatingInterval.prototype, "endFlowRunId", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
53
|
+
tslib_1.__metadata("design:type", Date)
|
|
54
|
+
], ResourceOperatingInterval.prototype, "createdAt", void 0);
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, (resource) => resource.operatingIntervals, { onDelete: 'CASCADE' }),
|
|
57
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceId' }),
|
|
58
|
+
tslib_1.__metadata("design:type", resource_entity_1.Resource)
|
|
59
|
+
], ResourceOperatingInterval.prototype, "resource", void 0);
|
|
60
|
+
exports.ResourceOperatingInterval = ResourceOperatingInterval = tslib_1.__decorate([
|
|
61
|
+
(0, typeorm_1.Index)('IDX_resource_operating_interval_resourceId_endTime', ['resourceId', 'endTime']),
|
|
62
|
+
(0, typeorm_1.Index)('IDX_resource_operating_interval_resourceId_startTime_id', ['resourceId', 'startTime', 'id']),
|
|
63
|
+
(0, typeorm_1.Entity)()
|
|
64
|
+
], ResourceOperatingInterval);
|
|
65
|
+
//# sourceMappingURL=resource-operating-interval.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-operating-interval.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resource-operating-interval.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAiH;AACjH,6CAA8C;AAC9C,uDAA6C;AAKtC,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;CAwCrC,CAAA;AAxCY,8DAAyB;AAGpC;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iDAAiD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;qDAChF;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC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CAAC;;+DACzE;AAG7B;IADC,IAAA,0BAAgB,GAAE;sCACP,IAAI;4DAAC;AAIjB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC7F,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;sCACxB,0BAAQ;2DAAC;oCAvCT,yBAAyB;IAHrC,IAAA,eAAK,EAAC,oDAAoD,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACtF,IAAA,eAAK,EAAC,yDAAyD,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IACnG,IAAA,gBAAM,GAAE;GACI,yBAAyB,CAwCrC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Resource } from './resource.entity';
|
|
2
|
+
import { FormSubmission } from './form';
|
|
3
|
+
import { BillingTransactionItem } from './billing-transaction-item.entity';
|
|
4
|
+
export type LifecycleBillingItem = Pick<BillingTransactionItem, 'name' | 'description' | 'externalReference' | 'unitPrice' | 'quantity'> & {
|
|
5
|
+
usageId: number;
|
|
6
|
+
};
|
|
7
|
+
/** A reservation, never a completed usage or bill. Interrupted attempts are aborted, not replayed. */
|
|
8
|
+
export declare class ResourceUsageLifecycleAttempt {
|
|
9
|
+
id: string;
|
|
10
|
+
resourceId: number;
|
|
11
|
+
resource: Resource;
|
|
12
|
+
kind: 'start' | 'end' | 'takeover';
|
|
13
|
+
candidateUsageId: number | null;
|
|
14
|
+
previousUsageId: number | null;
|
|
15
|
+
transitionTime: Date;
|
|
16
|
+
formSubmissions: FormSubmission[];
|
|
17
|
+
billingItems: LifecycleBillingItem[];
|
|
18
|
+
createdAt: Date;
|
|
19
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceUsageLifecycleAttempt = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const resource_entity_1 = require("./resource.entity");
|
|
7
|
+
/** A reservation, never a completed usage or bill. Interrupted attempts are aborted, not replayed. */
|
|
8
|
+
let ResourceUsageLifecycleAttempt = class ResourceUsageLifecycleAttempt {
|
|
9
|
+
};
|
|
10
|
+
exports.ResourceUsageLifecycleAttempt = ResourceUsageLifecycleAttempt;
|
|
11
|
+
tslib_1.__decorate([
|
|
12
|
+
(0, typeorm_1.PrimaryColumn)({ type: 'varchar' }),
|
|
13
|
+
tslib_1.__metadata("design:type", String)
|
|
14
|
+
], ResourceUsageLifecycleAttempt.prototype, "id", void 0);
|
|
15
|
+
tslib_1.__decorate([
|
|
16
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
17
|
+
tslib_1.__metadata("design:type", Number)
|
|
18
|
+
], ResourceUsageLifecycleAttempt.prototype, "resourceId", void 0);
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, { onDelete: 'CASCADE' }),
|
|
21
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceId' }),
|
|
22
|
+
tslib_1.__metadata("design:type", resource_entity_1.Resource)
|
|
23
|
+
], ResourceUsageLifecycleAttempt.prototype, "resource", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'varchar' }),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
27
|
+
], ResourceUsageLifecycleAttempt.prototype, "kind", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
30
|
+
tslib_1.__metadata("design:type", Number)
|
|
31
|
+
], ResourceUsageLifecycleAttempt.prototype, "candidateUsageId", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'integer', nullable: true }),
|
|
34
|
+
tslib_1.__metadata("design:type", Number)
|
|
35
|
+
], ResourceUsageLifecycleAttempt.prototype, "previousUsageId", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'datetime' }),
|
|
38
|
+
tslib_1.__metadata("design:type", Date)
|
|
39
|
+
], ResourceUsageLifecycleAttempt.prototype, "transitionTime", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'simple-json' }),
|
|
42
|
+
tslib_1.__metadata("design:type", Array)
|
|
43
|
+
], ResourceUsageLifecycleAttempt.prototype, "formSubmissions", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'simple-json' }),
|
|
46
|
+
tslib_1.__metadata("design:type", Array)
|
|
47
|
+
], ResourceUsageLifecycleAttempt.prototype, "billingItems", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
50
|
+
tslib_1.__metadata("design:type", Date)
|
|
51
|
+
], ResourceUsageLifecycleAttempt.prototype, "createdAt", void 0);
|
|
52
|
+
exports.ResourceUsageLifecycleAttempt = ResourceUsageLifecycleAttempt = tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.Entity)(),
|
|
54
|
+
(0, typeorm_1.Index)('IDX_resource_usage_lifecycle_attempt_resource', ['resourceId']),
|
|
55
|
+
(0, typeorm_1.Index)('IDX_resource_usage_lifecycle_attempt_candidate', ['candidateUsageId'], { unique: true }),
|
|
56
|
+
(0, typeorm_1.Index)('IDX_resource_usage_lifecycle_attempt_previous', ['previousUsageId'], { unique: true })
|
|
57
|
+
], ResourceUsageLifecycleAttempt);
|
|
58
|
+
//# sourceMappingURL=resource-usage-lifecycle-attempt.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-usage-lifecycle-attempt.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resource-usage-lifecycle-attempt.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAwG;AACxG,uDAA6C;AAS7C,sGAAsG;AAK/F,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;CA+BzC,CAAA;AA/BY,sEAA6B;AAExC;IADC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yDACvB;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;iEACR;AAIpB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAClD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;sCACxB,0BAAQ;+DAAC;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;2DACQ;AAGpC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uEACX;AAGjC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sEACZ;AAGhC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;sCACZ,IAAI;qEAAC;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;sEACG;AAGnC;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;;mEACM;AAGtC;IADC,IAAA,0BAAgB,GAAE;sCACP,IAAI;gEAAC;wCA9BN,6BAA6B;IAJzC,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,+CAA+C,EAAE,CAAC,Y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