@monocloud/auth-core 0.1.4 → 0.1.6

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.
@@ -1,208 +0,0 @@
1
- import { g as Jwk, t as AccessToken, v as JwsHeaderParameters } from "../types-BAE9nCpJ.cjs";
2
-
3
- //#region src/utils/internal.d.ts
4
- /**
5
- * @ignore
6
- * Converts a string to a Base64URL encoded string.
7
- *
8
- * @param input - The string to encode.
9
- *
10
- * @returns The Base64URL encoded string.
11
- */
12
- declare const toB64Url: (input: string) => string;
13
- /**
14
- * @ignore
15
- * Parses a string value into a boolean.
16
- *
17
- * @param value - The string value to parse.
18
- *
19
- * @returns `true` if "true", `false` if "false", otherwise `undefined`.
20
- */
21
- declare const getBoolean: (value?: string) => boolean | undefined;
22
- /**
23
- * @ignore
24
- * Parses a string value into a number.
25
- *
26
- * @param value - The string value to parse.
27
- *
28
- * @returns The parsed number, or `undefined` if empty or invalid.
29
- */
30
- declare const getNumber: (value?: string) => number | undefined;
31
- /**
32
- * @ignore
33
- * Ensures that a string has a leading forward slash.
34
- *
35
- * @param val - The string to check.
36
- *
37
- * @returns The string with a leading slash.
38
- */
39
- declare const ensureLeadingSlash: (val?: string) => string;
40
- /**
41
- * @ignore
42
- * Removes a trailing forward slash from a string.
43
- *
44
- * @param val - The string to check.
45
- *
46
- * @returns The string without a trailing slash.
47
- */
48
- declare const removeTrailingSlash: (val?: string) => string;
49
- /**
50
- * @ignore
51
- * Checks if a value is present (not null, undefined, or an empty string).
52
- *
53
- * @param value - The value to check.
54
- *
55
- * @returns `true` if the value is present, `false` otherwise.
56
- */
57
- declare const isPresent: (value?: string | number | boolean) => boolean;
58
- /**
59
- * @ignore
60
- * Checks if a URL is an absolute URL (starts with http:// or https://).
61
- *
62
- * @param url - The URL to check.
63
- *
64
- * @returns `true` if absolute, `false` otherwise.
65
- */
66
- declare const isAbsoluteUrl: (url: string) => boolean;
67
- /**
68
- * @ignore
69
- * Checks if two URLs have the same origin (host and port).
70
- *
71
- * @param url - The first URL.
72
- * @param urlToCheck - The second URL to compare against.
73
- *
74
- * @returns `true` if they share the same origin, `false` otherwise.
75
- */
76
- declare const isSameHost: (url: string, urlToCheck: string) => boolean;
77
- /**
78
- * @ignore
79
- * Converts a string to a Uint8Array using TextEncoder.
80
- *
81
- * @param str - The string to convert.
82
- *
83
- * @returns A Uint8Array representation of the string.
84
- */
85
- declare const stringToArrayBuffer: (str: string) => Uint8Array;
86
- /**
87
- * @ignore
88
- * Converts an ArrayBuffer to a string using TextDecoder.
89
- *
90
- * @param buffer - The buffer to convert.
91
- *
92
- * @returns The decoded string.
93
- */
94
- declare const arrayBufferToString: (buffer: ArrayBuffer) => string;
95
- /**
96
- * @ignore
97
- * Converts a Base64URL string back to a standard Base64 string with padding.
98
- *
99
- * @param input - The Base64URL string.
100
- *
101
- * @returns A standard Base64 string.
102
- */
103
- declare const fromB64Url: (input: string) => string;
104
- /**
105
- * @ignore
106
- * Decodes a Base64URL encoded string.
107
- *
108
- * @param input - The Base64URL string to decode.
109
- *
110
- * @returns The decoded plaintext string.
111
- */
112
- declare const decodeBase64Url: (input: string) => string;
113
- /**
114
- * @ignore
115
- * Converts a Uint8Array to a Base64URL encoded string.
116
- *
117
- * @param buffer - The buffer to encode.
118
- *
119
- * @returns The Base64URL encoded string.
120
- */
121
- declare const arrayBufferToBase64: (buffer: Uint8Array) => string;
122
- /**
123
- * @ignore
124
- * Gets the current Unix timestamp in seconds.
125
- *
126
- * @returns The current timestamp.
127
- */
128
- declare const now: () => number;
129
- /**
130
- * Retrieves a public CryptoKey from a JWK set based on the JWS header.
131
- *
132
- * @param jwks - The set of JSON Web Keys.
133
- * @param header - The JWS header containing the algorithm and key ID.
134
- *
135
- * @returns A promise that resolves to the CryptoKey.
136
- *
137
- * @throws If no applicable key or multiple keys are found or the algorithm is unsupported.
138
- */
139
- declare const getPublicSigKeyFromIssuerJwks: (jwks: Jwk[], header: JwsHeaderParameters) => Promise<CryptoKey>;
140
- /**
141
- * @ignore
142
- * Encodes a Uint8Array or ArrayBuffer into a Base64URL string using chunked processing.
143
- *
144
- * @param input - The data to encode.
145
- *
146
- * @returns The Base64URL encoded string.
147
- */
148
- declare const encodeBase64Url: (input: Uint8Array | ArrayBuffer) => string;
149
- /**
150
- * @ignore
151
- * Generates a random Base64URL encoded string.
152
- *
153
- * @param length - The number of random bytes to generate.
154
- *
155
- * @returns A random Base64URL string.
156
- */
157
- declare const randomBytes: (length?: number) => string;
158
- /**
159
- * @ignore
160
- * Checks if a value is a non-null, non-array JSON object.
161
- *
162
- * @param input - The value to check.
163
- *
164
- * @returns `true` if the value is a JSON object.
165
- */
166
- declare const isJsonObject: <T>(input: unknown) => input is T;
167
- /**
168
- * @ignore
169
- * Parses a space-separated string into an array of strings.
170
- *
171
- * @param s - The space-separated string.
172
- *
173
- * @returns An array of strings, or `undefined` if input is empty.
174
- */
175
- declare const parseSpaceSeparated: (s?: string) => string[] | undefined;
176
- /**
177
- * @ignore
178
- * Parses a space-separated string into a Set of strings.
179
- *
180
- * @param s - The space-separated string.
181
- *
182
- * @returns A Set containing the unique strings.
183
- */
184
- declare const parseSpaceSeparatedSet: (s?: string) => Set<string>;
185
- /**
186
- * @ignore
187
- * Compares two Sets for equality.
188
- *
189
- * @param a - The first Set
190
- * @param b - The second Set
191
- * @param strict - If `true`, requires both sets to be the same size. @defaultValue true
192
- *
193
- * @returns `true` if the sets are equal
194
- */
195
- declare const setsEqual: (a: Set<string>, b: Set<string>, strict?: boolean) => boolean;
196
- /**
197
- * Finds a specific access token in an array based on resource and scopes.
198
- *
199
- * @param tokens - The array of access tokens.
200
- * @param resource - Space-separated resource indicators.
201
- * @param scopes - Space-separated scopes.
202
- *
203
- * @returns The matching AccessToken, or `undefined` if not found.
204
- */
205
- declare const findToken: (tokens?: AccessToken[], resource?: string, scopes?: string) => AccessToken | undefined;
206
- //#endregion
207
- export { arrayBufferToBase64, arrayBufferToString, decodeBase64Url, encodeBase64Url, ensureLeadingSlash, findToken, fromB64Url, getBoolean, getNumber, getPublicSigKeyFromIssuerJwks, isAbsoluteUrl, isJsonObject, isPresent, isSameHost, now, parseSpaceSeparated, parseSpaceSeparatedSet, randomBytes, removeTrailingSlash, setsEqual, stringToArrayBuffer, toB64Url };
208
- //# sourceMappingURL=internal.d.cts.map