diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index a80337f2494396..df1528421a1242 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -47,6 +47,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: 'Upload to code-scanning' - uses: github/codeql-action/upload-sarif@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0 + uses: github/codeql-action/upload-sarif@883d8588e56d1753a8a58c1c86e88976f0c23449 # v3.26.3 with: sarif_file: results.sarif diff --git a/adev/shared-docs/package.json b/adev/shared-docs/package.json index 80a1c24f84eada..bd1d4e90c6c43e 100644 --- a/adev/shared-docs/package.json +++ b/adev/shared-docs/package.json @@ -9,7 +9,7 @@ "@angular/material": "^18.0.0-next.6 || ^18.1.0-next || ^18.2.0-next", "@angular/platform-browser": "^18.0.0-next.6 || ^18.1.0-next || ^18.2.0-next", "@angular/router": "^18.0.0-next.6 || ^18.1.0-next || ^18.2.0-next", - "algoliasearch": "^4.20.0", + "algoliasearch": "^5.0.0", "rxjs": "^7.8.1" }, "dependencies": { diff --git a/adev/shared-docs/services/search.service.ts b/adev/shared-docs/services/search.service.ts index 105c9de564a851..4fa61f1279e2c8 100644 --- a/adev/shared-docs/services/search.service.ts +++ b/adev/shared-docs/services/search.service.ts @@ -11,7 +11,7 @@ import {ENVIRONMENT} from '../providers/index'; import {SearchResult} from '../interfaces/index'; import {toObservable} from '@angular/core/rxjs-interop'; import {debounceTime, filter, from, of, switchMap} from 'rxjs'; -import algoliasearch, {SearchClient} from 'algoliasearch/lite'; +import {liteClient as algoliasearch} from 'algoliasearch/lite'; import {NavigationEnd, Router} from '@angular/router'; export const SEARCH_DELAY = 200; @@ -27,11 +27,7 @@ export class Search { private readonly router = inject(Router); private readonly config = inject(ENVIRONMENT); - private readonly client: SearchClient = (algoliasearch as any)( - this.config.algolia.appId, - this.config.algolia.apiKey, - ); - private readonly index = this.client.initIndex(this.config.algolia.indexName); + private readonly client = algoliasearch(this.config.algolia.appId, this.config.algolia.apiKey); searchQuery = this._searchQuery.asReadonly(); searchResults = this._searchResults.asReadonly(); @@ -41,35 +37,42 @@ export class Search { switchMap((query) => { return !!query ? from( - this.index.search(query, { - maxValuesPerFacet: MAX_VALUE_PER_FACET, - attributesToRetrieve: [ - 'hierarchy.lvl0', - 'hierarchy.lvl1', - 'hierarchy.lvl2', - 'hierarchy.lvl3', - 'hierarchy.lvl4', - 'hierarchy.lvl5', - 'hierarchy.lvl6', - 'content', - 'type', - 'url', - ], - hitsPerPage: 20, - snippetEllipsisText: '…', - highlightPreTag: '<ɵ>', - highlightPostTag: '', - attributesToHighlight: [], - attributesToSnippet: [ - 'hierarchy.lvl1:10', - 'hierarchy.lvl2:10', - 'hierarchy.lvl3:10', - 'hierarchy.lvl4:10', - 'hierarchy.lvl5:10', - 'hierarchy.lvl6:10', - 'content:10', - ], - }), + this.client.search([ + { + indexName: this.config.algolia.indexName, + params: { + query: query, + maxValuesPerFacet: MAX_VALUE_PER_FACET, + attributesToRetrieve: [ + 'hierarchy.lvl0', + 'hierarchy.lvl1', + 'hierarchy.lvl2', + 'hierarchy.lvl3', + 'hierarchy.lvl4', + 'hierarchy.lvl5', + 'hierarchy.lvl6', + 'content', + 'type', + 'url', + ], + hitsPerPage: 20, + snippetEllipsisText: '…', + highlightPreTag: '<ɵ>', + highlightPostTag: '', + attributesToHighlight: [], + attributesToSnippet: [ + 'hierarchy.lvl1:10', + 'hierarchy.lvl2:10', + 'hierarchy.lvl3:10', + 'hierarchy.lvl4:10', + 'hierarchy.lvl5:10', + 'hierarchy.lvl6:10', + 'content:10', + ], + }, + type: 'default', + }, + ]), ) : of(undefined); }), @@ -89,7 +92,7 @@ export class Search { private listenToSearchResults(): void { this.searchResults$.subscribe((response: any) => { this._searchResults.set( - response ? this.getUniqueSearchResultItems(response.hits) : undefined, + response ? this.getUniqueSearchResultItems(response.results[0].hits) : undefined, ); }); } diff --git a/package.json b/package.json index d7e76a0e7b09fc..cad9068fb4d2ba 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@types/yargs": "^17.0.3", "@xterm/addon-fit": "^0.10.0", "@xterm/xterm": "^5.5.0", - "algoliasearch": "^4.23.3", + "algoliasearch": "^5.0.0", "angular-1.5": "npm:angular@1.5", "angular-1.6": "npm:angular@1.6", "angular-1.7": "npm:angular@1.7", diff --git a/packages/common/src/i18n/format_date.ts b/packages/common/src/i18n/format_date.ts index e5c078ae13d777..7410af36c71bdd 100644 --- a/packages/common/src/i18n/format_date.ts +++ b/packages/common/src/i18n/format_date.ts @@ -67,8 +67,7 @@ enum TranslationType { * or an [ISO date-time string](https://www.w3.org/TR/NOTE-datetime). * @param format The date-time components to include. See `DatePipe` for details. * @param locale A locale code for the locale format rules to use. - * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`), - * or a standard UTC/GMT or continental US time zone abbreviation. + * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`). * If not specified, uses host system settings. * * @returns The formatted date string. diff --git a/packages/common/src/pipes/date_pipe.ts b/packages/common/src/pipes/date_pipe.ts index f8f9d30935566f..6edd150d5d8560 100644 --- a/packages/common/src/pipes/date_pipe.ts +++ b/packages/common/src/pipes/date_pipe.ts @@ -234,10 +234,10 @@ export class DatePipe implements PipeTransform { * custom format string. When not provided, the `DatePipe` looks for the value using the * `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads the `dateFormat` property). * If the token is not configured, the `mediumDate` is used as a value. - * @param timezone A timezone offset (such as `'+0430'`), or a standard UTC/GMT, or continental US - * timezone abbreviation. When not provided, the `DatePipe` looks for the value using the - * `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads the `timezone` property). If the token - * is not configured, the end-user's local system timezone is used as a value. + * @param timezone A timezone offset (such as `'+0430'`). When not provided, the `DatePipe` + * looks for the value using the `DATE_PIPE_DEFAULT_OPTIONS` injection token (and reads + * the `timezone` property). If the token is not configured, the end-user's local system + * timezone is used as a value. * @param locale A locale code for the locale format rules to use. * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default. * See [Setting your app locale](guide/i18n/locale-id). diff --git a/yarn.lock b/yarn.lock index dbdb7b4be8f7e2..9871925daa8c3b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,126 +28,69 @@ tunnel "^0.0.6" undici "^5.25.4" -"@algolia/cache-browser-local-storage@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.24.0.tgz#97bc6d067a9fd932b9c922faa6b7fd6e546e1348" - integrity sha512-t63W9BnoXVrGy9iYHBgObNXqYXM3tYXCjDSHeNwnsc324r4o5UiVKUiAB4THQ5z9U5hTj6qUvwg/Ez43ZD85ww== - dependencies: - "@algolia/cache-common" "4.24.0" - -"@algolia/cache-common@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/cache-common/-/cache-common-4.24.0.tgz#81a8d3a82ceb75302abb9b150a52eba9960c9744" - integrity sha512-emi+v+DmVLpMGhp0V9q9h5CdkURsNmFC+cOS6uK9ndeJm9J4TiqSvPYVu+THUP8P/S08rxf5x2P+p3CfID0Y4g== - -"@algolia/cache-in-memory@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/cache-in-memory/-/cache-in-memory-4.24.0.tgz#ffcf8872f3a10cb85c4f4641bdffd307933a6e44" - integrity sha512-gDrt2so19jW26jY3/MkFg5mEypFIPbPoXsQGQWAi6TrCPsNOSEYepBMPlucqWigsmEy/prp5ug2jy/N3PVG/8w== - dependencies: - "@algolia/cache-common" "4.24.0" - -"@algolia/client-account@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/client-account/-/client-account-4.24.0.tgz#eba7a921d828e7c8c40a32d4add21206c7fe12f1" - integrity sha512-adcvyJ3KjPZFDybxlqnf+5KgxJtBjwTPTeyG2aOyoJvx0Y8dUQAEOEVOJ/GBxX0WWNbmaSrhDURMhc+QeevDsA== - dependencies: - "@algolia/client-common" "4.24.0" - "@algolia/client-search" "4.24.0" - "@algolia/transporter" "4.24.0" - -"@algolia/client-analytics@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-4.24.0.tgz#9d2576c46a9093a14e668833c505ea697a1a3e30" - integrity sha512-y8jOZt1OjwWU4N2qr8G4AxXAzaa8DBvyHTWlHzX/7Me1LX8OayfgHexqrsL4vSBcoMmVw2XnVW9MhL+Y2ZDJXg== +"@algolia/client-abtesting@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@algolia/client-abtesting/-/client-abtesting-5.0.0.tgz#c6d5727ee77d8ea0eac0d545a977c19155bb1c29" + integrity sha512-pVSwJ2QZ9hNeINjSWRQGwN/zAk16E6fOM4VGayIULyiJnaIaRjGT/UfMRiGsIuBFib2zviq83uO8GOnCUBmXnA== dependencies: - "@algolia/client-common" "4.24.0" - "@algolia/client-search" "4.24.0" - "@algolia/requester-common" "4.24.0" - "@algolia/transporter" "4.24.0" + "@algolia/client-common" "5.0.0" + "@algolia/requester-browser-xhr" "5.0.0" + "@algolia/requester-node-http" "5.0.0" -"@algolia/client-common@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-4.24.0.tgz#77c46eee42b9444a1d1c1583a83f7df4398a649d" - integrity sha512-bc2ROsNL6w6rqpl5jj/UywlIYC21TwSSoFHKl01lYirGMW+9Eek6r02Tocg4gZ8HAw3iBvu6XQiM3BEbmEMoiA== +"@algolia/client-analytics@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-5.0.0.tgz#582d165cf6486e441646916635e5c74487ca3226" + integrity sha512-3A4JyblLorrxkYn6uOWyo7drDi3z7+Yzm45YP1MgOvzOCt0qWlEb6neIFLDe4UrBy24JqmRx54uNMBuYMOscgw== dependencies: - "@algolia/requester-common" "4.24.0" - "@algolia/transporter" "4.24.0" + "@algolia/client-common" "5.0.0" + "@algolia/requester-browser-xhr" "5.0.0" + "@algolia/requester-node-http" "5.0.0" -"@algolia/client-personalization@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-4.24.0.tgz#8b47789fb1cb0f8efbea0f79295b7c5a3850f6ae" - integrity sha512-l5FRFm/yngztweU0HdUzz1rC4yoWCFo3IF+dVIVTfEPg906eZg5BOd1k0K6rZx5JzyyoP4LdmOikfkfGsKVE9w== - dependencies: - "@algolia/client-common" "4.24.0" - "@algolia/requester-common" "4.24.0" - "@algolia/transporter" "4.24.0" +"@algolia/client-common@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-5.0.0.tgz#ff52d29ed81cdafaa38655fc4ee958ca49f20aaf" + integrity sha512-6N5Qygv/Z/B+rPufnPDLNWgsMf1uubMU7iS52xLcQSLiGlTS4f9eLUrmNXSzHccP33uoFi6xN9craN1sZi5MPQ== -"@algolia/client-search@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.24.0.tgz#75e6c02d33ef3e0f34afd9962c085b856fc4a55f" - integrity sha512-uRW6EpNapmLAD0mW47OXqTP8eiIx5F6qN9/x/7HHO6owL3N1IXqydGwW5nhDFBrV+ldouro2W1VX3XlcUXEFCA== +"@algolia/client-personalization@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@algolia/client-personalization/-/client-personalization-5.0.0.tgz#a5df3d5fce7a800145deca51cc10e8e9f037e568" + integrity sha512-Ns9pl+YGl0qZTbMqEKIO54GJqzyrMUmLfPB3/iEEkezKMMHXAsINrOuKTfhA6vyI0vhUJL3imOPo6vmXZBDZsA== dependencies: - "@algolia/client-common" "4.24.0" - "@algolia/requester-common" "4.24.0" - "@algolia/transporter" "4.24.0" + "@algolia/client-common" "5.0.0" + "@algolia/requester-browser-xhr" "5.0.0" + "@algolia/requester-node-http" "5.0.0" -"@algolia/logger-common@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/logger-common/-/logger-common-4.24.0.tgz#28d439976019ec0a46ba7a1a739ef493d4ef8123" - integrity sha512-LLUNjkahj9KtKYrQhFKCzMx0BY3RnNP4FEtO+sBybCjJ73E8jNdaKJ/Dd8A/VA4imVHP5tADZ8pn5B8Ga/wTMA== - -"@algolia/logger-console@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/logger-console/-/logger-console-4.24.0.tgz#c6ff486036cd90b81d07a95aaba04461da7e1c65" - integrity sha512-X4C8IoHgHfiUROfoRCV+lzSy+LHMgkoEEU1BbKcsfnV0i0S20zyy0NLww9dwVHUWNfPPxdMU+/wKmLGYf96yTg== +"@algolia/client-search@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-5.0.0.tgz#8d58f5daeffe9d19e0e0e9ebcdb5d23525edebe4" + integrity sha512-QdDYMzoxYZ3axzBy6CHe+M+NlOGvHEFTa2actchGnp25Uu0N6lyVNivT7nph+P1XoxgAD08cWbeJD3wWQXnpng== dependencies: - "@algolia/logger-common" "4.24.0" + "@algolia/client-common" "5.0.0" + "@algolia/requester-browser-xhr" "5.0.0" + "@algolia/requester-node-http" "5.0.0" -"@algolia/recommend@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/recommend/-/recommend-4.24.0.tgz#8a3f78aea471ee0a4836b78fd2aad4e9abcaaf34" - integrity sha512-P9kcgerfVBpfYHDfVZDvvdJv0lEoCvzNlOy2nykyt5bK8TyieYyiD0lguIJdRZZYGre03WIAFf14pgE+V+IBlw== - dependencies: - "@algolia/cache-browser-local-storage" "4.24.0" - "@algolia/cache-common" "4.24.0" - "@algolia/cache-in-memory" "4.24.0" - "@algolia/client-common" "4.24.0" - "@algolia/client-search" "4.24.0" - "@algolia/logger-common" "4.24.0" - "@algolia/logger-console" "4.24.0" - "@algolia/requester-browser-xhr" "4.24.0" - "@algolia/requester-common" "4.24.0" - "@algolia/requester-node-http" "4.24.0" - "@algolia/transporter" "4.24.0" - -"@algolia/requester-browser-xhr@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.24.0.tgz#313c5edab4ed73a052e75803855833b62dd19c16" - integrity sha512-Z2NxZMb6+nVXSjF13YpjYTdvV3032YTBSGm2vnYvYPA6mMxzM3v5rsCiSspndn9rzIW4Qp1lPHBvuoKJV6jnAA== +"@algolia/recommend@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@algolia/recommend/-/recommend-5.0.0.tgz#df3c63f7de2ddf6658a67308a7a5f4b805c87687" + integrity sha512-aEXg4RPFIRrJjrtri782W7XFNkarxoN9X42FwYYP1bz15jKu2vrIqzGlQoNCNWuZP7WwYyUAoTtixwLRJq8grQ== dependencies: - "@algolia/requester-common" "4.24.0" + "@algolia/client-common" "5.0.0" + "@algolia/requester-browser-xhr" "5.0.0" + "@algolia/requester-node-http" "5.0.0" -"@algolia/requester-common@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/requester-common/-/requester-common-4.24.0.tgz#1c60c198031f48fcdb9e34c4057a3ea987b9a436" - integrity sha512-k3CXJ2OVnvgE3HMwcojpvY6d9kgKMPRxs/kVohrwF5WMr2fnqojnycZkxPoEg+bXm8fi5BBfFmOqgYztRtHsQA== - -"@algolia/requester-node-http@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-4.24.0.tgz#4461593714031d02aa7da221c49df675212f482f" - integrity sha512-JF18yTjNOVYvU/L3UosRcvbPMGT9B+/GQWNWnenIImglzNVGpyzChkXLnrSf6uxwVNO6ESGu6oN8MqcGQcjQJw== +"@algolia/requester-browser-xhr@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-5.0.0.tgz#ddce386fd8635d79a1803c44b749289ff690db80" + integrity sha512-oOoQhSpg/RGiGHjn/cqtYpHBkkd+5M/DCi1jmfW+ZOvLVx21QVt6PbWIJoKJF85moNFo4UG9pMBU35R1MaxUKQ== dependencies: - "@algolia/requester-common" "4.24.0" + "@algolia/client-common" "5.0.0" -"@algolia/transporter@4.24.0": - version "4.24.0" - resolved "https://registry.yarnpkg.com/@algolia/transporter/-/transporter-4.24.0.tgz#226bb1f8af62430374c1972b2e5c8580ab275102" - integrity sha512-86nI7w6NzWxd1Zp9q3413dRshDqAzSbsQjhcDhPIatEFiZrL1/TjnHL8S7jVKFePlIMzDsZWXAXwXzcok9c5oA== +"@algolia/requester-node-http@5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-5.0.0.tgz#708961cb2c069e5ed3bae83aef144ec8b3300b57" + integrity sha512-FwCdugzpnW0wxbgWPauAz5vhmWGQnjZa5DCl9PBbIoDNEy/NIV8DmiL9CEA+LljQdDidG0l0ijojcTNaRRtPvQ== dependencies: - "@algolia/cache-common" "4.24.0" - "@algolia/logger-common" "4.24.0" - "@algolia/requester-common" "4.24.0" + "@algolia/client-common" "5.0.0" "@ampproject/remapping@2.3.0", "@ampproject/remapping@^2.2.0": version "2.3.0" @@ -5583,26 +5526,19 @@ ajv@~8.13.0: require-from-string "^2.0.2" uri-js "^4.4.1" -algoliasearch@^4.23.3: - version "4.24.0" - resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.24.0.tgz#b953b3e2309ef8f25da9de311b95b994ac918275" - integrity sha512-bf0QV/9jVejssFBmz2HQLxUadxk574t4iwjCKp5E7NBzwKkrDEhKPISIIjAU/p6K5qDx3qoeh4+26zWN1jmw3g== - dependencies: - "@algolia/cache-browser-local-storage" "4.24.0" - "@algolia/cache-common" "4.24.0" - "@algolia/cache-in-memory" "4.24.0" - "@algolia/client-account" "4.24.0" - "@algolia/client-analytics" "4.24.0" - "@algolia/client-common" "4.24.0" - "@algolia/client-personalization" "4.24.0" - "@algolia/client-search" "4.24.0" - "@algolia/logger-common" "4.24.0" - "@algolia/logger-console" "4.24.0" - "@algolia/recommend" "4.24.0" - "@algolia/requester-browser-xhr" "4.24.0" - "@algolia/requester-common" "4.24.0" - "@algolia/requester-node-http" "4.24.0" - "@algolia/transporter" "4.24.0" +algoliasearch@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-5.0.0.tgz#caa7cb9a5116291763c93f3e7ca0fc284b5784f8" + integrity sha512-j/RYIyKy7D6Vu/o142+6Gka1lXtu0j/Hj/Mw5oaPpOscOcE4jn29k465pcWYNC34HMxA4W8chiDk9cqw8nszag== + dependencies: + "@algolia/client-abtesting" "5.0.0" + "@algolia/client-analytics" "5.0.0" + "@algolia/client-common" "5.0.0" + "@algolia/client-personalization" "5.0.0" + "@algolia/client-search" "5.0.0" + "@algolia/recommend" "5.0.0" + "@algolia/requester-browser-xhr" "5.0.0" + "@algolia/requester-node-http" "5.0.0" "angular-1.5@npm:angular@1.5": version "1.5.11"