@geolonia/geonicdb-sdk 0.6.0 → 0.7.1
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 +23 -0
- package/geonicdb.d.ts +28 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,29 @@ await db.createEntity({
|
|
|
33
33
|
});
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
### TypeScript
|
|
37
|
+
|
|
38
|
+
The SDK ships type definitions (`geonicdb.d.ts`) in the published package. Named imports of error classes and types resolve cleanly even under strict tsconfig settings (`strict`, `verbatimModuleSyntax`, etc.):
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import GeonicDB, {
|
|
42
|
+
AuthorizationError,
|
|
43
|
+
AuthenticationError,
|
|
44
|
+
type EntityEvent,
|
|
45
|
+
type RefreshedCredentials,
|
|
46
|
+
} from '@geolonia/geonicdb-sdk';
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
await db.deleteEntity(entityId);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
if (err instanceof AuthorizationError) {
|
|
52
|
+
// Type-safe branch on XACML denial.
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
See **Error Handling** below for the full list of exported error classes.
|
|
58
|
+
|
|
36
59
|
### Browser (script tag)
|
|
37
60
|
|
|
38
61
|
```html
|
package/geonicdb.d.ts
CHANGED
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
export {
|
|
2
|
-
|
|
1
|
+
export {
|
|
2
|
+
AuthenticationError,
|
|
3
|
+
AuthorizationError,
|
|
4
|
+
ConflictError,
|
|
5
|
+
GeonicDB,
|
|
6
|
+
GeonicDBError,
|
|
7
|
+
NetworkError,
|
|
8
|
+
NotFoundError,
|
|
9
|
+
RateLimitError,
|
|
10
|
+
ValidationError,
|
|
11
|
+
} from './index';
|
|
12
|
+
export type {
|
|
13
|
+
CacheEvent,
|
|
14
|
+
CountEntitiesParams,
|
|
15
|
+
CredentialsOptions,
|
|
16
|
+
EntityEvent,
|
|
17
|
+
GeonicDBEventMap,
|
|
18
|
+
GeonicDBOptions,
|
|
19
|
+
GetEntitiesParams,
|
|
20
|
+
GetTemporalEntitiesParams,
|
|
21
|
+
LoginResponse,
|
|
22
|
+
PollHandle,
|
|
23
|
+
PollOptions,
|
|
24
|
+
ReconnectingEvent,
|
|
25
|
+
RefreshedCredentials,
|
|
26
|
+
SubscribeOptions,
|
|
27
|
+
} from './index';
|
|
28
|
+
export { default } from './index';
|