geo-engine-node 2.1.0 → 3.0.0-rc.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/dist/index.d.cts CHANGED
@@ -1,224 +1,5 @@
1
- /**
2
- * Detailed error metadata returned by GeoEngine api-service.
3
- */
4
- interface SpatialErrorDetail {
5
- '@type'?: string;
6
- reason?: string;
7
- domain?: string;
8
- metadata?: Record<string, string>;
9
- }
10
- /**
11
- * Base error class for all GeoEngine SDK exceptions.
12
- */
13
- declare class GeoEngineError extends Error {
14
- constructor(message: string);
15
- }
16
- /**
17
- * Error thrown when an operation is attempted on a closed client instance.
18
- * Equivalent to Go's ErrClientClosed.
19
- */
20
- declare class ClientClosedError extends GeoEngineError {
21
- constructor(message?: string);
22
- }
23
- /**
24
- * Error thrown when a client-side parameter validation fails.
25
- */
26
- declare class ValidationError extends GeoEngineError {
27
- constructor(message: string);
28
- }
29
- /**
30
- * Error thrown when device_id is missing or empty.
31
- * Equivalent to Go's ErrDeviceIDRequired.
32
- */
33
- declare class DeviceIDRequiredError extends ValidationError {
34
- constructor(message?: string);
35
- }
36
- /**
37
- * Error thrown when a geofence_id is missing or empty.
38
- * Equivalent to Go's ErrGeofenceIDRequired.
39
- */
40
- declare class GeofenceIDRequiredError extends ValidationError {
41
- constructor(message?: string);
42
- }
43
- /**
44
- * Error thrown when latitude falls outside the valid range [-90, 90].
45
- * Equivalent to Go's ErrInvalidLatitude.
46
- */
47
- declare class InvalidLatitudeError extends ValidationError {
48
- constructor(message?: string);
49
- }
50
- /**
51
- * Error thrown when longitude falls outside the valid range [-180, 180].
52
- * Equivalent to Go's ErrInvalidLongitude.
53
- */
54
- declare class InvalidLongitudeError extends ValidationError {
55
- constructor(message?: string);
56
- }
57
- /**
58
- * Error thrown when coordinate polygon validation fails.
59
- * Equivalent to Go's ErrInvalidCoordinates.
60
- */
61
- declare class InvalidCoordinatesError extends ValidationError {
62
- constructor(message?: string);
63
- }
64
- /**
65
- * Represents an HTTP error returned by the GeoEngine REST or Management API.
66
- * Equivalent to Go's APIError.
67
- */
68
- declare class APIError extends GeoEngineError {
69
- readonly statusCode: number;
70
- constructor(statusCode: number, message: string);
71
- }
72
- /**
73
- * Represents a structured error returned by GeoEngine api-service.
74
- * Equivalent to Go's SpatialAPIError.
75
- */
76
- declare class SpatialAPIError extends APIError {
77
- readonly code: string;
78
- readonly statusText?: string;
79
- readonly details: SpatialErrorDetail[];
80
- constructor(statusCode: number, code: string, message: string, statusText?: string, details?: SpatialErrorDetail[]);
81
- /**
82
- * Returns true if the error indicates the geofence or resource was not found.
83
- */
84
- isNotFound(): boolean;
85
- /**
86
- * Returns true if the error indicates quota limit was hit.
87
- */
88
- isQuotaExceeded(): boolean;
89
- /**
90
- * Returns true if authentication failed.
91
- */
92
- isUnauthorized(): boolean;
93
- /**
94
- * Returns true if access to the requested resource is forbidden.
95
- */
96
- isForbidden(): boolean;
97
- }
98
- /**
99
- * Specific error thrown when a geofence is not found (204 or 404).
100
- * Equivalent to Go's ErrGeofenceNotFound.
101
- */
102
- declare class GeofenceNotFoundError extends SpatialAPIError {
103
- constructor(message?: string, statusCode?: number, details?: SpatialErrorDetail[]);
104
- }
105
- /**
106
- * Specific error thrown when request quota limit is exceeded (HTTP 402 or 429).
107
- * Equivalent to Go's ErrQuotaExceeded.
108
- */
109
- declare class QuotaExceededError extends SpatialAPIError {
110
- constructor(message?: string, statusCode?: number, details?: SpatialErrorDetail[]);
111
- }
112
- /**
113
- * Specific error thrown when API authentication fails (HTTP 401).
114
- * Equivalent to Go's ErrUnauthorized.
115
- */
116
- declare class AuthenticationError extends SpatialAPIError {
117
- constructor(message?: string, statusCode?: number, details?: SpatialErrorDetail[]);
118
- }
119
- /**
120
- * Specific error thrown when access is forbidden (HTTP 403).
121
- * Equivalent to Go's ErrForbidden.
122
- */
123
- declare class ForbiddenError extends SpatialAPIError {
124
- constructor(message?: string, statusCode?: number, details?: SpatialErrorDetail[]);
125
- }
126
- /**
127
- * Error thrown when a network request exceeds its deadline or timeout limit.
128
- */
129
- declare class TimeoutError extends GeoEngineError {
130
- constructor(timeoutMs: number);
131
- }
132
- /**
133
- * Error thrown when a user ID is missing or empty.
134
- * Equivalent to Go's ErrUserIDRequired.
135
- */
136
- declare class UserIDRequiredError extends ValidationError {
137
- constructor(message?: string);
138
- }
139
- /**
140
- * Error thrown when a GeoIdentity rule ID is missing or empty.
141
- * Equivalent to Go's ErrRuleIDRequired.
142
- */
143
- declare class RuleIDRequiredError extends ValidationError {
144
- constructor(message?: string);
145
- }
146
- /**
147
- * Error thrown when a GeoIdentity rule name is missing or empty.
148
- * Equivalent to Go's ErrRuleNameRequired.
149
- */
150
- declare class RuleNameRequiredError extends ValidationError {
151
- constructor(message?: string);
152
- }
153
- /**
154
- * Error thrown when an invitation email is missing or empty.
155
- * Equivalent to Go's ErrEmailRequired.
156
- */
157
- declare class EmailRequiredError extends ValidationError {
158
- constructor(message?: string);
159
- }
160
- /**
161
- * Error thrown when a role is missing or empty.
162
- * Equivalent to Go's ErrRoleRequired.
163
- */
164
- declare class RoleRequiredError extends ValidationError {
165
- constructor(message?: string);
166
- }
167
- /**
168
- * Structured error returned by the api-service Users and GeoIdentity endpoints.
169
- * Equivalent to Go's APIServiceError. Branch on the subclasses (for example
170
- * UserNotFoundError) or on `code`.
171
- */
172
- declare class APIServiceError extends APIError {
173
- /** Machine-readable reason, e.g. "USER_NOT_FOUND". Empty when the API sent none. */
174
- readonly code: string;
175
- /** Message returned by the API, without the SDK prefix. */
176
- readonly apiMessage: string;
177
- readonly details: SpatialErrorDetail[];
178
- constructor(statusCode: number, code: string, message: string, details?: SpatialErrorDetail[]);
179
- }
180
- /**
181
- * The user does not exist in the organization (or its access was revoked).
182
- * Equivalent to Go's ErrUserNotFound.
183
- */
184
- declare class UserNotFoundError extends APIServiceError {
185
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
186
- }
187
- /**
188
- * The GeoIdentity rule does not exist.
189
- * Equivalent to Go's ErrRuleNotFound.
190
- */
191
- declare class RuleNotFoundError extends APIServiceError {
192
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
193
- }
194
- /**
195
- * The invited email already belongs to the organization.
196
- * Equivalent to Go's ErrUserAlreadyExists.
197
- */
198
- declare class UserAlreadyExistsError extends APIServiceError {
199
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
200
- }
201
- /**
202
- * A pending invitation already exists for the email.
203
- * Equivalent to Go's ErrInvitationPending.
204
- */
205
- declare class InvitationPendingError extends APIServiceError {
206
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
207
- }
208
- /**
209
- * The operation would leave the organization without an admin.
210
- * Equivalent to Go's ErrLastAdmin.
211
- */
212
- declare class LastAdminError extends APIServiceError {
213
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
214
- }
215
- /**
216
- * The operation would leave a rule without assigned subjects.
217
- * Equivalent to Go's ErrLastSubject.
218
- */
219
- declare class LastSubjectError extends APIServiceError {
220
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
221
- }
1
+ import { o as IdentityService } from './errors-C5S_d0Ca.cjs';
2
+ export { A as APIError, w as APIServiceError, x as AuthenticationError, C as Challenge, y as ClientClosedError, D as Decision, z as DeviceIDRequiredError, B as EmailRequiredError, E as EvaluateMeta, b as EvaluateOptions, c as EvaluateReason, d as EvaluateRequest, e as EvaluateResponse, f as EvaluateSignal, F as FallbackDecision, g as FallbackReason, H as ForbiddenError, J as GeoEngineError, O as GeofenceIDRequiredError, P as GeofenceNotFoundError, h as IdentityContext, i as IdentityDecision, j as IdentityErrorFields, l as IdentityIntegrationError, m as IdentityIntegrationReason, n as IdentityLocation, p as IdentityServiceConfig, q as IdentitySubject, r as IdentityTransientError, s as IdentityTransientReason, Q as InvalidCoordinatesError, T as InvalidLatitudeError, U as InvalidLongitudeError, V as InvitationPendingError, K as KnownDecision, t as KnownSignal, W as LastAdminError, X as LastSubjectError, L as LocationSource, M as MetaSource, Y as QuotaExceededError, R as ReputationStatus, Z as RoleRequiredError, _ as RuleIDRequiredError, $ as RuleNameRequiredError, a0 as RuleNotFoundError, u as RuleRef, S as ShadowMatch, a1 as SpatialAPIError, a2 as SpatialErrorDetail, a3 as TimeoutError, a4 as UserAlreadyExistsError, a5 as UserIDRequiredError, a6 as UserNotFoundError, a7 as ValidationError, v as isTransient } from './errors-C5S_d0Ca.cjs';
222
3
 
