@geolonia/geonicdb-sdk 0.15.0 → 0.16.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geolonia/geonicdb-sdk",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "GeonicDB JavaScript SDK — NGSI-LD Context Broker client for browser and Node.js",
5
5
  "main": "geonicdb.cjs",
6
6
  "module": "geonicdb.mjs",
package/react/index.d.ts CHANGED
@@ -283,6 +283,30 @@ export interface GetTemporalEntitiesParams {
283
283
  */
284
284
  options?: string;
285
285
  }
286
+ /**
287
+ * `GET /ngsi-ld/v1/types`(`details` 未指定)のレスポンス。
288
+ * ETSI GS CIM 009 / OpenAPI v1.8.1 の `EntityTypeList`(5.2.24)。
289
+ * `details=true` の場合は代わりに `EntityType` の配列が返る(本 SDK では未対応)。
290
+ */
291
+ export interface EntityTypeList {
292
+ id: string;
293
+ type: "EntityTypeList";
294
+ /** 利用可能なエンティティ型名の配列 */
295
+ typeList: string[];
296
+ "@context"?: string | string[];
297
+ }
298
+ /**
299
+ * `GET /ngsi-ld/v1/attributes`(`details` 未指定)のレスポンス。
300
+ * ETSI GS CIM 009 / OpenAPI v1.8.1 の `AttributeList`(5.2.27)。
301
+ * `details=true` の場合は代わりに `Attribute` の配列が返る(本 SDK では未対応)。
302
+ */
303
+ export interface AttributeList {
304
+ id: string;
305
+ type: "AttributeList";
306
+ /** 利用可能な属性名の配列 */
307
+ attributeList: string[];
308
+ "@context"?: string | string[];
309
+ }
286
310
  export type Listener<T> = (data: T) => void;
287
311
  declare class EventEmitter {
288
312
  private _listeners;
@@ -404,12 +428,24 @@ declare class GeonicDB extends EventEmitter {
404
428
  deleteEntity(entityId: string): Promise<{
405
429
  deleted: true;
406
430
  }>;
407
- /** List all entity types. */
408
- getTypes(): Promise<Record<string, unknown>[]>;
431
+ /**
432
+ * List all entity types.
433
+ *
434
+ * `details` 未指定の `GET /types` は ETSI OpenAPI v1.8.1 準拠の
435
+ * `EntityTypeList` オブジェクト(`{ id, type: 'EntityTypeList', typeList }`)を返す。
436
+ * 型名の一覧は `typeList` から取得する。
437
+ */
438
+ getTypes(): Promise<EntityTypeList>;
409
439
  /** Get details for a specific entity type. */
410
440
  getType(typeName: string): Promise<Record<string, unknown>>;
411
- /** List all attributes. */
412
- getAttributes(): Promise<Record<string, unknown>[]>;
441
+ /**
442
+ * List all attributes.
443
+ *
444
+ * `details` 未指定の `GET /attributes` は ETSI OpenAPI v1.8.1 準拠の
445
+ * `AttributeList` オブジェクト(`{ id, type: 'AttributeList', attributeList }`)を返す。
446
+ * 属性名の一覧は `attributeList` から取得する。
447
+ */
448
+ getAttributes(): Promise<AttributeList>;
413
449
  /** Get details for a specific attribute. */
414
450
  getAttribute(attrName: string): Promise<Record<string, unknown>>;
415
451
  /** Query temporal entities. */
@@ -484,7 +520,7 @@ export interface LdGeoProperty {
484
520
  /** NGSI-LD Relationship */
485
521
  export interface LdRelationship {
486
522
  type: "Relationship";
487
- object: string;
523
+ object: string | string[];
488
524
  observedAt?: string;
489
525
  }
490
526
  export type LdAttribute = LdProperty | LdGeoProperty | LdRelationship;