@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/README.md CHANGED
@@ -257,9 +257,11 @@ await db.deleteEntity('urn:ngsi-ld:Room:001');
257
257
  ## Types / Attributes Discovery
258
258
 
259
259
  ```typescript
260
- const types = await db.getTypes();
260
+ // getTypes()/getAttributes() は EntityTypeList/AttributeList オブジェクトを返す。
261
+ // 型名・属性名の一覧は typeList / attributeList から取得する。
262
+ const { typeList } = await db.getTypes(); // string[]
261
263
  const roomType = await db.getType('Room');
262
- const attributes = await db.getAttributes();
264
+ const { attributeList } = await db.getAttributes(); // string[]
263
265
  const tempAttr = await db.getAttribute('temperature');
264
266
  ```
265
267
 
@@ -488,9 +490,9 @@ handle.stop();
488
490
 
489
491
  | Method | Parameters | Returns | Description |
490
492
  |--------|-----------|---------|-------------|
491
- | `getTypes()` | — | `Promise<Record<string, unknown>[]>` | List all entity types |
493
+ | `getTypes()` | — | `Promise<EntityTypeList>` | List all entity types (`{ id, type, typeList }`) |
492
494
  | `getType(typeName)` | `string` | `Promise<Record<string, unknown>>` | Get details for a specific entity type |
493
- | `getAttributes()` | — | `Promise<Record<string, unknown>[]>` | List all attributes |
495
+ | `getAttributes()` | — | `Promise<AttributeList>` | List all attributes (`{ id, type, attributeList }`) |
494
496
  | `getAttribute(attrName)` | `string` | `Promise<Record<string, unknown>>` | Get details for a specific attribute |
495
497
 
496
498
  ### Temporal API
package/geonicdb.cjs CHANGED
@@ -82,7 +82,7 @@ var RECONNECT_MAX_ATTEMPTS = 10;
82
82
  var RECONNECT_BASE_MS = 1e3;
83
83
  var RECONNECT_MAX_DELAY_MS = 3e4;
84
84
  var SUB_PROTOCOL = "access_token";
85
- var NGSI_LD_CORE_CONTEXT = "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld";
85
+ var NGSI_LD_CORE_CONTEXT = "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.9.jsonld";
86
86
  var SDK_CACHE_MAX_ENTRIES_DEFAULT = 1e3;
87
87
  var SDK_POLL_INTERVAL_MS_DEFAULT = 5e3;
88
88
  var DPOP_IDB_NAME = "geonicdb-sdk";
@@ -1967,7 +1967,13 @@ var GeonicDB = class extends EventEmitter {
1967
1967
  return { deleted: true };
1968
1968
  }
1969
1969
  // --- Types / Attributes Discovery ---
1970
- /** List all entity types. */
1970
+ /**
1971
+ * List all entity types.
1972
+ *
1973
+ * `details` 未指定の `GET /types` は ETSI OpenAPI v1.8.1 準拠の
1974
+ * `EntityTypeList` オブジェクト(`{ id, type: 'EntityTypeList', typeList }`)を返す。
1975
+ * 型名の一覧は `typeList` から取得する。
1976
+ */
1971
1977
  async getTypes() {
1972
1978
  return this._jsonGet("/ngsi-ld/v1/types", "Types query failed");
1973
1979
  }
@@ -1978,7 +1984,13 @@ var GeonicDB = class extends EventEmitter {
1978
1984
  "Type not found"
1979
1985
  );
1980
1986
  }
1981
- /** List all attributes. */
1987
+ /**
1988
+ * List all attributes.
1989
+ *
1990
+ * `details` 未指定の `GET /attributes` は ETSI OpenAPI v1.8.1 準拠の
1991
+ * `AttributeList` オブジェクト(`{ id, type: 'AttributeList', attributeList }`)を返す。
1992
+ * 属性名の一覧は `attributeList` から取得する。
1993
+ */
1982
1994
  async getAttributes() {
1983
1995
  return this._jsonGet("/ngsi-ld/v1/attributes", "Attributes query failed");
1984
1996
  }