@cepseudo/ngsi-ld 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +425 -0
- package/dist/cache/entity_cache.d.ts +42 -0
- package/dist/cache/entity_cache.d.ts.map +1 -0
- package/dist/cache/entity_cache.js +93 -0
- package/dist/cache/entity_cache.js.map +1 -0
- package/dist/components/ngsi_ld_collector.d.ts +25 -0
- package/dist/components/ngsi_ld_collector.d.ts.map +1 -0
- package/dist/components/ngsi_ld_collector.js +13 -0
- package/dist/components/ngsi_ld_collector.js.map +1 -0
- package/dist/components/ngsi_ld_harvester.d.ts +25 -0
- package/dist/components/ngsi_ld_harvester.d.ts.map +1 -0
- package/dist/components/ngsi_ld_harvester.js +13 -0
- package/dist/components/ngsi_ld_harvester.js.map +1 -0
- package/dist/components/type_guards.d.ts +15 -0
- package/dist/components/type_guards.d.ts.map +1 -0
- package/dist/components/type_guards.js +25 -0
- package/dist/components/type_guards.js.map +1 -0
- package/dist/endpoints/attrs.d.ts +7 -0
- package/dist/endpoints/attrs.d.ts.map +1 -0
- package/dist/endpoints/attrs.js +37 -0
- package/dist/endpoints/attrs.js.map +1 -0
- package/dist/endpoints/entities.d.ts +9 -0
- package/dist/endpoints/entities.d.ts.map +1 -0
- package/dist/endpoints/entities.js +149 -0
- package/dist/endpoints/entities.js.map +1 -0
- package/dist/endpoints/subscriptions.d.ts +8 -0
- package/dist/endpoints/subscriptions.d.ts.map +1 -0
- package/dist/endpoints/subscriptions.js +109 -0
- package/dist/endpoints/subscriptions.js.map +1 -0
- package/dist/endpoints/types.d.ts +7 -0
- package/dist/endpoints/types.d.ts.map +1 -0
- package/dist/endpoints/types.js +45 -0
- package/dist/endpoints/types.js.map +1 -0
- package/dist/helpers/property.d.ts +33 -0
- package/dist/helpers/property.d.ts.map +1 -0
- package/dist/helpers/property.js +40 -0
- package/dist/helpers/property.js.map +1 -0
- package/dist/helpers/urn.d.ts +26 -0
- package/dist/helpers/urn.d.ts.map +1 -0
- package/dist/helpers/urn.js +30 -0
- package/dist/helpers/urn.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/models/agrifood/agri_parcel.d.ts +17 -0
- package/dist/models/agrifood/agri_parcel.d.ts.map +1 -0
- package/dist/models/agrifood/agri_parcel.js +27 -0
- package/dist/models/agrifood/agri_parcel.js.map +1 -0
- package/dist/models/agrifood/agri_soil_measurement.d.ts +17 -0
- package/dist/models/agrifood/agri_soil_measurement.d.ts.map +1 -0
- package/dist/models/agrifood/agri_soil_measurement.js +31 -0
- package/dist/models/agrifood/agri_soil_measurement.js.map +1 -0
- package/dist/models/agrifood/agri_weather_observed.d.ts +20 -0
- package/dist/models/agrifood/agri_weather_observed.d.ts.map +1 -0
- package/dist/models/agrifood/agri_weather_observed.js +34 -0
- package/dist/models/agrifood/agri_weather_observed.js.map +1 -0
- package/dist/models/device/device.d.ts +24 -0
- package/dist/models/device/device.d.ts.map +1 -0
- package/dist/models/device/device.js +39 -0
- package/dist/models/device/device.js.map +1 -0
- package/dist/models/device/device_measurement.d.ts +16 -0
- package/dist/models/device/device_measurement.d.ts.map +1 -0
- package/dist/models/device/device_measurement.js +34 -0
- package/dist/models/device/device_measurement.js.map +1 -0
- package/dist/models/environment/air_quality_observed.d.ts +22 -0
- package/dist/models/environment/air_quality_observed.d.ts.map +1 -0
- package/dist/models/environment/air_quality_observed.js +50 -0
- package/dist/models/environment/air_quality_observed.js.map +1 -0
- package/dist/models/environment/noise_level_observed.d.ts +17 -0
- package/dist/models/environment/noise_level_observed.d.ts.map +1 -0
- package/dist/models/environment/noise_level_observed.js +31 -0
- package/dist/models/environment/noise_level_observed.js.map +1 -0
- package/dist/models/environment/water_quality_observed.d.ts +20 -0
- package/dist/models/environment/water_quality_observed.d.ts.map +1 -0
- package/dist/models/environment/water_quality_observed.js +46 -0
- package/dist/models/environment/water_quality_observed.js.map +1 -0
- package/dist/models/environment/weather_observed.d.ts +19 -0
- package/dist/models/environment/weather_observed.d.ts.map +1 -0
- package/dist/models/environment/weather_observed.js +46 -0
- package/dist/models/environment/weather_observed.js.map +1 -0
- package/dist/models/index.d.ts +25 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +17 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/smart_city/parking_spot.d.ts +14 -0
- package/dist/models/smart_city/parking_spot.d.ts.map +1 -0
- package/dist/models/smart_city/parking_spot.js +27 -0
- package/dist/models/smart_city/parking_spot.js.map +1 -0
- package/dist/models/smart_city/street_light.d.ts +16 -0
- package/dist/models/smart_city/street_light.d.ts.map +1 -0
- package/dist/models/smart_city/street_light.js +33 -0
- package/dist/models/smart_city/street_light.js.map +1 -0
- package/dist/models/smart_city/traffic_flow_observed.d.ts +19 -0
- package/dist/models/smart_city/traffic_flow_observed.d.ts.map +1 -0
- package/dist/models/smart_city/traffic_flow_observed.js +37 -0
- package/dist/models/smart_city/traffic_flow_observed.js.map +1 -0
- package/dist/notifications/notification_sender.d.ts +16 -0
- package/dist/notifications/notification_sender.d.ts.map +1 -0
- package/dist/notifications/notification_sender.js +70 -0
- package/dist/notifications/notification_sender.js.map +1 -0
- package/dist/notifications/notification_worker.d.ts +19 -0
- package/dist/notifications/notification_worker.d.ts.map +1 -0
- package/dist/notifications/notification_worker.js +65 -0
- package/dist/notifications/notification_worker.js.map +1 -0
- package/dist/plugin.d.ts +35 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +113 -0
- package/dist/plugin.js.map +1 -0
- package/dist/subscriptions/q_parser.d.ts +42 -0
- package/dist/subscriptions/q_parser.d.ts.map +1 -0
- package/dist/subscriptions/q_parser.js +113 -0
- package/dist/subscriptions/q_parser.js.map +1 -0
- package/dist/subscriptions/subscription_cache.d.ts +46 -0
- package/dist/subscriptions/subscription_cache.d.ts.map +1 -0
- package/dist/subscriptions/subscription_cache.js +105 -0
- package/dist/subscriptions/subscription_cache.js.map +1 -0
- package/dist/subscriptions/subscription_matcher.d.ts +23 -0
- package/dist/subscriptions/subscription_matcher.d.ts.map +1 -0
- package/dist/subscriptions/subscription_matcher.js +84 -0
- package/dist/subscriptions/subscription_matcher.js.map +1 -0
- package/dist/subscriptions/subscription_store.d.ts +42 -0
- package/dist/subscriptions/subscription_store.d.ts.map +1 -0
- package/dist/subscriptions/subscription_store.js +189 -0
- package/dist/subscriptions/subscription_store.js.map +1 -0
- package/dist/types/context.d.ts +9 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/context.js +5 -0
- package/dist/types/context.js.map +1 -0
- package/dist/types/entity.d.ts +46 -0
- package/dist/types/entity.d.ts.map +1 -0
- package/dist/types/entity.js +2 -0
- package/dist/types/entity.js.map +1 -0
- package/dist/types/notification.d.ts +22 -0
- package/dist/types/notification.d.ts.map +1 -0
- package/dist/types/notification.js +2 -0
- package/dist/types/notification.js.map +1 -0
- package/dist/types/subscription.d.ts +54 -0
- package/dist/types/subscription.d.ts.map +1 -0
- package/dist/types/subscription.js +2 -0
- package/dist/types/subscription.js.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { randomUUID } from 'crypto';
|
|
2
|
+
const TABLE = 'ngsi_ld_subscriptions';
|
|
3
|
+
/**
|
|
4
|
+
* Column schema for the subscriptions table.
|
|
5
|
+
* Uses TEXT for everything (arrays stored as JSON) for SQLite/PostgreSQL compatibility.
|
|
6
|
+
* The integer `id` PK is added automatically by `createTableWithColumns`.
|
|
7
|
+
* The UUID is stored in `sub_id`.
|
|
8
|
+
*/
|
|
9
|
+
const SUBSCRIPTION_COLUMNS = {
|
|
10
|
+
sub_id: 'text not null',
|
|
11
|
+
name: 'text',
|
|
12
|
+
description: 'text',
|
|
13
|
+
entity_types: 'text not null',
|
|
14
|
+
watched_attributes: 'text',
|
|
15
|
+
q: 'text',
|
|
16
|
+
notification_endpoint: 'text not null',
|
|
17
|
+
notification_format: 'text',
|
|
18
|
+
notification_attrs: 'text',
|
|
19
|
+
throttling: 'integer',
|
|
20
|
+
expires_at: 'text',
|
|
21
|
+
is_active: 'integer',
|
|
22
|
+
last_notification_at: 'text',
|
|
23
|
+
last_success_at: 'text',
|
|
24
|
+
times_sent: 'integer',
|
|
25
|
+
times_failed: 'integer',
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* PostgreSQL/SQLite persistence layer for NGSI-LD subscriptions.
|
|
29
|
+
*
|
|
30
|
+
* Arrays are serialized as JSON strings for SQLite compatibility.
|
|
31
|
+
* The UUID subscription id is stored in the `sub_id` column; the database
|
|
32
|
+
* integer primary key is used internally for updates.
|
|
33
|
+
*/
|
|
34
|
+
export class SubscriptionStore {
|
|
35
|
+
#db;
|
|
36
|
+
constructor(db) {
|
|
37
|
+
this.#db = db;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates the ngsi_ld_subscriptions table if it does not already exist.
|
|
41
|
+
*/
|
|
42
|
+
async runMigration() {
|
|
43
|
+
const exists = await this.#db.doesTableExists(TABLE);
|
|
44
|
+
if (!exists) {
|
|
45
|
+
await this.#db.createTableWithColumns(TABLE, SUBSCRIPTION_COLUMNS);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
await this.#db.ensureColumns(TABLE, SUBSCRIPTION_COLUMNS);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Inserts a new subscription and returns it with generated id and timestamps.
|
|
53
|
+
*/
|
|
54
|
+
async create(input) {
|
|
55
|
+
const subId = randomUUID();
|
|
56
|
+
const entityTypes = input.entities?.map(e => e.type) ?? [];
|
|
57
|
+
const data = {
|
|
58
|
+
sub_id: subId,
|
|
59
|
+
name: input.name ?? null,
|
|
60
|
+
description: input.description ?? null,
|
|
61
|
+
entity_types: JSON.stringify(entityTypes),
|
|
62
|
+
watched_attributes: input.watchedAttributes ? JSON.stringify(input.watchedAttributes) : null,
|
|
63
|
+
q: input.q ?? null,
|
|
64
|
+
notification_endpoint: input.notification.endpoint.uri,
|
|
65
|
+
notification_format: input.notification.format ?? 'normalized',
|
|
66
|
+
notification_attrs: input.notification.attributes ? JSON.stringify(input.notification.attributes) : null,
|
|
67
|
+
throttling: input.throttling ?? 0,
|
|
68
|
+
expires_at: input.expiresAt ?? null,
|
|
69
|
+
is_active: 1,
|
|
70
|
+
last_notification_at: null,
|
|
71
|
+
last_success_at: null,
|
|
72
|
+
times_sent: 0,
|
|
73
|
+
times_failed: 0,
|
|
74
|
+
};
|
|
75
|
+
await this.#db.insertCustomTableRecord(TABLE, data);
|
|
76
|
+
const created = await this.findById(subId);
|
|
77
|
+
if (!created) {
|
|
78
|
+
throw new Error(`Failed to retrieve subscription after insert: ${subId}`);
|
|
79
|
+
}
|
|
80
|
+
return created;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns all active subscriptions.
|
|
84
|
+
*/
|
|
85
|
+
async findAll() {
|
|
86
|
+
const rows = await this.#db.findCustomTableRecords(TABLE, { is_active: 1 });
|
|
87
|
+
return rows.map(row => this.#rowToSubscription(row));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Returns a subscription by its UUID, or null if not found.
|
|
91
|
+
*/
|
|
92
|
+
async findById(subId) {
|
|
93
|
+
const rows = await this.#db.findCustomTableRecords(TABLE, { sub_id: subId, is_active: 1 });
|
|
94
|
+
if (rows.length === 0)
|
|
95
|
+
return null;
|
|
96
|
+
return this.#rowToSubscription(rows[0]);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Partially updates a subscription.
|
|
100
|
+
*/
|
|
101
|
+
async update(subId, patch) {
|
|
102
|
+
const rows = await this.#db.findCustomTableRecords(TABLE, { sub_id: subId });
|
|
103
|
+
if (rows.length === 0)
|
|
104
|
+
return null;
|
|
105
|
+
const internalId = rows[0].id;
|
|
106
|
+
const updates = {};
|
|
107
|
+
if (patch.name !== undefined)
|
|
108
|
+
updates['name'] = patch.name;
|
|
109
|
+
if (patch.description !== undefined)
|
|
110
|
+
updates['description'] = patch.description;
|
|
111
|
+
if (patch.entities !== undefined)
|
|
112
|
+
updates['entity_types'] = JSON.stringify(patch.entities.map(e => e.type));
|
|
113
|
+
if (patch.watchedAttributes !== undefined)
|
|
114
|
+
updates['watched_attributes'] = JSON.stringify(patch.watchedAttributes);
|
|
115
|
+
if (patch.q !== undefined)
|
|
116
|
+
updates['q'] = patch.q;
|
|
117
|
+
if (patch.notification?.endpoint?.uri !== undefined)
|
|
118
|
+
updates['notification_endpoint'] = patch.notification.endpoint.uri;
|
|
119
|
+
if (patch.notification?.format !== undefined)
|
|
120
|
+
updates['notification_format'] = patch.notification.format;
|
|
121
|
+
if (patch.notification?.attributes !== undefined)
|
|
122
|
+
updates['notification_attrs'] = JSON.stringify(patch.notification.attributes);
|
|
123
|
+
if (patch.throttling !== undefined)
|
|
124
|
+
updates['throttling'] = patch.throttling;
|
|
125
|
+
if (patch.expiresAt !== undefined)
|
|
126
|
+
updates['expires_at'] = patch.expiresAt;
|
|
127
|
+
await this.#db.updateById(TABLE, internalId, updates);
|
|
128
|
+
return this.findById(subId);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Soft-deletes a subscription by setting is_active = 0.
|
|
132
|
+
*/
|
|
133
|
+
async delete(subId) {
|
|
134
|
+
const rows = await this.#db.findCustomTableRecords(TABLE, { sub_id: subId });
|
|
135
|
+
if (rows.length === 0)
|
|
136
|
+
return false;
|
|
137
|
+
const internalId = rows[0].id;
|
|
138
|
+
await this.#db.updateById(TABLE, internalId, { is_active: 0 });
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Updates notification statistics after a delivery attempt.
|
|
143
|
+
*/
|
|
144
|
+
async recordNotification(subId, success, at) {
|
|
145
|
+
const rows = await this.#db.findCustomTableRecords(TABLE, { sub_id: subId });
|
|
146
|
+
if (rows.length === 0)
|
|
147
|
+
return;
|
|
148
|
+
const row = rows[0];
|
|
149
|
+
const internalId = row.id;
|
|
150
|
+
const updates = {
|
|
151
|
+
last_notification_at: at,
|
|
152
|
+
times_sent: (Number(row['times_sent']) || 0) + 1,
|
|
153
|
+
};
|
|
154
|
+
if (success) {
|
|
155
|
+
updates['last_success_at'] = at;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
updates['times_failed'] = (Number(row['times_failed']) || 0) + 1;
|
|
159
|
+
}
|
|
160
|
+
await this.#db.updateById(TABLE, internalId, updates);
|
|
161
|
+
}
|
|
162
|
+
#rowToSubscription(row) {
|
|
163
|
+
return {
|
|
164
|
+
id: String(row['sub_id']),
|
|
165
|
+
name: row['name'] ? String(row['name']) : undefined,
|
|
166
|
+
description: row['description'] ? String(row['description']) : undefined,
|
|
167
|
+
entityTypes: row['entity_types'] ? JSON.parse(String(row['entity_types'])) : [],
|
|
168
|
+
watchedAttributes: row['watched_attributes']
|
|
169
|
+
? JSON.parse(String(row['watched_attributes']))
|
|
170
|
+
: undefined,
|
|
171
|
+
q: row['q'] ? String(row['q']) : undefined,
|
|
172
|
+
notificationEndpoint: String(row['notification_endpoint']),
|
|
173
|
+
notificationFormat: row['notification_format'] ?? 'normalized',
|
|
174
|
+
notificationAttrs: row['notification_attrs']
|
|
175
|
+
? JSON.parse(String(row['notification_attrs']))
|
|
176
|
+
: undefined,
|
|
177
|
+
throttling: Number(row['throttling'] ?? 0),
|
|
178
|
+
expiresAt: row['expires_at'] ? String(row['expires_at']) : undefined,
|
|
179
|
+
isActive: Number(row['is_active']) === 1,
|
|
180
|
+
lastNotificationAt: row['last_notification_at'] ? String(row['last_notification_at']) : undefined,
|
|
181
|
+
lastSuccessAt: row['last_success_at'] ? String(row['last_success_at']) : undefined,
|
|
182
|
+
timesSent: Number(row['times_sent'] ?? 0),
|
|
183
|
+
timesFailed: Number(row['times_failed'] ?? 0),
|
|
184
|
+
createdAt: String(row['created_at']),
|
|
185
|
+
updatedAt: String(row['updated_at']),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=subscription_store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription_store.js","sourceRoot":"","sources":["../../src/subscriptions/subscription_store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAEnC,MAAM,KAAK,GAAG,uBAAuB,CAAA;AAErC;;;;;GAKG;AACH,MAAM,oBAAoB,GAA2B;IACjD,MAAM,EAAE,eAAe;IACvB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,YAAY,EAAE,eAAe;IAC7B,kBAAkB,EAAE,MAAM;IAC1B,CAAC,EAAE,MAAM;IACT,qBAAqB,EAAE,eAAe;IACtC,mBAAmB,EAAE,MAAM;IAC3B,kBAAkB,EAAE,MAAM;IAC1B,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,SAAS;IACpB,oBAAoB,EAAE,MAAM;IAC5B,eAAe,EAAE,MAAM;IACvB,UAAU,EAAE,SAAS;IACrB,YAAY,EAAE,SAAS;CAC1B,CAAA;AAED;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IACjB,GAAG,CAAiB;IAE7B,YAAY,EAAmB;QAC3B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;IACjB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;QACpD,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,IAAI,CAAC,GAAG,CAAC,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;QACtE,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;QAC7D,CAAC;IACL,CAAC;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CAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAc;gBAC7D,CAAC,CAAC,SAAS;YACf,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAC1C,SAAS,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YACpE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;YACxC,kBAAkB,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YACjG,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YAClF,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACzC,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC7C,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACpC,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;SACvC,CAAA;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON-LD @context value — can be a URL string, array of strings/objects, or an inline context object.
|
|
3
|
+
*/
|
|
4
|
+
export type JsonLdContext = string | string[] | Record<string, unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* The default ETSI NGSI-LD core context URL.
|
|
7
|
+
*/
|
|
8
|
+
export declare const NGSI_LD_CORE_CONTEXT = "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld";
|
|
9
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEvE;;GAEG;AACH,eAAO,MAAM,oBAAoB,gEAAgE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,6DAA6D,CAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { JsonLdContext } from './context.js';
|
|
2
|
+
/**
|
|
3
|
+
* A GeoJSON geometry value as per RFC 7946.
|
|
4
|
+
*/
|
|
5
|
+
export interface GeoJsonGeometry {
|
|
6
|
+
type: 'Point' | 'LineString' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon';
|
|
7
|
+
coordinates: number | number[] | number[][] | number[][][] | number[][][][];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* An NGSI-LD Property holding a typed value.
|
|
11
|
+
*/
|
|
12
|
+
export interface NgsiLdProperty<T = unknown> {
|
|
13
|
+
type: 'Property';
|
|
14
|
+
value: T;
|
|
15
|
+
observedAt?: string;
|
|
16
|
+
unitCode?: string;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* An NGSI-LD GeoProperty holding a GeoJSON geometry.
|
|
21
|
+
*/
|
|
22
|
+
export interface NgsiLdGeoProperty {
|
|
23
|
+
type: 'GeoProperty';
|
|
24
|
+
value: GeoJsonGeometry;
|
|
25
|
+
observedAt?: string;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An NGSI-LD Relationship pointing to another entity by URN.
|
|
30
|
+
*/
|
|
31
|
+
export interface NgsiLdRelationship {
|
|
32
|
+
type: 'Relationship';
|
|
33
|
+
object: string;
|
|
34
|
+
observedAt?: string;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An NGSI-LD entity with typed attributes.
|
|
39
|
+
*/
|
|
40
|
+
export interface NgsiLdEntity {
|
|
41
|
+
id: string;
|
|
42
|
+
type: string;
|
|
43
|
+
'@context'?: JsonLdContext;
|
|
44
|
+
[key: string]: NgsiLdProperty | NgsiLdGeoProperty | NgsiLdRelationship | string | JsonLdContext | undefined;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/types/entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,iBAAiB,GAAG,cAAc,CAAA;IAC5F,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,CAAA;CAC9E;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACvC,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,EAAE,CAAC,CAAA;IACR,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,aAAa,CAAA;IACnB,KAAK,EAAE,eAAe,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,cAAc,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,aAAa,CAAA;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,MAAM,GAAG,aAAa,GAAG,SAAS,CAAA;CAC9G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/types/entity.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { NgsiLdEntity } from './entity.js';
|
|
2
|
+
import type { Subscription } from './subscription.js';
|
|
3
|
+
/**
|
|
4
|
+
* Payload delivered to a subscriber's endpoint.
|
|
5
|
+
*/
|
|
6
|
+
export interface NotificationPayload {
|
|
7
|
+
id: string;
|
|
8
|
+
type: 'Notification';
|
|
9
|
+
subscriptionId: string;
|
|
10
|
+
notifiedAt: string;
|
|
11
|
+
data: NgsiLdEntity[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Data stored in the BullMQ job for notification delivery.
|
|
15
|
+
*/
|
|
16
|
+
export interface NotificationJobData {
|
|
17
|
+
subscription: Subscription;
|
|
18
|
+
entity: NgsiLdEntity;
|
|
19
|
+
notificationId: string;
|
|
20
|
+
notifiedAt: string;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/types/notification.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,cAAc,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,YAAY,EAAE,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,YAAY,EAAE,YAAY,CAAA;IAC1B,MAAM,EAAE,YAAY,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/types/notification.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification format for NGSI-LD subscriptions.
|
|
3
|
+
*/
|
|
4
|
+
export type NotificationFormat = 'normalized' | 'keyValues';
|
|
5
|
+
/**
|
|
6
|
+
* Notification endpoint configuration.
|
|
7
|
+
*/
|
|
8
|
+
export interface NotificationEndpoint {
|
|
9
|
+
uri: string;
|
|
10
|
+
accept?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Input payload for creating a new subscription.
|
|
14
|
+
*/
|
|
15
|
+
export interface SubscriptionCreate {
|
|
16
|
+
name?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
entities?: Array<{
|
|
19
|
+
type: string;
|
|
20
|
+
}>;
|
|
21
|
+
watchedAttributes?: string[];
|
|
22
|
+
q?: string;
|
|
23
|
+
notification: {
|
|
24
|
+
endpoint: NotificationEndpoint;
|
|
25
|
+
attributes?: string[];
|
|
26
|
+
format?: NotificationFormat;
|
|
27
|
+
};
|
|
28
|
+
throttling?: number;
|
|
29
|
+
expiresAt?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A fully hydrated subscription record (as stored in the DB).
|
|
33
|
+
*/
|
|
34
|
+
export interface Subscription {
|
|
35
|
+
id: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
entityTypes: string[];
|
|
39
|
+
watchedAttributes?: string[];
|
|
40
|
+
q?: string;
|
|
41
|
+
notificationEndpoint: string;
|
|
42
|
+
notificationFormat: NotificationFormat;
|
|
43
|
+
notificationAttrs?: string[];
|
|
44
|
+
throttling: number;
|
|
45
|
+
expiresAt?: string;
|
|
46
|
+
isActive: boolean;
|
|
47
|
+
lastNotificationAt?: string;
|
|
48
|
+
lastSuccessAt?: string;
|
|
49
|
+
timesSent: number;
|
|
50
|
+
timesFailed: number;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=subscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/types/subscription.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,WAAW,CAAA;AAE3D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,YAAY,EAAE;QACV,QAAQ,EAAE,oBAAoB,CAAA;QAC9B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;QACrB,MAAM,CAAC,EAAE,kBAAkB,CAAA;KAC9B,CAAA;IACD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,oBAAoB,EAAE,MAAM,CAAA;IAC5B,kBAAkB,EAAE,kBAAkB,CAAA;IACtC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../src/types/subscription.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cepseudo/ngsi-ld",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "NGSI-LD plugin for Digital Twin framework (entities, subscriptions, notifications)",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Axel Hoffmann",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"dev": "tsc --watch",
|
|
24
|
+
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
25
|
+
"test": "node -r ./bin/set-test-env.cjs --import ts-node-maintained/register/esm --enable-source-maps bin/test.ts",
|
|
26
|
+
"lint": "eslint src tests --no-error-on-unmatched-pattern",
|
|
27
|
+
"lint:fix": "eslint src tests --fix --no-error-on-unmatched-pattern"
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=20.0.0"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@cepseudo/components": "workspace:*",
|
|
34
|
+
"@cepseudo/database": "workspace:*",
|
|
35
|
+
"@cepseudo/shared": "workspace:*"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"bullmq": ">=5.0.0",
|
|
39
|
+
"ioredis": ">=5.0.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@japa/assert": "^4.1.0",
|
|
43
|
+
"@japa/runner": "^4.3.0",
|
|
44
|
+
"@testcontainers/postgresql": "^11.12.0",
|
|
45
|
+
"@testcontainers/redis": "^11.3.1",
|
|
46
|
+
"better-sqlite3": "^12.6.0",
|
|
47
|
+
"bullmq": "^5.0.0",
|
|
48
|
+
"ioredis": "^5.0.0",
|
|
49
|
+
"pg": "^8.20.0",
|
|
50
|
+
"rimraf": "^6.0.1",
|
|
51
|
+
"testcontainers": "^11.3.1",
|
|
52
|
+
"ts-node-maintained": "^10.9.5"
|
|
53
|
+
},
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/CePseudoBE/digitaltwin.git",
|
|
57
|
+
"directory": "packages/ngsi-ld"
|
|
58
|
+
},
|
|
59
|
+
"keywords": [
|
|
60
|
+
"digitaltwin",
|
|
61
|
+
"ngsi-ld",
|
|
62
|
+
"etsi",
|
|
63
|
+
"iot",
|
|
64
|
+
"smart-data-models",
|
|
65
|
+
"subscriptions"
|
|
66
|
+
],
|
|
67
|
+
"bugs": {
|
|
68
|
+
"url": "https://github.com/CePseudoBE/digitaltwin/issues"
|
|
69
|
+
},
|
|
70
|
+
"homepage": "https://github.com/CePseudoBE/digitaltwin#readme",
|
|
71
|
+
"publishConfig": {
|
|
72
|
+
"access": "public"
|
|
73
|
+
}
|
|
74
|
+
}
|