@transcommerce/cwm-shared 1.1.88 → 1.1.91
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/fesm2022/transcommerce-cwm-shared.mjs +822 -151
- package/fesm2022/transcommerce-cwm-shared.mjs.map +1 -1
- package/lib/components/external-navigation/external-navigation.component.d.ts +1 -1
- package/lib/components/navigate-to-route/navigate-to-route.component.d.ts +1 -1
- package/lib/components/page-not-found/page-not-found.component.d.ts +1 -1
- package/lib/cwm-shared-standalone.d.ts +19 -0
- package/lib/helpers/async-utils.d.ts +31 -3
- package/lib/helpers/jwt.d.ts +35 -0
- package/lib/helpers/time-span.d.ts +344 -0
- package/lib/helpers/utilities.d.ts +301 -0
- package/lib/modules/cwm-shared.module.d.ts +25 -10
- package/lib/pipes/safe-html.pipe.d.ts +1 -1
- package/lib/services/local-storage.service.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +9 -9
- package/lib/helpers/db-keys.d.ts +0 -18
- package/lib/helpers/time-span-overflow-error.d.ts +0 -2
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { HttpResponse, HttpResponseBase } from '@angular/common/http';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* A comprehensive utility service providing static helper methods for common operations across the application.
|
|
5
|
+
*
|
|
6
|
+
* This service includes utilities for:
|
|
7
|
+
* - **Cookie Management**: Getting, setting, removing, and checking cookies with proper encoding
|
|
8
|
+
* - **Security**: Scrubbing sensitive data from logs to prevent accidental exposure of PII and credentials
|
|
9
|
+
* - **HTTP Response Handling**: Parsing and extracting meaningful messages from HTTP responses and errors
|
|
10
|
+
* - **Date/Time Formatting**: Converting dates to various human-readable formats and calculating durations
|
|
11
|
+
* - **String Manipulation**: Case conversion, text expansion, trimming, and parsing operations
|
|
12
|
+
* - **Data Processing**: Array operations, deep cloning, searching, and JSON parsing with fallback handling
|
|
13
|
+
* - **Validation**: Type checking, URL validation, and network connectivity checks
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Using static utility methods
|
|
17
|
+
* const scrubbedLog = Utilities.scrubForLog(sensitiveData);
|
|
18
|
+
* const formattedDate = Utilities.printFriendlyDate(new Date());
|
|
19
|
+
* const errorMessage = Utilities.getHttpResponseMessage(httpError);
|
|
20
|
+
*
|
|
21
|
+
* @injectable
|
|
22
|
+
*/
|
|
3
23
|
export declare class Utilities {
|
|
4
24
|
static readonly captionAndMessageSeparator = ":";
|
|
5
25
|
static readonly noNetworkMessageCaption = "No Network";
|
|
@@ -8,11 +28,53 @@ export declare class Utilities {
|
|
|
8
28
|
static readonly accessDeniedMessageDetail = "";
|
|
9
29
|
static readonly notFoundMessageCaption = "Not Found";
|
|
10
30
|
static readonly notFoundMessageDetail = "The target resource cannot be found";
|
|
31
|
+
/**
|
|
32
|
+
* Cookie management utilities providing cross-browser compatible methods for cookie operations.
|
|
33
|
+
* All cookie keys and values are properly URL-encoded/decoded to handle special characters safely.
|
|
34
|
+
*
|
|
35
|
+
* Methods:
|
|
36
|
+
* - getItem: Retrieves a cookie value by name, returns null if not found
|
|
37
|
+
* - setItem: Sets a cookie with optional expiration, path, domain, and secure flags
|
|
38
|
+
* - removeItem: Removes a cookie by setting its expiration to the past
|
|
39
|
+
* - hasItem: Checks if a cookie exists
|
|
40
|
+
* - keys: Returns an array of all cookie names
|
|
41
|
+
*/
|
|
11
42
|
static cookies: {
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves the value of a cookie by its name with proper URL decoding.
|
|
45
|
+
* @param sKey The cookie name to retrieve
|
|
46
|
+
* @returns The decoded cookie value or null if not found
|
|
47
|
+
*/
|
|
12
48
|
getItem: (sKey: string) => string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Sets a cookie with optional expiration, domain, path, and secure flag.
|
|
51
|
+
* @param sKey The cookie name
|
|
52
|
+
* @param sValue The cookie value
|
|
53
|
+
* @param vEnd The expiration (Number for max-age in seconds, String for expires date, Date object, or null for session cookie)
|
|
54
|
+
* @param sPath The path scope for the cookie (defaults to all paths if empty)
|
|
55
|
+
* @param sDomain The domain scope for the cookie (defaults to current domain if empty)
|
|
56
|
+
* @param bSecure Whether to set the Secure flag (cookie only sent over HTTPS)
|
|
57
|
+
* @returns true if the cookie was set successfully, false otherwise
|
|
58
|
+
*/
|
|
13
59
|
setItem: (sKey: string, sValue: string, vEnd: any, sPath: string, sDomain: string, bSecure: unknown) => boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Removes a cookie by setting its expiration to a past date.
|
|
62
|
+
* @param sKey The cookie name to remove
|
|
63
|
+
* @param sPath The path scope (must match the path used when setting the cookie)
|
|
64
|
+
* @param sDomain The domain scope (must match the domain used when setting the cookie)
|
|
65
|
+
* @returns true if the removal was attempted, false if key was invalid
|
|
66
|
+
*/
|
|
14
67
|
removeItem: (sKey: string | number | boolean, sPath: string, sDomain: string) => boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Checks if a cookie with the specified name exists.
|
|
70
|
+
* @param sKey The cookie name to check
|
|
71
|
+
* @returns true if the cookie exists, false otherwise
|
|
72
|
+
*/
|
|
15
73
|
hasItem: (sKey: string | number | boolean) => boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves all cookie names as an array.
|
|
76
|
+
* @returns An array of all cookie names with proper URL decoding applied
|
|
77
|
+
*/
|
|
16
78
|
keys: () => string[];
|
|
17
79
|
};
|
|
18
80
|
/** Scrubs sensitive information from logs, such as email addresses, JWTs, tokens, GUIDs, credit card numbers, SSNs, phone numbers, and common password/username patterns.
|
|
@@ -30,49 +92,288 @@ export declare class Utilities {
|
|
|
30
92
|
* console.log(scrubbedData);
|
|
31
93
|
*/
|
|
32
94
|
static scrubForLog(input: any): string;
|
|
95
|
+
/**
|
|
96
|
+
* Extracts all messages from an HTTP response or error, formatting them as key-value pairs.
|
|
97
|
+
* Automatically detects network errors, access denied, and not found responses with special formatting.
|
|
98
|
+
*
|
|
99
|
+
* @param data The HTTP response or error object
|
|
100
|
+
* @returns An array of formatted message strings in the format "Key: Value"
|
|
101
|
+
*/
|
|
33
102
|
static getHttpResponseMessages(data: HttpResponseBase): string[];
|
|
103
|
+
/**
|
|
104
|
+
* Extracts a single consolidated message from an HTTP response or error.
|
|
105
|
+
* Searches in priority order: network message, not found message, error_description, error, then general response messages.
|
|
106
|
+
*
|
|
107
|
+
* @param data The HTTP response or error object
|
|
108
|
+
* @returns A single formatted message string
|
|
109
|
+
*/
|
|
34
110
|
static getHttpResponseMessage(data: HttpResponseBase | any): string;
|
|
111
|
+
/**
|
|
112
|
+
* Searches for a specific message within HTTP response messages.
|
|
113
|
+
* Can search in caption only or in full message text, and can optionally include the caption in the result.
|
|
114
|
+
*
|
|
115
|
+
* @param messageToFind The message or caption text to search for (case-insensitive)
|
|
116
|
+
* @param data The HTTP response or error object
|
|
117
|
+
* @param searchInCaptionOnly If true, only searches in the caption portion (before separator), defaults to true
|
|
118
|
+
* @param includeCaptionInResult If true, includes the caption in the returned result, defaults to false
|
|
119
|
+
* @returns The matching message or null if not found
|
|
120
|
+
*/
|
|
35
121
|
static findHttpResponseMessage(messageToFind: string, data: HttpResponse<any> | any, searchInCaptionOnly?: boolean, includeCaptionInResult?: boolean): any;
|
|
122
|
+
/**
|
|
123
|
+
* Extracts the response body from an HTTP response or error.
|
|
124
|
+
* For successful responses, returns the body property. For error responses, prioritizes error over message and statusText.
|
|
125
|
+
*
|
|
126
|
+
* @param response The HTTP response or error response
|
|
127
|
+
* @returns The response body, error, or null if none available
|
|
128
|
+
*/
|
|
36
129
|
static getResponseBody(response: HttpResponseBase): any;
|
|
130
|
+
/**
|
|
131
|
+
* Checks if the response indicates a network error (status 0).
|
|
132
|
+
* @param response The HTTP response to check
|
|
133
|
+
* @returns true if status is 0 (no network connection), false otherwise
|
|
134
|
+
*/
|
|
37
135
|
static checkNoNetwork(response: HttpResponseBase): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Checks if the response indicates an access denied error (status 403).
|
|
138
|
+
* @param response The HTTP response to check
|
|
139
|
+
* @returns true if status is 403 (Forbidden), false otherwise
|
|
140
|
+
*/
|
|
38
141
|
static checkAccessDenied(response: HttpResponseBase): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Checks if the response indicates a not found error (status 404).
|
|
144
|
+
* @param response The HTTP response to check
|
|
145
|
+
* @returns true if status is 404 (Not Found), false otherwise
|
|
146
|
+
*/
|
|
39
147
|
static checkNotFound(response: HttpResponseBase): boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Validates if a URL points to localhost or 127.0.0.1.
|
|
150
|
+
* @param url The URL to check
|
|
151
|
+
* @param base Optional base URL for resolving relative URLs
|
|
152
|
+
* @returns true if the URL hostname is localhost or 127.0.0.1, false otherwise
|
|
153
|
+
*/
|
|
40
154
|
static checkIsLocalHost(url: string, base?: string): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Parses a query parameter string into a key-value object.
|
|
157
|
+
* Handles standard URL query string format (key=value&key=value).
|
|
158
|
+
*
|
|
159
|
+
* @param paramString The query parameter string (e.g., "id=123&name=test")
|
|
160
|
+
* @returns An object with key-value pairs, or null if paramString is empty
|
|
161
|
+
*/
|
|
41
162
|
static getQueryParamsFromString(paramString: string): {
|
|
42
163
|
[key: string]: string;
|
|
43
164
|
} | null;
|
|
165
|
+
/**
|
|
166
|
+
* Splits a string into two parts based on the first occurrence of a separator.
|
|
167
|
+
* Both parts are trimmed of whitespace.
|
|
168
|
+
*
|
|
169
|
+
* @param text The text to split
|
|
170
|
+
* @param separator The separator string to split on
|
|
171
|
+
* @returns An object with firstPart and secondPart (secondPart is null if separator not found)
|
|
172
|
+
*/
|
|
44
173
|
static splitInTwo(text: string, separator: string): {
|
|
45
174
|
firstPart: string;
|
|
46
175
|
secondPart: any;
|
|
47
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Safely stringifies an object, filtering out complex types and handling circular references.
|
|
179
|
+
* If direct JSON.stringify fails, creates a sanitized object containing only primitive properties.
|
|
180
|
+
*
|
|
181
|
+
* @param object The object to stringify
|
|
182
|
+
* @returns A JSON string representation of the object, or a sanitized version if stringification fails
|
|
183
|
+
*/
|
|
48
184
|
static safeStringify(object: {
|
|
49
185
|
[x: string]: any;
|
|
50
186
|
hasOwnProperty: (arg0: string) => any;
|
|
51
187
|
}): string;
|
|
188
|
+
/**
|
|
189
|
+
* Safely parses a JSON string with fallback handling.
|
|
190
|
+
* Returns the parsed object if valid JSON, or returns undefined/value if parsing fails.
|
|
191
|
+
*
|
|
192
|
+
* @param value The JSON string to parse
|
|
193
|
+
* @returns The parsed object, 'undefined' if the string is 'undefined', or the original value if parsing fails
|
|
194
|
+
*/
|
|
52
195
|
static JsonTryParse(value: string): any;
|
|
196
|
+
/**
|
|
197
|
+
* Checks if an object has no properties.
|
|
198
|
+
* @param obj The object to check
|
|
199
|
+
* @returns true if the object is empty (no own properties), false otherwise
|
|
200
|
+
*/
|
|
53
201
|
static TestIsObjectEmpty(obj: any): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Checks if a value is undefined.
|
|
204
|
+
* @param value The value to check
|
|
205
|
+
* @returns true if the value is undefined, false otherwise
|
|
206
|
+
*/
|
|
54
207
|
static TestIsUndefined(value: any): value is undefined;
|
|
208
|
+
/**
|
|
209
|
+
* Checks if a value is a string.
|
|
210
|
+
* @param value The value to check
|
|
211
|
+
* @returns true if the value is a string primitive or String object, false otherwise
|
|
212
|
+
*/
|
|
55
213
|
static TestIsString(value: any): value is string | String;
|
|
214
|
+
/**
|
|
215
|
+
* Capitalizes the first letter of a string while leaving the rest unchanged.
|
|
216
|
+
* @param text The text to capitalize
|
|
217
|
+
* @returns The text with the first character uppercased, or the original text if empty
|
|
218
|
+
*/
|
|
56
219
|
static capitalizeFirstLetter(text: string): string;
|
|
220
|
+
/**
|
|
221
|
+
* Converts a string to title case, capitalizing the first letter of each word.
|
|
222
|
+
* @param text The text to convert to title case
|
|
223
|
+
* @returns The text in title case format
|
|
224
|
+
*/
|
|
57
225
|
static toTitleCase(text: string): string;
|
|
226
|
+
/**
|
|
227
|
+
* Converts a string or array of strings to lowercase.
|
|
228
|
+
* Supports overloaded signatures for both single string and array inputs.
|
|
229
|
+
*
|
|
230
|
+
* @param items A string or array of strings to convert to lowercase
|
|
231
|
+
* @returns The lowercased string or array of lowercased strings
|
|
232
|
+
*/
|
|
58
233
|
static toLowerCase(items: string): any;
|
|
59
234
|
static toLowerCase(items: string[]): any;
|
|
235
|
+
/**
|
|
236
|
+
* Generates a unique random ID string.
|
|
237
|
+
* @returns A string representation of a random number between 1,000,000 and 9,000,000
|
|
238
|
+
*/
|
|
60
239
|
static uniqueId(): string;
|
|
240
|
+
/**
|
|
241
|
+
* Generates a random integer within a specified range (inclusive).
|
|
242
|
+
* @param min The minimum value (inclusive)
|
|
243
|
+
* @param max The maximum value (inclusive)
|
|
244
|
+
* @returns A random integer between min and max
|
|
245
|
+
*/
|
|
61
246
|
static randomNumber(min: number, max: number): number;
|
|
247
|
+
/**
|
|
248
|
+
* Gets the base URL of the current application.
|
|
249
|
+
* Handles cases where window.location.origin is not available by constructing it from components.
|
|
250
|
+
*
|
|
251
|
+
* @returns The base URL without trailing slash (e.g., "http://localhost:4200")
|
|
252
|
+
*/
|
|
62
253
|
static baseUrl(): string;
|
|
254
|
+
/**
|
|
255
|
+
* Formats a date to display only the date portion in human-readable format.
|
|
256
|
+
* Example output: "Monday, 1st January 2024"
|
|
257
|
+
*
|
|
258
|
+
* @param date The date to format
|
|
259
|
+
* @returns A formatted date string with day of week, day of month with ordinal suffix, month name, and year
|
|
260
|
+
*/
|
|
63
261
|
static printDateOnly(date: Date): string;
|
|
262
|
+
/**
|
|
263
|
+
* Formats a date to display only the time portion in 12-hour format with AM/PM.
|
|
264
|
+
* Example output: "2:30 PM"
|
|
265
|
+
*
|
|
266
|
+
* @param date The date to format
|
|
267
|
+
* @returns A formatted time string in HH:MM AM/PM format
|
|
268
|
+
*/
|
|
64
269
|
static printTimeOnly(date: Date): string;
|
|
270
|
+
/**
|
|
271
|
+
* Combines date and time formatting into a single readable string.
|
|
272
|
+
* Example output: "Monday, 1st January 2024 at 2:30 PM"
|
|
273
|
+
*
|
|
274
|
+
* @param date The date to format
|
|
275
|
+
* @param separator The text to insert between date and time (defaults to 'at')
|
|
276
|
+
* @returns A combined date and time string
|
|
277
|
+
*/
|
|
65
278
|
static printDate(date: Date, separator?: string): string;
|
|
279
|
+
/**
|
|
280
|
+
* Formats a date using friendly relative terminology for recent dates.
|
|
281
|
+
* Returns "Today", "Yesterday", or full date for older dates.
|
|
282
|
+
*
|
|
283
|
+
* @param date The date to format
|
|
284
|
+
* @param separator The text to insert between "Today"/"Yesterday" and time (defaults to '-')
|
|
285
|
+
* @returns A friendly date string (e.g., "Today - 2:30 PM" or full date for older dates)
|
|
286
|
+
*/
|
|
66
287
|
static printFriendlyDate(date: Date, separator?: string): string;
|
|
288
|
+
/**
|
|
289
|
+
* Formats a date to a short format with time.
|
|
290
|
+
* Example output: "03/01/2024 - 2:30 PM"
|
|
291
|
+
*
|
|
292
|
+
* @param date The date to format
|
|
293
|
+
* @param separator The separator between month, day, and year (defaults to '/')
|
|
294
|
+
* @param dateTimeSeparator The separator between date and time (defaults to '-')
|
|
295
|
+
* @returns A formatted short date string with time
|
|
296
|
+
*/
|
|
67
297
|
static printShortDate(date: Date, separator?: string, dateTimeSeparator?: string): string;
|
|
298
|
+
/**
|
|
299
|
+
* Parses various date formats into a Date object.
|
|
300
|
+
* Supports Date objects, ISO strings, and timestamps (milliseconds).
|
|
301
|
+
* Automatically appends 'Z' to date strings without timezone information.
|
|
302
|
+
*
|
|
303
|
+
* @param date The date in various formats (Date, string, or number/timestamp)
|
|
304
|
+
* @returns A Date object, or an empty string if input is null/undefined
|
|
305
|
+
*/
|
|
68
306
|
static parseDate(date: any): "" | Date;
|
|
307
|
+
/**
|
|
308
|
+
* Calculates and formats the duration between two dates.
|
|
309
|
+
* Breaks down the duration into days, hours, minutes, and seconds.
|
|
310
|
+
* Example output: "2 days, 3 hours, 15 minutes and 30 seconds"
|
|
311
|
+
*
|
|
312
|
+
* @param start The start date
|
|
313
|
+
* @param end The end date
|
|
314
|
+
* @returns A human-readable duration string
|
|
315
|
+
*/
|
|
69
316
|
static printDuration(start: Date, end: Date): string;
|
|
317
|
+
/**
|
|
318
|
+
* Calculates the age in years between two dates.
|
|
319
|
+
* Properly accounts for whether the birthday has occurred in the current year.
|
|
320
|
+
*
|
|
321
|
+
* @param birthDate The birth date (can be string, number timestamp, or Date object)
|
|
322
|
+
* @param otherDate The reference date to calculate age from (can be string, number timestamp, or Date object)
|
|
323
|
+
* @returns The age in years as an integer
|
|
324
|
+
*/
|
|
70
325
|
static getAge(birthDate: string | number | Date, otherDate: string | number | Date): number;
|
|
326
|
+
/**
|
|
327
|
+
* Performs a deep clone of an array, recursively copying nested arrays and objects.
|
|
328
|
+
* Primitive types are returned unchanged, and handles circular references safely.
|
|
329
|
+
*
|
|
330
|
+
* @param items The array to clone
|
|
331
|
+
* @returns A deep copy of the array with all nested structures cloned
|
|
332
|
+
*/
|
|
71
333
|
static deepCloneArray<T>(items: T[]): T[];
|
|
334
|
+
/**
|
|
335
|
+
* Searches for a term within an array of values using case-sensitive or case-insensitive matching.
|
|
336
|
+
* Joins all values into a single string and searches for the term within it.
|
|
337
|
+
*
|
|
338
|
+
* @param searchTerm The term to search for
|
|
339
|
+
* @param caseSensitive Whether the search should be case-sensitive (defaults to false)
|
|
340
|
+
* @param values Variable number of values to search within
|
|
341
|
+
* @returns true if the search term is found, false otherwise
|
|
342
|
+
*/
|
|
72
343
|
static searchArray(searchTerm: string, caseSensitive: boolean, ...values: any[]): boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Moves an item within an array from one index to another.
|
|
346
|
+
* Handles negative indices (counts from the end) and automatically extends the array if needed.
|
|
347
|
+
*
|
|
348
|
+
* @param array The array to modify
|
|
349
|
+
* @param oldIndex The current index of the item to move
|
|
350
|
+
* @param newIndex The target index to move the item to
|
|
351
|
+
*/
|
|
73
352
|
static moveArrayItem(array: any[], oldIndex: number, newIndex: number): void;
|
|
353
|
+
/**
|
|
354
|
+
* Expands camelCase text into space-separated words.
|
|
355
|
+
* Handles both camelCase and PascalCase patterns as well as non-alphanumeric characters.
|
|
356
|
+
* Example: "myPropertyName" becomes "my Property Name"
|
|
357
|
+
*
|
|
358
|
+
* @param text The camelCase text to expand
|
|
359
|
+
* @returns The expanded text with spaces between words
|
|
360
|
+
*/
|
|
74
361
|
static expandCamelCase(text: string): string;
|
|
362
|
+
/**
|
|
363
|
+
* Tests whether a URL is absolute (starts with protocol or //).
|
|
364
|
+
* Matches URLs like "http://example.com" or "//example.com"
|
|
365
|
+
*
|
|
366
|
+
* @param url The URL to test
|
|
367
|
+
* @returns true if the URL is absolute, false if it's relative
|
|
368
|
+
*/
|
|
75
369
|
static testIsAbsoluteUrl(url: string): boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Converts a relative URL to an absolute URL by prepending //.
|
|
372
|
+
* If the URL is already absolute, it's returned unchanged.
|
|
373
|
+
*
|
|
374
|
+
* @param url The URL to convert
|
|
375
|
+
* @returns The absolute URL (e.g., "//example.com" for "example.com")
|
|
376
|
+
*/
|
|
76
377
|
static convertToAbsoluteUrl(url: string): string;
|
|
77
378
|
static ɵfac: i0.ɵɵFactoryDeclaration<Utilities, never>;
|
|
78
379
|
static ɵprov: i0.ɵɵInjectableDeclaration<Utilities>;
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "
|
|
3
|
-
import * as i2 from "
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "
|
|
6
|
-
import * as i5 from "@angular/
|
|
7
|
-
import * as i6 from "
|
|
8
|
-
import * as i7 from "
|
|
9
|
-
import * as i8 from "
|
|
10
|
-
import * as i9 from "
|
|
2
|
+
import * as i1 from "@angular/common";
|
|
3
|
+
import * as i2 from "@angular/router";
|
|
4
|
+
import * as i3 from "@azure/msal-angular";
|
|
5
|
+
import * as i4 from "@angular/platform-browser";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "../components/external-navigation/external-navigation.component";
|
|
8
|
+
import * as i7 from "../components/navigate-to-route/navigate-to-route.component";
|
|
9
|
+
import * as i8 from "../components/page-not-found/page-not-found.component";
|
|
10
|
+
import * as i9 from "../pipes/safe-html.pipe";
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use standalone components directly instead
|
|
13
|
+
*
|
|
14
|
+
* This module is maintained for backwards compatibility only.
|
|
15
|
+
* New applications should import standalone components directly:
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* import { PageNotFoundComponent, SafeHtmlPipe } from '@transcommerce/cwm-shared';
|
|
19
|
+
*
|
|
20
|
+
* @Component({
|
|
21
|
+
* selector: 'app-root',
|
|
22
|
+
* standalone: true,
|
|
23
|
+
* imports: [PageNotFoundComponent, SafeHtmlPipe]
|
|
24
|
+
* })
|
|
25
|
+
*/
|
|
11
26
|
export declare class CwmSharedModule {
|
|
12
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<CwmSharedModule, never>;
|
|
13
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<CwmSharedModule, [typeof i1.
|
|
28
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<CwmSharedModule, never, [typeof i1.CommonModule, typeof i2.RouterModule, typeof i3.MsalModule, typeof i4.BrowserModule, typeof i5.FormsModule, typeof i6.ExternalNavigationComponent, typeof i7.NavigateToRouteComponent, typeof i8.PageNotFoundComponent, typeof i9.SafeHtmlPipe], [typeof i1.CommonModule, typeof i2.RouterModule, typeof i3.MsalModule, typeof i6.ExternalNavigationComponent, typeof i7.NavigateToRouteComponent, typeof i8.PageNotFoundComponent, typeof i9.SafeHtmlPipe]>;
|
|
14
29
|
static ɵinj: i0.ɵɵInjectorDeclaration<CwmSharedModule>;
|
|
15
30
|
}
|
|
@@ -6,5 +6,5 @@ export declare class SafeHtmlPipe implements PipeTransform {
|
|
|
6
6
|
constructor(sanitizer: DomSanitizer);
|
|
7
7
|
transform(value: string): SafeHtml;
|
|
8
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<SafeHtmlPipe, never>;
|
|
9
|
-
static ɵpipe: i0.ɵɵPipeDeclaration<SafeHtmlPipe, "safeHtml",
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SafeHtmlPipe, "safeHtml", true>;
|
|
10
10
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class LocalStorageService {
|
|
4
|
+
static readonly USER_DATA = "user_data";
|
|
5
|
+
static readonly SYNC_KEYS = "sync_keys";
|
|
4
6
|
private static syncListenerInitialized;
|
|
5
7
|
private syncKeys;
|
|
6
8
|
private initEvent;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export { ExternalNavigationComponent } from './lib/components/external-navigation/external-navigation.component';
|
|
2
|
+
export { NavigateToRouteComponent } from './lib/components/navigate-to-route/navigate-to-route.component';
|
|
3
|
+
export { PageNotFoundComponent } from './lib/components/page-not-found/page-not-found.component';
|
|
4
|
+
export { msalInstanceFactory } from './lib/factories/msal.instance.factory';
|
|
5
|
+
export { msalGuardConfigFactory } from './lib/factories/msal.guard.config.factory';
|
|
6
|
+
export { msalInterceptorConfigFactory } from './lib/factories/msal-interceptor-config.factory';
|
|
7
7
|
export * from './lib/helpers/async-utils';
|
|
8
|
-
export * from './lib/helpers/db-keys';
|
|
9
8
|
export * from './lib/helpers/jwt';
|
|
10
9
|
export * from './lib/helpers/stack';
|
|
11
10
|
export * from './lib/helpers/time-span';
|
|
12
|
-
export * from './lib/helpers/time-span-overflow-error';
|
|
13
11
|
export * from './lib/helpers/utilities';
|
|
14
12
|
export * from './lib/models/config/api-config';
|
|
15
13
|
export * from './lib/models/config/auth-config';
|
|
@@ -23,6 +21,7 @@ export * from './lib/models/style/font-style';
|
|
|
23
21
|
export * from './lib/models/style/hex-color';
|
|
24
22
|
export * from './lib/models/style/image-style';
|
|
25
23
|
export * from './lib/models/style/justifications';
|
|
24
|
+
export * from './lib/models/style/named-colors';
|
|
26
25
|
export * from './lib/models/style/ng-style-attribute';
|
|
27
26
|
export * from './lib/models/style/on-style';
|
|
28
27
|
export * from './lib/models/style/rgba-color-style';
|
|
@@ -43,10 +42,11 @@ export * from './lib/models/slide';
|
|
|
43
42
|
export * from './lib/models/subscription';
|
|
44
43
|
export * from './lib/models/user-types';
|
|
45
44
|
export * from './lib/models/weight-tier-information';
|
|
45
|
+
export * from './lib/cwm-shared-standalone';
|
|
46
46
|
export * from './lib/modules/cwm-shared.module';
|
|
47
47
|
export * from '@angular/common';
|
|
48
48
|
export * from '@azure/msal-angular';
|
|
49
|
-
export
|
|
49
|
+
export { SafeHtmlPipe } from './lib/pipes/safe-html.pipe';
|
|
50
50
|
export * from './lib/services/mocks/mock-inventory-api-response';
|
|
51
51
|
export * from './lib/services/mocks/mock-config';
|
|
52
52
|
export * from './lib/services/mocks/mock-profile';
|
package/lib/helpers/db-keys.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class DbKeys {
|
|
3
|
-
static readonly CURRENT_USER = "current_user";
|
|
4
|
-
static readonly USER_PERMISSIONS = "user_permissions";
|
|
5
|
-
static readonly USER_DATA = "user_data";
|
|
6
|
-
static readonly SYNC_KEYS = "sync_keys";
|
|
7
|
-
static readonly AUTH_PROVIDER = "auth_provider";
|
|
8
|
-
static readonly REMEMBER_ME = "remember_me";
|
|
9
|
-
static readonly LANGUAGE = "language";
|
|
10
|
-
static readonly HOME_URL = "home_url";
|
|
11
|
-
static readonly THEME_ID = "themeId";
|
|
12
|
-
static readonly SHOW_DASHBOARD_STATISTICS = "show_dashboard_statistics";
|
|
13
|
-
static readonly SHOW_DASHBOARD_NOTIFICATIONS = "show_dashboard_notifications";
|
|
14
|
-
static readonly SHOW_DASHBOARD_TODO = "show_dashboard_todo";
|
|
15
|
-
static readonly SHOW_DASHBOARD_BANNER = "show_dashboard_banner";
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DbKeys, never>;
|
|
17
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<DbKeys>;
|
|
18
|
-
}
|