push neon reactor
This commit is contained in:
Generated
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
/** Generate a UUID, falling back to a timestamp+random string when crypto.randomUUID is unavailable. */
|
||||
export declare function generateGuid(): string;
|
||||
export declare function isGuid(nameNode: string): boolean;
|
||||
//# sourceMappingURL=GuidUtils.d.ts.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GuidUtils.d.ts","sourceRoot":"","sources":["../../src/utils/GuidUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wGAAwG;AACxG,wBAAgB,YAAY,IAAI,MAAM,CAKrC;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKhD"}
|
||||
Generated
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
/** Generate a UUID, falling back to a timestamp+random string when crypto.randomUUID is unavailable. */
|
||||
export function generateGuid() {
|
||||
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
return `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
||||
}
|
||||
export function isGuid(nameNode) {
|
||||
// GUID regex, C# Guid.TryParse equivalent
|
||||
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(nameNode);
|
||||
}
|
||||
//# sourceMappingURL=GuidUtils.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"GuidUtils.js","sourceRoot":"","sources":["../../src/utils/GuidUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wGAAwG;AACxG,MAAM,UAAU,YAAY;IAC1B,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACvD,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IACD,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,QAAgB;IACrC,0CAA0C;IAC1C,OAAO,4EAA4E,CAAC,IAAI,CACtF,QAAQ,CACT,CAAC;AACJ,CAAC"}
|
||||
Generated
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
/** Runtime check for async iterables (e.g. AsyncGenerator results). */
|
||||
export declare function isAsyncIterable(value: unknown): value is AsyncIterable<unknown>;
|
||||
//# sourceMappingURL=IterableUtils.d.ts.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IterableUtils.d.ts","sourceRoot":"","sources":["../../src/utils/IterableUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAE/E"}
|
||||
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
/** Runtime check for async iterables (e.g. AsyncGenerator results). */
|
||||
export function isAsyncIterable(value) {
|
||||
return value != null && typeof value === 'object' && Symbol.asyncIterator in value;
|
||||
}
|
||||
//# sourceMappingURL=IterableUtils.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IterableUtils.js","sourceRoot":"","sources":["../../src/utils/IterableUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,uEAAuE;AACvE,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,IAAI,KAAK,CAAC;AACrF,CAAC"}
|
||||
Generated
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
/**
|
||||
* Decode the payload section of a JWT (no signature verification).
|
||||
* Returns an empty object on any failure (malformed JWT, invalid base64, invalid JSON).
|
||||
*/
|
||||
export declare function parseJwtPayload(jwt: string): Record<string, unknown>;
|
||||
/**
|
||||
* Extract the `exp` claim from a JWT and convert it to milliseconds.
|
||||
* Returns `undefined` if the token cannot be parsed or has no numeric `exp` claim.
|
||||
*/
|
||||
export declare function getJwtExpirationMs(jwt: string): number | undefined;
|
||||
//# sourceMappingURL=JwtUtils.d.ts.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"JwtUtils.d.ts","sourceRoot":"","sources":["../../src/utils/JwtUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAepE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOlE"}
|
||||
Generated
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
/**
|
||||
* Decode the payload section of a JWT (no signature verification).
|
||||
* Returns an empty object on any failure (malformed JWT, invalid base64, invalid JSON).
|
||||
*/
|
||||
export function parseJwtPayload(jwt) {
|
||||
const parts = jwt.split('.');
|
||||
if (parts.length < 2) {
|
||||
return {};
|
||||
}
|
||||
// Base64url -> Base64
|
||||
const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/');
|
||||
try {
|
||||
const json = atob(base64);
|
||||
return JSON.parse(json);
|
||||
}
|
||||
catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Extract the `exp` claim from a JWT and convert it to milliseconds.
|
||||
* Returns `undefined` if the token cannot be parsed or has no numeric `exp` claim.
|
||||
*/
|
||||
export function getJwtExpirationMs(jwt) {
|
||||
const payload = parseJwtPayload(jwt);
|
||||
const exp = payload.exp;
|
||||
if (typeof exp !== 'number') {
|
||||
return undefined;
|
||||
}
|
||||
return exp * 1000;
|
||||
}
|
||||
//# sourceMappingURL=JwtUtils.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"JwtUtils.js","sourceRoot":"","sources":["../../src/utils/JwtUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,sBAAsB;IACtB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAE9D,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAA4B,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IACxB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,GAAG,IAAI,CAAC;AACpB,CAAC"}
|
||||
Generated
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
export interface DeferredPromise<T> {
|
||||
readonly promise: Promise<T>;
|
||||
readonly resolve: (value: T | PromiseLike<T>) => void;
|
||||
readonly reject: (reason?: unknown) => void;
|
||||
}
|
||||
export declare function createDeferredPromise<T = void>(): DeferredPromise<T>;
|
||||
//# sourceMappingURL=PromiseUtils.d.ts.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PromiseUtils.d.ts","sourceRoot":"","sources":["../../src/utils/PromiseUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC7C;AAED,wBAAgB,qBAAqB,CAAC,CAAC,GAAG,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,CAQpE"}
|
||||
Generated
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
export function createDeferredPromise() {
|
||||
let resolve;
|
||||
let reject;
|
||||
const promise = new Promise((res, rej) => {
|
||||
resolve = res;
|
||||
reject = rej;
|
||||
});
|
||||
return { promise, resolve, reject };
|
||||
}
|
||||
//# sourceMappingURL=PromiseUtils.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"PromiseUtils.js","sourceRoot":"","sources":["../../src/utils/PromiseUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAQH,MAAM,UAAU,qBAAqB;IACnC,IAAI,OAA6C,CAAC;IAClD,IAAI,MAAmC,CAAC;IACxC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,GAAG,GAAG,CAAC;QACd,MAAM,GAAG,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACtC,CAAC"}
|
||||
Generated
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
/**
|
||||
* Compares two strings case-insensitively, treating null, undefined, and empty (or whitespace-only)
|
||||
* strings as equivalent.
|
||||
*/
|
||||
export declare function equalsIgnoreCase(a: string | null | undefined, b: string | null | undefined): boolean;
|
||||
//# sourceMappingURL=StringUtils.d.ts.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"StringUtils.d.ts","sourceRoot":"","sources":["../../src/utils/StringUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC5B,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC3B,OAAO,CAIT"}
|
||||
Generated
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
/**
|
||||
* Compares two strings case-insensitively, treating null, undefined, and empty (or whitespace-only)
|
||||
* strings as equivalent.
|
||||
*/
|
||||
export function equalsIgnoreCase(a, b) {
|
||||
const normalize = (v) => v && v.trim() !== '' ? v.toLowerCase() : null;
|
||||
return normalize(a) === normalize(b);
|
||||
}
|
||||
//# sourceMappingURL=StringUtils.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"StringUtils.js","sourceRoot":"","sources":["../../src/utils/StringUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,CAA4B,EAC5B,CAA4B;IAE5B,MAAM,SAAS,GAAG,CAAC,CAA4B,EAAiB,EAAE,CAChE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAChD,OAAO,SAAS,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC"}
|
||||
Generated
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
export { generateGuid, isGuid } from './GuidUtils.js';
|
||||
export { isAsyncIterable } from './IterableUtils.js';
|
||||
export { getJwtExpirationMs, parseJwtPayload } from './JwtUtils.js';
|
||||
export type { DeferredPromise } from './PromiseUtils.js';
|
||||
export { createDeferredPromise } from './PromiseUtils.js';
|
||||
export { equalsIgnoreCase } from './StringUtils.js';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
||||
Generated
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
/*!
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*/
|
||||
export { generateGuid, isGuid } from './GuidUtils.js';
|
||||
export { isAsyncIterable } from './IterableUtils.js';
|
||||
export { getJwtExpirationMs, parseJwtPayload } from './JwtUtils.js';
|
||||
export { createDeferredPromise } from './PromiseUtils.js';
|
||||
export { equalsIgnoreCase } from './StringUtils.js';
|
||||
//# sourceMappingURL=index.js.map
|
||||
Generated
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
|
||||
Reference in New Issue
Block a user