@attraccess/plugin-wago 0.1.0-alpha.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/index.js +63750 -0
- package/dist/migrations.js +384 -0
- package/dist/signing-public-key.pub +1 -0
- package/frontend/__federation_expose_Plugin-BoHSTQq7.js +7543 -0
- package/frontend/__federation_fn_import-DAGm_xmC.js +2 -0
- package/frontend/_virtual___federation_fn_import-BXODRNto.js +261 -0
- package/frontend/index.html +8 -0
- package/frontend/jsx-runtime-DFPsoQIN.js +42 -0
- package/frontend/preload-helper-DxWiKyOd.js +68 -0
- package/frontend/react-Cr_hTkIJ.js +383 -0
- package/frontend/remoteEntry.js +74 -0
- package/frontend/rolldown-runtime-DC62tzP2.js +33 -0
- package/frontend/style.css +624 -0
- package/package.json +47 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
20
|
+
|
|
21
|
+
// backend/migrations.ts
|
|
22
|
+
var migrations_exports = {};
|
|
23
|
+
__export(migrations_exports, {
|
|
24
|
+
AddWagoClaimIntent1780010600000: () => AddWagoClaimIntent1780010600000,
|
|
25
|
+
AddWagoCommissioningClaimDetails1780000000006: () => AddWagoCommissioningClaimDetails1780000000006,
|
|
26
|
+
AddWagoCommissioningDeliveryToken1780000000008: () => AddWagoCommissioningDeliveryToken1780000000008,
|
|
27
|
+
AddWagoCommissioningEnrollment1780000000005: () => AddWagoCommissioningEnrollment1780000000005,
|
|
28
|
+
AddWagoCommissioningPrincipal1780000000009: () => AddWagoCommissioningPrincipal1780000000009,
|
|
29
|
+
AddWagoCommissioningProgress1780000000007: () => AddWagoCommissioningProgress1780000000007,
|
|
30
|
+
AddWagoCommissioningSessions1780000000004: () => AddWagoCommissioningSessions1780000000004,
|
|
31
|
+
AddWagoConfigurationRevisions1780000000002: () => AddWagoConfigurationRevisions1780000000002,
|
|
32
|
+
AddWagoEnrollmentRevocation1780000000001: () => AddWagoEnrollmentRevocation1780000000001,
|
|
33
|
+
AddWagoPresetProvenance1780000000003: () => AddWagoPresetProvenance1780000000003,
|
|
34
|
+
AddWagoRejectionAcknowledgement1780010630000: () => AddWagoRejectionAcknowledgement1780010630000,
|
|
35
|
+
AddWagoRevisionEditorMetadata1780010580000: () => AddWagoRevisionEditorMetadata1780010580000,
|
|
36
|
+
CreateWagoControllers1780000000000: () => CreateWagoControllers1780000000000,
|
|
37
|
+
WagoCommissioningLease1780000000011: () => WagoCommissioningLease1780000000011,
|
|
38
|
+
WagoCredentialRotation1780010610000: () => WagoCredentialRotation1780010610000,
|
|
39
|
+
WagoManagement1780000000010: () => WagoManagement1780000000010
|
|
40
|
+
});
|
|
41
|
+
module.exports = __toCommonJS(migrations_exports);
|
|
42
|
+
|
|
43
|
+
// backend/migrations/1780000000000-create-wago-controllers.ts
|
|
44
|
+
var CreateWagoControllers1780000000000 = class {
|
|
45
|
+
constructor() {
|
|
46
|
+
__publicField(this, "name", "CreateWagoControllers1780000000000");
|
|
47
|
+
}
|
|
48
|
+
async up(queryRunner) {
|
|
49
|
+
await queryRunner.query(`CREATE TABLE IF NOT EXISTS "plugin_wago_controllers" (
|
|
50
|
+
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "hardware_id" varchar NOT NULL,
|
|
51
|
+
"trust_state" varchar NOT NULL, "name" varchar, "mqtt_server_id" integer, "enrollment_id" integer,
|
|
52
|
+
"pairing_code_hash" varchar NOT NULL, "fingerprint" varchar,
|
|
53
|
+
"protocol_version" varchar NOT NULL, "runtime_version" varchar NOT NULL,
|
|
54
|
+
"capabilities" varchar NOT NULL, "last_sequence" integer NOT NULL DEFAULT (0),
|
|
55
|
+
"last_heartbeat_at" varchar, "last_seen_at" varchar NOT NULL,
|
|
56
|
+
"compatibility_error" varchar, "created_at" varchar NOT NULL, "updated_at" varchar NOT NULL,
|
|
57
|
+
CONSTRAINT "UQ_plugin_wago_controllers_hardware_id" UNIQUE ("hardware_id"))`);
|
|
58
|
+
await queryRunner.query(`CREATE TABLE IF NOT EXISTS "plugin_wago_settings" (
|
|
59
|
+
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "default_mqtt_server_id" integer)`);
|
|
60
|
+
await queryRunner.query(`CREATE TABLE IF NOT EXISTS "plugin_wago_enrollments" (
|
|
61
|
+
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "mqtt_server_id" integer NOT NULL, "hardware_id" varchar NOT NULL,
|
|
62
|
+
"secret_hash" varchar NOT NULL, "identity" varchar NOT NULL, "created_at" varchar NOT NULL,
|
|
63
|
+
"expires_at" varchar NOT NULL, "consumed_at" varchar, CONSTRAINT "UQ_plugin_wago_enrollments_secret_hash" UNIQUE ("secret_hash"))`);
|
|
64
|
+
await queryRunner.query(
|
|
65
|
+
'CREATE INDEX IF NOT EXISTS "IDX_plugin_wago_enrollments_active" ON "plugin_wago_enrollments" ("consumed_at", "expires_at")'
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
async down(queryRunner) {
|
|
69
|
+
await queryRunner.query('DROP INDEX IF EXISTS "IDX_plugin_wago_enrollments_active"');
|
|
70
|
+
await queryRunner.query('DROP TABLE "plugin_wago_enrollments"');
|
|
71
|
+
await queryRunner.query('DROP TABLE "plugin_wago_settings"');
|
|
72
|
+
await queryRunner.query('DROP TABLE "plugin_wago_controllers"');
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// backend/migrations/1780000000001-add-wago-enrollment-revocation.ts
|
|
77
|
+
var AddWagoEnrollmentRevocation1780000000001 = class {
|
|
78
|
+
constructor() {
|
|
79
|
+
__publicField(this, "name", "AddWagoEnrollmentRevocation1780000000001");
|
|
80
|
+
}
|
|
81
|
+
async up(queryRunner) {
|
|
82
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_enrollments" ADD COLUMN "revoked_at" varchar');
|
|
83
|
+
}
|
|
84
|
+
async down(queryRunner) {
|
|
85
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_enrollments" DROP COLUMN "revoked_at"');
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// backend/migrations/1780000000002-add-wago-configuration-revisions.ts
|
|
90
|
+
var AddWagoConfigurationRevisions1780000000002 = class {
|
|
91
|
+
constructor() {
|
|
92
|
+
__publicField(this, "name", "AddWagoConfigurationRevisions1780000000002");
|
|
93
|
+
}
|
|
94
|
+
async up(queryRunner) {
|
|
95
|
+
await queryRunner.query(
|
|
96
|
+
`ALTER TABLE "plugin_wago_settings" ADD COLUMN "operational_prefix" varchar NOT NULL DEFAULT ('attraccess/wago')`
|
|
97
|
+
);
|
|
98
|
+
await queryRunner.query(`CREATE TABLE "plugin_wago_configuration_drafts" (
|
|
99
|
+
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "controller_id" integer NOT NULL,
|
|
100
|
+
"snapshot" text NOT NULL, "reviewed_hash" varchar, "updated_at" varchar NOT NULL,
|
|
101
|
+
CONSTRAINT "UQ_plugin_wago_configuration_drafts_controller_id" UNIQUE ("controller_id"))`);
|
|
102
|
+
await queryRunner.query(`CREATE TABLE "plugin_wago_configuration_revisions" (
|
|
103
|
+
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "controller_id" integer NOT NULL,
|
|
104
|
+
"revision" integer NOT NULL, "snapshot" text NOT NULL, "content_hash" varchar NOT NULL,
|
|
105
|
+
"state" varchar NOT NULL, "rejection_errors" text, "published_at" varchar NOT NULL, "reported_at" varchar,
|
|
106
|
+
CONSTRAINT "UQ_plugin_wago_configuration_revisions_controller_revision" UNIQUE ("controller_id", "revision"))`);
|
|
107
|
+
await queryRunner.query(
|
|
108
|
+
'CREATE INDEX "IDX_plugin_wago_configuration_revisions_controller" ON "plugin_wago_configuration_revisions" ("controller_id", "revision")'
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
async down(queryRunner) {
|
|
112
|
+
await queryRunner.query('DROP INDEX "IDX_plugin_wago_configuration_revisions_controller"');
|
|
113
|
+
await queryRunner.query('DROP TABLE "plugin_wago_configuration_revisions"');
|
|
114
|
+
await queryRunner.query('DROP TABLE "plugin_wago_configuration_drafts"');
|
|
115
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_settings" DROP COLUMN "operational_prefix"');
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// backend/migrations/1780000000003-add-wago-preset-provenance.ts
|
|
120
|
+
var AddWagoPresetProvenance1780000000003 = class {
|
|
121
|
+
constructor() {
|
|
122
|
+
__publicField(this, "name", "AddWagoPresetProvenance1780000000003");
|
|
123
|
+
}
|
|
124
|
+
async up(queryRunner) {
|
|
125
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_configuration_drafts" ADD COLUMN "preset_provenance" text');
|
|
126
|
+
}
|
|
127
|
+
async down(queryRunner) {
|
|
128
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_configuration_drafts" DROP COLUMN "preset_provenance"');
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// backend/migrations/1780000000004-add-wago-commissioning-sessions.ts
|
|
133
|
+
var AddWagoCommissioningSessions1780000000004 = class {
|
|
134
|
+
constructor() {
|
|
135
|
+
__publicField(this, "name", "AddWagoCommissioningSessions1780000000004");
|
|
136
|
+
}
|
|
137
|
+
async up(queryRunner) {
|
|
138
|
+
await queryRunner.query(`CREATE TABLE IF NOT EXISTS "plugin_wago_commissioning_sessions" (
|
|
139
|
+
"id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "hardware_id" varchar NOT NULL,
|
|
140
|
+
"mqtt_server_id" integer NOT NULL, "target_host" varchar NOT NULL,
|
|
141
|
+
"host_key_fingerprint" varchar NOT NULL, "firmware_baseline" varchar NOT NULL,
|
|
142
|
+
"state" varchar NOT NULL, "enrollment_expires_at" varchar, "codesys_state" varchar,
|
|
143
|
+
"audit_log" varchar NOT NULL, "failure_reason" varchar,
|
|
144
|
+
"created_at" varchar NOT NULL, "updated_at" varchar NOT NULL
|
|
145
|
+
)`);
|
|
146
|
+
}
|
|
147
|
+
async down(queryRunner) {
|
|
148
|
+
await queryRunner.query('DROP TABLE "plugin_wago_commissioning_sessions"');
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// backend/migrations/1780000000005-add-wago-commissioning-enrollment.ts
|
|
153
|
+
var AddWagoCommissioningEnrollment1780000000005 = class {
|
|
154
|
+
constructor() {
|
|
155
|
+
__publicField(this, "name", "AddWagoCommissioningEnrollment1780000000005");
|
|
156
|
+
}
|
|
157
|
+
async up(queryRunner) {
|
|
158
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "enrollment_id" integer');
|
|
159
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "pairing_code" varchar');
|
|
160
|
+
}
|
|
161
|
+
async down(queryRunner) {
|
|
162
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "pairing_code"');
|
|
163
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "enrollment_id"');
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// backend/migrations/1780000000006-add-wago-commissioning-claim-details.ts
|
|
168
|
+
var AddWagoCommissioningClaimDetails1780000000006 = class {
|
|
169
|
+
constructor() {
|
|
170
|
+
__publicField(this, "name", "AddWagoCommissioningClaimDetails1780000000006");
|
|
171
|
+
}
|
|
172
|
+
async up(queryRunner) {
|
|
173
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "controller_name" varchar');
|
|
174
|
+
}
|
|
175
|
+
async down(queryRunner) {
|
|
176
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "controller_name"');
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// backend/migrations/1780000000007-add-wago-commissioning-progress.ts
|
|
181
|
+
var AddWagoCommissioningProgress1780000000007 = class {
|
|
182
|
+
constructor() {
|
|
183
|
+
__publicField(this, "name", "AddWagoCommissioningProgress1780000000007");
|
|
184
|
+
}
|
|
185
|
+
async up(queryRunner) {
|
|
186
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "progress_percent" integer');
|
|
187
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "progress_step" varchar');
|
|
188
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "progress_detail" varchar');
|
|
189
|
+
}
|
|
190
|
+
async down(queryRunner) {
|
|
191
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "progress_detail"');
|
|
192
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "progress_step"');
|
|
193
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "progress_percent"');
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// backend/migrations/1780000000008-add-wago-commissioning-delivery-token.ts
|
|
198
|
+
var AddWagoCommissioningDeliveryToken1780000000008 = class {
|
|
199
|
+
constructor() {
|
|
200
|
+
__publicField(this, "name", "AddWagoCommissioningDeliveryToken1780000000008");
|
|
201
|
+
}
|
|
202
|
+
async up(queryRunner) {
|
|
203
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "delivery_token" varchar');
|
|
204
|
+
}
|
|
205
|
+
async down(queryRunner) {
|
|
206
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "delivery_token"');
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
// backend/migrations/1780000000009-add-wago-commissioning-principal.ts
|
|
211
|
+
var AddWagoCommissioningPrincipal1780000000009 = class {
|
|
212
|
+
async up(queryRunner) {
|
|
213
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "initiating_principal" text');
|
|
214
|
+
await queryRunner.query(
|
|
215
|
+
'ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "runtime_artifact_digest" varchar'
|
|
216
|
+
);
|
|
217
|
+
await queryRunner.query(
|
|
218
|
+
'ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "management_controller_id" integer'
|
|
219
|
+
);
|
|
220
|
+
await queryRunner.query(
|
|
221
|
+
'ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "docker_provision_token" varchar'
|
|
222
|
+
);
|
|
223
|
+
await queryRunner.query(
|
|
224
|
+
'ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "docker_provision_state" varchar'
|
|
225
|
+
);
|
|
226
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" ADD COLUMN "platform_report" text');
|
|
227
|
+
}
|
|
228
|
+
async down(queryRunner) {
|
|
229
|
+
const rows = await queryRunner.query('SELECT COUNT(*) AS count FROM "plugin_wago_commissioning_sessions" WHERE "docker_provision_token" IS NOT NULL');
|
|
230
|
+
if (Number(rows[0].count) !== 0) throw new Error("Recover Docker provisioning before removing its saved ownership tokens");
|
|
231
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "initiating_principal"');
|
|
232
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "runtime_artifact_digest"');
|
|
233
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "management_controller_id"');
|
|
234
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "docker_provision_token"');
|
|
235
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "docker_provision_state"');
|
|
236
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_commissioning_sessions" DROP COLUMN "platform_report"');
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
// backend/wago-management.migration.ts
|
|
241
|
+
var WagoManagement1780000000010 = class {
|
|
242
|
+
constructor() {
|
|
243
|
+
__publicField(this, "name", "WagoManagement1780000000010");
|
|
244
|
+
}
|
|
245
|
+
async up(queryRunner) {
|
|
246
|
+
await queryRunner.query(`CREATE TABLE "plugin_wago_management" (
|
|
247
|
+
"controller_id" integer PRIMARY KEY NOT NULL,
|
|
248
|
+
"metadata_json" text,
|
|
249
|
+
"encrypted_private_key" text,
|
|
250
|
+
"lease_owner" varchar,
|
|
251
|
+
"lease_until" bigint NOT NULL DEFAULT 0
|
|
252
|
+
)`);
|
|
253
|
+
}
|
|
254
|
+
async down(queryRunner) {
|
|
255
|
+
const rows = await queryRunner.query(
|
|
256
|
+
'SELECT COUNT(*) AS count FROM "plugin_wago_management" WHERE "encrypted_private_key" IS NOT NULL OR "lease_owner" IS NOT NULL'
|
|
257
|
+
);
|
|
258
|
+
if (Number(rows[0].count) !== 0)
|
|
259
|
+
throw new Error("Recover management transitions before removing management storage");
|
|
260
|
+
await queryRunner.query('DROP TABLE "plugin_wago_management"');
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
// backend/wago-commissioning-lease.migration.ts
|
|
265
|
+
var WagoCommissioningLease1780000000011 = class {
|
|
266
|
+
constructor() {
|
|
267
|
+
__publicField(this, "name", "WagoCommissioningLease1780000000011");
|
|
268
|
+
}
|
|
269
|
+
async up(queryRunner) {
|
|
270
|
+
await queryRunner.query(`CREATE TABLE "plugin_wago_commissioning_lease" (
|
|
271
|
+
"fingerprint_hash" varchar(64) PRIMARY KEY NOT NULL,
|
|
272
|
+
"owner" varchar NOT NULL,
|
|
273
|
+
"lease_until" bigint NOT NULL,
|
|
274
|
+
"operation_until" bigint NOT NULL,
|
|
275
|
+
"recovery_after" bigint NOT NULL
|
|
276
|
+
)`);
|
|
277
|
+
}
|
|
278
|
+
async down(queryRunner) {
|
|
279
|
+
const rows = await queryRunner.query('SELECT COUNT(*) AS count FROM "plugin_wago_commissioning_lease"');
|
|
280
|
+
if (Number(rows[0].count) !== 0) throw new Error("Recover commissioning leases before removing lease storage");
|
|
281
|
+
await queryRunner.query('DROP TABLE "plugin_wago_commissioning_lease"');
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
// backend/wago-credential-rotation.migration.ts
|
|
286
|
+
var WagoCredentialRotation1780010610000 = class {
|
|
287
|
+
constructor() {
|
|
288
|
+
__publicField(this, "name", "WagoCredentialRotation1780010610000");
|
|
289
|
+
}
|
|
290
|
+
async up(queryRunner) {
|
|
291
|
+
const controllerColumns = await queryRunner.query('PRAGMA table_info("plugin_wago_controllers")');
|
|
292
|
+
if (!controllerColumns.some((column) => column.name === "credential_epoch"))
|
|
293
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_controllers" ADD COLUMN "credential_epoch" varchar');
|
|
294
|
+
const tables = await queryRunner.query(
|
|
295
|
+
"SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'plugin_wago_credential_rotations'"
|
|
296
|
+
);
|
|
297
|
+
if (!tables.length)
|
|
298
|
+
await queryRunner.query(`CREATE TABLE "plugin_wago_credential_rotations" (
|
|
299
|
+
"controller_id" integer PRIMARY KEY NOT NULL REFERENCES "plugin_wago_controllers"("id") ON DELETE CASCADE,
|
|
300
|
+
"revision" integer NOT NULL,
|
|
301
|
+
"credential_epoch" varchar NOT NULL,
|
|
302
|
+
"phase" varchar NOT NULL,
|
|
303
|
+
"mqtt_server_id" integer NOT NULL,
|
|
304
|
+
"prefix" varchar NOT NULL,
|
|
305
|
+
"token" varchar NOT NULL,
|
|
306
|
+
"encrypted_credentials" text
|
|
307
|
+
)`);
|
|
308
|
+
}
|
|
309
|
+
async down(queryRunner) {
|
|
310
|
+
const rows = await queryRunner.query('SELECT COUNT(*) AS count FROM "plugin_wago_credential_rotations"');
|
|
311
|
+
if (Number(rows[0].count))
|
|
312
|
+
throw new Error("Remove controller registrations before removing credential rotation history");
|
|
313
|
+
await queryRunner.query('DROP TABLE "plugin_wago_credential_rotations"');
|
|
314
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_controllers" DROP COLUMN "credential_epoch"');
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// backend/migrations/1780010580000-add-wago-revision-editor-metadata.ts
|
|
319
|
+
var AddWagoRevisionEditorMetadata1780010580000 = class {
|
|
320
|
+
constructor() {
|
|
321
|
+
__publicField(this, "name", "AddWagoRevisionEditorMetadata1780010580000");
|
|
322
|
+
}
|
|
323
|
+
async up(queryRunner) {
|
|
324
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_configuration_revisions" ADD COLUMN "preset_provenance" text');
|
|
325
|
+
}
|
|
326
|
+
async down(queryRunner) {
|
|
327
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_configuration_revisions" DROP COLUMN "preset_provenance"');
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
// backend/migrations/1780010600000-add-wago-claim-intent.ts
|
|
332
|
+
var AddWagoClaimIntent1780010600000 = class {
|
|
333
|
+
constructor() {
|
|
334
|
+
__publicField(this, "name", "AddWagoClaimIntent1780010600000");
|
|
335
|
+
}
|
|
336
|
+
async up(queryRunner) {
|
|
337
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_controllers" ADD COLUMN "credential_mqtt_server_id" integer');
|
|
338
|
+
}
|
|
339
|
+
async down(queryRunner) {
|
|
340
|
+
const rows = await queryRunner.query(
|
|
341
|
+
'SELECT 1 FROM "plugin_wago_controllers" WHERE "credential_mqtt_server_id" IS NOT NULL LIMIT 1'
|
|
342
|
+
);
|
|
343
|
+
if (rows.length) throw new Error("Revoke tracked WAGO credentials before removing claim recovery metadata.");
|
|
344
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_controllers" DROP COLUMN "credential_mqtt_server_id"');
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
// backend/migrations/1780010630000-add-wago-rejection-acknowledgement.ts
|
|
349
|
+
var AddWagoRejectionAcknowledgement1780010630000 = class {
|
|
350
|
+
constructor() {
|
|
351
|
+
__publicField(this, "name", "AddWagoRejectionAcknowledgement1780010630000");
|
|
352
|
+
}
|
|
353
|
+
async up(queryRunner) {
|
|
354
|
+
await queryRunner.query(
|
|
355
|
+
'ALTER TABLE "plugin_wago_configuration_revisions" ADD COLUMN "rejection_acknowledged_at" varchar'
|
|
356
|
+
);
|
|
357
|
+
await queryRunner.query(
|
|
358
|
+
'ALTER TABLE "plugin_wago_configuration_revisions" ADD COLUMN "rejection_acknowledged_by" integer'
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
async down(queryRunner) {
|
|
362
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_configuration_revisions" DROP COLUMN "rejection_acknowledged_by"');
|
|
363
|
+
await queryRunner.query('ALTER TABLE "plugin_wago_configuration_revisions" DROP COLUMN "rejection_acknowledged_at"');
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
367
|
+
0 && (module.exports = {
|
|
368
|
+
AddWagoClaimIntent1780010600000,
|
|
369
|
+
AddWagoCommissioningClaimDetails1780000000006,
|
|
370
|
+
AddWagoCommissioningDeliveryToken1780000000008,
|
|
371
|
+
AddWagoCommissioningEnrollment1780000000005,
|
|
372
|
+
AddWagoCommissioningPrincipal1780000000009,
|
|
373
|
+
AddWagoCommissioningProgress1780000000007,
|
|
374
|
+
AddWagoCommissioningSessions1780000000004,
|
|
375
|
+
AddWagoConfigurationRevisions1780000000002,
|
|
376
|
+
AddWagoEnrollmentRevocation1780000000001,
|
|
377
|
+
AddWagoPresetProvenance1780000000003,
|
|
378
|
+
AddWagoRejectionAcknowledgement1780010630000,
|
|
379
|
+
AddWagoRevisionEditorMetadata1780010580000,
|
|
380
|
+
CreateWagoControllers1780000000000,
|
|
381
|
+
WagoCommissioningLease1780000000011,
|
|
382
|
+
WagoCredentialRotation1780010610000,
|
|
383
|
+
WagoManagement1780000000010
|
|
384
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOHA1fO/SL9FqNn5xtSbFrYxMBs/SOyAkyTrA30GZ7Qv
|