223
4
  /**
224
5
  * Configuration options for the GeoEngine Client.
@@ -260,6 +41,11 @@ interface GeoEngineOptions {
260
41
  * HTTP request timeout in milliseconds. Default: 10000ms (10 seconds).
261
42
  */
262
43
  timeout?: number;
44
+ /**
45
+ * Total deadline in milliseconds for GeoIdentity `/v1/evaluate` calls (including retry).
46
+ * Default: 500ms.
47
+ */
48
+ identityTimeoutMs?: number;
263
49
  /**
264
50
  * Maximum number of automatic retries on network failures or 429/5xx status codes.
265
51
  * Default: 2.
@@ -449,13 +235,13 @@ interface RequestOptions {
449
235
  isApiService?: boolean;
450
236
  }
451
237
  interface HttpClientConfig {
452
- apiKey: string;
453
238
  jwtToken?: string;
454
239
  environment: string;
455
240
  managementUrl: string;
456
241
  ingestUrl: string;
457
242
  apiServiceUrl: string;
458
243
  timeout: number;
244
+ identityTimeoutMs: number;
459
245
  maxRetries: number;
460
246
  batchSize: number;
461
247
  flushInterval: number;
@@ -467,9 +253,11 @@ interface HttpClientConfig {
467
253
  * timeouts via AbortController, and exponential backoff retries.
468
254
  */
