@oneidentity/safeguard 8.2.0-pre58935 → 8.2.0-pre6932
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/browser.d.ts +28 -28
- package/dist/browser.d.ts.map +1 -1
- package/dist/events.d.cts +3 -3
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.ts +3 -3
- package/dist/events.d.ts.map +1 -1
- package/dist/index.d.cts +35 -35
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +35 -35
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/browser.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ interface StorageProvider {
|
|
|
35
35
|
clear(): void;
|
|
36
36
|
}
|
|
37
37
|
/** Well-known storage keys used by the SDK. */
|
|
38
|
-
declare const StorageKeys: {
|
|
38
|
+
export declare const StorageKeys: {
|
|
39
39
|
readonly STATE: "safeguard_state";
|
|
40
40
|
readonly CODE_VERIFIER: "safeguard_code_verifier";
|
|
41
41
|
};
|
|
@@ -49,7 +49,7 @@ declare const StorageKeys: {
|
|
|
49
49
|
* - `console.log(secretValue)` prints "[REDACTED]"
|
|
50
50
|
* - `.expose()` returns the raw value when intentionally needed
|
|
51
51
|
*/
|
|
52
|
-
declare class SecretValue {
|
|
52
|
+
export declare class SecretValue {
|
|
53
53
|
#private;
|
|
54
54
|
constructor(value: string);
|
|
55
55
|
/** Returns the raw secret. Use only when you intentionally need the plaintext. */
|
|
@@ -94,7 +94,7 @@ interface Auth {
|
|
|
94
94
|
/**
|
|
95
95
|
* Safeguard appliance service endpoints.
|
|
96
96
|
*/
|
|
97
|
-
declare enum Service {
|
|
97
|
+
export declare enum Service {
|
|
98
98
|
CORE = "core",
|
|
99
99
|
APPLIANCE = "appliance",
|
|
100
100
|
NOTIFICATION = "notification",
|
|
@@ -105,7 +105,7 @@ declare enum Service {
|
|
|
105
105
|
/**
|
|
106
106
|
* HTTP methods supported by the Safeguard API.
|
|
107
107
|
*/
|
|
108
|
-
declare enum HttpMethod {
|
|
108
|
+
export declare enum HttpMethod {
|
|
109
109
|
GET = "GET",
|
|
110
110
|
POST = "POST",
|
|
111
111
|
PUT = "PUT",
|
|
@@ -169,7 +169,7 @@ interface SafeguardClientOptions {
|
|
|
169
169
|
* ├── TransportError (Network/connection failures)
|
|
170
170
|
* └── ConfigurationError (Invalid client options)
|
|
171
171
|
*/
|
|
172
|
-
declare class SafeguardError extends Error {
|
|
172
|
+
export declare class SafeguardError extends Error {
|
|
173
173
|
constructor(message: string, options?: ErrorOptions);
|
|
174
174
|
}
|
|
175
175
|
interface ApiErrorBody {
|
|
@@ -180,7 +180,7 @@ interface ApiErrorBody {
|
|
|
180
180
|
};
|
|
181
181
|
[key: string]: unknown;
|
|
182
182
|
}
|
|
183
|
-
declare class ApiError extends SafeguardError {
|
|
183
|
+
export declare class ApiError extends SafeguardError {
|
|
184
184
|
readonly status: number;
|
|
185
185
|
readonly body: ApiErrorBody | null;
|
|
186
186
|
constructor(message: string, status: number, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
@@ -191,19 +191,19 @@ declare class ApiError extends SafeguardError {
|
|
|
191
191
|
private static parseBody;
|
|
192
192
|
private static buildMessage;
|
|
193
193
|
}
|
|
194
|
-
declare class AuthenticationError extends ApiError {
|
|
194
|
+
export declare class AuthenticationError extends ApiError {
|
|
195
195
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
196
196
|
}
|
|
197
|
-
declare class AuthorizationError extends ApiError {
|
|
197
|
+
export declare class AuthorizationError extends ApiError {
|
|
198
198
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
199
199
|
}
|
|
200
|
-
declare class NotFoundError extends ApiError {
|
|
200
|
+
export declare class NotFoundError extends ApiError {
|
|
201
201
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
202
202
|
}
|
|
203
|
-
declare class TransportError extends SafeguardError {
|
|
203
|
+
export declare class TransportError extends SafeguardError {
|
|
204
204
|
constructor(message: string, options?: ErrorOptions);
|
|
205
205
|
}
|
|
206
|
-
declare class ConfigurationError extends SafeguardError {
|
|
206
|
+
export declare class ConfigurationError extends SafeguardError {
|
|
207
207
|
constructor(message: string, options?: ErrorOptions);
|
|
208
208
|
}
|
|
209
209
|
//#endregion
|
|
@@ -215,7 +215,7 @@ declare class ConfigurationError extends SafeguardError {
|
|
|
215
215
|
* buildServiceUrl('appliance.example.com', Service.CORE)
|
|
216
216
|
* // => 'https://appliance.example.com/service/core/v4'
|
|
217
217
|
*/
|
|
218
|
-
declare function buildServiceUrl(host: string, service: Service, apiVersion?: string): string;
|
|
218
|
+
export declare function buildServiceUrl(host: string, service: Service, apiVersion?: string): string;
|
|
219
219
|
/**
|
|
220
220
|
* Builds a full API URL including path and optional query parameters.
|
|
221
221
|
*
|
|
@@ -223,32 +223,32 @@ declare function buildServiceUrl(host: string, service: Service, apiVersion?: st
|
|
|
223
223
|
* buildRequestUrl('appliance.example.com', Service.CORE, 'Users', { filter: 'Name eq "admin"' })
|
|
224
224
|
* // => 'https://appliance.example.com/service/core/v4/Users?filter=Name+eq+%22admin%22'
|
|
225
225
|
*/
|
|
226
|
-
declare function buildRequestUrl(host: string, service: Service, relativeUrl: string, query?: Record<string, string | number | boolean>, apiVersion?: string): string;
|
|
226
|
+
export declare function buildRequestUrl(host: string, service: Service, relativeUrl: string, query?: Record<string, string | number | boolean>, apiVersion?: string): string;
|
|
227
227
|
/**
|
|
228
228
|
* Encodes bytes to a URL-safe base64 string (no padding).
|
|
229
229
|
*/
|
|
230
|
-
declare function base64UrlEncode(bytes: Uint8Array): string;
|
|
230
|
+
export declare function base64UrlEncode(bytes: Uint8Array): string;
|
|
231
231
|
/**
|
|
232
232
|
* Generates a cryptographically random code verifier for PKCE.
|
|
233
233
|
* Returns a 43-character base64url string (32 random bytes).
|
|
234
234
|
*/
|
|
235
|
-
declare function generateCodeVerifier(): string;
|
|
235
|
+
export declare function generateCodeVerifier(): string;
|
|
236
236
|
/**
|
|
237
237
|
* Computes the S256 code challenge from a code verifier.
|
|
238
238
|
* Uses Web Crypto API (available in Node 20+ and all modern browsers).
|
|
239
239
|
*/
|
|
240
|
-
declare function generateCodeChallenge(verifier: string): Promise<string>;
|
|
240
|
+
export declare function generateCodeChallenge(verifier: string): Promise<string>;
|
|
241
241
|
/**
|
|
242
242
|
* Generates a random state parameter for OAuth flows.
|
|
243
243
|
*/
|
|
244
|
-
declare function generateState(): string;
|
|
244
|
+
export declare function generateState(): string;
|
|
245
245
|
//#endregion
|
|
246
246
|
//#region src/storage/memory.d.ts
|
|
247
247
|
/**
|
|
248
248
|
* In-memory storage provider. Default for Node.js environments.
|
|
249
249
|
* Data does not persist across process restarts.
|
|
250
250
|
*/
|
|
251
|
-
declare class MemoryStorage implements StorageProvider {
|
|
251
|
+
export declare class MemoryStorage implements StorageProvider {
|
|
252
252
|
#private;
|
|
253
253
|
get(key: string): string | null;
|
|
254
254
|
set(key: string, value: string): void;
|
|
@@ -261,7 +261,7 @@ declare class MemoryStorage implements StorageProvider {
|
|
|
261
261
|
* Browser sessionStorage adapter. Data persists for the browser tab lifetime.
|
|
262
262
|
* Requires a DOM environment (browser or jsdom).
|
|
263
263
|
*/
|
|
264
|
-
declare class BrowserSessionStorage implements StorageProvider {
|
|
264
|
+
export declare class BrowserSessionStorage implements StorageProvider {
|
|
265
265
|
get(key: string): string | null;
|
|
266
266
|
set(key: string, value: string): void;
|
|
267
267
|
remove(key: string): void;
|
|
@@ -273,7 +273,7 @@ declare class BrowserSessionStorage implements StorageProvider {
|
|
|
273
273
|
* Browser HTTP client using native fetch API.
|
|
274
274
|
* No TLS configuration needed — browser handles certificates.
|
|
275
275
|
*/
|
|
276
|
-
declare class BrowserHttpClient implements HttpClient {
|
|
276
|
+
export declare class BrowserHttpClient implements HttpClient {
|
|
277
277
|
#private;
|
|
278
278
|
constructor(options?: {
|
|
279
279
|
credentials?: RequestCredentials;
|
|
@@ -291,7 +291,7 @@ interface PasswordAuthOptions {
|
|
|
291
291
|
/**
|
|
292
292
|
* Authenticates using username/password via RSTS Resource Owner grant.
|
|
293
293
|
*/
|
|
294
|
-
declare class PasswordAuth implements Auth {
|
|
294
|
+
export declare class PasswordAuth implements Auth {
|
|
295
295
|
#private;
|
|
296
296
|
constructor(options: PasswordAuthOptions);
|
|
297
297
|
get description(): string;
|
|
@@ -310,7 +310,7 @@ interface PkceAuthOptions {
|
|
|
310
310
|
* Authenticates using PKCE (Proof Key for Code Exchange) with browser redirect.
|
|
311
311
|
* For browser environments where the user is redirected to RSTS login.
|
|
312
312
|
*/
|
|
313
|
-
declare class PkceAuth implements Auth {
|
|
313
|
+
export declare class PkceAuth implements Auth {
|
|
314
314
|
#private;
|
|
315
315
|
constructor(options: PkceAuthOptions);
|
|
316
316
|
get description(): string;
|
|
@@ -368,7 +368,7 @@ interface DeviceCodeAuthOptions {
|
|
|
368
368
|
* spawns or opens a browser and performs no display I/O. Platform-agnostic, so
|
|
369
369
|
* it is exported from both the Node and browser entry points.
|
|
370
370
|
*/
|
|
371
|
-
declare class DeviceCodeAuth implements Auth {
|
|
371
|
+
export declare class DeviceCodeAuth implements Auth {
|
|
372
372
|
#private;
|
|
373
373
|
constructor(options: DeviceCodeAuthOptions);
|
|
374
374
|
get description(): string;
|
|
@@ -391,7 +391,7 @@ interface PkceCallbackResult {
|
|
|
391
391
|
* @param url - The callback URL to parse (defaults to window.location.href)
|
|
392
392
|
* @returns The parsed code and state, or null if not a valid callback
|
|
393
393
|
*/
|
|
394
|
-
declare function handlePkceCallback(storage: StorageProvider, url?: string): PkceCallbackResult | null;
|
|
394
|
+
export declare function handlePkceCallback(storage: StorageProvider, url?: string): PkceCallbackResult | null;
|
|
395
395
|
//#endregion
|
|
396
396
|
//#region src/auth/token.d.ts
|
|
397
397
|
interface TokenAuthOptions {
|
|
@@ -402,7 +402,7 @@ interface TokenAuthOptions {
|
|
|
402
402
|
* Uses a pre-existing access token. No authentication flow — the token is assumed valid.
|
|
403
403
|
* Useful when tokens are obtained externally or for service-to-service scenarios.
|
|
404
404
|
*/
|
|
405
|
-
declare class TokenAuth implements Auth {
|
|
405
|
+
export declare class TokenAuth implements Auth {
|
|
406
406
|
#private;
|
|
407
407
|
constructor(options: TokenAuthOptions);
|
|
408
408
|
get description(): string;
|
|
@@ -414,7 +414,7 @@ declare class TokenAuth implements Auth {
|
|
|
414
414
|
* Anonymous authentication — no credentials.
|
|
415
415
|
* Used for accessing public Safeguard endpoints (e.g., appliance status).
|
|
416
416
|
*/
|
|
417
|
-
declare class AnonymousAuth implements Auth {
|
|
417
|
+
export declare class AnonymousAuth implements Auth {
|
|
418
418
|
get description(): string;
|
|
419
419
|
authenticate(_host: string, _httpClient: HttpClient, _storage: StorageProvider): Promise<TokenSet>;
|
|
420
420
|
}
|
|
@@ -424,7 +424,7 @@ declare class AnonymousAuth implements Auth {
|
|
|
424
424
|
* Main entry point for the Safeguard SDK.
|
|
425
425
|
* Instance-based — no global state. Multiple clients to different appliances are supported.
|
|
426
426
|
*/
|
|
427
|
-
declare class SafeguardClient {
|
|
427
|
+
export declare class SafeguardClient {
|
|
428
428
|
#private;
|
|
429
429
|
constructor(host: string, options: SafeguardClientOptions);
|
|
430
430
|
/** The appliance hostname this client connects to. */
|
|
@@ -477,5 +477,5 @@ declare class SafeguardClient {
|
|
|
477
477
|
invoke<T = unknown>(service: Service, method: HttpMethod, relativeUrl: string, options?: RequestOptions): Promise<T>;
|
|
478
478
|
}
|
|
479
479
|
//#endregion
|
|
480
|
-
export {
|
|
480
|
+
export type { ApiErrorBody, Auth, DeviceCodeAuthOptions, DeviceCodeInfo, HttpClient, HttpRequestOptions, HttpResponse, PasswordAuthOptions, PkceAuthOptions, PkceCallbackResult, RequestOptions, SafeguardClientOptions, SafeguardResponse, StorageProvider, TokenAuthOptions, TokenSet };
|
|
481
481
|
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","names":[],"sources":["../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/types.ts","../src/errors.ts","../src/utils.ts","../src/storage/memory.ts","../src/storage/session.ts","../src/http/browser.ts","../src/auth/password.ts","../src/auth/pkce.ts","../src/auth/device-code.ts","../src/auth/pkce-callback.ts","../src/auth/token.ts","../src/auth/anonymous.ts","../src/client.ts"],"mappings":";;;;UAIiB;EACf;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT;;UAGe;EACf;EACA,SAAS;EACT;;;;;;UA+Ce;EACf,QAAQ,SAAS,qBAAqB,QAAQ;EAC9C;;;;;;;UC9De;EACf,IAAI;EACJ,IAAI,aAAa;EACjB,OAAO;EACP;;;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","names":["_$__auth_types_js0.Auth"],"sources":["../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/types.ts","../src/errors.ts","../src/utils.ts","../src/storage/memory.ts","../src/storage/session.ts","../src/http/browser.ts","../src/auth/password.ts","../src/auth/pkce.ts","../src/auth/device-code.ts","../src/auth/pkce-callback.ts","../src/auth/token.ts","../src/auth/anonymous.ts","../src/client.ts"],"mappings":";;;;UAIiB;EACf;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT;;UAGe;EACf;EACA,SAAS;EACT;;;;;;UA+Ce;EACf,QAAQ,SAAS,qBAAqB,QAAQ;EAC9C;;;;;;;UC9De;EACf,IAAI;EACJ,IAAI,aAAa;EACjB,OAAO;EACP;;;qBAIW;;;;;;;;;;;;;;qBCDA;;EAGC,YAAA;;EAKZ;EAIA;EAIA;OASK,OAAO;;;;;;;UC5BG;;EAEf,aAAa;;EAEb;;EAEA;;;;;UAMe;;;;;;;EAOf,aAAa,cAAc,YAAY,YAAY,SAAS,kBAAkB,QAAQ;;;;EAKtF,cAAc,cAAc,YAAY,YAAY,SAAS,kBAAkB,QAAQ;;WAG9E;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a,SAAS,SAAS,qBAAqB,UAAU,iBAAiB,QAAQ;;;;;;;EAY7F,OAAO,aACX,SAAS,SACT,QAAQ,YACR,qBACA,UAAU,iBACT,QAAQ"}
|
package/dist/events.d.cts
CHANGED
|
@@ -35,7 +35,7 @@ interface PersistentListenerOptions {
|
|
|
35
35
|
* One-shot event listener wrapping a SignalR HubConnection.
|
|
36
36
|
* For persistent auto-reconnect behavior, use PersistentSafeguardEventListener.
|
|
37
37
|
*/
|
|
38
|
-
declare class SafeguardEventListener {
|
|
38
|
+
export declare class SafeguardEventListener {
|
|
39
39
|
#private;
|
|
40
40
|
constructor(connection: HubConnection);
|
|
41
41
|
/** Current connection state. */
|
|
@@ -131,7 +131,7 @@ interface Auth {
|
|
|
131
131
|
* - State change event notifications
|
|
132
132
|
* - Manual `stop()` that prevents further auto-reconnect
|
|
133
133
|
*/
|
|
134
|
-
declare class PersistentSafeguardEventListener {
|
|
134
|
+
export declare class PersistentSafeguardEventListener {
|
|
135
135
|
#private;
|
|
136
136
|
constructor(connection: HubConnection, auth: Auth, host: string, httpClient: HttpClient, storage: StorageProvider, options?: PersistentListenerOptions, tokenSet?: TokenSet);
|
|
137
137
|
/** Current connection state. */
|
|
@@ -154,5 +154,5 @@ declare class PersistentSafeguardEventListener {
|
|
|
154
154
|
stop(): Promise<void>;
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
|
-
export {
|
|
157
|
+
export type { EventHandler, EventListenerState, PersistentListenerOptions, SafeguardEvent, StateChangeHandler };
|
|
158
158
|
//# sourceMappingURL=events.d.cts.map
|
package/dist/events.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.cts","names":[],"sources":["../src/events/types.ts","../src/events/listener.ts","../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/events/persistent.ts"],"mappings":";;;;;KAGY;;;;KAUA,gBAAgB,OAAO;;;;KAKvB,sBAAsB,OAAO;;;;UAKxB;EACf;GACC;;;;;UAMc;;EAEf;;EAEA;;;;;;;;
|
|
1
|
+
{"version":3,"file":"events.d.cts","names":[],"sources":["../src/events/types.ts","../src/events/listener.ts","../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/events/persistent.ts"],"mappings":";;;;;KAGY;;;;KAUA,gBAAgB,OAAO;;;;KAKvB,sBAAsB,OAAO;;;;UAKxB;EACf;GACC;;;;;UAMc;;EAEf;;EAEA;;;;;;;;qBC5BW;;EAKC,YAAA,YAAY;;MAwBpB,SAAS;;;;EAOb,GAAG,6BAA6B,SAAS;;;;EAQnC,SAAS;;;;EAST,QAAQ;;;;;;;UCxDC;EACf;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT;;UAGe;EACf;EACA,SAAS;EACT;;;;;;UA+Ce;EACf,QAAQ,SAAS,qBAAqB,QAAQ;EAC9C;;;;;;;UC9De;EACf,IAAI;EACJ,IAAI,aAAa;EACjB,OAAO;EACP;;;;;;;;;;;;cCGW;;EAGC,YAAA;;EAKZ;EAIA;EAIA;OASK,OAAO;;;;;;;UC5BG;;EAEf,aAAa;;EAEb;;EAEA;;;;;UAMe;;;;;;;EAOf,aAAa,cAAc,YAAY,YAAY,SAAS,kBAAkB,QAAQ;;;;EAKtF,cAAc,cAAc,YAAY,YAAY,SAAS,kBAAkB,QAAQ;;WAG9E;;;;;;;;;;;;qBCXE;;EAoBT,YAAA,YAAY,eACZ,MAAM,MACN,cACA,YAAY,YACZ,SAAS,iBACT,UAAU,2BACV,WAAW;;MAmCT,SAAS;;;;EAOb,GAAG,6BAA6B,SAAS;;;;EAQzC,cAAc,SAAS;;;;EAQjB,SAAS;;;;EAWT,QAAQ"}
|
package/dist/events.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ interface PersistentListenerOptions {
|
|
|
35
35
|
* One-shot event listener wrapping a SignalR HubConnection.
|
|
36
36
|
* For persistent auto-reconnect behavior, use PersistentSafeguardEventListener.
|
|
37
37
|
*/
|
|
38
|
-
declare class SafeguardEventListener {
|
|
38
|
+
export declare class SafeguardEventListener {
|
|
39
39
|
#private;
|
|
40
40
|
constructor(connection: HubConnection);
|
|
41
41
|
/** Current connection state. */
|
|
@@ -131,7 +131,7 @@ interface Auth {
|
|
|
131
131
|
* - State change event notifications
|
|
132
132
|
* - Manual `stop()` that prevents further auto-reconnect
|
|
133
133
|
*/
|
|
134
|
-
declare class PersistentSafeguardEventListener {
|
|
134
|
+
export declare class PersistentSafeguardEventListener {
|
|
135
135
|
#private;
|
|
136
136
|
constructor(connection: HubConnection, auth: Auth, host: string, httpClient: HttpClient, storage: StorageProvider, options?: PersistentListenerOptions, tokenSet?: TokenSet);
|
|
137
137
|
/** Current connection state. */
|
|
@@ -154,5 +154,5 @@ declare class PersistentSafeguardEventListener {
|
|
|
154
154
|
stop(): Promise<void>;
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
|
-
export {
|
|
157
|
+
export type { EventHandler, EventListenerState, PersistentListenerOptions, SafeguardEvent, StateChangeHandler };
|
|
158
158
|
//# sourceMappingURL=events.d.ts.map
|
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","names":[],"sources":["../src/events/types.ts","../src/events/listener.ts","../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/events/persistent.ts"],"mappings":";;;;;KAGY;;;;KAUA,gBAAgB,OAAO;;;;KAKvB,sBAAsB,OAAO;;;;UAKxB;EACf;GACC;;;;;UAMc;;EAEf;;EAEA;;;;;;;;
|
|
1
|
+
{"version":3,"file":"events.d.ts","names":[],"sources":["../src/events/types.ts","../src/events/listener.ts","../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/events/persistent.ts"],"mappings":";;;;;KAGY;;;;KAUA,gBAAgB,OAAO;;;;KAKvB,sBAAsB,OAAO;;;;UAKxB;EACf;GACC;;;;;UAMc;;EAEf;;EAEA;;;;;;;;qBC5BW;;EAKC,YAAA,YAAY;;MAwBpB,SAAS;;;;EAOb,GAAG,6BAA6B,SAAS;;;;EAQnC,SAAS;;;;EAST,QAAQ;;;;;;;UCxDC;EACf;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT;;UAGe;EACf;EACA,SAAS;EACT;;;;;;UA+Ce;EACf,QAAQ,SAAS,qBAAqB,QAAQ;EAC9C;;;;;;;UC9De;EACf,IAAI;EACJ,IAAI,aAAa;EACjB,OAAO;EACP;;;;;;;;;;;;cCGW;;EAGC,YAAA;;EAKZ;EAIA;EAIA;OASK,OAAO;;;;;;;UC5BG;;EAEf,aAAa;;EAEb;;EAEA;;;;;UAMe;;;;;;;EAOf,aAAa,cAAc,YAAY,YAAY,SAAS,kBAAkB,QAAQ;;;;EAKtF,cAAc,cAAc,YAAY,YAAY,SAAS,kBAAkB,QAAQ;;WAG9E;;;;;;;;;;;;qBCXE;;EAoBT,YAAA,YAAY,eACZ,MAAM,MACN,cACA,YAAY,YACZ,SAAS,iBACT,UAAU,2BACV,WAAW;;MAmCT,SAAS;;;;EAOb,GAAG,6BAA6B,SAAS;;;;EAQzC,cAAc,SAAS;;;;EAQjB,SAAS;;;;EAWT,QAAQ"}
|
package/dist/index.d.cts
CHANGED
|
@@ -73,7 +73,7 @@ interface StorageProvider {
|
|
|
73
73
|
clear(): void;
|
|
74
74
|
}
|
|
75
75
|
/** Well-known storage keys used by the SDK. */
|
|
76
|
-
declare const StorageKeys: {
|
|
76
|
+
export declare const StorageKeys: {
|
|
77
77
|
readonly STATE: "safeguard_state";
|
|
78
78
|
readonly CODE_VERIFIER: "safeguard_code_verifier";
|
|
79
79
|
};
|
|
@@ -87,7 +87,7 @@ declare const StorageKeys: {
|
|
|
87
87
|
* - `console.log(secretValue)` prints "[REDACTED]"
|
|
88
88
|
* - `.expose()` returns the raw value when intentionally needed
|
|
89
89
|
*/
|
|
90
|
-
declare class SecretValue {
|
|
90
|
+
export declare class SecretValue {
|
|
91
91
|
#private;
|
|
92
92
|
constructor(value: string);
|
|
93
93
|
/** Returns the raw secret. Use only when you intentionally need the plaintext. */
|
|
@@ -132,7 +132,7 @@ interface Auth {
|
|
|
132
132
|
/**
|
|
133
133
|
* Safeguard appliance service endpoints.
|
|
134
134
|
*/
|
|
135
|
-
declare enum Service {
|
|
135
|
+
export declare enum Service {
|
|
136
136
|
CORE = "core",
|
|
137
137
|
APPLIANCE = "appliance",
|
|
138
138
|
NOTIFICATION = "notification",
|
|
@@ -143,7 +143,7 @@ declare enum Service {
|
|
|
143
143
|
/**
|
|
144
144
|
* HTTP methods supported by the Safeguard API.
|
|
145
145
|
*/
|
|
146
|
-
declare enum HttpMethod {
|
|
146
|
+
export declare enum HttpMethod {
|
|
147
147
|
GET = "GET",
|
|
148
148
|
POST = "POST",
|
|
149
149
|
PUT = "PUT",
|
|
@@ -207,7 +207,7 @@ interface SafeguardClientOptions {
|
|
|
207
207
|
* ├── TransportError (Network/connection failures)
|
|
208
208
|
* └── ConfigurationError (Invalid client options)
|
|
209
209
|
*/
|
|
210
|
-
declare class SafeguardError extends Error {
|
|
210
|
+
export declare class SafeguardError extends Error {
|
|
211
211
|
constructor(message: string, options?: ErrorOptions);
|
|
212
212
|
}
|
|
213
213
|
interface ApiErrorBody {
|
|
@@ -218,7 +218,7 @@ interface ApiErrorBody {
|
|
|
218
218
|
};
|
|
219
219
|
[key: string]: unknown;
|
|
220
220
|
}
|
|
221
|
-
declare class ApiError extends SafeguardError {
|
|
221
|
+
export declare class ApiError extends SafeguardError {
|
|
222
222
|
readonly status: number;
|
|
223
223
|
readonly body: ApiErrorBody | null;
|
|
224
224
|
constructor(message: string, status: number, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
@@ -229,19 +229,19 @@ declare class ApiError extends SafeguardError {
|
|
|
229
229
|
private static parseBody;
|
|
230
230
|
private static buildMessage;
|
|
231
231
|
}
|
|
232
|
-
declare class AuthenticationError extends ApiError {
|
|
232
|
+
export declare class AuthenticationError extends ApiError {
|
|
233
233
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
234
234
|
}
|
|
235
|
-
declare class AuthorizationError extends ApiError {
|
|
235
|
+
export declare class AuthorizationError extends ApiError {
|
|
236
236
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
237
237
|
}
|
|
238
|
-
declare class NotFoundError extends ApiError {
|
|
238
|
+
export declare class NotFoundError extends ApiError {
|
|
239
239
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
240
240
|
}
|
|
241
|
-
declare class TransportError extends SafeguardError {
|
|
241
|
+
export declare class TransportError extends SafeguardError {
|
|
242
242
|
constructor(message: string, options?: ErrorOptions);
|
|
243
243
|
}
|
|
244
|
-
declare class ConfigurationError extends SafeguardError {
|
|
244
|
+
export declare class ConfigurationError extends SafeguardError {
|
|
245
245
|
constructor(message: string, options?: ErrorOptions);
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
@@ -252,7 +252,7 @@ declare class ConfigurationError extends SafeguardError {
|
|
|
252
252
|
*
|
|
253
253
|
* @throws {ConfigurationError} if the host contains disallowed characters
|
|
254
254
|
*/
|
|
255
|
-
declare function validateHost(host: string): string;
|
|
255
|
+
export declare function validateHost(host: string): string;
|
|
256
256
|
/**
|
|
257
257
|
* Builds the base URL for a Safeguard service endpoint.
|
|
258
258
|
*
|
|
@@ -260,7 +260,7 @@ declare function validateHost(host: string): string;
|
|
|
260
260
|
* buildServiceUrl('appliance.example.com', Service.CORE)
|
|
261
261
|
* // => 'https://appliance.example.com/service/core/v4'
|
|
262
262
|
*/
|
|
263
|
-
declare function buildServiceUrl(host: string, service: Service, apiVersion?: string): string;
|
|
263
|
+
export declare function buildServiceUrl(host: string, service: Service, apiVersion?: string): string;
|
|
264
264
|
/**
|
|
265
265
|
* Builds a full API URL including path and optional query parameters.
|
|
266
266
|
*
|
|
@@ -268,32 +268,32 @@ declare function buildServiceUrl(host: string, service: Service, apiVersion?: st
|
|
|
268
268
|
* buildRequestUrl('appliance.example.com', Service.CORE, 'Users', { filter: 'Name eq "admin"' })
|
|
269
269
|
* // => 'https://appliance.example.com/service/core/v4/Users?filter=Name+eq+%22admin%22'
|
|
270
270
|
*/
|
|
271
|
-
declare function buildRequestUrl(host: string, service: Service, relativeUrl: string, query?: Record<string, string | number | boolean>, apiVersion?: string): string;
|
|
271
|
+
export declare function buildRequestUrl(host: string, service: Service, relativeUrl: string, query?: Record<string, string | number | boolean>, apiVersion?: string): string;
|
|
272
272
|
/**
|
|
273
273
|
* Encodes bytes to a URL-safe base64 string (no padding).
|
|
274
274
|
*/
|
|
275
|
-
declare function base64UrlEncode(bytes: Uint8Array): string;
|
|
275
|
+
export declare function base64UrlEncode(bytes: Uint8Array): string;
|
|
276
276
|
/**
|
|
277
277
|
* Generates a cryptographically random code verifier for PKCE.
|
|
278
278
|
* Returns a 43-character base64url string (32 random bytes).
|
|
279
279
|
*/
|
|
280
|
-
declare function generateCodeVerifier(): string;
|
|
280
|
+
export declare function generateCodeVerifier(): string;
|
|
281
281
|
/**
|
|
282
282
|
* Computes the S256 code challenge from a code verifier.
|
|
283
283
|
* Uses Web Crypto API (available in Node 20+ and all modern browsers).
|
|
284
284
|
*/
|
|
285
|
-
declare function generateCodeChallenge(verifier: string): Promise<string>;
|
|
285
|
+
export declare function generateCodeChallenge(verifier: string): Promise<string>;
|
|
286
286
|
/**
|
|
287
287
|
* Generates a random state parameter for OAuth flows.
|
|
288
288
|
*/
|
|
289
|
-
declare function generateState(): string;
|
|
289
|
+
export declare function generateState(): string;
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/storage/memory.d.ts
|
|
292
292
|
/**
|
|
293
293
|
* In-memory storage provider. Default for Node.js environments.
|
|
294
294
|
* Data does not persist across process restarts.
|
|
295
295
|
*/
|
|
296
|
-
declare class MemoryStorage implements StorageProvider {
|
|
296
|
+
export declare class MemoryStorage implements StorageProvider {
|
|
297
297
|
#private;
|
|
298
298
|
get(key: string): string | null;
|
|
299
299
|
set(key: string, value: string): void;
|
|
@@ -306,7 +306,7 @@ declare class MemoryStorage implements StorageProvider {
|
|
|
306
306
|
* Browser sessionStorage adapter. Data persists for the browser tab lifetime.
|
|
307
307
|
* Requires a DOM environment (browser or jsdom).
|
|
308
308
|
*/
|
|
309
|
-
declare class BrowserSessionStorage implements StorageProvider {
|
|
309
|
+
export declare class BrowserSessionStorage implements StorageProvider {
|
|
310
310
|
get(key: string): string | null;
|
|
311
311
|
set(key: string, value: string): void;
|
|
312
312
|
remove(key: string): void;
|
|
@@ -318,7 +318,7 @@ declare class BrowserSessionStorage implements StorageProvider {
|
|
|
318
318
|
* Node.js HTTP client using undici for full TLS control.
|
|
319
319
|
* Creates a per-instance Agent — no global state mutation.
|
|
320
320
|
*/
|
|
321
|
-
declare class NodeHttpClient implements HttpClient {
|
|
321
|
+
export declare class NodeHttpClient implements HttpClient {
|
|
322
322
|
#private;
|
|
323
323
|
constructor(tlsOptions?: TlsOptions);
|
|
324
324
|
request(options: HttpRequestOptions): Promise<HttpResponse>;
|
|
@@ -330,7 +330,7 @@ declare class NodeHttpClient implements HttpClient {
|
|
|
330
330
|
* Browser HTTP client using native fetch API.
|
|
331
331
|
* No TLS configuration needed — browser handles certificates.
|
|
332
332
|
*/
|
|
333
|
-
declare class BrowserHttpClient implements HttpClient {
|
|
333
|
+
export declare class BrowserHttpClient implements HttpClient {
|
|
334
334
|
#private;
|
|
335
335
|
constructor(options?: {
|
|
336
336
|
credentials?: RequestCredentials;
|
|
@@ -348,7 +348,7 @@ interface PasswordAuthOptions {
|
|
|
348
348
|
/**
|
|
349
349
|
* Authenticates using username/password via RSTS Resource Owner grant.
|
|
350
350
|
*/
|
|
351
|
-
declare class PasswordAuth implements Auth {
|
|
351
|
+
export declare class PasswordAuth implements Auth {
|
|
352
352
|
#private;
|
|
353
353
|
constructor(options: PasswordAuthOptions);
|
|
354
354
|
get description(): string;
|
|
@@ -379,7 +379,7 @@ interface CertificateAuthOptions {
|
|
|
379
379
|
* Authenticates using a client certificate (mTLS) against RSTS.
|
|
380
380
|
* Node.js only — requires TLS client cert support in HttpClient.
|
|
381
381
|
*/
|
|
382
|
-
declare class CertificateAuth implements Auth {
|
|
382
|
+
export declare class CertificateAuth implements Auth {
|
|
383
383
|
#private;
|
|
384
384
|
constructor(options: CertificateAuthOptions);
|
|
385
385
|
get description(): string;
|
|
@@ -405,7 +405,7 @@ interface PkceAuthOptions {
|
|
|
405
405
|
* Authenticates using PKCE (Proof Key for Code Exchange) with browser redirect.
|
|
406
406
|
* For browser environments where the user is redirected to RSTS login.
|
|
407
407
|
*/
|
|
408
|
-
declare class PkceAuth implements Auth {
|
|
408
|
+
export declare class PkceAuth implements Auth {
|
|
409
409
|
#private;
|
|
410
410
|
constructor(options: PkceAuthOptions);
|
|
411
411
|
get description(): string;
|
|
@@ -430,7 +430,7 @@ interface PkceNonInteractiveAuthOptions {
|
|
|
430
430
|
*
|
|
431
431
|
* Matches PySafeguard's PkceAuth behavior (local server pattern).
|
|
432
432
|
*/
|
|
433
|
-
declare class PkceNonInteractiveAuth implements Auth {
|
|
433
|
+
export declare class PkceNonInteractiveAuth implements Auth {
|
|
434
434
|
#private;
|
|
435
435
|
constructor(options?: PkceNonInteractiveAuthOptions);
|
|
436
436
|
get description(): string;
|
|
@@ -484,7 +484,7 @@ interface DeviceCodeAuthOptions {
|
|
|
484
484
|
* spawns or opens a browser and performs no display I/O. Platform-agnostic, so
|
|
485
485
|
* it is exported from both the Node and browser entry points.
|
|
486
486
|
*/
|
|
487
|
-
declare class DeviceCodeAuth implements Auth {
|
|
487
|
+
export declare class DeviceCodeAuth implements Auth {
|
|
488
488
|
#private;
|
|
489
489
|
constructor(options: DeviceCodeAuthOptions);
|
|
490
490
|
get description(): string;
|
|
@@ -507,7 +507,7 @@ interface PkceCallbackResult {
|
|
|
507
507
|
* @param url - The callback URL to parse (defaults to window.location.href)
|
|
508
508
|
* @returns The parsed code and state, or null if not a valid callback
|
|
509
509
|
*/
|
|
510
|
-
declare function handlePkceCallback(storage: StorageProvider, url?: string): PkceCallbackResult | null;
|
|
510
|
+
export declare function handlePkceCallback(storage: StorageProvider, url?: string): PkceCallbackResult | null;
|
|
511
511
|
//#endregion
|
|
512
512
|
//#region src/auth/token.d.ts
|
|
513
513
|
interface TokenAuthOptions {
|
|
@@ -518,7 +518,7 @@ interface TokenAuthOptions {
|
|
|
518
518
|
* Uses a pre-existing access token. No authentication flow — the token is assumed valid.
|
|
519
519
|
* Useful when tokens are obtained externally or for service-to-service scenarios.
|
|
520
520
|
*/
|
|
521
|
-
declare class TokenAuth implements Auth {
|
|
521
|
+
export declare class TokenAuth implements Auth {
|
|
522
522
|
#private;
|
|
523
523
|
constructor(options: TokenAuthOptions);
|
|
524
524
|
get description(): string;
|
|
@@ -530,7 +530,7 @@ declare class TokenAuth implements Auth {
|
|
|
530
530
|
* Anonymous authentication — no credentials.
|
|
531
531
|
* Used for accessing public Safeguard endpoints (e.g., appliance status).
|
|
532
532
|
*/
|
|
533
|
-
declare class AnonymousAuth implements Auth {
|
|
533
|
+
export declare class AnonymousAuth implements Auth {
|
|
534
534
|
get description(): string;
|
|
535
535
|
authenticate(_host: string, _httpClient: HttpClient, _storage: StorageProvider): Promise<TokenSet>;
|
|
536
536
|
}
|
|
@@ -540,7 +540,7 @@ declare class AnonymousAuth implements Auth {
|
|
|
540
540
|
* Main entry point for the Safeguard SDK.
|
|
541
541
|
* Instance-based — no global state. Multiple clients to different appliances are supported.
|
|
542
542
|
*/
|
|
543
|
-
declare class SafeguardClient {
|
|
543
|
+
export declare class SafeguardClient {
|
|
544
544
|
#private;
|
|
545
545
|
constructor(host: string, options: SafeguardClientOptions);
|
|
546
546
|
/** The appliance hostname this client connects to. */
|
|
@@ -597,7 +597,7 @@ declare class SafeguardClient {
|
|
|
597
597
|
/**
|
|
598
598
|
* SSH key formats for private key retrieval.
|
|
599
599
|
*/
|
|
600
|
-
declare enum SshKeyFormat {
|
|
600
|
+
export declare enum SshKeyFormat {
|
|
601
601
|
OpenSsh = "OpenSsh",
|
|
602
602
|
Ssh2 = "Ssh2",
|
|
603
603
|
Putty = "Putty"
|
|
@@ -617,7 +617,7 @@ interface RetrievableAccount {
|
|
|
617
617
|
/**
|
|
618
618
|
* Brokered access request types.
|
|
619
619
|
*/
|
|
620
|
-
declare enum BrokeredAccessRequestType {
|
|
620
|
+
export declare enum BrokeredAccessRequestType {
|
|
621
621
|
Password = "Password",
|
|
622
622
|
SshKey = "SshKey",
|
|
623
623
|
ApiKey = "ApiKey",
|
|
@@ -666,7 +666,7 @@ interface A2AClientOptions {
|
|
|
666
666
|
*
|
|
667
667
|
* Full parity with PySafeguard and SafeguardDotNet A2A clients.
|
|
668
668
|
*/
|
|
669
|
-
declare class A2AClient {
|
|
669
|
+
export declare class A2AClient {
|
|
670
670
|
#private;
|
|
671
671
|
constructor(host: string, options: A2AClientOptions);
|
|
672
672
|
/** The appliance hostname. */
|
|
@@ -728,5 +728,5 @@ declare class A2AClient {
|
|
|
728
728
|
brokerAccessRequest(apiKey: string, request: BrokeredAccessRequest): Promise<BrokeredAccessResponse>;
|
|
729
729
|
}
|
|
730
730
|
//#endregion
|
|
731
|
-
export {
|
|
731
|
+
export type { A2AClientOptions, ApiErrorBody, Auth, BrokeredAccessRequest, BrokeredAccessResponse, CertificateAuthOptions, DeviceCodeAuthOptions, DeviceCodeInfo, HttpClient, HttpRequestOptions, HttpResponse, PasswordAuthOptions, PkceAuthOptions, PkceCallbackResult, PkceNonInteractiveAuthOptions, RequestOptions, RetrievableAccount, SafeguardClientOptions, SafeguardResponse, StorageProvider, TlsOptions, TlsVersion, TokenAuthOptions, TokenSet };
|
|
732
732
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/types.ts","../src/errors.ts","../src/utils.ts","../src/storage/memory.ts","../src/storage/session.ts","../src/http/node.ts","../src/http/browser.ts","../src/auth/password.ts","../src/auth/certificate.ts","../src/auth/pkce.ts","../src/auth/pkce-noninteractive.ts","../src/auth/device-code.ts","../src/auth/pkce-callback.ts","../src/auth/token.ts","../src/auth/anonymous.ts","../src/client.ts","../src/a2a/types.ts","../src/a2a/index.ts"],"mappings":";;;;UAIiB;EACf;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT;;UAGe;EACf;EACA,SAAS;EACT;;;;;;KAOU;UAEK;;EAEf,cAAc;;EAEd,gBAAgB;;EAEhB,eAAe;;EAEf,eAAe;;EAEf;;EAEA;;;;;;EAMA,aAAa;;;;;;;;;;;;;EAab,aAAa;;;;;;UAOE;EACf,QAAQ,SAAS,qBAAqB,QAAQ;EAC9C;;;;;;;UC9De;EACf,IAAI;EACJ,IAAI,aAAa;EACjB,OAAO;EACP;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":["_$__auth_types_js0.Auth"],"sources":["../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/types.ts","../src/errors.ts","../src/utils.ts","../src/storage/memory.ts","../src/storage/session.ts","../src/http/node.ts","../src/http/browser.ts","../src/auth/password.ts","../src/auth/certificate.ts","../src/auth/pkce.ts","../src/auth/pkce-noninteractive.ts","../src/auth/device-code.ts","../src/auth/pkce-callback.ts","../src/auth/token.ts","../src/auth/anonymous.ts","../src/client.ts","../src/a2a/types.ts","../src/a2a/index.ts"],"mappings":";;;;UAIiB;EACf;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT;;UAGe;EACf;EACA,SAAS;EACT;;;;;;KAOU;UAEK;;EAEf,cAAc;;EAEd,gBAAgB;;EAEhB,eAAe;;EAEf,eAAe;;EAEf;;EAEA;;;;;;EAMA,aAAa;;;;;;;;;;;;;EAab,aAAa;;;;;;UAOE;EACf,QAAQ,SAAS,qBAAqB,QAAQ;EAC9C;;;;;;;UC9De;EAC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;;qBASW;;EAQC,YAAA,cAAc,SAAS;;MAW/B;;MAKA,eAAe;;MAKf;;MAKA,QAAQ;;;;EAOZ,cAAc,YAAY;;;;;EASpB,iBAAiB,iBAAiB,QAAQ;;;;;;EAY1C,mBAAmB,gBAAgB,SAAS,eAAe,QAAQ;;;;;EAgBnE,qBAAqB,iBAAiB,QAAQ;;;;;;;;;EAa9C,0BAA0B,QAAQ;;;;;;EAwClC,YAAY,gBAAgB,mBAAmB;;;;;;;;EAyB/C,cACJ,gBACA,aACA,qBACA,SAAS,eACR;;;;;;EA+BG,oBACJ,gBACA,SAAS,wBACR,QAAQ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ interface StorageProvider {
|
|
|
73
73
|
clear(): void;
|
|
74
74
|
}
|
|
75
75
|
/** Well-known storage keys used by the SDK. */
|
|
76
|
-
declare const StorageKeys: {
|
|
76
|
+
export declare const StorageKeys: {
|
|
77
77
|
readonly STATE: "safeguard_state";
|
|
78
78
|
readonly CODE_VERIFIER: "safeguard_code_verifier";
|
|
79
79
|
};
|
|
@@ -87,7 +87,7 @@ declare const StorageKeys: {
|
|
|
87
87
|
* - `console.log(secretValue)` prints "[REDACTED]"
|
|
88
88
|
* - `.expose()` returns the raw value when intentionally needed
|
|
89
89
|
*/
|
|
90
|
-
declare class SecretValue {
|
|
90
|
+
export declare class SecretValue {
|
|
91
91
|
#private;
|
|
92
92
|
constructor(value: string);
|
|
93
93
|
/** Returns the raw secret. Use only when you intentionally need the plaintext. */
|
|
@@ -132,7 +132,7 @@ interface Auth {
|
|
|
132
132
|
/**
|
|
133
133
|
* Safeguard appliance service endpoints.
|
|
134
134
|
*/
|
|
135
|
-
declare enum Service {
|
|
135
|
+
export declare enum Service {
|
|
136
136
|
CORE = "core",
|
|
137
137
|
APPLIANCE = "appliance",
|
|
138
138
|
NOTIFICATION = "notification",
|
|
@@ -143,7 +143,7 @@ declare enum Service {
|
|
|
143
143
|
/**
|
|
144
144
|
* HTTP methods supported by the Safeguard API.
|
|
145
145
|
*/
|
|
146
|
-
declare enum HttpMethod {
|
|
146
|
+
export declare enum HttpMethod {
|
|
147
147
|
GET = "GET",
|
|
148
148
|
POST = "POST",
|
|
149
149
|
PUT = "PUT",
|
|
@@ -207,7 +207,7 @@ interface SafeguardClientOptions {
|
|
|
207
207
|
* ├── TransportError (Network/connection failures)
|
|
208
208
|
* └── ConfigurationError (Invalid client options)
|
|
209
209
|
*/
|
|
210
|
-
declare class SafeguardError extends Error {
|
|
210
|
+
export declare class SafeguardError extends Error {
|
|
211
211
|
constructor(message: string, options?: ErrorOptions);
|
|
212
212
|
}
|
|
213
213
|
interface ApiErrorBody {
|
|
@@ -218,7 +218,7 @@ interface ApiErrorBody {
|
|
|
218
218
|
};
|
|
219
219
|
[key: string]: unknown;
|
|
220
220
|
}
|
|
221
|
-
declare class ApiError extends SafeguardError {
|
|
221
|
+
export declare class ApiError extends SafeguardError {
|
|
222
222
|
readonly status: number;
|
|
223
223
|
readonly body: ApiErrorBody | null;
|
|
224
224
|
constructor(message: string, status: number, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
@@ -229,19 +229,19 @@ declare class ApiError extends SafeguardError {
|
|
|
229
229
|
private static parseBody;
|
|
230
230
|
private static buildMessage;
|
|
231
231
|
}
|
|
232
|
-
declare class AuthenticationError extends ApiError {
|
|
232
|
+
export declare class AuthenticationError extends ApiError {
|
|
233
233
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
234
234
|
}
|
|
235
|
-
declare class AuthorizationError extends ApiError {
|
|
235
|
+
export declare class AuthorizationError extends ApiError {
|
|
236
236
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
237
237
|
}
|
|
238
|
-
declare class NotFoundError extends ApiError {
|
|
238
|
+
export declare class NotFoundError extends ApiError {
|
|
239
239
|
constructor(message: string, body?: ApiErrorBody | null, options?: ErrorOptions);
|
|
240
240
|
}
|
|
241
|
-
declare class TransportError extends SafeguardError {
|
|
241
|
+
export declare class TransportError extends SafeguardError {
|
|
242
242
|
constructor(message: string, options?: ErrorOptions);
|
|
243
243
|
}
|
|
244
|
-
declare class ConfigurationError extends SafeguardError {
|
|
244
|
+
export declare class ConfigurationError extends SafeguardError {
|
|
245
245
|
constructor(message: string, options?: ErrorOptions);
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
@@ -252,7 +252,7 @@ declare class ConfigurationError extends SafeguardError {
|
|
|
252
252
|
*
|
|
253
253
|
* @throws {ConfigurationError} if the host contains disallowed characters
|
|
254
254
|
*/
|
|
255
|
-
declare function validateHost(host: string): string;
|
|
255
|
+
export declare function validateHost(host: string): string;
|
|
256
256
|
/**
|
|
257
257
|
* Builds the base URL for a Safeguard service endpoint.
|
|
258
258
|
*
|
|
@@ -260,7 +260,7 @@ declare function validateHost(host: string): string;
|
|
|
260
260
|
* buildServiceUrl('appliance.example.com', Service.CORE)
|
|
261
261
|
* // => 'https://appliance.example.com/service/core/v4'
|
|
262
262
|
*/
|
|
263
|
-
declare function buildServiceUrl(host: string, service: Service, apiVersion?: string): string;
|
|
263
|
+
export declare function buildServiceUrl(host: string, service: Service, apiVersion?: string): string;
|
|
264
264
|
/**
|
|
265
265
|
* Builds a full API URL including path and optional query parameters.
|
|
266
266
|
*
|
|
@@ -268,32 +268,32 @@ declare function buildServiceUrl(host: string, service: Service, apiVersion?: st
|
|
|
268
268
|
* buildRequestUrl('appliance.example.com', Service.CORE, 'Users', { filter: 'Name eq "admin"' })
|
|
269
269
|
* // => 'https://appliance.example.com/service/core/v4/Users?filter=Name+eq+%22admin%22'
|
|
270
270
|
*/
|
|
271
|
-
declare function buildRequestUrl(host: string, service: Service, relativeUrl: string, query?: Record<string, string | number | boolean>, apiVersion?: string): string;
|
|
271
|
+
export declare function buildRequestUrl(host: string, service: Service, relativeUrl: string, query?: Record<string, string | number | boolean>, apiVersion?: string): string;
|
|
272
272
|
/**
|
|
273
273
|
* Encodes bytes to a URL-safe base64 string (no padding).
|
|
274
274
|
*/
|
|
275
|
-
declare function base64UrlEncode(bytes: Uint8Array): string;
|
|
275
|
+
export declare function base64UrlEncode(bytes: Uint8Array): string;
|
|
276
276
|
/**
|
|
277
277
|
* Generates a cryptographically random code verifier for PKCE.
|
|
278
278
|
* Returns a 43-character base64url string (32 random bytes).
|
|
279
279
|
*/
|
|
280
|
-
declare function generateCodeVerifier(): string;
|
|
280
|
+
export declare function generateCodeVerifier(): string;
|
|
281
281
|
/**
|
|
282
282
|
* Computes the S256 code challenge from a code verifier.
|
|
283
283
|
* Uses Web Crypto API (available in Node 20+ and all modern browsers).
|
|
284
284
|
*/
|
|
285
|
-
declare function generateCodeChallenge(verifier: string): Promise<string>;
|
|
285
|
+
export declare function generateCodeChallenge(verifier: string): Promise<string>;
|
|
286
286
|
/**
|
|
287
287
|
* Generates a random state parameter for OAuth flows.
|
|
288
288
|
*/
|
|
289
|
-
declare function generateState(): string;
|
|
289
|
+
export declare function generateState(): string;
|
|
290
290
|
//#endregion
|
|
291
291
|
//#region src/storage/memory.d.ts
|
|
292
292
|
/**
|
|
293
293
|
* In-memory storage provider. Default for Node.js environments.
|
|
294
294
|
* Data does not persist across process restarts.
|
|
295
295
|
*/
|
|
296
|
-
declare class MemoryStorage implements StorageProvider {
|
|
296
|
+
export declare class MemoryStorage implements StorageProvider {
|
|
297
297
|
#private;
|
|
298
298
|
get(key: string): string | null;
|
|
299
299
|
set(key: string, value: string): void;
|
|
@@ -306,7 +306,7 @@ declare class MemoryStorage implements StorageProvider {
|
|
|
306
306
|
* Browser sessionStorage adapter. Data persists for the browser tab lifetime.
|
|
307
307
|
* Requires a DOM environment (browser or jsdom).
|
|
308
308
|
*/
|
|
309
|
-
declare class BrowserSessionStorage implements StorageProvider {
|
|
309
|
+
export declare class BrowserSessionStorage implements StorageProvider {
|
|
310
310
|
get(key: string): string | null;
|
|
311
311
|
set(key: string, value: string): void;
|
|
312
312
|
remove(key: string): void;
|
|
@@ -318,7 +318,7 @@ declare class BrowserSessionStorage implements StorageProvider {
|
|
|
318
318
|
* Node.js HTTP client using undici for full TLS control.
|
|
319
319
|
* Creates a per-instance Agent — no global state mutation.
|
|
320
320
|
*/
|
|
321
|
-
declare class NodeHttpClient implements HttpClient {
|
|
321
|
+
export declare class NodeHttpClient implements HttpClient {
|
|
322
322
|
#private;
|
|
323
323
|
constructor(tlsOptions?: TlsOptions);
|
|
324
324
|
request(options: HttpRequestOptions): Promise<HttpResponse>;
|
|
@@ -330,7 +330,7 @@ declare class NodeHttpClient implements HttpClient {
|
|
|
330
330
|
* Browser HTTP client using native fetch API.
|
|
331
331
|
* No TLS configuration needed — browser handles certificates.
|
|
332
332
|
*/
|
|
333
|
-
declare class BrowserHttpClient implements HttpClient {
|
|
333
|
+
export declare class BrowserHttpClient implements HttpClient {
|
|
334
334
|
#private;
|
|
335
335
|
constructor(options?: {
|
|
336
336
|
credentials?: RequestCredentials;
|
|
@@ -348,7 +348,7 @@ interface PasswordAuthOptions {
|
|
|
348
348
|
/**
|
|
349
349
|
* Authenticates using username/password via RSTS Resource Owner grant.
|
|
350
350
|
*/
|
|
351
|
-
declare class PasswordAuth implements Auth {
|
|
351
|
+
export declare class PasswordAuth implements Auth {
|
|
352
352
|
#private;
|
|
353
353
|
constructor(options: PasswordAuthOptions);
|
|
354
354
|
get description(): string;
|
|
@@ -379,7 +379,7 @@ interface CertificateAuthOptions {
|
|
|
379
379
|
* Authenticates using a client certificate (mTLS) against RSTS.
|
|
380
380
|
* Node.js only — requires TLS client cert support in HttpClient.
|
|
381
381
|
*/
|
|
382
|
-
declare class CertificateAuth implements Auth {
|
|
382
|
+
export declare class CertificateAuth implements Auth {
|
|
383
383
|
#private;
|
|
384
384
|
constructor(options: CertificateAuthOptions);
|
|
385
385
|
get description(): string;
|
|
@@ -405,7 +405,7 @@ interface PkceAuthOptions {
|
|
|
405
405
|
* Authenticates using PKCE (Proof Key for Code Exchange) with browser redirect.
|
|
406
406
|
* For browser environments where the user is redirected to RSTS login.
|
|
407
407
|
*/
|
|
408
|
-
declare class PkceAuth implements Auth {
|
|
408
|
+
export declare class PkceAuth implements Auth {
|
|
409
409
|
#private;
|
|
410
410
|
constructor(options: PkceAuthOptions);
|
|
411
411
|
get description(): string;
|
|
@@ -430,7 +430,7 @@ interface PkceNonInteractiveAuthOptions {
|
|
|
430
430
|
*
|
|
431
431
|
* Matches PySafeguard's PkceAuth behavior (local server pattern).
|
|
432
432
|
*/
|
|
433
|
-
declare class PkceNonInteractiveAuth implements Auth {
|
|
433
|
+
export declare class PkceNonInteractiveAuth implements Auth {
|
|
434
434
|
#private;
|
|
435
435
|
constructor(options?: PkceNonInteractiveAuthOptions);
|
|
436
436
|
get description(): string;
|
|
@@ -484,7 +484,7 @@ interface DeviceCodeAuthOptions {
|
|
|
484
484
|
* spawns or opens a browser and performs no display I/O. Platform-agnostic, so
|
|
485
485
|
* it is exported from both the Node and browser entry points.
|
|
486
486
|
*/
|
|
487
|
-
declare class DeviceCodeAuth implements Auth {
|
|
487
|
+
export declare class DeviceCodeAuth implements Auth {
|
|
488
488
|
#private;
|
|
489
489
|
constructor(options: DeviceCodeAuthOptions);
|
|
490
490
|
get description(): string;
|
|
@@ -507,7 +507,7 @@ interface PkceCallbackResult {
|
|
|
507
507
|
* @param url - The callback URL to parse (defaults to window.location.href)
|
|
508
508
|
* @returns The parsed code and state, or null if not a valid callback
|
|
509
509
|
*/
|
|
510
|
-
declare function handlePkceCallback(storage: StorageProvider, url?: string): PkceCallbackResult | null;
|
|
510
|
+
export declare function handlePkceCallback(storage: StorageProvider, url?: string): PkceCallbackResult | null;
|
|
511
511
|
//#endregion
|
|
512
512
|
//#region src/auth/token.d.ts
|
|
513
513
|
interface TokenAuthOptions {
|
|
@@ -518,7 +518,7 @@ interface TokenAuthOptions {
|
|
|
518
518
|
* Uses a pre-existing access token. No authentication flow — the token is assumed valid.
|
|
519
519
|
* Useful when tokens are obtained externally or for service-to-service scenarios.
|
|
520
520
|
*/
|
|
521
|
-
declare class TokenAuth implements Auth {
|
|
521
|
+
export declare class TokenAuth implements Auth {
|
|
522
522
|
#private;
|
|
523
523
|
constructor(options: TokenAuthOptions);
|
|
524
524
|
get description(): string;
|
|
@@ -530,7 +530,7 @@ declare class TokenAuth implements Auth {
|
|
|
530
530
|
* Anonymous authentication — no credentials.
|
|
531
531
|
* Used for accessing public Safeguard endpoints (e.g., appliance status).
|
|
532
532
|
*/
|
|
533
|
-
declare class AnonymousAuth implements Auth {
|
|
533
|
+
export declare class AnonymousAuth implements Auth {
|
|
534
534
|
get description(): string;
|
|
535
535
|
authenticate(_host: string, _httpClient: HttpClient, _storage: StorageProvider): Promise<TokenSet>;
|
|
536
536
|
}
|
|
@@ -540,7 +540,7 @@ declare class AnonymousAuth implements Auth {
|
|
|
540
540
|
* Main entry point for the Safeguard SDK.
|
|
541
541
|
* Instance-based — no global state. Multiple clients to different appliances are supported.
|
|
542
542
|
*/
|
|
543
|
-
declare class SafeguardClient {
|
|
543
|
+
export declare class SafeguardClient {
|
|
544
544
|
#private;
|
|
545
545
|
constructor(host: string, options: SafeguardClientOptions);
|
|
546
546
|
/** The appliance hostname this client connects to. */
|
|
@@ -597,7 +597,7 @@ declare class SafeguardClient {
|
|
|
597
597
|
/**
|
|
598
598
|
* SSH key formats for private key retrieval.
|
|
599
599
|
*/
|
|
600
|
-
declare enum SshKeyFormat {
|
|
600
|
+
export declare enum SshKeyFormat {
|
|
601
601
|
OpenSsh = "OpenSsh",
|
|
602
602
|
Ssh2 = "Ssh2",
|
|
603
603
|
Putty = "Putty"
|
|
@@ -617,7 +617,7 @@ interface RetrievableAccount {
|
|
|
617
617
|
/**
|
|
618
618
|
* Brokered access request types.
|
|
619
619
|
*/
|
|
620
|
-
declare enum BrokeredAccessRequestType {
|
|
620
|
+
export declare enum BrokeredAccessRequestType {
|
|
621
621
|
Password = "Password",
|
|
622
622
|
SshKey = "SshKey",
|
|
623
623
|
ApiKey = "ApiKey",
|
|
@@ -666,7 +666,7 @@ interface A2AClientOptions {
|
|
|
666
666
|
*
|
|
667
667
|
* Full parity with PySafeguard and SafeguardDotNet A2A clients.
|
|
668
668
|
*/
|
|
669
|
-
declare class A2AClient {
|
|
669
|
+
export declare class A2AClient {
|
|
670
670
|
#private;
|
|
671
671
|
constructor(host: string, options: A2AClientOptions);
|
|
672
672
|
/** The appliance hostname. */
|
|
@@ -728,5 +728,5 @@ declare class A2AClient {
|
|
|
728
728
|
brokerAccessRequest(apiKey: string, request: BrokeredAccessRequest): Promise<BrokeredAccessResponse>;
|
|
729
729
|
}
|
|
730
730
|
//#endregion
|
|
731
|
-
export {
|
|
731
|
+
export type { A2AClientOptions, ApiErrorBody, Auth, BrokeredAccessRequest, BrokeredAccessResponse, CertificateAuthOptions, DeviceCodeAuthOptions, DeviceCodeInfo, HttpClient, HttpRequestOptions, HttpResponse, PasswordAuthOptions, PkceAuthOptions, PkceCallbackResult, PkceNonInteractiveAuthOptions, RequestOptions, RetrievableAccount, SafeguardClientOptions, SafeguardResponse, StorageProvider, TlsOptions, TlsVersion, TokenAuthOptions, TokenSet };
|
|
732
732
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/types.ts","../src/errors.ts","../src/utils.ts","../src/storage/memory.ts","../src/storage/session.ts","../src/http/node.ts","../src/http/browser.ts","../src/auth/password.ts","../src/auth/certificate.ts","../src/auth/pkce.ts","../src/auth/pkce-noninteractive.ts","../src/auth/device-code.ts","../src/auth/pkce-callback.ts","../src/auth/token.ts","../src/auth/anonymous.ts","../src/client.ts","../src/a2a/types.ts","../src/a2a/index.ts"],"mappings":";;;;UAIiB;EACf;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT;;UAGe;EACf;EACA,SAAS;EACT;;;;;;KAOU;UAEK;;EAEf,cAAc;;EAEd,gBAAgB;;EAEhB,eAAe;;EAEf,eAAe;;EAEf;;EAEA;;;;;;EAMA,aAAa;;;;;;;;;;;;;EAab,aAAa;;;;;;UAOE;EACf,QAAQ,SAAS,qBAAqB,QAAQ;EAC9C;;;;;;;UC9De;EACf,IAAI;EACJ,IAAI,aAAa;EACjB,OAAO;EACP;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["_$__auth_types_js0.Auth"],"sources":["../src/http/types.ts","../src/storage/types.ts","../src/secret.ts","../src/auth/types.ts","../src/types.ts","../src/errors.ts","../src/utils.ts","../src/storage/memory.ts","../src/storage/session.ts","../src/http/node.ts","../src/http/browser.ts","../src/auth/password.ts","../src/auth/certificate.ts","../src/auth/pkce.ts","../src/auth/pkce-noninteractive.ts","../src/auth/device-code.ts","../src/auth/pkce-callback.ts","../src/auth/token.ts","../src/auth/anonymous.ts","../src/client.ts","../src/a2a/types.ts","../src/a2a/index.ts"],"mappings":";;;;UAIiB;EACf;EACA;EACA,UAAU;EACV,gBAAgB;EAChB,SAAS;EACT;;UAGe;EACf;EACA,SAAS;EACT;;;;;;KAOU;UAEK;;EAEf,cAAc;;EAEd,gBAAgB;;EAEhB,eAAe;;EAEf,eAAe;;EAEf;;EAEA;;;;;;EAMA,aAAa;;;;;;;;;;;;;EAab,aAAa;;;;;;UAOE;EACf,QAAQ,SAAS,qBAAqB,QAAQ;EAC9C;;;;;;;UC9De;EACf,IAAI;EACJ,IAAI,aAAa;EACjB,OAAO;EACP;;;qBAIW;;;;;;;;;;;;;;qBCDA;;EAGC,YAAA;;EAKZ;EAIA;EAIA;OASK,OAAO;;;;;;;UC5BG;;EAEf,aAAa;;EAEb;;EAEA;;;;;UAMe;;;;;;;EAOf,aAAa,cAAc,YAAY,YAAY,SAAS,kBAAkB,QAAQ;;;;EAKtF,cAAc,cAAc,YAAY,YAAY,SAAS,kBAAkB,QAAQ;;WAG9E;;;;;;;oBC/BC;EACV;EACA;EACA;EACA;EACA;EACA;;;;;oBAMU;EACV;EACA;EACA;EACA;E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BACR,QAAQ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneidentity/safeguard",
|
|
3
|
-
"version": "8.2.0-
|
|
3
|
+
"version": "8.2.0-pre6932",
|
|
4
4
|
"description": "One Identity Safeguard JavaScript/TypeScript SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@typescript-eslint/parser": "^8.33.0",
|
|
93
93
|
"eslint": "^9.27.0",
|
|
94
94
|
"prettier": "^3.5.3",
|
|
95
|
-
"tsdown": "^0.
|
|
95
|
+
"tsdown": "^0.23.1",
|
|
96
96
|
"typescript": "^5.8.3",
|
|
97
97
|
"typescript-eslint": "^8.59.3",
|
|
98
98
|
"vitest": "^4.1.6"
|