@likewatt/models 1.148.0 → 1.149.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.
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Événement de cycle de vie d'un compte (user) Aurora, tel que la gateway
|
|
3
|
+
* l'a provoqué ou constaté.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum AuroraAccountEvent {
|
|
6
|
+
/** User Aurora invité et rattaché à l'utilisateur Optiwize. */
|
|
7
|
+
CREATED = "CREATED",
|
|
8
|
+
/**
|
|
9
|
+
* Invitation renvoyée. Aurora n'ayant pas de vrai renvoi, l'ancien user est
|
|
10
|
+
* désactivé et un nouveau est invité : `previousAuroraUserId` → `auroraUserId`.
|
|
11
|
+
*/
|
|
12
|
+
INVITATION_RESENT = "INVITATION_RESENT",
|
|
13
|
+
/** User Aurora désactivé (droit retiré, compte Optiwize supprimé). */
|
|
14
|
+
REVOKED = "REVOKED",
|
|
15
|
+
/**
|
|
16
|
+
* Identité Aurora oubliée côté Optiwize sans action de notre part : user
|
|
17
|
+
* supprimé chez Aurora (404), ou désactivé par un renvoi d'invitation qui
|
|
18
|
+
* a échoué.
|
|
19
|
+
*/
|
|
20
|
+
FORGOTTEN = "FORGOTTEN"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Journal des comptes Aurora des utilisateurs (monitoring admin, KO-919).
|
|
24
|
+
*
|
|
25
|
+
* Une ligne = un événement. L'API Aurora ne fournit aucune date de création de
|
|
26
|
+
* user (et ses ids sont des UUID v4) : ce journal est la seule source datée de
|
|
27
|
+
* l'historique d'un compte. `userEmail`, `principalId` et `workspaceId` sont
|
|
28
|
+
* figés au moment de l'événement et peuvent être nuls (compte Optiwize déjà
|
|
29
|
+
* supprimé).
|
|
30
|
+
*/
|
|
31
|
+
export declare class AuroraAccountLog {
|
|
32
|
+
id: number;
|
|
33
|
+
event: AuroraAccountEvent;
|
|
34
|
+
/** Utilisateur Optiwize titulaire du compte Aurora. */
|
|
35
|
+
userId: string;
|
|
36
|
+
userEmail?: string | null;
|
|
37
|
+
/** Compte principal (titulaire) de l'organisation de l'utilisateur. */
|
|
38
|
+
principalId?: string | null;
|
|
39
|
+
workspaceId?: string | null;
|
|
40
|
+
/** User Aurora concerné (le NOUVEAU pour un renvoi d'invitation). */
|
|
41
|
+
auroraUserId?: string | null;
|
|
42
|
+
/** User Aurora désactivé par un renvoi d'invitation. */
|
|
43
|
+
previousAuroraUserId?: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Précision libre sur l'origine de l'événement (ex. `deleted`,
|
|
46
|
+
* `right_removed`, `aurora_not_found`). VARCHAR et non ENUM : une nouvelle
|
|
47
|
+
* cause ne doit pas faire échouer l'écriture d'une ligne de traçage.
|
|
48
|
+
*/
|
|
49
|
+
reason?: string | null;
|
|
50
|
+
/** Date de l'événement (transmise par la gateway). */
|
|
51
|
+
createdAt?: Date;
|
|
52
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AuroraAccountLog = exports.AuroraAccountEvent = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
/**
|
|
15
|
+
* Événement de cycle de vie d'un compte (user) Aurora, tel que la gateway
|
|
16
|
+
* l'a provoqué ou constaté.
|
|
17
|
+
*/
|
|
18
|
+
var AuroraAccountEvent;
|
|
19
|
+
(function (AuroraAccountEvent) {
|
|
20
|
+
/** User Aurora invité et rattaché à l'utilisateur Optiwize. */
|
|
21
|
+
AuroraAccountEvent["CREATED"] = "CREATED";
|
|
22
|
+
/**
|
|
23
|
+
* Invitation renvoyée. Aurora n'ayant pas de vrai renvoi, l'ancien user est
|
|
24
|
+
* désactivé et un nouveau est invité : `previousAuroraUserId` → `auroraUserId`.
|
|
25
|
+
*/
|
|
26
|
+
AuroraAccountEvent["INVITATION_RESENT"] = "INVITATION_RESENT";
|
|
27
|
+
/** User Aurora désactivé (droit retiré, compte Optiwize supprimé). */
|
|
28
|
+
AuroraAccountEvent["REVOKED"] = "REVOKED";
|
|
29
|
+
/**
|
|
30
|
+
* Identité Aurora oubliée côté Optiwize sans action de notre part : user
|
|
31
|
+
* supprimé chez Aurora (404), ou désactivé par un renvoi d'invitation qui
|
|
32
|
+
* a échoué.
|
|
33
|
+
*/
|
|
34
|
+
AuroraAccountEvent["FORGOTTEN"] = "FORGOTTEN";
|
|
35
|
+
})(AuroraAccountEvent || (exports.AuroraAccountEvent = AuroraAccountEvent = {}));
|
|
36
|
+
/**
|
|
37
|
+
* Journal des comptes Aurora des utilisateurs (monitoring admin, KO-919).
|
|
38
|
+
*
|
|
39
|
+
* Une ligne = un événement. L'API Aurora ne fournit aucune date de création de
|
|
40
|
+
* user (et ses ids sont des UUID v4) : ce journal est la seule source datée de
|
|
41
|
+
* l'historique d'un compte. `userEmail`, `principalId` et `workspaceId` sont
|
|
42
|
+
* figés au moment de l'événement et peuvent être nuls (compte Optiwize déjà
|
|
43
|
+
* supprimé).
|
|
44
|
+
*/
|
|
45
|
+
let AuroraAccountLog = class AuroraAccountLog {
|
|
46
|
+
};
|
|
47
|
+
exports.AuroraAccountLog = AuroraAccountLog;
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ type: 'bigint' }),
|
|
50
|
+
__metadata("design:type", Number)
|
|
51
|
+
], AuroraAccountLog.prototype, "id", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({
|
|
54
|
+
name: 'event',
|
|
55
|
+
type: 'enum',
|
|
56
|
+
enum: AuroraAccountEvent,
|
|
57
|
+
nullable: false,
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], AuroraAccountLog.prototype, "event", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ name: 'user_id', type: 'varchar', length: 64, nullable: false }),
|
|
63
|
+
__metadata("design:type", String)
|
|
64
|
+
], AuroraAccountLog.prototype, "userId", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.Column)({
|
|
67
|
+
name: 'user_email',
|
|
68
|
+
type: 'varchar',
|
|
69
|
+
length: 320,
|
|
70
|
+
nullable: true,
|
|
71
|
+
}),
|
|
72
|
+
__metadata("design:type", Object)
|
|
73
|
+
], AuroraAccountLog.prototype, "userEmail", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.Column)({
|
|
76
|
+
name: 'principal_id',
|
|
77
|
+
type: 'varchar',
|
|
78
|
+
length: 64,
|
|
79
|
+
nullable: true,
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", Object)
|
|
82
|
+
], AuroraAccountLog.prototype, "principalId", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({
|
|
85
|
+
name: 'workspace_id',
|
|
86
|
+
type: 'varchar',
|
|
87
|
+
length: 64,
|
|
88
|
+
nullable: true,
|
|
89
|
+
}),
|
|
90
|
+
__metadata("design:type", Object)
|
|
91
|
+
], AuroraAccountLog.prototype, "workspaceId", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({
|
|
94
|
+
name: 'aurora_user_id',
|
|
95
|
+
type: 'varchar',
|
|
96
|
+
length: 64,
|
|
97
|
+
nullable: true,
|
|
98
|
+
}),
|
|
99
|
+
__metadata("design:type", Object)
|
|
100
|
+
], AuroraAccountLog.prototype, "auroraUserId", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, typeorm_1.Column)({
|
|
103
|
+
name: 'previous_aurora_user_id',
|
|
104
|
+
type: 'varchar',
|
|
105
|
+
length: 64,
|
|
106
|
+
nullable: true,
|
|
107
|
+
}),
|
|
108
|
+
__metadata("design:type", Object)
|
|
109
|
+
], AuroraAccountLog.prototype, "previousAuroraUserId", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, typeorm_1.Column)({ name: 'reason', type: 'varchar', length: 64, nullable: true }),
|
|
112
|
+
__metadata("design:type", Object)
|
|
113
|
+
], AuroraAccountLog.prototype, "reason", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
|
|
116
|
+
__metadata("design:type", Date)
|
|
117
|
+
], AuroraAccountLog.prototype, "createdAt", void 0);
|
|
118
|
+
exports.AuroraAccountLog = AuroraAccountLog = __decorate([
|
|
119
|
+
(0, typeorm_1.Entity)('aurora_account_log'),
|
|
120
|
+
(0, typeorm_1.Index)('idx_aurora_account_log_user_created', ['userId', 'createdAt']),
|
|
121
|
+
(0, typeorm_1.Index)('idx_aurora_account_log_principal_created', ['principalId', 'createdAt']),
|
|
122
|
+
(0, typeorm_1.Index)('idx_aurora_account_log_aurora_user', ['auroraUserId']),
|
|
123
|
+
(0, typeorm_1.Index)('idx_aurora_account_log_created', ['createdAt'])
|
|
124
|
+
], AuroraAccountLog);
|
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export * from './core/TypeORM/KoncileOcrLog';
|
|
|
42
42
|
export * from './core/TypeORM/AssistantLlmLog';
|
|
43
43
|
export * from './core/TypeORM/WebhookOutput';
|
|
44
44
|
export * from './core/TypeORM/AdminActionLog';
|
|
45
|
+
export * from './core/TypeORM/AuroraAccountLog';
|
|
45
46
|
export { EnedisReportAcquisitionMethod, EnedisReportOperationType, ExtractionSens, ExtractionType, ExtractionSource, } from './core/TypeORM/EnedisReportHistory';
|
|
46
47
|
export * from './core/internal/enums';
|
|
47
48
|
export * from './core/enums/BuildingDataStatus';
|
package/dist/index.js
CHANGED
|
@@ -61,6 +61,7 @@ __exportStar(require("./core/TypeORM/KoncileOcrLog"), exports);
|
|
|
61
61
|
__exportStar(require("./core/TypeORM/AssistantLlmLog"), exports);
|
|
62
62
|
__exportStar(require("./core/TypeORM/WebhookOutput"), exports);
|
|
63
63
|
__exportStar(require("./core/TypeORM/AdminActionLog"), exports);
|
|
64
|
+
__exportStar(require("./core/TypeORM/AuroraAccountLog"), exports);
|
|
64
65
|
// TypeORM enums
|
|
65
66
|
var EnedisReportHistory_1 = require("./core/TypeORM/EnedisReportHistory");
|
|
66
67
|
Object.defineProperty(exports, "EnedisReportAcquisitionMethod", { enumerable: true, get: function () { return EnedisReportHistory_1.EnedisReportAcquisitionMethod; } });
|