469
255
  declare class HttpClient {
256
+ #private;
470
257
  private readonly config;
471
258
  constructor(options?: GeoEngineOptions);
472
259
  get options(): Readonly<HttpClientConfig>;
260
+ toJSON(): Record<string, unknown>;
473
261
  /**
474
262
  * Executes an HTTP request with timeout, authentication headers and exponential backoff retry.
475
263
  */
@@ -862,6 +650,7 @@ declare class UsersService {
862
650
  * Equivalent to Go's Client struct.
863
651
  */
864
652
  declare class GeoEngine {
653
+ #private;
865
654
  private readonly http;
866
655
  private isClosed;
867
656
  /**
@@ -888,6 +677,10 @@ declare class GeoEngine {
888
677
  * Alias for geoIdentity (matches Go client.GeoIdentity).
889
678
  */
890
679
  readonly GeoIdentity: GeoIdentityService;
680
+ /**
681
+ * Server-only runtime decision client for `POST /v1/evaluate`.
682
+ */
683
+ readonly identity: IdentityService;
891
684
  /**
892
685
  * Initializes a new GeoEngine client instance.
893
686
  *
@@ -896,9 +689,10 @@ declare class GeoEngine {
896
689
  */
897
690
  constructor(apiKeyOrOptions: string | GeoEngineOptions, maybeOptions?: GeoEngineOptions);
898
691
  /**
899
- * Current configuration options.
692
+ * Current configuration options (without secret apiKey).
900
693
  */
901
694
  get options(): Readonly<HttpClientConfig>;
695
+ toJSON(): Record<string, unknown>;
902
696
  /**
903
697
  * Sends device coordinates over HTTP REST.
904
698
  * Equivalent to Go's Client.SendLocation.
@@ -984,4 +778,4 @@ declare function validateAndNormalizePolygon(coordinates: Array<[number, number]
984
778
  */
985
779
  declare function generateHMACSignature(key: string, timestamp: number): string;
986
780
 
987
- export { APIError, APIServiceError, AsyncIngester, AuthenticationError, GeoEngine as Client, ClientClosedError, type CreateRuleRequest, DeviceIDRequiredError, EmailRequiredError, ForbiddenError, GeneralGeofenceCheck, GeoEngine, GeoEngineError, type GeoEngineOptions, GeoIdentityService, type GeoLimit, GeofenceIDRequiredError, type GeofenceMatch, GeofenceNotFoundError, type GeofenceRequest, type HttpClientConfig, type IngestResponse, type IngesterClient, InvalidCoordinatesError, InvalidLatitudeError, InvalidLongitudeError, type Invitation, InvitationPendingError, type InviteUserRequest, LastAdminError, LastSubjectError, type ListRulesOptions, type LocationPing, QuotaExceededError, type Role, RoleRequiredError, Roles, type Rule, type RuleAction, RuleActions, RuleIDRequiredError, RuleNameRequiredError, RuleNotFoundError, SingleGeofenceCheck, SpatialAPIError, SpatialCheckBuilder, type SpatialErrorDetail, type SpatialGeneralRequest, SpatialGeneralResult, type SpatialGeneralResultData, SpatialService, type SpatialValidationRequest, SpatialValidationResult, type SpatialValidationResultData, type SubjectAssignment, type SubjectType, SubjectTypes, TimeoutError, type UpdateRuleRequest, type User, UserAlreadyExistsError, UserIDRequiredError, UserNotFoundError, UserStatus, UsersService, ValidationError, GeoEngine as default, generateHMACSignature, polygonFromLatLng, validateAndNormalizePolygon, validateCoordinates, validateDeviceId, validateGeofenceId };
781
+ export { AsyncIngester, GeoEngine as Client, type CreateRuleRequest, GeneralGeofenceCheck, GeoEngine, type GeoEngineOptions, GeoIdentityService, type GeoLimit, type GeofenceMatch, type GeofenceRequest, type HttpClientConfig, IdentityService, type IngestResponse, type IngesterClient, type Invitation, type InviteUserRequest, type ListRulesOptions, type LocationPing, type Role, Roles, type Rule, type RuleAction, RuleActions, SingleGeofenceCheck, SpatialCheckBuilder, type SpatialGeneralRequest, SpatialGeneralResult, type SpatialGeneralResultData, SpatialService, type SpatialValidationRequest, SpatialValidationResult, type SpatialValidationResultData, type SubjectAssignment, type SubjectType, SubjectTypes, type UpdateRuleRequest, type User, UserStatus, UsersService, GeoEngine as default, generateHMACSignature, polygonFromLatLng, validateAndNormalizePolygon, validateCoordinates, validateDeviceId, validateGeofenceId };
package/dist/index.d.ts CHANGED
@@ -1,224 +1,5 @@
1
- /**
2
- * Detailed error metadata returned by GeoEngine api-service.
3
- */
4
- interface SpatialErrorDetail {
5
- '@type'?: string;
6
- reason?: string;
7
- domain?: string;
8
- metadata?: Record<string, string>;
9
- }
10
- /**
11
- * Base error class for all GeoEngine SDK exceptions.
12
- */
13
- declare class GeoEngineError extends Error {
14
- constructor(message: string);
15
- }
16
- /**
17
- * Error thrown when an operation is attempted on a closed client instance.
18
- * Equivalent to Go's ErrClientClosed.
19
- */
20
- declare class ClientClosedError extends GeoEngineError {
21
- constructor(message?: string);
22
- }
23
- /**
24
- * Error thrown when a client-side parameter validation fails.
25
- */
26
- declare class ValidationError extends GeoEngineError {
27
- constructor(message: string);
28
- }
29
- /**
30
- * Error thrown when device_id is missing or empty.
31
- * Equivalent to Go's ErrDeviceIDRequired.
32
- */
33
- declare class DeviceIDRequiredError extends ValidationError {
34
- constructor(message?: string);
35
- }
36
- /**
37
- * Error thrown when a geofence_id is missing or empty.
38
- * Equivalent to Go's ErrGeofenceIDRequired.
39
- */
40
- declare class GeofenceIDRequiredError extends ValidationError {
41
- constructor(message?: string);
42
- }
43
- /**
44
- * Error thrown when latitude falls outside the valid range [-90, 90].
45
- * Equivalent to Go's ErrInvalidLatitude.
46
- */
47
- declare class InvalidLatitudeError extends ValidationError {
48
- constructor(message?: string);
49
- }
50
- /**
51
- * Error thrown when longitude falls outside the valid range [-180, 180].
52
- * Equivalent to Go's ErrInvalidLongitude.
53
- */
54
- declare class InvalidLongitudeError extends ValidationError {
55
- constructor(message?: string);
56
- }
57
- /**
58
- * Error thrown when coordinate polygon validation fails.
59
- * Equivalent to Go's ErrInvalidCoordinates.
60
- */
61
- declare class InvalidCoordinatesError extends ValidationError {
62
- constructor(message?: string);
63
- }
64
- /**
65
- * Represents an HTTP error returned by the GeoEngine REST or Management API.
66
- * Equivalent to Go's APIError.
67
- */
68
- declare class APIError extends GeoEngineError {
69
- readonly statusCode: number;
70
- constructor(statusCode: number, message: string);
71
- }
72
- /**
73
- * Represents a structured error returned by GeoEngine api-service.
74
- * Equivalent to Go's SpatialAPIError.
75
- */
76
- declare class SpatialAPIError extends APIError {
77
- readonly code: string;
78
- readonly statusText?: string;
79
- readonly details: SpatialErrorDetail[];
80
- constructor(statusCode: number, code: string, message: string, statusText?: string, details?: SpatialErrorDetail[]);
81
- /**
82
- * Returns true if the error indicates the geofence or resource was not found.
83
- */
84
- isNotFound(): boolean;
85
- /**
86
- * Returns true if the error indicates quota limit was hit.
87
- */
88
- isQuotaExceeded(): boolean;
89
- /**
90
- * Returns true if authentication failed.
91
- */
92
- isUnauthorized(): boolean;
93
- /**
94
- * Returns true if access to the requested resource is forbidden.
95
- */
96
- isForbidden(): boolean;
97
- }
98
- /**
99
- * Specific error thrown when a geofence is not found (204 or 404).
100
- * Equivalent to Go's ErrGeofenceNotFound.
101
- */
102
- declare class GeofenceNotFoundError extends SpatialAPIError {
103
- constructor(message?: string, statusCode?: number, details?: SpatialErrorDetail[]);
104
- }
105
- /**
106
- * Specific error thrown when request quota limit is exceeded (HTTP 402 or 429).
107
- * Equivalent to Go's ErrQuotaExceeded.
108
- */
109
- declare class QuotaExceededError extends SpatialAPIError {
110
- constructor(message?: string, statusCode?: number, details?: SpatialErrorDetail[]);
111
- }
112
- /**
113
- * Specific error thrown when API authentication fails (HTTP 401).
114
- * Equivalent to Go's ErrUnauthorized.
115
- */
116
- declare class AuthenticationError extends SpatialAPIError {
117
- constructor(message?: string, statusCode?: number, details?: SpatialErrorDetail[]);
118
- }
119
- /**
120
- * Specific error thrown when access is forbidden (HTTP 403).
121
- * Equivalent to Go's ErrForbidden.
122
- */
123
- declare class ForbiddenError extends SpatialAPIError {
124
- constructor(message?: string, statusCode?: number, details?: SpatialErrorDetail[]);
125
- }
126
- /**
127
- * Error thrown when a network request exceeds its deadline or timeout limit.
128
- */
129
- declare class TimeoutError extends GeoEngineError {
130
- constructor(timeoutMs: number);
131
- }
132
- /**
133
- * Error thrown when a user ID is missing or empty.
134
- * Equivalent to Go's ErrUserIDRequired.
135
- */
136
- declare class UserIDRequiredError extends ValidationError {
137
- constructor(message?: string);
138
- }
139
- /**
140
- * Error thrown when a GeoIdentity rule ID is missing or empty.
141
- * Equivalent to Go's ErrRuleIDRequired.
142
- */
143
- declare class RuleIDRequiredError extends ValidationError {
144
- constructor(message?: string);
145
- }
146
- /**
147
- * Error thrown when a GeoIdentity rule name is missing or empty.
148
- * Equivalent to Go's ErrRuleNameRequired.
149
- */
150
- declare class RuleNameRequiredError extends ValidationError {
151
- constructor(message?: string);
152
- }
153
- /**
154
- * Error thrown when an invitation email is missing or empty.
155
- * Equivalent to Go's ErrEmailRequired.
156
- */
157
- declare class EmailRequiredError extends ValidationError {
158
- constructor(message?: string);
159
- }
160
- /**
161
- * Error thrown when a role is missing or empty.
162
- * Equivalent to Go's ErrRoleRequired.
163
- */
164
- declare class RoleRequiredError extends ValidationError {
165
- constructor(message?: string);
166
- }
167
- /**
168
- * Structured error returned by the api-service Users and GeoIdentity endpoints.
169
- * Equivalent to Go's APIServiceError. Branch on the subclasses (for example
170
- * UserNotFoundError) or on `code`.
171
- */
172
- declare class APIServiceError extends APIError {
173
- /** Machine-readable reason, e.g. "USER_NOT_FOUND". Empty when the API sent none. */
174
- readonly code: string;
175
- /** Message returned by the API, without the SDK prefix. */
176
- readonly apiMessage: string;
177
- readonly details: SpatialErrorDetail[];
178
- constructor(statusCode: number, code: string, message: string, details?: SpatialErrorDetail[]);
179
- }
180
- /**
181
- * The user does not exist in the organization (or its access was revoked).
182
- * Equivalent to Go's ErrUserNotFound.
183
- */
184
- declare class UserNotFoundError extends APIServiceError {
185
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
186
- }
187
- /**
188
- * The GeoIdentity rule does not exist.
189
- * Equivalent to Go's ErrRuleNotFound.
190
- */
191
- declare class RuleNotFoundError extends APIServiceError {
192
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
193
- }
194
- /**
195
- * The invited email already belongs to the organization.
196
- * Equivalent to Go's ErrUserAlreadyExists.
197
- */
198
- declare class UserAlreadyExistsError extends APIServiceError {
199
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
200
- }
201
- /**
202
- * A pending invitation already exists for the email.
203
- * Equivalent to Go's ErrInvitationPending.
204
- */
205
- declare class InvitationPendingError extends APIServiceError {
206
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
207
- }
208
- /**
209
- * The operation would leave the organization without an admin.
210
- * Equivalent to Go's ErrLastAdmin.
211
- */
212
- declare class LastAdminError extends APIServiceError {
213
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
214
- }
215
- /**
216
- * The operation would leave a rule without assigned subjects.
217
- * Equivalent to Go's ErrLastSubject.
218
- */
219
- declare class LastSubjectError extends APIServiceError {
220
- constructor(message?: string, statusCode?: number, code?: string, details?: SpatialErrorDetail[]);
221
- }
1
+ import { o as IdentityService } from './errors-C5S_d0Ca.js';
2
+ export { A as APIError, w as APIServiceError, x as AuthenticationError, C as Challenge, y as ClientClosedError, D as Decision, z as DeviceIDRequiredError, B as EmailRequiredError, E as EvaluateMeta, b as EvaluateOptions, c as EvaluateReason, d as EvaluateRequest, e as EvaluateResponse, f as EvaluateSignal, F as FallbackDecision, g as FallbackReason, H as ForbiddenError, J as GeoEngineError, O as GeofenceIDRequiredError, P as GeofenceNotFoundError, h as IdentityContext, i as IdentityDecision, j as IdentityErrorFields, l as IdentityIntegrationError, m as IdentityIntegrationReason, n as IdentityLocation, p as IdentityServiceConfig, q as IdentitySubject, r as IdentityTransientError, s as IdentityTransientReason, Q as InvalidCoordinatesError, T as InvalidLatitudeError, U as InvalidLongitudeError, V as InvitationPendingError, K as KnownDecision, t as KnownSignal, W as LastAdminError, X as LastSubjectError, L as LocationSource, M as MetaSource, Y as QuotaExceededError, R as ReputationStatus, Z as RoleRequiredError, _ as RuleIDRequiredError, $ as RuleNameRequiredError, a0 as RuleNotFoundError, u as RuleRef, S as ShadowMatch, a1 as SpatialAPIError, a2 as SpatialErrorDetail, a3 as TimeoutError, a4 as UserAlreadyExistsError, a5 as UserIDRequiredError, a6 as UserNotFoundError, a7 as ValidationError, v as isTransient } from './errors-C5S_d0Ca.js';
222
3
 
223
4
  /**
224
5
  * Configuration options for the GeoEngine Client.
@@ -260,6 +41,11 @@ interface GeoEngineOptions {
260
41
  * HTTP request timeout in milliseconds. Default: 10000ms (10 seconds).
261
42
  */
262
43
  timeout?: number;
44
+ /**
45
+ * Total deadline in milliseconds for GeoIdentity `/v1/evaluate` calls (including retry).
46
+ * Default: 500ms.
47
+ */
48
+ identityTimeoutMs?: number;
263
49
  /**
264
50
  * Maximum number of automatic retries on network failures or 429/5xx status codes.
265
51
  * Default: 2.
@@ -449,13 +235,13 @@ interface RequestOptions {
449
235
  isApiService?: boolean;
450
236
  }
451
237
  interface HttpClientConfig {
452
- apiKey: string;
453
238
  jwtToken?: string;
454
239
  environment: string;
455
240
  managementUrl: string;
456
241
  ingestUrl: string;
457
242
  apiServiceUrl: string;
458
243
  timeout: number;
244
+ identityTimeoutMs: number;
459
245
  maxRetries: number;
460
246
  batchSize: number;
461
247
  flushInterval: number;
@@ -467,9 +253,11 @@ interface HttpClientConfig {
467
253
  * timeouts via AbortController, and exponential backoff retries.
468
254
  */
469
255
  declare class HttpClient {
256
+ #private;
470
257
  private readonly config;
471
258
  constructor(options?: GeoEngineOptions);
472
259
  get options(): Readonly<HttpClientConfig>;
260
+ toJSON(): Record<string, unknown>;
473
261
  /**
474
262
  * Executes an HTTP request with timeout, authentication headers and exponential backoff retry.
475
263
  */
@@ -862,6 +650,7 @@ declare class UsersService {
862
650
  * Equivalent to Go's Client struct.
863
651
  */
864
652
  declare class GeoEngine {
653
+ #private;
865
654
  private readonly http;
866
655
  private isClosed;
867
656
  /**
@@ -888,6 +677,10 @@ declare class GeoEngine {
888
677
  * Alias for geoIdentity (matches Go client.GeoIdentity).
889
678
  */
890
679
  readonly GeoIdentity: GeoIdentityService;
680
+ /**
681
+ * Server-only runtime decision client for `POST /v1/evaluate`.
682
+ */
683
+ readonly identity: IdentityService;
891
684
  /**
892
685
  * Initializes a new GeoEngine client instance.
893
686
  *
@@ -896,9 +689,10 @@ declare class GeoEngine {
896
689
  */
897
690
  constructor(apiKeyOrOptions: string | GeoEngineOptions, maybeOptions?: GeoEngineOptions);
898
691
  /**
899
- * Current configuration options.
692
+ * Current configuration options (without secret apiKey).
900
693
  */
901
694
  get options(): Readonly<HttpClientConfig>;
695
+ toJSON(): Record<string, unknown>;
902
696
  /**
903
697
  * Sends device coordinates over HTTP REST.
904
698
  * Equivalent to Go's Client.SendLocation.
@@ -984,4 +778,4 @@ declare function validateAndNormalizePolygon(coordinates: Array<[number, number]
984
778
  */
985
779
  declare function generateHMACSignature(key: string, timestamp: number): string;
986
780
 
987
- export { APIError, APIServiceError, AsyncIngester, AuthenticationError, GeoEngine as Client, ClientClosedError, type CreateRuleRequest, DeviceIDRequiredError, EmailRequiredError, ForbiddenError, GeneralGeofenceCheck, GeoEngine, GeoEngineError, type GeoEngineOptions, GeoIdentityService, type GeoLimit, GeofenceIDRequiredError, type GeofenceMatch, GeofenceNotFoundError, type GeofenceRequest, type HttpClientConfig, type IngestResponse, type IngesterClient, InvalidCoordinatesError, InvalidLatitudeError, InvalidLongitudeError, type Invitation, InvitationPendingError, type InviteUserRequest, LastAdminError, LastSubjectError, type ListRulesOptions, type LocationPing, QuotaExceededError, type Role, RoleRequiredError, Roles, type Rule, type RuleAction, RuleActions, RuleIDRequiredError, RuleNameRequiredError, RuleNotFoundError, SingleGeofenceCheck, SpatialAPIError, SpatialCheckBuilder, type SpatialErrorDetail, type SpatialGeneralRequest, SpatialGeneralResult, type SpatialGeneralResultData, SpatialService, type SpatialValidationRequest, SpatialValidationResult, type SpatialValidationResultData, type SubjectAssignment, type SubjectType, SubjectTypes, TimeoutError, type UpdateRuleRequest, type User, UserAlreadyExistsError, UserIDRequiredError, UserNotFoundError, UserStatus, UsersService, ValidationError, GeoEngine as default, generateHMACSignature, polygonFromLatLng, validateAndNormalizePolygon, validateCoordinates, validateDeviceId, validateGeofenceId };
781
+ export { AsyncIngester, GeoEngine as Client, type CreateRuleRequest, GeneralGeofenceCheck, GeoEngine, type GeoEngineOptions, GeoIdentityService, type GeoLimit, type GeofenceMatch, type GeofenceRequest, type HttpClientConfig, IdentityService, type IngestResponse, type IngesterClient, type Invitation, type InviteUserRequest, type ListRulesOptions, type LocationPing, type Role, Roles, type Rule, type RuleAction, RuleActions, SingleGeofenceCheck, SpatialCheckBuilder, type SpatialGeneralRequest, SpatialGeneralResult, type SpatialGeneralResultData, SpatialService, type SpatialValidationRequest, SpatialValidationResult, type SpatialValidationResultData, type SubjectAssignment, type SubjectType, SubjectTypes, type UpdateRuleRequest, type User, UserStatus, UsersService, GeoEngine as default, generateHMACSignature, polygonFromLatLng, validateAndNormalizePolygon, validateCoordinates, validateDeviceId, validateGeofenceId };