From 82223eec7eb70cedf0b14c135d5c652a591ccf9e Mon Sep 17 00:00:00 2001 From: Adam Akiva <26404016+adamakiva@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:01:33 +0300 Subject: [PATCH 01/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75295=20[exp?= =?UTF-8?q?ress-serve-static-core]:=20Changed=20Errback=20type=20err=20par?= =?UTF-8?q?ameter=20to=20be=20optional=20by=20@adamakiva?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../express-serve-static-core-tests.ts | 7 +++++-- types/express-serve-static-core/index.d.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/types/express-serve-static-core/express-serve-static-core-tests.ts b/types/express-serve-static-core/express-serve-static-core-tests.ts index e0029d3590cf4d..d9c7858e68ce95 100644 --- a/types/express-serve-static-core/express-serve-static-core-tests.ts +++ b/types/express-serve-static-core/express-serve-static-core-tests.ts @@ -300,13 +300,16 @@ app.get<{}, any, any, {}, { foo: boolean }>("/locals", (req, res, next) => { app.get("/file.txt", (req, res) => { res.download("/some/path/to/file.txt", "file.txt", { maxAge: 3_600_000 }, error => { - // $ExpectType Error + // $ExpectType Error | undefined error; }); }); app.get("/file2.txt", (req, res) => { - res.sendFile("/some/path/to/file2.txt", { maxAge: 3_600_000 }); + res.sendFile("/some/path/to/file2.txt", { maxAge: 3_600_000 }, error => { + // $ExpectType Error | undefined + error; + }); // @ts-expect-error res.sendFile("/some/path/to/file2.txt", { "max-age": 3_600_000 }); }); diff --git a/types/express-serve-static-core/index.d.ts b/types/express-serve-static-core/index.d.ts index d13bf897d3a60d..9914659cb9fb7f 100644 --- a/types/express-serve-static-core/index.d.ts +++ b/types/express-serve-static-core/index.d.ts @@ -391,7 +391,7 @@ export interface ByteRange { export interface RequestRanges extends RangeParserRanges {} -export type Errback = (err: Error) => void; +export type Errback = (err?: Error) => void; /** * @param P For most requests, this should be `ParamsDictionary`, but if you're From 460240786bacc4aa073649591427554be11c617c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20K=C3=B6ller?= Date: Fri, 31 Jul 2026 19:05:10 +0200 Subject: [PATCH 02/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75189=20Add?= =?UTF-8?q?=20missing=20types=20Google=20libphonenumber=20by=20@spike-rabb?= =?UTF-8?q?it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/google-libphonenumber/google-libphonenumber-tests.ts | 2 ++ types/google-libphonenumber/index.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/google-libphonenumber/google-libphonenumber-tests.ts b/types/google-libphonenumber/google-libphonenumber-tests.ts index fe15b789eb4848..4583724ad1805a 100644 --- a/types/google-libphonenumber/google-libphonenumber-tests.ts +++ b/types/google-libphonenumber/google-libphonenumber-tests.ts @@ -32,6 +32,8 @@ import { // $ExpectType number phoneUtil.getLengthOfNationalDestinationCode(phoneNumber); + + phoneNumber.clone(); // $ExpectType PhoneNumber }); (() => { diff --git a/types/google-libphonenumber/index.d.ts b/types/google-libphonenumber/index.d.ts index 0f6f7b25237342..c70fc6bd97e899 100644 --- a/types/google-libphonenumber/index.d.ts +++ b/types/google-libphonenumber/index.d.ts @@ -23,6 +23,7 @@ declare namespace libphonenumber { export namespace PhoneNumber { export enum CountryCodeSource { + UNSPECIFIED = 0, FROM_NUMBER_WITH_PLUS_SIGN = 1, FROM_NUMBER_WITH_IDD = 5, FROM_NUMBER_WITHOUT_PLUS_SIGN = 10, @@ -31,6 +32,7 @@ declare namespace libphonenumber { } export class PhoneNumber { + clone(): PhoneNumber; getCountryCode(): number | undefined; getCountryCodeOrDefault(): number; setCountryCode(value: number): void; From 277f45fb82ef3ae99f20d1168f1936bddf018dc9 Mon Sep 17 00:00:00 2001 From: Marcel Jackwerth Date: Fri, 31 Jul 2026 19:24:12 +0200 Subject: [PATCH 03/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75246=20[thr?= =?UTF-8?q?ee]=20Refactor=20Node=20type=20extensions=20into=20a=20lookup?= =?UTF-8?q?=20map=20by=20@mrcljx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Claude Opus 4.8 (1M context) --- types/three/src/nodes/core/Node.d.ts | 103 +++++++++++++-------------- 1 file changed, 50 insertions(+), 53 deletions(-) diff --git a/types/three/src/nodes/core/Node.d.ts b/types/three/src/nodes/core/Node.d.ts index 162515f6d8467c..d03d3c0f8eb0bf 100644 --- a/types/three/src/nodes/core/Node.d.ts +++ b/types/three/src/nodes/core/Node.d.ts @@ -556,63 +556,60 @@ export interface Mat4Extensions { export interface MatExtensions { } +interface NodeExtras { + [x: string]: {}; + "float": NumOrBoolExtensions<"float"> & FloatExtensions & NumExtensions<"float"> & FloatOrVecExtensions<"float">; + "int": + & NumOrBoolExtensions<"int"> + & IntExtensions + & NumExtensions<"int"> + & IntegerExtensions<"int"> + & IntOrVecExtensions<"int">; + "uint": + & NumOrBoolExtensions<"uint"> + & UintExtensions + & NumExtensions<"uint"> + & IntegerExtensions<"uint"> + & IntOrVecExtensions<"uint">; + "bool": NumOrBoolExtensions<"bool"> & BoolExtensions & BoolOrVecExtensions<"bool">; + "vec2": + & NumOrBoolVec2Extensions<"float"> + & Vec2Extensions + & NumVec2Extensions<"float"> + & FloatVecExtensions<"vec2"> + & FloatOrVecExtensions<"vec2">; + "ivec2": NumOrBoolVec2Extensions<"int"> & NumVec2Extensions<"int"> & IntOrVecExtensions<"ivec2">; + "uvec2": NumOrBoolVec2Extensions<"uint"> & NumVec2Extensions<"uint"> & IntOrVecExtensions<"uvec2">; + "bvec2": NumOrBoolVec2Extensions<"bool"> & BoolOrVecExtensions<"bvec2">; + "vec3": + & NumOrBoolVec3Extensions<"float"> + & Vec3Extensions + & NumVec3Extensions<"float"> + & FloatVecExtensions<"vec3"> + & FloatOrVecExtensions<"vec3">; + "ivec3": NumOrBoolVec3Extensions<"int"> & NumVec3Extensions<"int"> & IntOrVecExtensions<"ivec3">; + "uvec3": NumOrBoolVec3Extensions<"uint"> & NumVec3Extensions<"uint"> & IntOrVecExtensions<"uvec3">; + "bvec3": NumOrBoolVec3Extensions<"bool"> & BoolOrVecExtensions<"bvec3">; + "vec4": + & NumOrBoolVec4Extensions<"float"> + & Vec4Extensions + & NumVec4Extensions<"float"> + & FloatVecExtensions<"vec4"> + & FloatOrVecExtensions<"vec4">; + "ivec4": NumOrBoolVec4Extensions<"int"> & NumVec4Extensions<"int"> & IntOrVecExtensions<"ivec4">; + "uvec4": NumOrBoolVec4Extensions<"uint"> & NumVec4Extensions<"uint"> & IntOrVecExtensions<"uvec4">; + "bvec4": NumOrBoolVec4Extensions<"bool"> & BoolOrVecExtensions<"bvec4">; + "color": ColorExtensions; + "mat2": Mat2Extensions & MatExtensions<"mat2">; + "mat3": Mat3Extensions & MatExtensions<"mat3">; + "mat4": Mat4Extensions & MatExtensions<"mat4">; +} + type Node = & NodeClass & NodeElements & (unknown extends TNodeType ? {} : NodeExtensions) - & (TNodeType extends "float" - ? NumOrBoolExtensions<"float"> & FloatExtensions & NumExtensions<"float"> & FloatOrVecExtensions<"float"> - : TNodeType extends "int" ? - & NumOrBoolExtensions<"int"> - & IntExtensions - & NumExtensions<"int"> - & IntegerExtensions<"int"> - & IntOrVecExtensions<"int"> - : TNodeType extends "uint" ? - & NumOrBoolExtensions<"uint"> - & UintExtensions - & NumExtensions<"uint"> - & IntegerExtensions<"uint"> - & IntOrVecExtensions<"uint"> - : TNodeType extends "bool" ? NumOrBoolExtensions<"bool"> & BoolExtensions & BoolOrVecExtensions<"bool"> - : TNodeType extends "vec2" ? - & NumOrBoolVec2Extensions<"float"> - & Vec2Extensions - & NumVec2Extensions<"float"> - & FloatVecExtensions<"vec2"> - & FloatOrVecExtensions<"vec2"> - : TNodeType extends "ivec2" - ? NumOrBoolVec2Extensions<"int"> & NumVec2Extensions<"int"> & IntOrVecExtensions<"ivec2"> - : TNodeType extends "uvec2" - ? NumOrBoolVec2Extensions<"uint"> & NumVec2Extensions<"uint"> & IntOrVecExtensions<"uvec2"> - : TNodeType extends "bvec2" ? NumOrBoolVec2Extensions<"bool"> & BoolOrVecExtensions<"bvec2"> - : TNodeType extends "vec3" ? - & NumOrBoolVec3Extensions<"float"> - & Vec3Extensions - & NumVec3Extensions<"float"> - & FloatVecExtensions<"vec3"> - & FloatOrVecExtensions<"vec3"> - : TNodeType extends "ivec3" - ? NumOrBoolVec3Extensions<"int"> & NumVec3Extensions<"int"> & IntOrVecExtensions<"ivec3"> - : TNodeType extends "uvec3" - ? NumOrBoolVec3Extensions<"uint"> & NumVec3Extensions<"uint"> & IntOrVecExtensions<"uvec3"> - : TNodeType extends "bvec3" ? NumOrBoolVec3Extensions<"bool"> & BoolOrVecExtensions<"bvec3"> - : TNodeType extends "vec4" ? - & NumOrBoolVec4Extensions<"float"> - & Vec4Extensions - & NumVec4Extensions<"float"> - & FloatVecExtensions<"vec4"> - & FloatOrVecExtensions<"vec4"> - : TNodeType extends "ivec4" - ? NumOrBoolVec4Extensions<"int"> & NumVec4Extensions<"int"> & IntOrVecExtensions<"ivec4"> - : TNodeType extends "uvec4" - ? NumOrBoolVec4Extensions<"uint"> & NumVec4Extensions<"uint"> & IntOrVecExtensions<"uvec4"> - : TNodeType extends "bvec4" ? NumOrBoolVec4Extensions<"bool"> & BoolOrVecExtensions<"bvec4"> - : TNodeType extends "color" ? ColorExtensions - : TNodeType extends "mat2" ? Mat2Extensions & MatExtensions<"mat2"> - : TNodeType extends "mat3" ? Mat3Extensions & MatExtensions<"mat3"> - : TNodeType extends "mat4" ? Mat4Extensions & MatExtensions<"mat4"> - : {}) + & NodeExtras[TNodeType & string] & { __TypeScript_NODE_TYPE__: TNodeType; }; From 6d34125566bef51a1196a4ee22d9a8216ffdaee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=E2=84=93e=20Hensel?= Date: Sat, 1 Aug 2026 05:37:19 +1200 Subject: [PATCH 04/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75330=20fix(?= =?UTF-8?q?d3-geo):=20GeoRawProjection=20misdefined=20by=20@k-yle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/d3-geo/d3-geo-tests.ts | 24 ++++++++++++++---------- types/d3-geo/index.d.ts | 20 ++++++++++---------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index 9f34f26e29ea29..1f779a784df3d8 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -364,19 +364,19 @@ multiString = d3Geo.geoGraticule10(); // Pre-Defined Raw Projection Factories ================================= -const azimuthalEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEqualAreaRaw(); -const azimuthalEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEquidistantRaw(); +const azimuthalEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEqualAreaRaw; +const azimuthalEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEquidistantRaw; const conicConformalRaw: d3Geo.GeoRawProjection = d3Geo.geoConicConformalRaw(0, 0); const conicEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoConicEqualAreaRaw(0, 0); const conicEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoConicEquidistantRaw(0, 0); -const equirectangularRaw: d3Geo.GeoRawProjection = d3Geo.geoEquirectangularRaw(); -const gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw(); -const mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw(); -const orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw(); -const stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw(); -const equalEarthRaw: d3Geo.GeoRawProjection = d3Geo.geoEqualEarthRaw(); -const transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw(); -const naturalEarth1Raw: d3Geo.GeoRawProjection = d3Geo.geoNaturalEarth1Raw(); +const equirectangularRaw: d3Geo.GeoRawProjection = d3Geo.geoEquirectangularRaw; +const gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw; +const mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw; +const orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw; +const stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw; +const equalEarthRaw: d3Geo.GeoRawProjection = d3Geo.geoEqualEarthRaw; +const transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw; +const naturalEarth1Raw: d3Geo.GeoRawProjection = d3Geo.geoNaturalEarth1Raw; // Use Raw Projection ===================================================== @@ -384,6 +384,10 @@ const rawProjectionPoint: [number, number] = azimuthalEqualAreaRaw(54, 2); if (azimuthalEqualAreaRaw.invert) { const rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert(180, 6); } + +let raw: [number, number] = mercatorRaw(1, 2); +raw = mercatorRaw.invert!(...raw); + // ---------------------------------------------------------------------- // Pre-Defined Projections // ---------------------------------------------------------------------- diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index c92af5fa1aaeb1..b7e2d13b144e64 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -1003,7 +1003,7 @@ export function geoAzimuthalEqualArea(): GeoProjection; /** * The raw azimuthal equal-area projection. */ -export function geoAzimuthalEqualAreaRaw(): GeoRawProjection; +export const geoAzimuthalEqualAreaRaw: GeoRawProjection; /** * The azimuthal equidistant projection. @@ -1012,7 +1012,7 @@ export function geoAzimuthalEquidistant(): GeoProjection; /** * The raw azimuthal equidistant projection. */ -export function geoAzimuthalEquidistantRaw(): GeoRawProjection; +export const geoAzimuthalEquidistantRaw: GeoRawProjection; /** * The gnomonic projection. @@ -1022,7 +1022,7 @@ export function geoGnomonic(): GeoProjection; /** * The raw gnomonic projection. */ -export function geoGnomonicRaw(): GeoRawProjection; +export const geoGnomonicRaw: GeoRawProjection; /** * The orthographic projection. @@ -1032,7 +1032,7 @@ export function geoOrthographic(): GeoProjection; /** * The raw orthographic projection. */ -export function geoOrthographicRaw(): GeoRawProjection; +export const geoOrthographicRaw: GeoRawProjection; /** * The stereographic projection. @@ -1042,7 +1042,7 @@ export function geoStereographic(): GeoProjection; /** * The raw stereographic projection. */ -export function geoStereographicRaw(): GeoRawProjection; +export const geoStereographicRaw: GeoRawProjection; /** * The Equal Eartch projection, by Bojan Šavrič et al., 2018. @@ -1052,7 +1052,7 @@ export function geoEqualEarth(): GeoProjection; /** * The raw Equal Earth projection, by Bojan Šavrič et al., 2018. */ -export function geoEqualEarthRaw(): GeoRawProjection; +export const geoEqualEarthRaw: GeoRawProjection; // Composite Projections --------------------------------------------------- @@ -1112,7 +1112,7 @@ export function geoEquirectangular(): GeoProjection; /** * The raw equirectangular (plate carrée) projection. */ -export function geoEquirectangularRaw(): GeoRawProjection; +export const geoEquirectangularRaw: GeoRawProjection; /** * The spherical Mercator projection. @@ -1122,7 +1122,7 @@ export function geoMercator(): GeoProjection; /** * The raw spherical Mercator projection. */ -export function geoMercatorRaw(): GeoRawProjection; +export const geoMercatorRaw: GeoRawProjection; /** * The transverse spherical Mercator projection. @@ -1133,7 +1133,7 @@ export function geoTransverseMercator(): GeoProjection; /** * The raw transverse spherical Mercator projection. */ -export function geoTransverseMercatorRaw(): GeoRawProjection; +export const geoTransverseMercatorRaw: GeoRawProjection; /** * The Natural Earth projection is a pseudocylindrical projection designed by Tom Patterson. It is neither conformal nor equal-area, but appealing to the eye for small-scale maps of the whole world. @@ -1143,7 +1143,7 @@ export function geoNaturalEarth1(): GeoProjection; /** * The raw pseudo-cylindircal Natural Earth projection. */ -export function geoNaturalEarth1Raw(): GeoRawProjection; +export const geoNaturalEarth1Raw: GeoRawProjection; // ---------------------------------------------------------------------- // Projection Transforms From 0b84dd38bfa8147ded68c00ed37af55b62393868 Mon Sep 17 00:00:00 2001 From: Abhishek Hiremath <131762197+Abhi-DevHub@users.noreply.github.com> Date: Fri, 31 Jul 2026 23:12:38 +0530 Subject: [PATCH 05/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75264=20fix(?= =?UTF-8?q?pg):=20add=20verify=20option=20to=20PoolConfig=20by=20@Abhi-Dev?= =?UTF-8?q?Hub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Abhishek Hiremath <131762197+Abhi-DevHub@users.noreply.github.com> --- types/pg/index.d.ts | 1 + types/pg/pg-tests.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/types/pg/index.d.ts b/types/pg/index.d.ts index cc91d102ff7a9b..9048f04c2345ca 100644 --- a/types/pg/index.d.ts +++ b/types/pg/index.d.ts @@ -55,6 +55,7 @@ export interface PoolConfig extends ClientConfig { maxLifetimeSeconds?: number | undefined; Client?: (new() => ClientBase) | undefined; onConnect?: ((client: ClientBase) => void) | undefined; + verify?: ((client: PoolClient, done: (err?: Error) => void) => void) | undefined; } export interface QueryConfig { diff --git a/types/pg/pg-tests.ts b/types/pg/pg-tests.ts index 39778064b6efe7..7fc8582a6789ce 100644 --- a/types/pg/pg-tests.ts +++ b/types/pg/pg-tests.ts @@ -445,3 +445,15 @@ const poolWithOnConnect = new Pool({ poolWithOnConnect.connect().then(client => { console.log("client connected"); }); + +const poolWithVerify = new Pool({ + verify: (client, done) => { + client.query("SELECT 1", (err) => { + done(err ?? undefined); + }); + }, +}); + +poolWithVerify.connect().then(client => { + console.log("client connected"); +}); From a7c768fc88c8a370554925a0b5c2b2b0e885d736 Mon Sep 17 00:00:00 2001 From: googlemaps-bot Date: Fri, 31 Jul 2026 11:12:47 -0700 Subject: [PATCH 06/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75326=20chor?= =?UTF-8?q?e:=20sync=20updates=20to=20google.maps=20by=20@googlemaps-bot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: copybara-service[bot] --- types/google.maps/google.maps-tests.ts | 2 +- types/google.maps/index.d.ts | 30 +++++++++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/types/google.maps/google.maps-tests.ts b/types/google.maps/google.maps-tests.ts index 8dba222bf27fa5..17c416777fba19 100644 --- a/types/google.maps/google.maps-tests.ts +++ b/types/google.maps/google.maps-tests.ts @@ -1,3 +1,3 @@ // No tests required for generated types -// Synced from: https://github.com/googlemaps/js-types/commit/5c18d66b827f52c40cac7ff7012cfb3f4d3eb18f +// Synced from: https://github.com/googlemaps/js-types/commit/ebd6bc64eedd42e35d5691772febe9d55892c77a google.maps.Map; diff --git a/types/google.maps/index.d.ts b/types/google.maps/index.d.ts index 6a2ca271fca91a..c584dd3abb5359 100644 --- a/types/google.maps/index.d.ts +++ b/types/google.maps/index.d.ts @@ -2,11 +2,12 @@ // https://issuetracker.google.com/savedsearches/558438 // Google Maps JS API Version: 3.65 +// tslint:disable:array-type // tslint:disable:enforce-name-casing -// tslint:disable:no-any // tslint:disable:interface-over-type-literal -// tslint:disable:array-type +// tslint:disable:no-any // tslint:disable:no-empty-interface +// tslint:disable:no-quoted-property-signatures // tslint:disable:no-unnecessary-class // tslint:disable:strict-export-declare-modifiers // g3-prettier-ignore-file @@ -3810,7 +3811,7 @@ declare namespace google.maps { /** * Access by calling `const {MVCArray} = await google.maps.importLibrary("core");`. See https://developers.google.com/maps/documentation/javascript/libraries. */ - export class MVCArray< T = any > extends google.maps.MVCObject { + export class MVCArray extends google.maps.MVCObject { /** * A mutable MVC Array. * @param array @@ -5515,8 +5516,8 @@ declare namespace google.maps { export class StyledMapType extends google.maps.MVCObject implements google.maps.MapType { /** * Creates a styled MapType with the specified options. The StyledMapType takes an array of MapTypeStyles, where each MapTypeStyle is applied to the map consecutively. A later MapTypeStyle that applies the same MapTypeStylers to the same selectors as an earlier MapTypeStyle will override the earlier MapTypeStyle.

Note that the StyledMapType is not supported when a map ID is set. When using both together, you will receive a console warning. - * @param styles - * @param options + * @param styles The styles to apply. + * @param options The styled map type options. */ constructor(styles: (google.maps.MapTypeStyle | null)[] | null, options?: google.maps.StyledMapTypeOptions | null); @@ -15573,6 +15574,20 @@ declare namespace google.maps.routes { */ units?: google.maps.UnitSystem; } + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * Options for creating waypoint markers. + */ + export interface CreateWaypointMarkersOptions { + /** + * A custom function to mutate the created elements. The default forEach function appends pins with A-Z glyphs to each marker. For different behavior, override this function. + */ + forEach?: ((arg0: T) => void) | null; + /** + * The constructor of the element to create. Supported types include:
  • {@link google.maps.maps3d.Marker3DElement}
  • {@link google.maps.maps3d.Marker3DInteractiveElement}
  • {@link google.maps.maps3d.MarkerElement}
  • {@link google.maps.maps3d.MarkerInteractiveElement}
+ */ + markerClass?: (new () => T) | null; + } /** * Encapsulates a geographic point and an optional heading. * Access by calling `const {DirectionalLocation} = await google.maps.importLibrary("routes");`. See https://developers.google.com/maps/documentation/javascript/libraries. @@ -15903,6 +15918,11 @@ declare namespace google.maps.routes { * Creates markers for the route labeled 'A', 'B', 'C', etc. for each waypoint. Markers have default styling applied. Options can be passed in to alter the marker style based on the marker index or properties of the corresponding {@link google.maps.routes.RouteLeg}. The {@link google.maps.routes.WaypointMarkerDetails.leg} parameter will be undefined if the route has no legs.

The "legs" field must be requested in {@link google.maps.routes.ComputeRoutesRequest.fields} in order for intermediate waypoints to be included. */ createWaypointAdvancedMarkers(options?: google.maps.marker.AdvancedMarkerElementOptions | ((arg0: google.maps.marker.AdvancedMarkerElementOptions, arg1: google.maps.routes.WaypointMarkerDetails) => google.maps.marker.AdvancedMarkerElementOptions)): Promise; + /** + * Available only in the v=alpha channel: https://goo.gle/js-alpha-channel. + * Creates markers for the route's origin and destination. Markers have default styling applied unless a customOverride function is specified. Intermediate waypoints are not currently supported.

Created markers have their {@link google.maps.CollisionBehavior} set to {@link google.maps.CollisionBehavior.REQUIRED_AND_HIDES_OPTIONAL} by default. + */ + createWaypointMarkers(options?: google.maps.routes.CreateWaypointMarkersOptions): Promise; /** * Converts to a plain object. */ From 7446100a499a910ea67f0376e565613940995110 Mon Sep 17 00:00:00 2001 From: Gyeonghun Park Date: Sat, 1 Aug 2026 03:20:46 +0900 Subject: [PATCH 07/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75251=20[thr?= =?UTF-8?q?ee]=20Fix=20barrelMask=20typo=20in=20CRT=20declarations=20by=20?= =?UTF-8?q?@Gyeonghun-Park?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/three/examples/jsm/tsl/display/CRT.d.ts | 2 +- types/three/test/unit/examples/jsm/tsl/display/CRT.ts | 4 ++++ types/three/tsconfig.json | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 types/three/test/unit/examples/jsm/tsl/display/CRT.ts diff --git a/types/three/examples/jsm/tsl/display/CRT.d.ts b/types/three/examples/jsm/tsl/display/CRT.d.ts index d5f2702ae0f315..01dac2049f517a 100644 --- a/types/three/examples/jsm/tsl/display/CRT.d.ts +++ b/types/three/examples/jsm/tsl/display/CRT.d.ts @@ -2,7 +2,7 @@ import { Node } from "three/webgpu"; export const barrelUV: (curvature?: Node<"float">, coord?: Node<"vec2">) => Node<"vec2">; -export const barrelMast: (coord: Node<"vec2">) => Node<"float">; +export const barrelMask: (coord: Node<"vec2">) => Node<"float">; export const colorBleeding: (color: Node, amount?: Node<"float">) => Node<"vec3">; diff --git a/types/three/test/unit/examples/jsm/tsl/display/CRT.ts b/types/three/test/unit/examples/jsm/tsl/display/CRT.ts new file mode 100644 index 00000000000000..b903d3c73db095 --- /dev/null +++ b/types/three/test/unit/examples/jsm/tsl/display/CRT.ts @@ -0,0 +1,4 @@ +import { barrelMask } from "three/addons/tsl/display/CRT.js"; +import { uv } from "three/tsl"; + +barrelMask(uv()); diff --git a/types/three/tsconfig.json b/types/three/tsconfig.json index efb69c66391870..b5a9180bced592 100644 --- a/types/three/tsconfig.json +++ b/types/three/tsconfig.json @@ -36,6 +36,7 @@ "test/unit/examples/jsm/postprocessing/EffectComposer.ts", "test/unit/examples/jsm/postprocessing/SavePass.ts", "test/unit/examples/jsm/shaders/ACESFilmicToneMappingShader.ts", + "test/unit/examples/jsm/tsl/display/CRT.ts", "test/unit/src/audio/AudioContext.ts", "test/unit/src/core/EventDispatcher.ts", "test/unit/src/core/Uniform.ts", From 2477dfe833902ed9f9312e6760badff654ebfff1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jul 2026 11:35:31 -0700 Subject: [PATCH 08/26] Bump the github-actions group across 2 directories with 2 updates (#75314) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/actions/setup-for-scripts/action.yml | 2 +- .github/workflows/CI.yml | 12 ++++++------ .github/workflows/UpdateCodeowners.yml | 2 +- .github/workflows/format-and-commit.yml | 2 +- .github/workflows/ghostbuster.yml | 2 +- .github/workflows/lint-md.yml | 2 +- .github/workflows/pnpm-cache.yml | 4 ++-- .github/workflows/support-window.yml | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/actions/setup-for-scripts/action.yml b/.github/actions/setup-for-scripts/action.yml index f6aef2908787e9..97ba50f274adbf 100644 --- a/.github/actions/setup-for-scripts/action.yml +++ b/.github/actions/setup-for-scripts/action.yml @@ -4,7 +4,7 @@ description: Set up repo for running scripts runs: using: composite steps: - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: '24' - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bb07855a9807cf..19612e58bd357e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -30,12 +30,12 @@ jobs: matrix: ${{ steps.matrix.outputs.matrix }} steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: # Need this to be able to inquire about origin/master filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: '24' @@ -62,12 +62,12 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: # Need this to be able to inquire about origin/master filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: '24' @@ -132,7 +132,7 @@ jobs: - test steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-for-scripts - name: Get suggestions dir @@ -162,7 +162,7 @@ jobs: if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-for-scripts - run: pnpm tsc -p ./scripts diff --git a/.github/workflows/UpdateCodeowners.yml b/.github/workflows/UpdateCodeowners.yml index d6bedb16d24899..5f3360187d77dc 100644 --- a/.github/workflows/UpdateCodeowners.yml +++ b/.github/workflows/UpdateCodeowners.yml @@ -21,7 +21,7 @@ jobs: if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 diff --git a/.github/workflows/format-and-commit.yml b/.github/workflows/format-and-commit.yml index 7271eddf67dbfa..ca049bd1cae85c 100644 --- a/.github/workflows/format-and-commit.yml +++ b/.github/workflows/format-and-commit.yml @@ -16,7 +16,7 @@ jobs: contents: write if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-for-scripts - name: Get date diff --git a/.github/workflows/ghostbuster.yml b/.github/workflows/ghostbuster.yml index a68a25c4a4b0b3..0e0a77d3556e2c 100644 --- a/.github/workflows/ghostbuster.yml +++ b/.github/workflows/ghostbuster.yml @@ -23,7 +23,7 @@ jobs: if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-for-scripts - run: node ./scripts/ghostbuster.js > ${{ runner.temp }}/comment.md env: diff --git a/.github/workflows/lint-md.yml b/.github/workflows/lint-md.yml index 9ca0bd4f691e4b..4765920f3dd420 100644 --- a/.github/workflows/lint-md.yml +++ b/.github/workflows/lint-md.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-slim if: github.repository == 'DefinitelyTyped/DefinitelyTyped' steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-for-scripts - run: pnpm remark --frail . .github diff --git a/.github/workflows/pnpm-cache.yml b/.github/workflows/pnpm-cache.yml index f67e22a51b74a0..6278497ff7b7c9 100644 --- a/.github/workflows/pnpm-cache.yml +++ b/.github/workflows/pnpm-cache.yml @@ -11,8 +11,8 @@ jobs: runs-on: ubuntu-latest if: ${{ github.repository == 'DefinitelyTyped/DefinitelyTyped' }} steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: '24' - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 diff --git a/.github/workflows/support-window.yml b/.github/workflows/support-window.yml index 3248fc8270a70c..e9f7b4312c4468 100644 --- a/.github/workflows/support-window.yml +++ b/.github/workflows/support-window.yml @@ -23,7 +23,7 @@ jobs: if: github.repository == 'DefinitelyTyped/DefinitelyTyped' runs-on: ubuntu-slim steps: - - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - uses: ./.github/actions/setup-for-scripts - name: Fetch TypeScript versions and release dates from npm From 2bae1bb8834d0b2000472f1b5d6d2f9605b4db30 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Fri, 31 Jul 2026 20:35:43 +0200 Subject: [PATCH 09/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75331=20[oid?= =?UTF-8?q?c-provider]=20v9.11.0=20bump=20and=20various=20fixes=20by=20@pa?= =?UTF-8?q?nva?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filip Skokan --- types/oidc-provider/index.d.ts | 782 +++++++++++++++++---- types/oidc-provider/oidc-provider-tests.ts | 438 +++++++++++- types/oidc-provider/package.json | 2 +- 3 files changed, 1076 insertions(+), 146 deletions(-) diff --git a/types/oidc-provider/index.d.ts b/types/oidc-provider/index.d.ts index 7119b0885dd77e..9a44c3f34a7867 100644 --- a/types/oidc-provider/index.d.ts +++ b/types/oidc-provider/index.d.ts @@ -13,12 +13,14 @@ export type CanBePromise = Promise | T; export type FindAccount = ( ctx: KoaContextWithOIDC, sub: string, - token?: AuthorizationCode | AccessToken | DeviceCode | BackchannelAuthenticationRequest, + token?: AuthorizationCode | AccessToken | DeviceCode | BackchannelAuthenticationRequest | PreAuthorizedCode, ) => CanBePromise; export type TokenFormat = "opaque" | "jwt"; export type FapiProfile = "1.0 Final" | "2.0"; -export type TTLFunction = (ctx: KoaContextWithOIDC, token: T, client: Client) => number; +export type TTLFunction = WithClient extends true + ? (ctx: KoaContextWithOIDC, token: T, client: Client) => number + : (ctx: KoaContextWithOIDC, token: T) => number; export interface UnknownObject { [key: string]: unknown; @@ -26,7 +28,7 @@ export interface UnknownObject { export interface JWK { kid?: string | undefined; - x5c?: string[] | undefined; + x5c?: readonly string[] | undefined; alg?: string | undefined; crv?: string | undefined; d?: string | undefined; @@ -35,7 +37,7 @@ export interface JWK { e?: string | undefined; ext?: boolean | undefined; k?: string | undefined; - key_ops?: string[] | undefined; + key_ops?: readonly string[] | undefined; kty?: string | undefined; n?: string | undefined; p?: string | undefined; @@ -49,15 +51,96 @@ export interface JWK { } export interface JWKS { - keys: Array; + keys: ReadonlyArray; +} + +export interface AuthorizationDetail extends UnknownObject { + type: string; +} + +export interface JWTVerificationResult { + protectedHeader: UnknownObject; + payload: UnknownObject; + key: crypto.KeyObject | crypto.webcrypto.CryptoKey; +} + +export interface KeyAttestation { + jwt: string; + attestedKeys: readonly JWK[]; + payload: UnknownObject; +} + +export interface OpenID4VCIProofType { + proof_signing_alg_values_supported?: readonly string[] | undefined; + key_attestations_required?: + | { + key_storage?: readonly string[] | undefined; + user_authentication?: readonly string[] | undefined; + } + | undefined; + [key: string]: unknown; +} + +export interface OpenID4VCICredentialConfiguration { + format: string; + scope?: string | undefined; + cryptographic_binding_methods_supported?: readonly "jwk"[] | undefined; + proof_types_supported?: + | { + jwt?: OpenID4VCIProofType | undefined; + attestation?: OpenID4VCIProofType | undefined; + } + | undefined; + [key: string]: unknown; +} + +export interface OpenID4VCIMetadata extends UnknownObject { + batch_credential_issuance?: + | { + batch_size: number; + [key: string]: unknown; + } + | undefined; +} + +export type OpenID4VCIProofs = + | { + jwt: readonly string[]; + key_attestation?: KeyAttestation | undefined; + attestation?: never; + } + | { + attestation: KeyAttestation; + jwt?: never; + key_attestation?: never; + }; + +export interface OpenID4VCICredentialContext { + credentialConfigurationId: string; + credentialConfiguration: OpenID4VCICredentialConfiguration; + credentialIdentifier?: string | undefined; + client: Client; + account: Account; + grant: Grant; + accessToken: AccessToken; +} + +export interface OpenID4VCIIssueCredentialContext extends OpenID4VCICredentialContext { + body: UnknownObject; + proofs?: OpenID4VCIProofs | undefined; +} + +export interface OpenID4VCICredentialResponse extends UnknownObject { + credentials: readonly unknown[]; + notification_id?: string | undefined; } export interface AllClientMetadata { client_id?: string | undefined; - redirect_uris?: string[] | undefined; - grant_types?: string[] | undefined; - response_types?: ResponseType[] | undefined; - response_modes?: string[] | undefined; + redirect_uris?: readonly string[] | undefined; + grant_types?: readonly string[] | undefined; + response_types?: readonly ResponseType[] | undefined; + response_modes?: readonly string[] | undefined; application_type?: "web" | "native" | undefined; client_id_issued_at?: number | undefined; @@ -65,8 +148,8 @@ export interface AllClientMetadata { client_secret_expires_at?: number | undefined; client_secret?: string | undefined; client_uri?: string | undefined; - contacts?: string[] | undefined; - default_acr_values?: string[] | undefined; + contacts?: readonly string[] | undefined; + default_acr_values?: readonly string[] | undefined; default_max_age?: number | undefined; id_token_signed_response_alg?: SigningAlgorithmWithNone | undefined; initiate_login_uri?: string | undefined; @@ -74,7 +157,7 @@ export interface AllClientMetadata { jwks?: JWKS | undefined; logo_uri?: string | undefined; policy_uri?: string | undefined; - post_logout_redirect_uris?: string[] | undefined; + post_logout_redirect_uris?: readonly string[] | undefined; require_auth_time?: boolean | undefined; scope?: string | undefined; sector_identifier_uri?: string | undefined; @@ -106,6 +189,8 @@ export interface AllClientMetadata { authorization_encrypted_response_enc?: EncryptionEncValues | undefined; tls_client_certificate_bound_access_tokens?: boolean | undefined; use_mtls_endpoint_aliases?: boolean | undefined; + dpop_bound_access_tokens?: boolean | undefined; + authorization_details_types?: readonly string[] | undefined; require_signed_request_object?: boolean | undefined; require_pushed_authorization_requests?: boolean | undefined; @@ -115,6 +200,26 @@ export interface AllClientMetadata { backchannel_client_notification_endpoint?: string | undefined; backchannel_token_delivery_mode?: CIBADeliveryMode | undefined; + authorization_encryption_alg_values_supported?: readonly EncryptionAlgValues[] | undefined; + authorization_encryption_enc_values_supported?: readonly EncryptionEncValues[] | undefined; + authorization_signing_alg_values_supported?: readonly SigningAlgorithm[] | undefined; + backchannel_authentication_request_signing_alg_values_supported?: readonly SigningAlgorithm[] | undefined; + id_token_encryption_alg_values_supported?: readonly EncryptionAlgValues[] | undefined; + id_token_encryption_enc_values_supported?: readonly EncryptionEncValues[] | undefined; + id_token_signing_alg_values_supported?: readonly SigningAlgorithmWithNone[] | undefined; + introspection_encryption_alg_values_supported?: readonly EncryptionAlgValues[] | undefined; + introspection_encryption_enc_values_supported?: readonly EncryptionEncValues[] | undefined; + introspection_signing_alg_values_supported?: readonly SigningAlgorithmWithNone[] | undefined; + request_object_encryption_alg_values_supported?: readonly EncryptionAlgValues[] | undefined; + request_object_encryption_enc_values_supported?: readonly EncryptionEncValues[] | undefined; + request_object_signing_alg_values_supported?: readonly SigningAlgorithmWithNone[] | undefined; + subject_types_supported?: readonly SubjectTypes[] | undefined; + token_endpoint_auth_methods_supported?: readonly ClientAuthMethod[] | undefined; + token_endpoint_auth_signing_alg_values_supported?: readonly SigningAlgorithm[] | undefined; + userinfo_encryption_alg_values_supported?: readonly EncryptionAlgValues[] | undefined; + userinfo_encryption_enc_values_supported?: readonly EncryptionEncValues[] | undefined; + userinfo_signing_alg_values_supported?: readonly SigningAlgorithmWithNone[] | undefined; + [key: string]: unknown; } @@ -139,12 +244,13 @@ export type ClientAuthMethod = | "private_key_jwt" | "tls_client_auth" | "self_signed_tls_client_auth" + | "attest_jwt_client_auth" | "none"; export interface ClaimsParameterMember { essential?: boolean | undefined; value?: string | undefined; - values?: string[] | undefined; + values?: readonly string[] | undefined; [key: string]: unknown; } @@ -221,8 +327,7 @@ declare class Session extends BaseModel { } | undefined; - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - authTime(): string | void; + authTime(): number | undefined; past(age: number): boolean; ensureClientContainer(clientId: string): void; @@ -233,11 +338,10 @@ declare class Session extends BaseModel { loginTs?: number | undefined; transient?: boolean | undefined; }): void; - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type - authorizationFor(clientId: string): ClientAuthorizationState | void; - sidFor(clientId: string): string; + authorizationFor(clientId: string): ClientAuthorizationState; + sidFor(clientId: string): string | undefined; sidFor(clientId: string, value: string): void; - grantIdFor(clientId: string): string; + grantIdFor(clientId: string): string | undefined; grantIdFor(clientId: string, value: string): void; save(ttl: number): Promise; @@ -250,7 +354,11 @@ declare class Session extends BaseModel { } declare class Grant extends BaseToken { - constructor(properties?: { clientId?: string | undefined; accountId?: string | undefined }); + constructor(properties?: { + clientId?: string | undefined; + accountId?: string | undefined; + rar?: AuthorizationDetail[] | undefined; + }); accountId?: string | undefined; clientId?: string | undefined; @@ -265,25 +373,31 @@ declare class Grant extends BaseToken { [resource: string]: string; } | undefined; + rar?: AuthorizationDetail[] | undefined; rejected?: Pick | undefined; - addOIDCScope(scope: string): undefined; - rejectOIDCScope(scope: string): undefined; + addOIDCScope(scope: string | string[] | Set): undefined; + rejectOIDCScope(scope: string | string[] | Set): undefined; getOIDCScope(): string; + getRejectedOIDCScope(): string; getOIDCScopeEncountered(): string; - getOIDCScopeFiltered(filter: Set): string; + getOIDCScopeFiltered(filter: string[] | Set): string; - addOIDCClaims(claims: string[]): undefined; - rejectOIDCClaims(claims: string[]): undefined; + addOIDCClaims(claims: string[] | Set): undefined; + rejectOIDCClaims(claims: string[] | Set): undefined; getOIDCClaims(): string[]; + getRejectedOIDCClaims(): string[]; getOIDCClaimsEncountered(): string[]; - getOIDCClaimsFiltered(filter: Set): string[]; + getOIDCClaimsFiltered(filter: string[] | Set): string[]; - addResourceScope(resource: string, scope: string): undefined; - rejectResourceScope(resource: string, scope: string): undefined; + addResourceScope(resource: string, scope: string | string[] | Set): undefined; + rejectResourceScope(resource: string, scope: string | string[] | Set): undefined; getResourceScope(resource: string): string; + getRejectedResourceScope(resource: string): string; getResourceScopeEncountered(resource: string): string; - getResourceScopeFiltered(resource: string, filter: Set): string; + getResourceScopeFiltered(resource: string, filter: string[] | Set): string; + + addRar(detail: AuthorizationDetail): undefined; } interface BaseModel { @@ -299,6 +413,11 @@ declare class BaseModel { save(ttl?: number): Promise; destroy(): Promise; emit(eventName: string): void; + ttlPercentagePassed(): number; + + readonly isValid: boolean; + readonly isExpired: boolean; + readonly remainingTTL: number; static readonly adapter: Adapter; @@ -316,6 +435,7 @@ declare class BaseToken extends BaseModel { client?: Client | undefined; readonly format?: string | undefined; readonly scopes: Set; + readonly resourceIndicators: Set; ttlPercentagePassed(): number; @@ -337,19 +457,27 @@ declare class BaseToken extends BaseModel { static readonly adapter: Adapter; } -declare class ReplayDetection { +declare class ReplayDetection extends BaseModel { readonly kind: "ReplayDetection"; - unique(iss: string, jti: string, exp?: number): Promise; - - readonly adapter: Adapter; - static readonly adapter: Adapter; + iss?: string | undefined; + static unique(iss: string, jti: string, exp: number): Promise; } -declare class PushedAuthorizationRequest extends BaseToken { - constructor(properties: { request: string }); +declare class PushedAuthorizationRequest extends BaseModel { + constructor(properties: { + request: string; + attestationJkt?: string | undefined; + dpopJkt?: string | undefined; + trusted?: string[] | undefined; + }); readonly kind: "PushedAuthorizationRequest"; request: string; + attestationJkt?: string | undefined; dpopJkt?: string | undefined; + trusted?: string[] | undefined; + consumed: unknown; + + consume(): Promise; } declare class RefreshToken extends BaseToken { @@ -370,6 +498,7 @@ declare class RefreshToken extends BaseToken { jkt?: string | undefined; grantId: string; gty: string; + rar?: AuthorizationDetail[] | undefined; [key: string]: unknown; }); readonly kind: "RefreshToken"; @@ -390,6 +519,8 @@ declare class RefreshToken extends BaseToken { jkt?: string | undefined; grantId?: string | undefined; gty?: string | undefined; + rar?: AuthorizationDetail[] | undefined; + attestationJkt?: string | undefined; consumed: unknown; totalLifetime(): number; @@ -417,9 +548,10 @@ declare class AuthorizationCode extends BaseToken { sessionUid?: string | undefined; expiresWithSession?: boolean | undefined; "x5t#S256"?: string | undefined; - jkt?: string | undefined; + dpopJkt?: string | undefined; grantId: string; gty: string; + rar?: AuthorizationDetail[] | undefined; [key: string]: unknown; }); readonly kind: "AuthorizationCode"; @@ -438,9 +570,11 @@ declare class AuthorizationCode extends BaseToken { sessionUid?: string | undefined; expiresWithSession?: boolean | undefined; "x5t#S256"?: string | undefined; - jkt?: string | undefined; + dpopJkt?: string | undefined; grantId?: string | undefined; gty?: string | undefined; + rar?: AuthorizationDetail[] | undefined; + attestationJkt?: string | undefined; consume(): Promise; @@ -481,6 +615,7 @@ declare class DeviceCode extends BaseToken { sessionUid?: string | undefined; expiresWithSession?: boolean | undefined; grantId: string; + attestationJkt?: string | undefined; consumed: unknown; consume(): Promise; @@ -507,15 +642,45 @@ declare class BackchannelAuthenticationRequest extends BaseToken { sessionUid?: string | undefined; expiresWithSession?: boolean | undefined; grantId: string; + rar?: AuthorizationDetail[] | undefined; + attestationJkt?: string | undefined; consumed: unknown; static revokeByGrantId(grantId: string): Promise; } +declare class PreAuthorizedCode extends BaseToken { + constructor(properties: { + accountId: string; + clientId: string; + grantId: string; + claims?: ClaimsParameter | undefined; + rar?: AuthorizationDetail[] | undefined; + resource?: string | string[] | undefined; + scope: string; + txCode?: string | undefined; + [key: string]: unknown; + }); + + readonly kind: "PreAuthorizedCode"; + accountId: string; + grantId: string; + claims?: ClaimsParameter | undefined; + rar?: AuthorizationDetail[] | undefined; + resource?: string | string[] | undefined; + scope: string; + txCode?: string | undefined; + consumed: unknown; + + consume(): Promise; + + static revokeByGrantId(grantId: string): Promise; +} + declare class ClientCredentials extends BaseToken { constructor(properties: { client: Client; - resourceServer?: ResourceServer | undefined; + resourceServer?: ResourceServerInstance | undefined; scope: string; [key: string]: unknown; }); @@ -526,7 +691,7 @@ declare class ClientCredentials extends BaseToken { readonly tokenType: string; "x5t#S256"?: string | undefined; jkt?: string | undefined; - resourceServer?: ResourceServer | undefined; + resourceServer?: ResourceServerInstance | undefined; isSenderConstrained(): boolean; } @@ -551,7 +716,7 @@ declare class AccessToken extends BaseToken { constructor(properties: { client: Client; accountId: string; - resourceServer?: ResourceServer | undefined; + resourceServer?: ResourceServerInstance | undefined; claims?: ClaimsParameter | undefined; aud?: string | string[] | undefined; scope: string; @@ -562,17 +727,19 @@ declare class AccessToken extends BaseToken { jkt?: string | undefined; grantId: string; gty: string; + rar?: AuthorizationDetail[] | undefined; [key: string]: unknown; }); readonly kind: "AccessToken"; accountId: string; - resourceServer?: ResourceServer | undefined; + resourceServer?: ResourceServerInstance | undefined; aud: string | string[]; claims?: ClaimsParameter | undefined; extra?: UnknownObject | undefined; grantId: string; scope?: string | undefined; gty: string; + rar?: AuthorizationDetail[] | undefined; sid?: string | undefined; sessionUid?: string | undefined; expiresWithSession?: boolean | undefined; @@ -602,6 +769,20 @@ declare class IdToken { static validate(idToken: string, client: Client): Promise<{ header: UnknownObject; payload: UnknownObject }>; } +declare class Claims { + constructor( + available: UnknownObject, + context: + | { ctx: KoaContextWithOIDC; client?: Client | undefined } + | { ctx?: undefined; client: Client }, + ); + + scope(value?: string): this; + mask(value: UnknownObject): void; + rejected(value?: readonly string[]): void; + result(): Promise; +} + declare class Client { responseTypeAllowed(type: ResponseType): boolean; responseModeAllowed(type: string, responseType: ResponseType, fapiProfile: FapiProfile | undefined): boolean; @@ -617,10 +798,10 @@ declare class Client { readonly clientId: string; - readonly grantTypes?: string[] | undefined; - readonly redirectUris?: string[] | undefined; - readonly responseTypes?: ResponseType[] | undefined; - readonly responseModes?: string[] | undefined; + readonly grantTypes?: readonly string[] | undefined; + readonly redirectUris?: readonly string[] | undefined; + readonly responseTypes?: readonly ResponseType[] | undefined; + readonly responseModes?: readonly string[] | undefined; readonly applicationType?: "web" | "native" | undefined; readonly clientIdIssuedAt?: number | undefined; @@ -628,8 +809,8 @@ declare class Client { readonly clientSecretExpiresAt?: number | undefined; readonly clientSecret?: string | undefined; readonly clientUri?: string | undefined; - readonly contacts?: string[] | undefined; - readonly defaultAcrValues?: string[] | undefined; + readonly contacts?: readonly string[] | undefined; + readonly defaultAcrValues?: readonly string[] | undefined; readonly defaultMaxAge?: number | undefined; readonly idTokenSignedResponseAlg?: string | undefined; readonly initiateLoginUri?: string | undefined; @@ -637,7 +818,7 @@ declare class Client { readonly jwks?: JWKS | undefined; readonly logoUri?: string | undefined; readonly policyUri?: string | undefined; - readonly postLogoutRedirectUris?: string[] | undefined; + readonly postLogoutRedirectUris?: readonly string[] | undefined; readonly requireAuthTime?: boolean | undefined; readonly scope?: string | undefined; readonly sectorIdentifierUri?: string | undefined; @@ -670,12 +851,37 @@ declare class Client { readonly authorizationEncryptedResponseAlg?: string | undefined; readonly authorizationEncryptedResponseEnc?: string | undefined; readonly tlsClientCertificateBoundAccessTokens?: boolean | undefined; + readonly useMtlsEndpointAliases?: boolean | undefined; + readonly dpopBoundAccessTokens?: boolean | undefined; + readonly authorizationDetailsTypes?: readonly string[] | undefined; + readonly requireSignedRequestObject?: boolean | undefined; + readonly requirePushedAuthorizationRequests?: boolean | undefined; readonly backchannelUserCodeParameter?: boolean | undefined; readonly backchannelAuthenticationRequestSigningAlg?: string | undefined; readonly backchannelClientNotificationEndpoint?: string | undefined; readonly backchannelTokenDeliveryMode?: CIBADeliveryMode | undefined; + readonly authorizationEncryptionAlgValuesSupported?: readonly EncryptionAlgValues[] | undefined; + readonly authorizationEncryptionEncValuesSupported?: readonly EncryptionEncValues[] | undefined; + readonly authorizationSigningAlgValuesSupported?: readonly SigningAlgorithm[] | undefined; + readonly backchannelAuthenticationRequestSigningAlgValuesSupported?: readonly SigningAlgorithm[] | undefined; + readonly idTokenEncryptionAlgValuesSupported?: readonly EncryptionAlgValues[] | undefined; + readonly idTokenEncryptionEncValuesSupported?: readonly EncryptionEncValues[] | undefined; + readonly idTokenSigningAlgValuesSupported?: readonly SigningAlgorithmWithNone[] | undefined; + readonly introspectionEncryptionAlgValuesSupported?: readonly EncryptionAlgValues[] | undefined; + readonly introspectionEncryptionEncValuesSupported?: readonly EncryptionEncValues[] | undefined; + readonly introspectionSigningAlgValuesSupported?: readonly SigningAlgorithmWithNone[] | undefined; + readonly requestObjectEncryptionAlgValuesSupported?: readonly EncryptionAlgValues[] | undefined; + readonly requestObjectEncryptionEncValuesSupported?: readonly EncryptionEncValues[] | undefined; + readonly requestObjectSigningAlgValuesSupported?: readonly SigningAlgorithmWithNone[] | undefined; + readonly subjectTypesSupported?: readonly SubjectTypes[] | undefined; + readonly tokenEndpointAuthMethodsSupported?: readonly ClientAuthMethod[] | undefined; + readonly tokenEndpointAuthSigningAlgValuesSupported?: readonly SigningAlgorithm[] | undefined; + readonly userinfoEncryptionAlgValuesSupported?: readonly EncryptionAlgValues[] | undefined; + readonly userinfoEncryptionEncValuesSupported?: readonly EncryptionEncValues[] | undefined; + readonly userinfoSigningAlgValuesSupported?: readonly SigningAlgorithmWithNone[] | undefined; + [key: string]: unknown; static find(id: string): Promise; @@ -686,6 +892,7 @@ export type { AccessToken, AuthorizationCode, BackchannelAuthenticationRequest, + Claims, Client, ClientCredentials, DeviceCode, @@ -694,6 +901,7 @@ export type { InitialAccessToken, Interaction, OIDCContext, + PreAuthorizedCode, PushedAuthorizationRequest, RefreshToken, RegistrationAccessToken, @@ -709,21 +917,23 @@ export interface ResourceServer { jwt?: | { sign?: + | false | { alg?: AsymmetricSigningAlgorithm | undefined; kid?: string | undefined; } | { alg: SymmetricSigningAlgorithm; - key: crypto.KeyObject | Buffer; + key: crypto.KeyObject | crypto.webcrypto.CryptoKey | Buffer; kid?: string | undefined; } | undefined; encrypt?: + | false | { alg: EncryptionAlgValues; enc: EncryptionEncValues; - key: crypto.KeyObject | Buffer; + key: crypto.KeyObject | crypto.webcrypto.CryptoKey | Buffer; kid?: string | undefined; } | undefined; @@ -731,6 +941,11 @@ export interface ResourceServer { | undefined; } +export interface ResourceServerInstance extends ResourceServer { + readonly scopes: Set; + identifier(): string; +} + declare class OIDCContext { constructor(ctx: Koa.Context); readonly route: string; @@ -752,6 +967,7 @@ declare class OIDCContext { readonly InitialAccessToken?: InitialAccessToken | undefined; readonly Interaction?: Interaction | undefined; readonly PushedAuthorizationRequest?: PushedAuthorizationRequest | undefined; + readonly PreAuthorizedCode?: PreAuthorizedCode | undefined; readonly BackchannelAuthenticationRequest?: BackchannelAuthenticationRequest | undefined; readonly RefreshToken?: RefreshToken | undefined; readonly RegistrationAccessToken?: RegistrationAccessToken | undefined; @@ -763,24 +979,32 @@ declare class OIDCContext { readonly claims: ClaimsParameter; readonly issuer: string; readonly provider: Provider; - readonly resourceServers?: { [key: string]: ResourceServer } | undefined; + readonly resourceServers?: { [key: string]: ResourceServerInstance } | undefined; + readonly fapiProfile?: FapiProfile | undefined; entity(key: string, value: any): void; + urlFor(name: string, options?: UnknownObject): string; + isFapi(...profiles: FapiProfile[]): FapiProfile | undefined; promptPending(name: string): boolean; readonly requestParamClaims: Set; readonly requestParamScopes: Set; + readonly requestParamOIDCScopes: Set; readonly prompts: Set; + readonly responseMode?: string | undefined; readonly result?: InteractionResults | undefined; readonly redirectUriCheckPerformed?: boolean | undefined; readonly trusted?: string[] | undefined; readonly registrationAccessToken?: RegistrationAccessToken | undefined; readonly deviceCode?: DeviceCode | undefined; + readonly authorizationCode?: AuthorizationCode | undefined; + readonly refreshToken?: RefreshToken | undefined; readonly accessToken?: AccessToken | undefined; readonly account?: Account | undefined; readonly client?: Client | undefined; + readonly grant?: Grant | undefined; readonly session?: Session | undefined; readonly acr: string; readonly amr: string[]; @@ -824,7 +1048,7 @@ export interface Account { } export type RotateRegistrationAccessTokenFunction = (ctx: KoaContextWithOIDC) => CanBePromise; -export type IssueRegistrationAccessTokenFunction = (ctx: KoaContextWithOIDC, client: Client) => boolean; +export type IssueRegistrationAccessTokenFunction = (ctx: KoaContextWithOIDC) => CanBePromise; export interface ErrorOut { error: string; @@ -837,7 +1061,7 @@ export interface AdapterPayload extends AllClientMetadata { accountId?: string | undefined; acr?: string | undefined; amr?: string[] | undefined; - aud?: string[] | undefined; + aud?: string | string[] | undefined; authorizations?: | { [clientId: string]: ClientAuthorizationState; @@ -845,10 +1069,12 @@ export interface AdapterPayload extends AllClientMetadata { | undefined; authTime?: number | undefined; claims?: ClaimsParameter | undefined; + cid?: string | undefined; clientId?: string | undefined; codeChallenge?: string | undefined; codeChallengeMethod?: string | undefined; consumed?: any; + deviceCode?: string | undefined; deviceInfo?: UnknownObject | undefined; error?: string | undefined; errorDescription?: string | undefined; @@ -866,11 +1092,14 @@ export interface AdapterPayload extends AllClientMetadata { lastSubmission?: InteractionResults | undefined; loginTs?: number | undefined; nonce?: string | undefined; + parJti?: string | undefined; params?: UnknownObject | undefined; policies?: string[] | undefined; + prompt?: PromptDetail | undefined; redirectUri?: string | undefined; request?: string | undefined; - resource?: string | undefined; + rar?: AuthorizationDetail[] | undefined; + resource?: string | string[] | undefined; result?: InteractionResults | undefined; returnTo?: string | undefined; rotations?: number | undefined; @@ -887,17 +1116,20 @@ export interface AdapterPayload extends AllClientMetadata { sessionUid?: string | undefined; sid?: string | undefined; trusted?: string[] | undefined; + attestationJkt?: string | undefined; dpopJkt?: string | undefined; + iss?: string | undefined; state?: UnknownObject | undefined; transient?: boolean | undefined; uid?: string | undefined; userCode?: string | undefined; + txCode?: string | undefined; jkt?: string | undefined; "x5t#S256"?: string | undefined; } export interface Adapter { - upsert(id: string, payload: AdapterPayload, expiresIn: number): Promise; // eslint-disable-line @typescript-eslint/no-invalid-void-type + upsert(id: string, payload: AdapterPayload, expiresIn?: number): Promise; // eslint-disable-line @typescript-eslint/no-invalid-void-type find(id: string): Promise; // eslint-disable-line @typescript-eslint/no-invalid-void-type findByUserCode(userCode: string): Promise; // eslint-disable-line @typescript-eslint/no-invalid-void-type findByUid(uid: string): Promise; // eslint-disable-line @typescript-eslint/no-invalid-void-type @@ -932,20 +1164,61 @@ export type JsonArray = JsonValue[]; export type JsonPrimitive = string | number | boolean | null; export type JsonValue = JsonPrimitive | JsonObject | JsonArray; +export interface RichAuthorizationRequestType { + validate: ( + ctx: KoaContextWithOIDC, + detail: AuthorizationDetail, + client: Client, + ) => CanBePromise; +} + +export interface RichAuthorizationRequestsConfiguration { + enabled?: boolean | undefined; + ack?: string | undefined; + types?: Readonly> | undefined; + rarForAuthorizationCode?: + | ((ctx: KoaContextWithOIDC) => CanBePromise) + | undefined; + rarForBackchannelResponse?: + | (( + ctx: KoaContextWithOIDC, + resourceServer: ResourceServerInstance, + ) => CanBePromise) + | undefined; + rarForCodeResponse?: + | (( + ctx: KoaContextWithOIDC, + resourceServer: ResourceServerInstance, + ) => CanBePromise) + | undefined; + rarForIntrospectionResponse?: + | (( + ctx: KoaContextWithOIDC, + token: AccessToken | ClientCredentials | RefreshToken, + ) => CanBePromise) + | undefined; + rarForRefreshTokenResponse?: + | (( + ctx: KoaContextWithOIDC, + resourceServer: ResourceServerInstance, + ) => CanBePromise) + | undefined; +} + export interface Configuration { - acrValues?: string[] | Set | undefined; + acrValues?: readonly string[] | ReadonlySet | undefined; adapter?: AdapterConstructor | AdapterFactory | undefined; claims?: | { - [key: string]: null | string[]; + [key: string]: null | readonly string[]; } | undefined; clientBasedCORS?: ((ctx: KoaContextWithOIDC, origin: string, client: Client) => boolean) | undefined; - clients?: ClientMetadata[] | undefined; + clients?: readonly ClientMetadata[] | undefined; formats?: | { @@ -982,7 +1255,7 @@ export interface Configuration { | undefined; long?: CookiesSetOptions | undefined; short?: CookiesSetOptions | undefined; - keys?: Array | undefined | KeyGrip; + keys?: ReadonlyArray | undefined | KeyGrip; } | undefined; @@ -990,11 +1263,15 @@ export interface Configuration { enableHttpPostMethods?: boolean | undefined; - extraParams?: string[] | { - [param: string]: - | null - | ((ctx: KoaContextWithOIDC, value: string | undefined, client: Client) => CanBePromise); - } | undefined; + extraParams?: + | readonly string[] + | ReadonlySet + | { + [param: string]: + | null + | ((ctx: KoaContextWithOIDC, value: string | undefined, client: Client) => CanBePromise); + } + | undefined; assertJwtClientAuthClaimsAndHeader?: ( ctx: KoaContextWithOIDC, @@ -1024,6 +1301,23 @@ export interface Configuration { } | undefined; + clientIdMetadataDocument?: + | { + enabled?: boolean | undefined; + ack?: string | undefined; + allowFetch?: + | ((ctx: KoaContextWithOIDC, clientId: string) => CanBePromise) + | undefined; + allowClient?: ((ctx: KoaContextWithOIDC, client: Client) => CanBePromise) | undefined; + cacheDuration?: + | { + min?: number | undefined; + max?: number | undefined; + } + | undefined; + } + | undefined; + clientCredentials?: | { enabled?: boolean | undefined; @@ -1087,7 +1381,7 @@ export interface Configuration { } | undefined; idFactory?: ((ctx: KoaContextWithOIDC) => string) | undefined; - secretFactory?: ((ctx: KoaContextWithOIDC) => string) | undefined; + secretFactory?: ((ctx: KoaContextWithOIDC) => CanBePromise) | undefined; issueRegistrationAccessToken?: IssueRegistrationAccessTokenFunction | boolean | undefined; } | undefined; @@ -1157,14 +1451,14 @@ export interface Configuration { fapi?: | { enabled?: boolean | undefined; - profile: FapiProfile | ((ctx: KoaContextWithOIDC, client: Client) => FapiProfile) | undefined; + profile?: FapiProfile | ((ctx: KoaContextWithOIDC, client: Client) => FapiProfile) | undefined; } | undefined; ciba?: | { enabled?: boolean | undefined; - deliveryModes: CIBADeliveryMode[]; + deliveryModes?: readonly CIBADeliveryMode[] | ReadonlySet | undefined; triggerAuthenticationDevice?: | (( ctx: KoaContextWithOIDC, @@ -1260,8 +1554,8 @@ export interface Configuration { | (( ctx: KoaContextWithOIDC, client: Client, - oneOf?: string[] | undefined, - ) => CanBePromise) + oneOf?: readonly string[] | undefined, + ) => CanBePromise) | undefined; useGrantedResource?: | (( @@ -1270,39 +1564,83 @@ export interface Configuration { | AuthorizationCode | RefreshToken | DeviceCode - | BackchannelAuthenticationRequest, + | BackchannelAuthenticationRequest + | PreAuthorizedCode, ) => CanBePromise) | undefined; } | undefined; - richAuthorizationRequests?: { - enabled?: boolean | undefined; - ack?: string | undefined; - /* experimental features are mostly explicit any */ - [key: string]: any; - } | undefined; + richAuthorizationRequests?: RichAuthorizationRequestsConfiguration | undefined; rpMetadataChoices?: { enabled?: boolean | undefined; - ack?: string | undefined; - /* experimental features are mostly explicit any */ - [key: string]: any; } | undefined; externalSigningSupport?: { enabled?: boolean | undefined; ack?: string | undefined; - /* experimental features are mostly explicit any */ [key: string]: any; } | undefined; attestClientAuth?: { enabled?: boolean | undefined; ack?: string | undefined; - /* experimental features are mostly explicit any */ - [key: string]: any; - }; + additionalSecuritySignal?: false | "optional" | "required" | undefined; + challengeSecret?: Buffer | undefined; + getAttestationSignaturePublicKey?: + | (( + ctx: KoaContextWithOIDC, + header: UnknownObject, + payload: UnknownObject, + client: Client, + ) => CanBePromise) + | undefined; + assertAttestationJwtAndPop?: + | (( + ctx: KoaContextWithOIDC, + attestation: JWTVerificationResult, + pop: JWTVerificationResult, + client: Client, + ) => CanBePromise) + | undefined; + } | undefined; + + openid4vci?: + | { + enabled?: boolean | undefined; + ack?: string | undefined; + nonceSecret?: Buffer | undefined; + preAuthorizedCodeGrant?: boolean | undefined; + metadata?: OpenID4VCIMetadata | undefined; + credentialConfigurationsSupported?: + | Record + | undefined; + credentialEndpointExpectedAudience?: + | ((ctx: KoaContextWithOIDC) => CanBePromise) + | undefined; + credentialConfigurationPolicy?: + | (( + ctx: KoaContextWithOIDC, + details: OpenID4VCICredentialContext, + ) => CanBePromise) + | undefined; + issueCredential?: + | (( + ctx: KoaContextWithOIDC, + details: OpenID4VCIIssueCredentialContext, + ) => CanBePromise) + | undefined; + getKeyAttestationSignaturePublicKey?: + | (( + ctx: KoaContextWithOIDC, + issuer: string, + header: UnknownObject, + client: Client, + ) => CanBePromise) + | undefined; + } + | undefined; } | undefined; @@ -1312,6 +1650,15 @@ export interface Configuration { fetch?: typeof fetch; + fetchResponseBodyLimits?: + | { + "client_id metadata document"?: number | undefined; + jwks_uri?: number | undefined; + sector_identifier_uri?: number | undefined; + [purpose: string]: number | undefined; + } + | undefined; + expiresWithSession?: | ((ctx: KoaContextWithOIDC, token: AccessToken | AuthorizationCode | DeviceCode) => CanBePromise) | undefined; @@ -1320,15 +1667,15 @@ export interface Configuration { | (( ctx: KoaContextWithOIDC, client: Client, - code: AuthorizationCode | DeviceCode | BackchannelAuthenticationRequest, + code: AuthorizationCode | DeviceCode | BackchannelAuthenticationRequest | PreAuthorizedCode, ) => CanBePromise) | undefined; jwks?: JWKS | undefined; - responseTypes?: ResponseType[] | undefined; + responseTypes?: readonly ResponseType[] | undefined; - revokeGrantPolicy?: ((ctx: KoaContextWithOIDC) => boolean) | undefined; + revokeGrantPolicy?: ((ctx: KoaContextWithOIDC) => CanBePromise) | undefined; pkce?: | { @@ -1341,6 +1688,8 @@ export interface Configuration { authorization?: string | undefined; code_verification?: string | undefined; device_authorization?: string | undefined; + challenge?: string | undefined; + credential?: string | undefined; end_session?: string | undefined; introspection?: string | undefined; jwks?: string | undefined; @@ -1353,15 +1702,15 @@ export interface Configuration { } | undefined; - scopes?: string[] | undefined; + scopes?: readonly string[] | ReadonlySet | undefined; - subjectTypes?: SubjectTypes[] | undefined; + subjectTypes?: readonly SubjectTypes[] | ReadonlySet | undefined; pairwiseIdentifier?: | ((ctx: KoaContextWithOIDC, accountId: string, client: Client) => CanBePromise) | undefined; - clientAuthMethods?: ClientAuthMethod[] | undefined; + clientAuthMethods?: readonly ClientAuthMethod[] | ReadonlySet | undefined; ttl?: | { @@ -1370,11 +1719,12 @@ export interface Configuration { ClientCredentials?: TTLFunction | number | undefined; DeviceCode?: TTLFunction | number | undefined; BackchannelAuthenticationRequest?: TTLFunction | number | undefined; + PreAuthorizedCode?: TTLFunction | number | undefined; IdToken?: TTLFunction | number | undefined; RefreshToken?: TTLFunction | number | undefined; - Interaction?: TTLFunction | number | undefined; - Session?: TTLFunction | number | undefined; - Grant?: TTLFunction | number | undefined; + Interaction?: TTLFunction | number | undefined; + Session?: TTLFunction | number | undefined; + Grant?: TTLFunction | number | undefined; [key: string]: unknown; } @@ -1384,7 +1734,7 @@ export interface Configuration { extraClientMetadata?: | { - properties?: string[] | undefined; + properties?: readonly string[] | undefined; validator?: | (( @@ -1414,32 +1764,35 @@ export interface Configuration { interactions?: | { - policy?: interactionPolicy.Prompt[] | undefined; + policy?: readonly interactionPolicy.Prompt[] | undefined; url?: ((ctx: KoaContextWithOIDC, interaction: Interaction) => CanBePromise) | undefined; } | undefined; findAccount?: FindAccount | undefined; + sectorIdentifierUriValidate?: ((client: Client) => boolean) | undefined; + enabledJWA?: | { - authorizationEncryptionAlgValues?: EncryptionAlgValues[] | undefined; - authorizationEncryptionEncValues?: EncryptionEncValues[] | undefined; - authorizationSigningAlgValues?: SigningAlgorithm[] | undefined; - dPoPSigningAlgValues?: AsymmetricSigningAlgorithm[] | undefined; - idTokenEncryptionAlgValues?: EncryptionAlgValues[] | undefined; - idTokenEncryptionEncValues?: EncryptionEncValues[] | undefined; - idTokenSigningAlgValues?: SigningAlgorithmWithNone[] | undefined; - introspectionEncryptionAlgValues?: EncryptionAlgValues[] | undefined; - introspectionEncryptionEncValues?: EncryptionEncValues[] | undefined; - introspectionSigningAlgValues?: SigningAlgorithmWithNone[] | undefined; - requestObjectEncryptionAlgValues?: EncryptionAlgValues[] | undefined; - requestObjectEncryptionEncValues?: EncryptionEncValues[] | undefined; - requestObjectSigningAlgValues?: SigningAlgorithmWithNone[] | undefined; - clientAuthSigningAlgValues?: SigningAlgorithm[] | undefined; - userinfoEncryptionAlgValues?: EncryptionAlgValues[] | undefined; - userinfoEncryptionEncValues?: EncryptionEncValues[] | undefined; - userinfoSigningAlgValues?: SigningAlgorithmWithNone[] | undefined; + authorizationEncryptionAlgValues?: readonly EncryptionAlgValues[] | undefined; + authorizationEncryptionEncValues?: readonly EncryptionEncValues[] | undefined; + authorizationSigningAlgValues?: readonly SigningAlgorithm[] | undefined; + dPoPSigningAlgValues?: readonly AsymmetricSigningAlgorithm[] | undefined; + attestSigningAlgValues?: readonly AsymmetricSigningAlgorithm[] | undefined; + idTokenEncryptionAlgValues?: readonly EncryptionAlgValues[] | undefined; + idTokenEncryptionEncValues?: readonly EncryptionEncValues[] | undefined; + idTokenSigningAlgValues?: readonly SigningAlgorithmWithNone[] | undefined; + introspectionEncryptionAlgValues?: readonly EncryptionAlgValues[] | undefined; + introspectionEncryptionEncValues?: readonly EncryptionEncValues[] | undefined; + introspectionSigningAlgValues?: readonly SigningAlgorithmWithNone[] | undefined; + requestObjectEncryptionAlgValues?: readonly EncryptionAlgValues[] | undefined; + requestObjectEncryptionEncValues?: readonly EncryptionEncValues[] | undefined; + requestObjectSigningAlgValues?: readonly SigningAlgorithmWithNone[] | undefined; + clientAuthSigningAlgValues?: readonly SigningAlgorithm[] | undefined; + userinfoEncryptionAlgValues?: readonly EncryptionAlgValues[] | undefined; + userinfoEncryptionEncValues?: readonly EncryptionEncValues[] | undefined; + userinfoSigningAlgValues?: readonly SigningAlgorithmWithNone[] | undefined; } | undefined; } @@ -1514,6 +1867,30 @@ export interface InteractionResults { [key: string]: unknown; } +interface ProviderAdditionalEventMap { + "backchannel_authentication.error": ( + ctx: KoaContextWithOIDC, + err: errors.OIDCProviderError, + ) => void; + "challenge.error": (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void; + "code_verification.error": (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void; + "credential.error": (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void; + "device_authorization.error": (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void; + "device_authorization.success": (ctx: KoaContextWithOIDC, body: UnknownObject) => void; + "device_resume.error": (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void; + "end_session_confirm.error": (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void; + "end_session_success.error": (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void; + "initial_access_token.destroyed": (token: InitialAccessToken) => void; + "initial_access_token.saved": (token: InitialAccessToken) => void; + "openid_credential_issuer.error": ( + ctx: KoaContextWithOIDC, + err: errors.OIDCProviderError, + ) => void; + "pre_authorized_code.consumed": (code: PreAuthorizedCode) => void; + "pre_authorized_code.destroyed": (code: PreAuthorizedCode) => void; + "pre_authorized_code.saved": (code: PreAuthorizedCode) => void; +} + export default class Provider extends Koa { constructor(issuer: string, configuration?: Configuration); @@ -1526,10 +1903,31 @@ export default class Provider extends Koa { static get ctx(): KoaContextWithOIDC | undefined; + urlFor(name: string, options?: UnknownObject): string; + pathFor(name: string, options?: UnknownObject & { mountPath?: string | undefined }): string; + cookieName(type: string): string; + + registerResponseMode( + name: string, + handler: ( + ctx: KoaContextWithOIDC, + redirectUri: string, + payload: UnknownObject, + ) => CanBePromise, + ): void; + backchannelResult( request: BackchannelAuthenticationRequest | string, result: Grant | errors.OIDCProviderError | string, - opts?: { acr?: string | undefined; amr?: string[] | undefined; authTime?: number | undefined }, + opts?: { + acr?: string | undefined; + amr?: string[] | undefined; + authTime?: number | undefined; + sessionUid?: string | undefined; + expiresWithSession?: boolean | undefined; + sid?: string | undefined; + rar?: AuthorizationDetail[] | undefined; + }, ): Promise; interactionResult( @@ -1554,8 +1952,8 @@ export default class Provider extends Koa { registerGrantType( name: string, handler: (ctx: KoaContextWithOIDC, next: () => Promise) => CanBePromise, - params?: string | string[] | Set, - duplicates?: string | string[] | Set, + params?: string | readonly string[] | ReadonlySet, + duplicates?: string | readonly string[] | ReadonlySet, ): void; // tslint:disable:unified-signatures @@ -1568,12 +1966,18 @@ export default class Provider extends Koa { addListener(event: "device_code.saved", listener: (deviceCode: DeviceCode) => void): this; addListener(event: "device_code.destroyed", listener: (deviceCode: DeviceCode) => void): this; addListener(event: "device_code.consumed", listener: (deviceCode: DeviceCode) => void): this; - addListener(event: "backchannel_authentication_request.saved", listener: (deviceCode: DeviceCode) => void): this; + addListener( + event: "backchannel_authentication_request.saved", + listener: (request: BackchannelAuthenticationRequest) => void, + ): this; addListener( event: "backchannel_authentication_request.destroyed", - listener: (deviceCode: DeviceCode) => void, + listener: (request: BackchannelAuthenticationRequest) => void, + ): this; + addListener( + event: "backchannel_authentication_request.consumed", + listener: (request: BackchannelAuthenticationRequest) => void, ): this; - addListener(event: "backchannel_authentication_request.consumed", listener: (deviceCode: DeviceCode) => void): this; addListener(event: "client_credentials.destroyed", listener: (clientCredentials: ClientCredentials) => void): this; addListener(event: "client_credentials.saved", listener: (clientCredentials: ClientCredentials) => void): this; addListener(event: "client_credentials.issued", listener: (clientCredentials: ClientCredentials) => void): this; @@ -1631,7 +2035,10 @@ export default class Provider extends Koa { event: "backchannel.error", listener: (ctx: KoaContextWithOIDC, err: Error, client: Client, accountId: string, sid: string) => void, ): this; - addListener(event: "pushed_authorization_request.success", listener: (ctx: KoaContextWithOIDC) => void): this; + addListener( + event: "pushed_authorization_request.success", + listener: (ctx: KoaContextWithOIDC, client: Client) => void, + ): this; addListener( event: "pushed_authorization_request.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void, @@ -1681,6 +2088,10 @@ export default class Provider extends Koa { event: "revocation.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void, ): this; + addListener( + event: Event, + listener: ProviderAdditionalEventMap[Event], + ): this; addListener(event: "server_error", listener: (ctx: KoaContextWithOIDC, err: Error) => void): this; on(event: "access_token.destroyed", listener: (accessToken: AccessToken) => void): this; @@ -1692,9 +2103,18 @@ export default class Provider extends Koa { on(event: "device_code.saved", listener: (deviceCode: DeviceCode) => void): this; on(event: "device_code.destroyed", listener: (deviceCode: DeviceCode) => void): this; on(event: "device_code.consumed", listener: (deviceCode: DeviceCode) => void): this; - on(event: "backchannel_authentication_request.saved", listener: (deviceCode: DeviceCode) => void): this; - on(event: "backchannel_authentication_request.destroyed", listener: (deviceCode: DeviceCode) => void): this; - on(event: "backchannel_authentication_request.consumed", listener: (deviceCode: DeviceCode) => void): this; + on( + event: "backchannel_authentication_request.saved", + listener: (request: BackchannelAuthenticationRequest) => void, + ): this; + on( + event: "backchannel_authentication_request.destroyed", + listener: (request: BackchannelAuthenticationRequest) => void, + ): this; + on( + event: "backchannel_authentication_request.consumed", + listener: (request: BackchannelAuthenticationRequest) => void, + ): this; on(event: "client_credentials.destroyed", listener: (clientCredentials: ClientCredentials) => void): this; on(event: "client_credentials.saved", listener: (clientCredentials: ClientCredentials) => void): this; on(event: "client_credentials.issued", listener: (clientCredentials: ClientCredentials) => void): this; @@ -1743,7 +2163,10 @@ export default class Provider extends Koa { event: "backchannel.error", listener: (ctx: KoaContextWithOIDC, err: Error, client: Client, accountId: string, sid: string) => void, ): this; - on(event: "pushed_authorization_request.success", listener: (ctx: KoaContextWithOIDC) => void): this; + on( + event: "pushed_authorization_request.success", + listener: (ctx: KoaContextWithOIDC, client: Client) => void, + ): this; on( event: "pushed_authorization_request.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void, @@ -1772,6 +2195,10 @@ export default class Provider extends Koa { on(event: "discovery.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void): this; on(event: "userinfo.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void): this; on(event: "revocation.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void): this; + on( + event: Event, + listener: ProviderAdditionalEventMap[Event], + ): this; on(event: "server_error", listener: (ctx: KoaContextWithOIDC, err: Error) => void): this; once(event: "access_token.destroyed", listener: (accessToken: AccessToken) => void): this; @@ -1783,9 +2210,18 @@ export default class Provider extends Koa { once(event: "device_code.saved", listener: (deviceCode: DeviceCode) => void): this; once(event: "device_code.destroyed", listener: (deviceCode: DeviceCode) => void): this; once(event: "device_code.consumed", listener: (deviceCode: DeviceCode) => void): this; - once(event: "backchannel_authentication_request.saved", listener: (deviceCode: DeviceCode) => void): this; - once(event: "backchannel_authentication_request.destroyed", listener: (deviceCode: DeviceCode) => void): this; - once(event: "backchannel_authentication_request.consumed", listener: (deviceCode: DeviceCode) => void): this; + once( + event: "backchannel_authentication_request.saved", + listener: (request: BackchannelAuthenticationRequest) => void, + ): this; + once( + event: "backchannel_authentication_request.destroyed", + listener: (request: BackchannelAuthenticationRequest) => void, + ): this; + once( + event: "backchannel_authentication_request.consumed", + listener: (request: BackchannelAuthenticationRequest) => void, + ): this; once(event: "client_credentials.destroyed", listener: (clientCredentials: ClientCredentials) => void): this; once(event: "client_credentials.saved", listener: (clientCredentials: ClientCredentials) => void): this; once(event: "client_credentials.issued", listener: (clientCredentials: ClientCredentials) => void): this; @@ -1837,7 +2273,10 @@ export default class Provider extends Koa { event: "backchannel.error", listener: (ctx: KoaContextWithOIDC, err: Error, client: Client, accountId: string, sid: string) => void, ): this; - once(event: "pushed_authorization_request.success", listener: (ctx: KoaContextWithOIDC) => void): this; + once( + event: "pushed_authorization_request.success", + listener: (ctx: KoaContextWithOIDC, client: Client) => void, + ): this; once( event: "pushed_authorization_request.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void, @@ -1869,6 +2308,10 @@ export default class Provider extends Koa { once(event: "discovery.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void): this; once(event: "userinfo.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void): this; once(event: "revocation.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void): this; + once( + event: Event, + listener: ProviderAdditionalEventMap[Event], + ): this; once(event: "server_error", listener: (ctx: KoaContextWithOIDC, err: Error) => void): this; prependListener(event: "access_token.destroyed", listener: (accessToken: AccessToken) => void): this; @@ -1888,15 +2331,15 @@ export default class Provider extends Koa { prependListener(event: "device_code.consumed", listener: (deviceCode: DeviceCode) => void): this; prependListener( event: "backchannel_authentication_request.saved", - listener: (deviceCode: DeviceCode) => void, + listener: (request: BackchannelAuthenticationRequest) => void, ): this; prependListener( event: "backchannel_authentication_request.destroyed", - listener: (deviceCode: DeviceCode) => void, + listener: (request: BackchannelAuthenticationRequest) => void, ): this; prependListener( event: "backchannel_authentication_request.consumed", - listener: (deviceCode: DeviceCode) => void, + listener: (request: BackchannelAuthenticationRequest) => void, ): this; prependListener( event: "client_credentials.destroyed", @@ -1961,7 +2404,10 @@ export default class Provider extends Koa { event: "backchannel.error", listener: (ctx: KoaContextWithOIDC, err: Error, client: Client, accountId: string, sid: string) => void, ): this; - prependListener(event: "pushed_authorization_request.success", listener: (ctx: KoaContextWithOIDC) => void): this; + prependListener( + event: "pushed_authorization_request.success", + listener: (ctx: KoaContextWithOIDC, client: Client) => void, + ): this; prependListener( event: "pushed_authorization_request.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void, @@ -2014,6 +2460,10 @@ export default class Provider extends Koa { event: "revocation.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void, ): this; + prependListener( + event: Event, + listener: ProviderAdditionalEventMap[Event], + ): this; prependListener(event: "server_error", listener: (ctx: KoaContextWithOIDC, err: Error) => void): this; prependOnceListener(event: "access_token.destroyed", listener: (accessToken: AccessToken) => void): this; @@ -2036,15 +2486,15 @@ export default class Provider extends Koa { prependOnceListener(event: "device_code.consumed", listener: (deviceCode: DeviceCode) => void): this; prependOnceListener( event: "backchannel_authentication_request.saved", - listener: (deviceCode: DeviceCode) => void, + listener: (request: BackchannelAuthenticationRequest) => void, ): this; prependOnceListener( event: "backchannel_authentication_request.destroyed", - listener: (deviceCode: DeviceCode) => void, + listener: (request: BackchannelAuthenticationRequest) => void, ): this; prependOnceListener( event: "backchannel_authentication_request.consumed", - listener: (deviceCode: DeviceCode) => void, + listener: (request: BackchannelAuthenticationRequest) => void, ): this; prependOnceListener( event: "client_credentials.destroyed", @@ -2120,7 +2570,7 @@ export default class Provider extends Koa { ): this; prependOnceListener( event: "pushed_authorization_request.success", - listener: (ctx: KoaContextWithOIDC) => void, + listener: (ctx: KoaContextWithOIDC, client: Client) => void, ): this; prependOnceListener( event: "pushed_authorization_request.error", @@ -2174,6 +2624,10 @@ export default class Provider extends Koa { event: "revocation.error", listener: (ctx: KoaContextWithOIDC, err: errors.OIDCProviderError) => void, ): this; + prependOnceListener( + event: Event, + listener: ProviderAdditionalEventMap[Event], + ): this; prependOnceListener(event: "server_error", listener: (ctx: KoaContextWithOIDC, err: Error) => void): this; // tslint:enable:unified-signatures @@ -2188,9 +2642,14 @@ export default class Provider extends Koa { readonly ClientCredentials: typeof ClientCredentials; readonly DeviceCode: typeof DeviceCode; readonly BackchannelAuthenticationRequest: typeof BackchannelAuthenticationRequest; + readonly PreAuthorizedCode: typeof PreAuthorizedCode; readonly BaseToken: typeof BaseToken; readonly IdToken: typeof IdToken; + readonly Claims: typeof Claims; readonly ReplayDetection: typeof ReplayDetection; + readonly ResourceServer: { + new(identifier: string, data: ResourceServer): ResourceServerInstance; + }; readonly OIDCContext: typeof OIDCContext; readonly Session: typeof Session; readonly Interaction: typeof Interaction; @@ -2270,6 +2729,15 @@ export namespace errors { class InvalidBindingMessage extends OIDCProviderError { constructor(description?: string, detail?: string); } + class InvalidAuthorizationDetails extends OIDCProviderError { + constructor(description?: string, detail?: string); + } + class InvalidCredentialRequest extends OIDCProviderError { + constructor(description?: string, detail?: string); + } + class InvalidNonce extends OIDCProviderError { + constructor(description?: string, detail?: string); + } class InvalidUserCode extends OIDCProviderError { constructor(description?: string, detail?: string); } @@ -2304,16 +2772,16 @@ export namespace errors { constructor(description?: string, detail?: string); } class InvalidClientAuth extends OIDCProviderError { - constructor(detail: string); + constructor(detail?: string); } class InvalidClientMetadata extends OIDCProviderError { - constructor(description: string); + constructor(description: string, detail?: string); } class InvalidGrant extends OIDCProviderError { - constructor(detail: string); + constructor(detail?: string); } class InvalidRequest extends OIDCProviderError { - constructor(description: string, code?: number); + constructor(description: string, code?: number, detail?: string); } class SessionNotFound extends InvalidRequest {} class InvalidRequestObject extends OIDCProviderError { @@ -2322,11 +2790,14 @@ export namespace errors { class InvalidRequestUri extends OIDCProviderError { constructor(description?: string, detail?: string); } + class InvalidProof extends OIDCProviderError { + constructor(description?: string, detail?: string); + } class InvalidScope extends OIDCProviderError { - constructor(description: string, scope: string); + constructor(description: string, scope: string, detail?: string); } class InsufficientScope extends OIDCProviderError { - constructor(description: string, scope: string); + constructor(description: string, scope: string, detail?: string); } class InvalidSoftwareStatement extends OIDCProviderError { constructor(description?: string, detail?: string); @@ -2334,8 +2805,14 @@ export namespace errors { class InvalidTarget extends OIDCProviderError { constructor(description?: string, detail?: string); } + class UnknownCredentialConfiguration extends OIDCProviderError { + constructor(description?: string, detail?: string); + } + class UnknownCredentialIdentifier extends OIDCProviderError { + constructor(description?: string, detail?: string); + } class InvalidToken extends OIDCProviderError { - constructor(detail: string); + constructor(detail?: string); } class LoginRequired extends OIDCProviderError { constructor(description?: string, detail?: string); @@ -2376,12 +2853,29 @@ export namespace errors { class CustomOIDCProviderError extends OIDCProviderError { constructor(message: string, description?: string); } + class CredentialRequestDenied extends OIDCProviderError { + constructor(description?: string, detail?: string); + } + class UseDpopNonce extends OIDCProviderError { + constructor(description?: string, detail?: string); + } + class UnsupportedTokenType extends OIDCProviderError { + constructor(description?: string, detail?: string); + } + class UseAttestationChallenge extends OIDCProviderError { + constructor(description?: string, detail?: string); + } + class UseFreshAttestation extends OIDCProviderError { + constructor(description?: string, detail?: string); + } + class InvalidClientAttestation extends OIDCProviderError { + constructor(description?: string, detail?: string); + } class UnmetAuthenticationRequirements extends OIDCProviderError { - constructor(message: string, description?: string); + constructor(description?: string, detail?: string); } } -/* experimental features are mostly explicit any */ export class ExternalSigningKey { get alg(): string | undefined; get crv(): string | undefined; diff --git a/types/oidc-provider/oidc-provider-tests.ts b/types/oidc-provider/oidc-provider-tests.ts index 0588acc8483cff..f8dbd2587f4494 100644 --- a/types/oidc-provider/oidc-provider-tests.ts +++ b/types/oidc-provider/oidc-provider-tests.ts @@ -279,7 +279,11 @@ const provider = new oidc.Provider("https://op.example.com", { async issueRefreshToken( ctx: oidc.KoaContextWithOIDC, client: oidc.Client, - token: oidc.AuthorizationCode | oidc.DeviceCode | oidc.BackchannelAuthenticationRequest, + token: + | oidc.AuthorizationCode + | oidc.DeviceCode + | oidc.BackchannelAuthenticationRequest + | oidc.PreAuthorizedCode, ) { ctx.oidc.issuer.substring(0); client.clientId.substring(0); @@ -721,3 +725,435 @@ provider.OIDCContext.prototype.clientJwtAuthExpectedAudience = function clientJw }, }); } + +new Provider("https://op.example.com", { + fetchResponseBodyLimits: { + "client_id metadata document": 5 * 1024, + jwks_uri: Infinity, + sector_identifier_uri: Infinity, + }, + routes: { + challenge: "/challenge", + credential: "/credential", + }, + ttl: { + PreAuthorizedCode: 600, + }, + enabledJWA: { + attestSigningAlgValues: ["ES256", "EdDSA"], + }, + features: { + rpMetadataChoices: { + enabled: true, + }, + clientIdMetadataDocument: { + enabled: true, + ack: "draft-02", + async allowFetch(ctx, clientId) { + ctx.oidc.issuer.substring(0); + clientId.substring(0); + return true; + }, + async allowClient(ctx, client) { + ctx.oidc.issuer.substring(0); + client.clientId.substring(0); + return true; + }, + cacheDuration: { + min: 30, + max: 86400, + }, + }, + attestClientAuth: { + enabled: true, + ack: "draft-10", + additionalSecuritySignal: "optional", + challengeSecret: Buffer.alloc(32), + getAttestationSignaturePublicKey(ctx, header, payload, client) { + ctx.oidc.issuer.substring(0); + JSON.stringify(header); + JSON.stringify(payload); + client.clientId.substring(0); + return crypto.generateKeyPairSync("ed25519").publicKey; + }, + assertAttestationJwtAndPop(ctx, attestation, pop, client) { + ctx.oidc.issuer.substring(0); + JSON.stringify(attestation.protectedHeader); + JSON.stringify(pop.payload); + client.clientId.substring(0); + }, + }, + openid4vci: { + enabled: true, + ack: "experimental-01", + nonceSecret: Buffer.alloc(32), + preAuthorizedCodeGrant: true, + metadata: { + batch_credential_issuance: { + batch_size: 2, + }, + }, + credentialConfigurationsSupported: { + "org.iso.18013.5.1.mDL": { + format: "mso_mdoc", + scope: "mdl_scope", + cryptographic_binding_methods_supported: ["jwk"], + proof_types_supported: { + jwt: { + proof_signing_alg_values_supported: ["ES256"], + key_attestations_required: { + key_storage: ["iso_18045_high"], + }, + }, + }, + }, + }, + credentialEndpointExpectedAudience(ctx) { + return ctx.oidc.urlFor("credential"); + }, + credentialConfigurationPolicy(ctx, details) { + ctx.oidc.issuer.substring(0); + details.credentialConfigurationId.substring(0); + details.credentialConfiguration.format.substring(0); + details.credentialIdentifier?.substring(0); + details.client.clientId.substring(0); + details.account.accountId.substring(0); + details.grant.getOIDCScope(); + details.accessToken.scopes.has("mdl_scope"); + return true; + }, + issueCredential(ctx, details) { + ctx.oidc.issuer.substring(0); + JSON.stringify(details.body); + if (details.proofs && "jwt" in details.proofs) { + details.proofs.jwt?.[0].substring(0); + details.proofs.key_attestation?.attestedKeys[0].kty; + } + return { + credentials: [{ credential: "serialized credential" }], + notification_id: "notification-id", + }; + }, + getKeyAttestationSignaturePublicKey(ctx, issuer, header, client) { + ctx.oidc.issuer.substring(0); + issuer.substring(0); + JSON.stringify(header); + client.clientId.substring(0); + return crypto.generateKeyPairSync("ed25519").publicKey; + }, + }, + resourceIndicators: { + enabled: true, + useGrantedResource(ctx, model) { + ctx.oidc.issuer.substring(0); + if (model.kind === "PreAuthorizedCode") { + model.txCode?.substring(0); + } + return true; + }, + }, + }, +}); + +const preAuthorizedCode = new provider.PreAuthorizedCode({ + accountId: "account", + clientId: "client", + grantId: "grant", + resource: "https://op.example.com/credential", + scope: "mdl_scope", + txCode: "493536", + rar: [{ type: "openid_credential", credential_configuration_id: "org.iso.18013.5.1.mDL" }], +}); +preAuthorizedCode.txCode?.substring(0); +preAuthorizedCode.consume().then(console.log); +provider.PreAuthorizedCode.revokeByGrantId("grant").then(console.log); + +const rarGrant = new provider.Grant({ clientId: "client", accountId: "account" }); +rarGrant.addRar({ type: "openid_credential", credential_configuration_id: "org.iso.18013.5.1.mDL" }); + +provider.backchannelResult("request", rarGrant, { + acr: "urn:example:acr", + amr: ["pwd"], + authTime: Date.now(), + sessionUid: "session", + expiresWithSession: true, + sid: "sid", + rar: [{ type: "openid_credential", credential_configuration_id: "org.iso.18013.5.1.mDL" }], +}); + +provider.on("credential.error", (ctx, err) => { + ctx.oidc.issuer.substring(0); + err.error.substring(0); +}); +provider.on("pre_authorized_code.saved", code => { + code.txCode?.substring(0); +}); +new oidc.errors.InvalidAuthorizationDetails(); +new oidc.errors.InvalidCredentialRequest(); +new oidc.errors.InvalidNonce(); +new oidc.errors.InvalidProof(); +new oidc.errors.UnknownCredentialConfiguration(); +new oidc.errors.UnknownCredentialIdentifier(); +new oidc.errors.CredentialRequestDenied(); +new oidc.errors.UseFreshAttestation(); + +const immutableConfiguration = { + acrValues: ["urn:example:bronze"], + claims: { + profile: ["name", "family_name"], + }, + clients: [ + { + client_id: "immutable-client", + redirect_uris: ["https://client.example.com/cb"], + grant_types: ["authorization_code"], + response_types: ["code"], + contacts: ["ops@example.com"], + default_acr_values: ["urn:example:bronze"], + post_logout_redirect_uris: ["https://client.example.com/logout/cb"], + authorization_details_types: ["payment"], + dpop_bound_access_tokens: true, + require_pushed_authorization_requests: true, + require_signed_request_object: true, + use_mtls_endpoint_aliases: true, + authorization_encryption_alg_values_supported: ["RSA-OAEP"], + authorization_encryption_enc_values_supported: ["A256GCM"], + authorization_signing_alg_values_supported: ["PS256"], + backchannel_authentication_request_signing_alg_values_supported: ["PS256"], + id_token_encryption_alg_values_supported: ["RSA-OAEP"], + id_token_encryption_enc_values_supported: ["A256GCM"], + id_token_signing_alg_values_supported: ["PS256"], + introspection_encryption_alg_values_supported: ["RSA-OAEP"], + introspection_encryption_enc_values_supported: ["A256GCM"], + introspection_signing_alg_values_supported: ["PS256"], + request_object_encryption_alg_values_supported: ["RSA-OAEP"], + request_object_encryption_enc_values_supported: ["A256GCM"], + request_object_signing_alg_values_supported: ["PS256"], + subject_types_supported: ["public"], + token_endpoint_auth_methods_supported: ["private_key_jwt"], + token_endpoint_auth_signing_alg_values_supported: ["PS256"], + userinfo_encryption_alg_values_supported: ["RSA-OAEP"], + userinfo_encryption_enc_values_supported: ["A256GCM"], + userinfo_signing_alg_values_supported: ["PS256"], + }, + ], + cookies: { + keys: ["immutable-cookie-key"], + }, + extraParams: ["audience"], + responseTypes: ["code"], + scopes: ["openid", "profile"], + subjectTypes: ["public", "pairwise"], + clientAuthMethods: ["private_key_jwt", "none"], + extraClientMetadata: { + properties: ["tenant_id"], + }, + enabledJWA: { + authorizationEncryptionAlgValues: ["RSA-OAEP"], + authorizationEncryptionEncValues: ["A256GCM"], + authorizationSigningAlgValues: ["PS256"], + dPoPSigningAlgValues: ["PS256"], + attestSigningAlgValues: ["PS256"], + idTokenEncryptionAlgValues: ["RSA-OAEP"], + idTokenEncryptionEncValues: ["A256GCM"], + idTokenSigningAlgValues: ["PS256"], + introspectionEncryptionAlgValues: ["RSA-OAEP"], + introspectionEncryptionEncValues: ["A256GCM"], + introspectionSigningAlgValues: ["PS256"], + requestObjectEncryptionAlgValues: ["RSA-OAEP"], + requestObjectEncryptionEncValues: ["A256GCM"], + requestObjectSigningAlgValues: ["PS256"], + clientAuthSigningAlgValues: ["PS256"], + userinfoEncryptionAlgValues: ["RSA-OAEP"], + userinfoEncryptionEncValues: ["A256GCM"], + userinfoSigningAlgValues: ["PS256"], + }, + features: { + ciba: { + deliveryModes: ["poll"], + }, + fapi: { + enabled: false, + }, + openid4vci: { + credentialConfigurationsSupported: { + credential: { + format: "example", + cryptographic_binding_methods_supported: ["jwk"], + proof_types_supported: { + jwt: { + proof_signing_alg_values_supported: ["PS256"], + key_attestations_required: { + key_storage: ["hardware"], + user_authentication: ["biometric"], + }, + }, + }, + }, + }, + }, + }, + jwks: { + keys: [ + { + kty: "RSA", + key_ops: ["sign"], + x5c: ["certificate"], + }, + ], + }, +} as const satisfies oidc.Configuration; + +new Provider("https://op.example.com", immutableConfiguration); + +const readonlyValuesConfiguration: oidc.Configuration = { + acrValues: new Set(["urn:example:bronze"]) as ReadonlySet, + clientAuthMethods: new Set(["none"]) as ReadonlySet, + extraParams: new Set(["audience"]) as ReadonlySet, + scopes: new Set(["openid"]) as ReadonlySet, + subjectTypes: new Set(["public"]) as ReadonlySet, + features: { + ciba: { + deliveryModes: new Set(["poll"]) as ReadonlySet, + }, + }, +}; +new Provider("https://op.example.com", readonlyValuesConfiguration); + +new Provider("https://op.example.com", { + async revokeGrantPolicy(ctx) { + return ctx.oidc.route !== "revocation"; + }, + sectorIdentifierUriValidate(client) { + return client.sectorIdentifierUri !== undefined; + }, + ttl: { + AccessToken(ctx, token, client) { + ctx.oidc.issuer.substring(0); + token.jti.substring(0); + client.clientId.substring(0); + return 60; + }, + Grant(ctx, grant) { + ctx.oidc.issuer.substring(0); + grant.getOIDCScope(); + return 60; + }, + Interaction(ctx, interaction) { + ctx.oidc.issuer.substring(0); + interaction.uid.substring(0); + return 60; + }, + PreAuthorizedCode(ctx, code) { + ctx.oidc.issuer.substring(0); + code.jti.substring(0); + return 60; + }, + Session(ctx, session) { + ctx.oidc.issuer.substring(0); + session.uid.substring(0); + return 60; + }, + }, + features: { + registration: { + async secretFactory(ctx) { + return ctx.oidc.issuer; + }, + async issueRegistrationAccessToken(ctx) { + return ctx.oidc.route === "registration"; + }, + }, + resourceIndicators: { + defaultResource(ctx, client, oneOf) { + ctx.oidc.issuer.substring(0); + client.clientId.substring(0); + return oneOf; + }, + getResourceServerInfo() { + return { + scope: "api:read", + jwt: { + sign: false, + encrypt: { + alg: "dir", + enc: "A256GCM", + key: null as unknown as crypto.webcrypto.CryptoKey, + }, + }, + }; + }, + }, + richAuthorizationRequests: { + enabled: true, + types: { + payment: { + async validate(ctx, detail, client) { + ctx.oidc.issuer.substring(0); + detail.type.substring(0); + client.clientId.substring(0); + }, + }, + }, + rarForAuthorizationCode(ctx) { + return ctx.oidc.grant?.rar; + }, + rarForBackchannelResponse(ctx, resourceServer) { + resourceServer.identifier().substring(0); + resourceServer.scopes.has("api:read"); + return ctx.oidc.grant?.rar; + }, + rarForCodeResponse(ctx, resourceServer) { + resourceServer.identifier().substring(0); + return ctx.oidc.grant?.rar; + }, + rarForIntrospectionResponse(ctx, token) { + token.jti.substring(0); + return ctx.oidc.grant?.rar; + }, + rarForRefreshTokenResponse(ctx, resourceServer) { + resourceServer.identifier().substring(0); + return ctx.oidc.grant?.rar; + }, + }, + }, +}); + +provider.urlFor("authorization").substring(0); +provider.pathFor("authorization", { mountPath: "/oidc" }).substring(0); +provider.cookieName("session").substring(0); +provider.registerResponseMode("custom", (ctx, redirectUri, payload) => { + ctx.oidc.issuer.substring(0); + redirectUri.substring(0); + JSON.stringify(payload); +}); +provider.registerGrantType( + "custom", + async ctx => { + ctx.oidc.issuer.substring(0); + }, + ["custom"] as const, + new Set(["resource"]) as ReadonlySet, +); + +const resourceServer = new provider.ResourceServer("https://api.example.com", { + scope: "api:read", +}); +resourceServer.identifier().substring(0); +resourceServer.scopes.has("api:read"); + +const claims = new provider.Claims( + { sub: "account" }, + { client: null as unknown as oidc.Client }, +); +claims.scope("openid").result().then(JSON.stringify); + +provider.ReplayDetection.unique("issuer", "jti", Date.now()).then(Boolean); +new oidc.errors.InvalidClientAuth(); +new oidc.errors.InvalidClientMetadata("invalid metadata", "validation detail"); +new oidc.errors.InvalidGrant(); +new oidc.errors.InvalidRequest("invalid request", 400, "validation detail"); +new oidc.errors.InvalidScope("invalid scope", "api:write", "validation detail"); +new oidc.errors.InsufficientScope("insufficient scope", "api:write", "validation detail"); +new oidc.errors.InvalidToken(); +new oidc.errors.UnmetAuthenticationRequirements("authentication required", "validation detail"); diff --git a/types/oidc-provider/package.json b/types/oidc-provider/package.json index 25b583c238eed0..fd90cd433bf315 100644 --- a/types/oidc-provider/package.json +++ b/types/oidc-provider/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/oidc-provider", - "version": "9.5.9999", + "version": "9.11.9999", "projects": [ "https://github.com/panva/node-oidc-provider" ], From b68e8a2f5ec73880dbf7219145ad97d72394482f Mon Sep 17 00:00:00 2001 From: Jimmy Leung <43258070+hkleungai@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:45:26 +0800 Subject: [PATCH 10/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75206=20chor?= =?UTF-8?q?e:=20remove=20pnpm=20overrides=20field=20by=20@hkleungai?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/package.json b/package.json index 555bb19d9c6561..a70c594a9167fa 100644 --- a/package.json +++ b/package.json @@ -46,10 +46,5 @@ "risk": "^0.0.4", "typescript": "<7" }, - "pnpm": { - "overrides": { - "fflate": "0.8.2" - } - }, "type": "module" } From 2b87eb6b3b337b9240942db9cc3646efdbc66030 Mon Sep 17 00:00:00 2001 From: Erwan Jugand <47392755+erwanjugand@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:54:07 +0200 Subject: [PATCH 11/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75319=20[chr?= =?UTF-8?q?ome]=20fix=20chrome.action.setIcon()=20by=20@erwanjugand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 27 +++++++++++++++++++-------- types/chrome/test/index.ts | 14 +++++++++++--- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 32e74753bd9a9e..9a705d99da9b8e 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -179,14 +179,25 @@ declare namespace chrome { popup: string; } - interface TabIconDetails { - /** Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */ - path?: string | { [index: number]: string } | undefined; - /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ - tabId?: number | undefined; - /** Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then image with size `scale` \* n will be selected, where n is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}' */ - imageData?: ImageData | { [index: number]: ImageData } | undefined; - } + type TabIconDetails = + & { + /** Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */ + tabId?: number | null | undefined; + } + & ( + | { + /** Either an ImageData object or a dictionary {size -> ImageData} representing an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is selected, where _n_ is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}' */ + imageData: ImageData | { [index: number]: ImageData }; + /** Either a relative image path or a dictionary {size -> relative image path} pointing to an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is selected, where _n_ is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */ + path?: string | { [index: string]: string } | undefined; + } + | { + /** Either an ImageData object or a dictionary {size -> ImageData} representing an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is selected, where _n_ is the size of the icon in the UI. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'16': foo}' */ + imageData?: ImageData | { [index: number]: ImageData } | undefined; + /** Either a relative image path or a dictionary {size -> relative image path} pointing to an icon to be set. If the icon is specified as a dictionary, the image used is chosen depending on the screen's pixel density. If the number of image pixels that fit into one screen space unit equals `scale`, then an image with size `scale` \* n is selected, where _n_ is the size of the icon in the UI. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.path = {'16': foo}' */ + path: string | { [index: string]: string }; + } + ); /** @since Chrome 99 */ interface OpenPopupOptions { diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index caba3a26526a27..81139c68d18389 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -2553,10 +2553,18 @@ async function testAction() { // @ts-expect-error chrome.action.setBadgeTextColor(() => {}).then(() => {}); - const tabIconDetails: chrome.action.TabIconDetails = { path: { "16": "path/to/icon.png" }, tabId }; + const iconDetails: chrome.action.TabIconDetails = { + imageData: { 16: new ImageData(16, 16) }, + tabId, + }; + + const iconDetails2: chrome.action.TabIconDetails = { + path: "path/to/icon.png", + tabId, + }; - chrome.action.setIcon(tabIconDetails); // $ExpectType Promise - chrome.action.setIcon(tabIconDetails, () => {}); // $ExpectType void + chrome.action.setIcon(iconDetails); // $ExpectType Promise + chrome.action.setIcon(iconDetails2, () => {}); // $ExpectType void // @ts-expect-error chrome.action.setIcon(() => {}).then(() => {}); From d08908b73dc5ca2e2f7e963fb2c104053d0088a7 Mon Sep 17 00:00:00 2001 From: Erwan Jugand <47392755+erwanjugand@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:55:38 +0200 Subject: [PATCH 12/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75320=20[chr?= =?UTF-8?q?ome]=20fix=20chrome.tabs.insertCSS()=20by=20@erwanjugand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 9 ++++++--- types/chrome/test/index.ts | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 9a705d99da9b8e..3a3e5d98c3e9e1 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -11156,7 +11156,7 @@ declare namespace chrome { * The last time the tab became active in its window as the number of milliseconds since epoch. * @since Chrome 121 */ - lastAccessed?: number | undefined; + lastAccessed: number; } /** The tab's loading status. */ @@ -11726,8 +11726,11 @@ declare namespace chrome { function insertCSS(details: extensionTypes.InjectDetails): Promise; function insertCSS(tabId: number | undefined, details: extensionTypes.InjectDetails): Promise; function insertCSS(details: extensionTypes.InjectDetails, callback: () => void): void; - function insertCSS(tabId: number | undefined, details: extensionTypes.InjectDetails): Promise; - function insertCSS(tabId: number, details: extensionTypes.InjectDetails, callback: () => void): void; + function insertCSS( + tabId: number | undefined, + details: extensionTypes.InjectDetails, + callback: () => void, + ): void; /** * Highlights the given tabs and focuses on the first of group. Will appear to do nothing if the specified tab is currently active. diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index 81139c68d18389..2cf348185e6794 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -3768,8 +3768,10 @@ async function testTabs() { chrome.tabs.insertCSS(details); // $ExpectType Promise chrome.tabs.insertCSS(tabId, details); // $ExpectType Promise + chrome.tabs.insertCSS(undefined, details); // $ExpectType Promise chrome.tabs.insertCSS(details, () => {}); // $ExpectType void chrome.tabs.insertCSS(tabId, details, () => {}); // $ExpectType void + chrome.tabs.insertCSS(undefined, details, () => {}); // $ExpectType void // @ts-expect-error chrome.tabs.insertCSS(() => {}).then(() => {}); @@ -8219,6 +8221,7 @@ function testDesktopCapture() { selected: false, discarded: false, autoDiscardable: false, + lastAccessed: 0, groupId: 0, }; From bcf4d542cd920257467f3964c167e62c19291c5b Mon Sep 17 00:00:00 2001 From: Erwan Jugand <47392755+erwanjugand@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:56:45 +0200 Subject: [PATCH 13/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75281=20[chr?= =?UTF-8?q?ome]=20fix=20chrome.declarativeWebRequest,=20bad=20enum=20+=20d?= =?UTF-8?q?eprecated=20functions=20by=20@erwanjugand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 24 ++++++++++++++++-------- types/chrome/test/index.ts | 9 +++++++-- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 3a3e5d98c3e9e1..8566b040bc98bd 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -1071,7 +1071,10 @@ declare namespace chrome { /** A set of data types. Missing data types are interpreted as `false`. */ interface DataTypeSet { - /** Websites' WebSQL data. */ + /** + * Websites' WebSQL data. + * @deprecated since Chrome 139. Support for WebSQL has been removed. This data type will be ignored. + */ webSQL?: boolean | undefined; /** Websites' IndexedDB data. */ indexedDB?: boolean | undefined; @@ -1093,7 +1096,10 @@ declare namespace chrome { cache?: boolean | undefined; /** Cache storage. */ cacheStorage?: boolean | undefined; - /** Websites' appcaches. */ + /** + * Websites' appcaches. + * @deprecated since Chrome 98. Support for appcache has been removed. This data type will be ignored. + */ appcache?: boolean | undefined; /** Websites' file systems. */ fileSystems?: boolean | undefined; @@ -1192,6 +1198,7 @@ declare namespace chrome { * Clears websites' WebSQL data. * * Can return its result via Promise in Manifest V3 or later since Chrome 96. + * @deprecated since Chrome 139. Support for WebSQL has been removed. This function has no effect. */ function removeWebSQL(options: RemovalOptions): Promise; function removeWebSQL(options: RemovalOptions, callback: () => void): void; @@ -1200,6 +1207,7 @@ declare namespace chrome { * Clears websites' appcache data. * * Can return its result via Promise in Manifest V3 or later since Chrome 96. + * @deprecated since Chrome 98. Support for appcache has been removed. This function has no effect. */ function removeAppcache(options: RemovalOptions): Promise; function removeAppcache(options: RemovalOptions, callback: () => void): void; @@ -2504,7 +2512,7 @@ declare namespace chrome { * * Permissions: "declarativeWebRequest" * - * MV2 only + * Beta and MV2 only * @deprecated Check out the {@link declarativeNetRequest} API instead */ export namespace declarativeWebRequest { @@ -2559,9 +2567,9 @@ declare namespace chrome { /** Matches if the MIME media type of a response (from the HTTP Content-Type header) is not contained in the list. */ excludeContentType?: string[] | undefined; /** Matches if none of the request headers is matched by any of the HeaderFilters. */ - excludeResponseHeaders?: HeaderFilter[] | undefined; + excludeRequestHeaders?: HeaderFilter[] | undefined; /** Matches if none of the response headers is matched by any of the HeaderFilters. */ - excludeResponseHeader?: HeaderFilter[] | undefined; + excludeResponseHeaders?: HeaderFilter[] | undefined; /** * Matches if the conditions of the UrlFilter are fulfilled for the 'first party' URL of the request. The 'first party' URL of a request, when present, can be different from the request's target URL, and describes what is considered 'first party' for the sake of third-party checks for cookies. * @deprecated since Chrome 82 @@ -2628,7 +2636,7 @@ declare namespace chrome { /** Edits one or more cookies of response. Note that it is preferred to use the Cookies API because this is computationally less expensive. */ interface EditResponseCookie { /** Filter for cookies that will be modified. All empty entries are ignored. */ - filter: ResponseCookie; + filter: FilterResponseCookie; /** Attributes that shall be overridden in cookies that matched the filter. Attributes that are set to an empty string are removed. */ modification: ResponseCookie; } @@ -2672,7 +2680,7 @@ declare namespace chrome { /** Existence of the Secure cookie attribute. */ secure?: string | undefined; /** Filters session cookies. Session cookies have no lifetime specified in any of 'max-age' or 'expires' attributes. */ - session?: boolean | undefined; + sessionCookie?: boolean | undefined; /** Value of a cookie, may be padded in double-quotes. */ value?: string | undefined; } @@ -7241,7 +7249,7 @@ declare namespace chrome { enum ExtensionType { EXTENSION = "extension", HOSTED_APP = "hosted_app", - PACKAGE_APP = "package_app", + PACKAGED_APP = "packaged_app", LEGACY_PACKAGED_APP = "legacy_packaged_app", THEME = "theme", LOGIN_SCREEN_EXTENSION = "login_screen_extension", diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index 2cf348185e6794..2e97ebaeebf6cb 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -2849,7 +2849,7 @@ async function testManagement() { chrome.management.ExtensionType.HOSTED_APP === "hosted_app"; chrome.management.ExtensionType.LEGACY_PACKAGED_APP === "legacy_packaged_app"; chrome.management.ExtensionType.LOGIN_SCREEN_EXTENSION === "login_screen_extension"; - chrome.management.ExtensionType.PACKAGE_APP === "package_app"; + chrome.management.ExtensionType.PACKAGED_APP === "packaged_app"; chrome.management.ExtensionType.THEME === "theme"; chrome.management.LaunchType.OPEN_AS_PINNED_TAB === "OPEN_AS_PINNED_TAB"; @@ -2889,7 +2889,7 @@ async function testManagement() { result.optionsUrl; // $ExpectType string result.permissions; // $ExpectType string[] result.shortName; // $ExpectType string - result.type; // $ExpectType "extension" | "hosted_app" | "legacy_packaged_app" | "login_screen_extension" | "package_app" | "theme" + result.type; // $ExpectType "extension" | "hosted_app" | "legacy_packaged_app" | "login_screen_extension" | "packaged_app" | "theme" result.updateUrl; // $ExpectType string | undefined result.version; // $ExpectType string result.versionName; // $ExpectType string | undefined @@ -4339,6 +4339,11 @@ async function testDeclarativeNetRequest() { // https://developer.chrome.com/docs/extensions/mv2/reference/declarativeWebRequest function testDeclarativeWebRequest() { + chrome.declarativeWebRequest.Stage.ON_AUTH_REQUIRED === "onAuthRequired"; + chrome.declarativeWebRequest.Stage.ON_BEFORE_REQUEST === "onBeforeRequest"; + chrome.declarativeWebRequest.Stage.ON_BEFORE_SEND_HEADERS === "onBeforeSendHeaders"; + chrome.declarativeWebRequest.Stage.ON_HEADERS_RECEIVED === "onHeadersReceived"; + chrome.declarativeWebRequest.onRequest.addRules([]); // $ExpectType void chrome.declarativeWebRequest.onRequest.removeRules([]); // $ExpectType void chrome.declarativeWebRequest.onRequest.getRules((rules) => { // $ExpectType void From 032680d2ed4be085fcc36ff68dbffa0328995c35 Mon Sep 17 00:00:00 2001 From: Erwan Jugand <47392755+erwanjugand@users.noreply.github.com> Date: Fri, 31 Jul 2026 20:58:41 +0200 Subject: [PATCH 14/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75283=20[chr?= =?UTF-8?q?ome]=20update=20manifest=20type=20by=20@erwanjugand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 71 +++++++++++++++++++++--------- types/chrome/test/index.ts | 88 +++++++++++++++++++++++++++++++++++--- 2 files changed, 133 insertions(+), 26 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 8566b040bc98bd..3000bdd40328e0 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -9184,9 +9184,11 @@ declare namespace chrome { } interface ManifestAction { - default_icon?: ManifestIcons | undefined; + default_icon?: ManifestIcons | string | undefined; default_title?: string | undefined; default_popup?: string | undefined; + /** @default 'enabled' */ + default_state?: "enabled" | "disabled"; } /** Source: https://developer.chrome.com/docs/extensions/reference/permissions-list */ @@ -9292,22 +9294,37 @@ declare namespace chrome { | "webAuthenticationProxy" >; + /** A search engine. */ interface SearchProvider { + /** Name of the search engine displayed to user. This is required if you don't set `prepopulated_id`. */ name?: string | undefined; + /** An omnibox keyword for the search engine. This is required if you don't set `prepopulated_id`. */ keyword?: string | undefined; + /** An icon URL for the search engine. This is required if you don't set `prepopulated_id`. */ favicon_url?: string | undefined; + /** The search URL the search engine uses. */ search_url: string; + /** The encoding used for search terms. This is required if you don't set `prepopulated_id`. */ encoding?: string | undefined; + /** The URL the search engine uses for suggestions. If this isn't used, the engine doesn't support suggestions. */ suggest_url?: string | undefined; instant_url?: string | undefined; + /** The URL the search engine uses for image search. If this isn't used, the engine doesn't support image search. */ image_url?: string | undefined; + /** The post parameters for `search_url`. */ search_url_post_params?: string | undefined; + /** The post parameters for `suggest_url`. */ suggest_url_post_params?: string | undefined; + /** The post parameters for `instant_url`. */ instant_url_post_params?: string | undefined; + /** The post parameters for `image_url`. */ image_url_post_params?: string | undefined; + /** A list of URL patterns that can be used in addition to `search_url`. */ alternate_urls?: string[] | undefined; + /** An ID for Chrome's built-in search engine. */ prepopulated_id?: number | undefined; - is_default?: boolean | undefined; + /** Specifies whether the search provider should be default. */ + is_default: boolean; } interface ManifestBase { @@ -9332,8 +9349,10 @@ declare namespace chrome { author?: { email: string } | undefined; /** Defines overrides for selected Chrome settings. */ chrome_settings_overrides?: { + /** The new value for the homepage. */ homepage?: string | undefined; search_provider?: SearchProvider | undefined; + /** An array of length one containing a URL to be used as the startup page. */ startup_pages?: string[] | undefined; } | undefined; /** Defines overrides for default Chrome pages. */ @@ -9345,13 +9364,16 @@ declare namespace chrome { /** Defines keyboard shortcuts within the extension. */ commands?: { [name: string]: { - suggested_key?: { - default?: string | undefined; - windows?: string | undefined; - mac?: string | undefined; - chromeos?: string | undefined; - linux?: string | undefined; - } | undefined; + suggested_key?: + | { + default?: string | undefined; + windows?: string | undefined; + mac?: string | undefined; + chromeos?: string | undefined; + linux?: string | undefined; + } + | string + | undefined; description?: string | undefined; global?: boolean | undefined; }; @@ -9367,7 +9389,7 @@ declare namespace chrome { cross_origin_opener_policy?: { value: string } | undefined; current_locale?: string | undefined; /** Defines static rules for the declarativeNetRequest API, which allows blocking and modifying of network requests. */ - declarative_net_request?: { rule_resources?: declarativeNetRequest.Ruleset[] } | undefined; + declarative_net_request?: { rule_resources: declarativeNetRequest.Ruleset[] } | undefined; /** Defines pages that use the DevTools APIs. */ devtools_page?: string | undefined; event_rules?: @@ -9439,20 +9461,13 @@ declare namespace chrome { /** Allows the use of an OAuth 2.0 security ID. The value of this key must be an object with "client_id" and "scopes" properties. */ oauth2?: { client_id: string; - scopes?: string[] | undefined; + scopes: string[]; } | undefined; offline_enabled?: boolean | undefined; /** Allows the extension to register a keyword in Chrome's address bar. */ omnibox?: { keyword: string } | undefined; /** Specifies a path to an options.html file for the extension to use as an options page. */ options_page?: string | undefined; - /** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */ - options_ui?: { - /** Path to the options page, relative to the extension's root. */ - page: string; - /** Specify as `false` to declare an embedded options page. If `true`, the extension's options page will be opened in a new tab rather than embedded in `chrome://extensions`. */ - open_in_tab: boolean; - } | undefined; /** Lists technologies required to use the extension. */ requirements?: { "3D"?: { features?: string[] | undefined } | undefined; @@ -9488,8 +9503,8 @@ declare namespace chrome { manifest_version: 2; // Pick one (or none) - browser_action?: ManifestAction | undefined; - page_action?: ManifestAction | undefined; + browser_action?: Omit | undefined; + page_action?: Omit | undefined; // Optional background?: @@ -9515,6 +9530,15 @@ declare namespace chrome { | undefined; /** Defines restrictions on the scripts, styles, and other resources an extension can use. */ content_security_policy?: string | undefined; + /** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */ + options_ui?: { + /** Path to the options page, relative to the extension's root. */ + page: string; + /** If `true`, a Chrome user agent stylesheet will be applied to your options page. Defaults to `false`. */ + chrome_style?: boolean | undefined; + /** Specify as `false` to declare an embedded options page. If `true`, the extension's options page will be opened in a new tab rather than embedded in `chrome://extensions`. */ + open_in_tab?: boolean | undefined; + } | undefined; /** Declares optional permissions for your extension. */ optional_permissions?: (ManifestOptionalPermission | string)[] | undefined; /** Enables use of particular extension APIs. */ @@ -9578,6 +9602,13 @@ declare namespace chrome { | undefined; /** Lists the web pages your extension is allowed to interact with, defined using URL match patterns. User permission for these sites is requested at install time. */ host_permissions?: string[] | undefined; + /** Specifies a path to an HTML file that lets a user change extension options from the Chrome Extensions page. */ + options_ui?: { + /** Specifies the path to the options page, relative to the extension's root. */ + page: string; + /** Indicates whether the extension's options page will be opened in a new tab. If set to `false`, the extension's options page is embedded in `chrome://extensions` rather than opened in a new tab. */ + open_in_tab?: boolean | undefined; + } | undefined; /** Declares optional permissions for your extension. */ optional_permissions?: ManifestOptionalPermission[] | undefined; /** Declares optional host permissions for your extension. */ diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index 2e97ebaeebf6cb..51449453bb908e 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -1033,6 +1033,42 @@ function testGetManifest() { manifest.author.email; // $ExpectType string } + if (manifest.chrome_settings_overrides) { + manifest.chrome_settings_overrides.homepage; // $ExpectType string | undefined + manifest.chrome_settings_overrides.startup_pages; // $ExpectType string[] | undefined + if (manifest.chrome_settings_overrides.search_provider) { + manifest.chrome_settings_overrides.search_provider.name; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.keyword; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.favicon_url; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.search_url; // $ExpectType string + manifest.chrome_settings_overrides.search_provider.encoding; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.suggest_url; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.instant_url; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.image_url; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.search_url_post_params; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.suggest_url_post_params; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.instant_url_post_params; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.image_url_post_params; // $ExpectType string | undefined + manifest.chrome_settings_overrides.search_provider.alternate_urls; // $ExpectType string[] | undefined + manifest.chrome_settings_overrides.search_provider.prepopulated_id; // $ExpectType number | undefined + manifest.chrome_settings_overrides.search_provider.is_default; // $ExpectType boolean + } + } + + if (manifest.commands?.foobar) { + if (typeof manifest.commands.foobar.suggested_key === "object") { + manifest.commands.foobar.suggested_key.default; // $ExpectType string | undefined + manifest.commands.foobar.suggested_key.windows; // $ExpectType string | undefined + manifest.commands.foobar.suggested_key.mac; // $ExpectType string | undefined + manifest.commands.foobar.suggested_key.chromeos; // $ExpectType string | undefined + manifest.commands.foobar.suggested_key.linux; // $ExpectType string | undefined + } else { + manifest.commands.foobar.suggested_key; // $ExpectType string | undefined + } + manifest.commands.foobar.global; // $ExpectType boolean | undefined + manifest.commands.foobar.description; // $ExpectType string | undefined + } + if (manifest.cross_origin_embedder_policy) { manifest.cross_origin_embedder_policy.value; // $ExpectType string } @@ -1080,9 +1116,9 @@ function testGetManifest() { manifest.input_components[0].options_page; // $ExpectType string | undefined } - if (manifest.options_ui) { - manifest.options_ui.page; // $ExpectType string - manifest.options_ui.open_in_tab; // $ExpectType boolean + if (manifest.oauth2) { + manifest.oauth2.client_id; // $ExpectType string + manifest.oauth2.scopes; // $ExpectType string[] } if (manifest.sandbox) { @@ -1091,8 +1127,27 @@ function testGetManifest() { } if (manifest.manifest_version === 2) { - manifest.browser_action; // $ExpectType ManifestAction | undefined - manifest.page_action; // $ExpectType ManifestAction | undefined + if (manifest.page_action) { + manifest.page_action.default_icon; // $ExpectType ManifestIcons | string | undefined + manifest.page_action.default_title; // $ExpectType string | undefined + manifest.page_action.default_popup; // $ExpectType string | undefined + // @ts-expect-error The default_state key cannot be set for browser_action or page_action keys. + manifest.page_action.default_state; + } + + if (manifest.browser_action) { + manifest.browser_action.default_icon; // $ExpectType ManifestIcons | string | undefined + manifest.browser_action.default_title; // $ExpectType string | undefined + manifest.browser_action.default_popup; // $ExpectType string | undefined + // @ts-expect-error The default_state key cannot be set for browser_action or page_action keys. + manifest.browser_action.default_state; + } + + if (manifest.options_ui) { + manifest.options_ui.page; // $ExpectType string + manifest.options_ui.open_in_tab; // $ExpectType boolean | undefined + manifest.options_ui.chrome_style; // $ExpectType boolean | undefined + } manifest.content_security_policy; // $ExpectType string | undefined @@ -1107,7 +1162,19 @@ function testGetManifest() { manifest.web_accessible_resources; // $ExpectType string[] | undefined } else if (manifest.manifest_version === 3) { - manifest.action; // $ExpectType ManifestAction | undefined + if (manifest.action) { + manifest.action.default_icon; // $ExpectType ManifestIcons | string | undefined + manifest.action.default_title; // $ExpectType string | undefined + manifest.action.default_popup; // $ExpectType string | undefined + manifest.action.default_state; // $ExpectType 'enabled' | 'disabled' | undefined + } + + if (manifest.options_ui) { + manifest.options_ui.page; // $ExpectType string + manifest.options_ui.open_in_tab; // $ExpectType boolean | undefined + // @ts-expect-error The chrome_style option cannot be used with manifest version 3. + manifest.options_ui.chrome_style; + } // @ts-expect-error manifest.content_security_policy = "default-src 'self'"; @@ -1202,6 +1269,11 @@ function testGetManifest() { }, ], content_security_policy: "default-src 'self'", + options_ui: { + page: "options.html", + open_in_tab: true, + chrome_style: true, + }, optional_permissions: ["https://*/*"], permissions: ["https://*/*"], web_accessible_resources: ["some-page.html"], @@ -1231,6 +1303,10 @@ function testGetManifest() { extension_pages: "default-src 'self'", sandbox: "default-src 'self'", }, + options_ui: { + page: "options.html", + open_in_tab: true, + }, host_permissions: ["http://*/*"], optional_permissions: ["cookies"], permissions: ["activeTab"], From 38cc134e0be8513c2581549c0bf06a9f7e5291c5 Mon Sep 17 00:00:00 2001 From: Yaroslav <63865083+dnrovs@users.noreply.github.com> Date: Fri, 31 Jul 2026 22:59:29 +0300 Subject: [PATCH 15/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75221=20Add?= =?UTF-8?q?=20types=20for=20lua-format=20by=20@dnrovs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/lua-format/.npmignore | 5 +++ types/lua-format/index.d.ts | 9 +++++ types/lua-format/lua-format-tests.ts | 56 ++++++++++++++++++++++++++++ types/lua-format/package.json | 17 +++++++++ types/lua-format/tsconfig.json | 19 ++++++++++ 5 files changed, 106 insertions(+) create mode 100644 types/lua-format/.npmignore create mode 100644 types/lua-format/index.d.ts create mode 100644 types/lua-format/lua-format-tests.ts create mode 100644 types/lua-format/package.json create mode 100644 types/lua-format/tsconfig.json diff --git a/types/lua-format/.npmignore b/types/lua-format/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/lua-format/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/lua-format/index.d.ts b/types/lua-format/index.d.ts new file mode 100644 index 00000000000000..3de3560c14fd98 --- /dev/null +++ b/types/lua-format/index.d.ts @@ -0,0 +1,9 @@ +export interface Settings { + RenameVariables?: boolean; + RenameGlobals?: boolean; + SolveMath?: boolean; + Indentation?: string; +} + +export function Beautify(code: string, settings: Settings): string; +export function Minify(code: string, settings: Settings): string; diff --git a/types/lua-format/lua-format-tests.ts b/types/lua-format/lua-format-tests.ts new file mode 100644 index 00000000000000..9b67ee58fc6fc6 --- /dev/null +++ b/types/lua-format/lua-format-tests.ts @@ -0,0 +1,56 @@ +import { Beautify, Minify, type Settings } from "lua-format"; + +Beautify("print('hello')", {}); +Minify("print('hello')", {}); + +Beautify("print('hello')", { + RenameVariables: true, + Indentation: "\t", +}); + +Minify("print('hello')", { + RenameGlobals: false, + SolveMath: true, +}); + +const settings: Settings = { + RenameVariables: true, + RenameGlobals: false, + SolveMath: true, + Indentation: " ", +}; + +Beautify("print('hello')", settings); +Minify("print('hello')", settings); + +const beautified: string = Beautify("print()", {}); +const minified: string = Minify("print()", {}); + +// @ts-expect-error +Beautify(); + +// @ts-expect-error +Beautify("print('hello')"); + +// @ts-expect-error +Minify(123); + +Beautify("code", { + // @ts-expect-error + RenameVariables: "yes", +}); + +Minify("code", { + // @ts-expect-error + RenameGlobals: 1, +}); + +Beautify("code", { + // @ts-expect-error + Indentation: 4, +}); + +Beautify("code", { + // @ts-expect-error + UnknownOption: true, +}); diff --git a/types/lua-format/package.json b/types/lua-format/package.json new file mode 100644 index 00000000000000..927affe6d1a195 --- /dev/null +++ b/types/lua-format/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/lua-format", + "version": "1.5.9999", + "projects": [ + "https://github.com/Herrtt/luamin.js#readme" + ], + "devDependencies": { + "@types/lua-format": "workspace:." + }, + "owners": [ + { + "name": "Yaroslav", + "githubUsername": "dnrovs" + } + ] +} diff --git a/types/lua-format/tsconfig.json b/types/lua-format/tsconfig.json new file mode 100644 index 00000000000000..075e350f255bdd --- /dev/null +++ b/types/lua-format/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "lua-format-tests.ts" + ] +} From 5bd77bf053f3251e08916924d65c5dd37f2b0c56 Mon Sep 17 00:00:00 2001 From: Edwin Gichuru Date: Fri, 31 Jul 2026 23:00:48 +0300 Subject: [PATCH 16/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75235=20Cove?= =?UTF-8?q?rageJSON=20Update:=20Rework=20how=20CoverageCollection,Coverage?= =?UTF-8?q?=20generics=20work.=20Add=20bounds=20property=20to=20axes=20by?= =?UTF-8?q?=20@murithigeo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/coveragejson/coveragejson-tests.ts | 236 ++++++++- types/coveragejson/index.d.ts | 615 +++++++++-------------- types/coveragejson/package.json | 2 +- 3 files changed, 474 insertions(+), 379 deletions(-) diff --git a/types/coveragejson/coveragejson-tests.ts b/types/coveragejson/coveragejson-tests.ts index 714ae37f45de8a..bae43bec5e172d 100644 --- a/types/coveragejson/coveragejson-tests.ts +++ b/types/coveragejson/coveragejson-tests.ts @@ -1,5 +1,4 @@ // Annex A Informative Examples - let referencing: CoverageJSON.ReferenceSystemConnection[] = [ { coordinates: ["x", "y"], @@ -691,6 +690,7 @@ let multiPointSeriesDomain: CoverageJSON.MultiPointSeries = { [1, 20, 1], [2, 21, 3], ], + bounds: [[0.5, 19.5, 0], [1.5, 20.5, 2], [1.5, 20.5, 2], [2.5, 21.5, 4]], }, }, referencing, @@ -905,3 +905,237 @@ let verticalprofilewithRegularElevation: CoverageJSON.Domain = { y: { values: [20] }, }, }; + +const gridtiled: CoverageJSON.Coverage = { + "type": "Coverage", + "domain": { + "type": "Domain", + "domainType": "Grid", + "axes": { + "x": { "values": [-10, -5, 0] }, + "y": { "values": [40, 50] }, + "t": { "values": ["2010-01-01T00:12:20Z"] }, + }, + "referencing": [{ + "coordinates": ["x", "y"], + "system": { + "type": "GeographicCRS", + "id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84", + }, + }, { + "coordinates": ["t"], + "system": { + "type": "TemporalRS", + "calendar": "Gregorian", + }, + }], + }, + "parameters": { + "LC": { + "type": "Parameter", + "description": { + "en": "Land Cover according to xyz classification", + }, + "observedProperty": { + "id": "http://example.com/landcover", + "label": { + "en": "XYZ Land Cover", + }, + "categories": [{ + "id": "http://example.com/landcover/categories/grass", + "label": { + "en": "Grass", + }, + "description": { + "en": "Very green grass.", + }, + }, { + "id": "http://example.com/landcover/categories/rocks", + "label": { + "en": "Rock", + }, + "description": { + "en": "Just rocks.", + }, + }], + }, + "categoryEncoding": { + "http://example.com/landcover/categories/grass": 1, + "http://example.com/landcover/categories/rocks": 2, + }, + }, + }, + "ranges": { + "LC": { + "type": "NdArray", + "dataType": "integer", + "axisNames": ["t", "y", "x"], + "shape": [1, 2, 3], + "values": [1, 1, null, 2, 1, 2], + }, + }, +}; + +const pointCollection: CoverageJSON.CoverageCollection = { + "type": "CoverageCollection", + "domainType": "Point", + "parameters": { + "POTM": { + "type": "Parameter", + "description": { + "en": "The potential temperature, in degrees celsius, of the sea water", + }, + "unit": { + "label": { + "en": "Degree Celsius", + }, + "symbol": { + "value": "Cel", + "type": "http://www.opengis.net/def/uom/UCUM/", + }, + }, + "observedProperty": { + "id": "http://vocab.nerc.ac.uk/standard_name/sea_water_potential_temperature/", + "label": { + "en": "Sea Water Potential Temperature", + }, + }, + }, + "QC": { + "type": "Parameter", + "observedProperty": { + "id": "http://mmisw.org/ont/argo/qualityFlag", + "label": { + "en": "Argo Quality Control Flag", + }, + "categories": [ + { + "id": "http://mmisw.org/ont/argo/qualityFlag/_0", + "label": { + "en": "No QC was performed", + }, + }, + { + "id": "http://mmisw.org/ont/argo/qualityFlag/_1", + "label": { + "en": "Good data", + }, + }, + { + "id": "http://mmisw.org/ont/argo/qualityFlag/_4", + "label": { + "en": "Bad data", + }, + }, + ], + }, + "categoryEncoding": { + "http://mmisw.org/ont/argo/qualityFlag/_0": 0, + "http://mmisw.org/ont/argo/qualityFlag/_1": 1, + "http://mmisw.org/ont/argo/qualityFlag/_4": 4, + }, + }, + }, + "referencing": [ + { + "coordinates": [ + "x", + "y", + ], + "system": { + "type": "GeographicCRS", + "id": "http://www.opengis.net/def/crs/OGC/1.3/CRS84", + }, + }, + { + "coordinates": [ + "t", + ], + "system": { + "type": "TemporalRS", + "calendar": "Gregorian", + }, + }, + ], + "coverages": [ + { + "type": "Coverage", + "domain": { + "type": "Domain", + "axes": { + "x": { + "values": [ + -5.1, + ], + bounds: [-6.1, -4.1], + }, + "y": { + "values": [ + -40.2, + ], + }, + "t": { + "values": [ + "2013-01-01", + ], + }, + }, + }, + "ranges": { + "POTM": { + "type": "NdArray", + "dataType": "float", + "values": [ + 23.8, + ], + }, + "QC": { + "type": "NdArray", + "dataType": "integer", + "values": [ + 1, + ], + }, + }, + }, + { + "type": "Coverage", + "domain": { + "type": "Domain", + "axes": { + "x": { + "values": [ + -5.1, + ], + }, + "y": { + "values": [ + -39.2, + ], + }, + "t": { + "values": [ + "2013-01-01", + ], + }, + }, + }, + "ranges": { + "POTM": { + "type": "NdArray", + "dataType": "float", + "values": [ + 21.8, + ], + }, + "QC": { + "type": "NdArray", + "dataType": "integer", + "values": [ + 0, + ], + }, + }, + }, + ], +}; diff --git a/types/coveragejson/index.d.ts b/types/coveragejson/index.d.ts index e825870545f4eb..409a4c144aead3 100644 --- a/types/coveragejson/index.d.ts +++ b/types/coveragejson/index.d.ts @@ -1,20 +1,29 @@ /** - * @external http://www.opengis.net/doc/CS/covjson/1.0 + * CoverageJSON is an official Open Geospatial Consortium standard for sharing spatio-temporal data on the web + * http://www.opengis.net/doc/CS/covjson/1.0 */ export as namespace CoverageJSON; -/** - * CoverageJSON documents always consist of a single object. This object (referred to as the - * CoverageJSON object below) represents a domain, range, coverage, or collection of coverages - * The CoverageJSON object MAY have any number of members (name/value pairs). - * The CoverageJSON object MUST have a member with the name "type" whose value is one of: "Domain", "NdArray" (a range encoding), "TiledNdArray" (a range encoding), "Coverage", or "CoverageCollection". - * The case of the type member values MUST be as shown here. - */ export type CoverageJSON = Domain | CoverageCollection | Coverage | NdArray; export type CoverageJsonTypes = CoverageJSON["type"]; export type DomainAxes = Domain["axes"]; + +/** + * Common domainType ID's + */ export type DomainTypes = Domain["domainType"]; +export type PrimitiveValue = + | string + | number + | boolean + | null + | object + | undefined; // undefined ensures that interface does not reject other members +export type Value = PrimitiveValue | PrimitiveValue[]; +/** + * Common Domains + */ export type Domain = | Grid | Trajectory @@ -30,7 +39,7 @@ export type Domain = | Section; /** - * @description string in multiple languages with tags as defined in BCP 47, and the value is the string in that language. The special language tag "und" can be used to identify a value whose language is unknown or undetermined. [IETF BCP47] + * An object whose keys are BCP 47 language tags and the values are the strings in that language * http://tools.ietf.org/html/bcp47 */ export interface I18N { @@ -38,86 +47,53 @@ export interface I18N { } /** - * @description Parameter objects represent metadata about the values of the coverage in terms of the observed property (like water temperature), the units, and others. - * A parameter object MUST NOT have a "unit" member if the "observedProperty" member has a "categories" member + * Parameter objects represent metadata about the values of the coverage in terms of the observed property (like water temperature), the units, and others. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E3%2E%C2%A0%20Parameter%20Objects,-Parameter */ - export interface Parameter { - /** A parameter Object MAY have any number of members (name/value pairs) */ - [key: string]: any; - /**A parameter object MUST have a member with the name "type" and the value must be "Parameter" */ + [key: string]: Value; type: "Parameter"; - /**A parameter object MAY have a member with the name "id" where the value MUST be a - string and SHOULD be a common identifier. */ - id?: string; - /** - * A parameter object MAY have a member with the name "label" where the value - * MUST be an i18n object that is the name of the parameter and which SHOULD be - * short. Note that this SHOULD be left out if it would be identical to the "label" of the - * "observedProperty" member */ - label?: I18N; /** - * A parameter object MAY have a member with the name "description" where the value - * MUST be an i18n object which is a, perhaps lengthy, textual description of the parameter - * Note that some tests using validators will fail if you use a string + * Common ID for the parameter */ + id?: string; + label?: I18N; description?: I18N; - /** - * A parameter object MUST have a member "observedProperty" where the value is an object - * which MUST have the member "label" and which MAY have the members "id", "description", and "categories". - * The value of the - */ observedProperty: ObservedProperty; - /** - * A parameter object MAY have a member with the name "categoryEncoding" where the value is an object where each key is equal to an "id" value of the "categories" array within the "observedProperty" member of the parameter object. There MUST be no duplicate keys. The value is either an integer or an array of integers where each integer MUST be unique within the object - */ categoryEncoding?: CategoryEncoding; - /** - * A parameter object MUST NOT have a "unit" member if the "observedProperty" member has a "categories" member + * DO NOT include if "observedProperty" has a "categories" member */ unit?: Unit; } -/** - * Section 9.3 - */ export interface ObservedProperty { label: I18N; id?: string; description?: I18N; - /**MUST be a non-empty array of category objects */ categories?: [Category, ...Category[]]; } -/** - * MUST have a id & label member - * MAY have a description member - */ export interface Category { - /**MUST be a i18n object of the name of the category */ label: I18N; id: string; - /**If given, it should be a textual description of the category */ description?: I18N; } /** - * MAY have member "categoryEncoding" where value is an object where each key is equal to an id value of the categories array - * within the observedProperty member of the parameter object - * There MUST be no duplicate keys - * The value is either an integer or an array of integers where each integer MUST be unique within the object + * The values of keys must be unique within the object. The keys must be present in the "categories" member of the "observedProperty" member */ export interface CategoryEncoding { [key: string]: number | number[]; } -/** - * the value MUST have either or both the members "label" or/and "symbol" and which MAY have the member "id" - * If given, the value of "id" MUST be a string and SHOULD be a common identifier. It is recommended to reference a serialization scheme to allow automatic unit conversion - */ export type Unit = - & { id?: string } + & { + /** + * Common ID for the unit + */ + id?: string; + } & ( | { label: I18N; symbol: UnitSymbol } | { label: I18N | string } @@ -130,41 +106,38 @@ export type Unit = * "type" MUST have the value "http://www.opengis.net/def/uom/UCUM" if UCUM (http://unitsofmeasure.org/) is used or a custom value as recommended in section https://docs.ogc.org/cs/21-069r2/21-069r2.pdf#%5B%7B%22num%22%3A3041%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C99.212%2C338.319%2Cnull%5D */ export type UnitSymbol = - | string - | { value: string; type: "http://www.opengis.net/def/uom/UCUM" | string }; + | /** + * Symbolic notation of the unit + */ string + | { + value: string; + /** + * The serialization scheme for the unit. If UCUM (https://unitsofmeasure.org) is used, then the value MUST be "http://www.opengis.net/def/uom/UCUM" + */ + type: "http://www.opengis.net/def/uom/UCUM" | string; + }; /** - * @description Parameter group objects represent logical groups of parameters, for example vector quantities - * A parameter group object MUST have either or both the members "label" or/and "observedProperty". + * A logical grouping of parameters via the "members" array */ export type ParameterGroup = & { - /** MAY have any number of name/value pairs */ - [key: string]: any; - /**MUST have member with name "type" and value "ParameterGroup" */ + [key: string]: Value; type: "ParameterGroup"; label?: I18N; - /**MAY have member "id" where value MUST be a string and SHOULD be a common identifier */ - id?: string; - /**MAY have a member with the name "description" where the value MUST be an i18n object which is a, perhaps lengthy, textual description of the parameter group */ - description?: I18N; /** - * A parameter group object MUST have a member with the name "members" where the - * value is a non-empty array of parameter identifiers (see 6.3 Coverage objects). + * Common ID for the group */ - members?: [string, ...string[]]; + id?: string; + description?: I18N; + members: [string, ...string[]]; } & ( | { - /**MAY have a member with the name "observedProperty" where the value is an object as specified for parameter objects */ observedProperty: ObservedProperty; } | { - /** - * MAY have member "label" which MUST be a i18n object and which SHOULD be short. - * Note that this SHOULD be left out if it would be identical to the "label" of the "observedProperty" member - */ label: I18N; } | { @@ -174,12 +147,9 @@ export type ParameterGroup = ); /** - * @section 9.5 - * @description Reference system objects are used to provide information about how to interpret coordinate - * values within the domain. Coordinates are usually geospatial or temporal in nature, but may also - * be categorical (based on identifiers). All reference system objects MUST have a member "type", - * the possible values of which are given in the sections below. Custom values MAY be used as - * detailed in the Extensions section. + * Provide information about how to interpret coordinate values within the domain. + * Coordinates are usually geospatial or temporal in nature, but may be categorical. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E6%2E1%2E2%2E%C2%A0%20Reference%20System%20Connection%20Objects */ export type ReferenceSystemObject = | SpatialReferenceSystem @@ -187,17 +157,16 @@ export type ReferenceSystemObject = | TemporalReferenceSystem; export interface SpatialReferenceSystem { - [key: string]: any; - /**value of type MUST be "GeographicCRS" or "ProjectedCRS" or "VerticalCRS" */ + [key: string]: Value; type: "GeographicCRS" | "ProjectedCRS" | "VerticalCRS"; /** + * A common ID for the system and should be omitted if unclear in which case meaning is derived from the "type" * MAY have an id member whose value MUST be a string and SHOULD be a common identifier for the reference system - * Note that sometimes (e.g. for numerical model data) the exact CRS may not be known or may - * be undefined. In this case the "id" may be omitted, but the "type" still indicates that this is a - * geographic CRS */ id?: string; - /**MAY have a "description" member which must be an i18n object but no standardized content is interpreted from this description */ + /** + * No standardized meaning is to be derived from this member + */ description?: I18N; } @@ -215,107 +184,83 @@ export interface SpatialReferenceSystem { * representation MUST be used */ export interface TemporalReferenceSystem { - /** MUST have member "type". The only currently defined value of it is "TemporalRS" */ type: "TemporalRS"; /** - * MUST have member "calendar" with value "Gregorian" or an URI - * If Gregorian calendar is used, then "calendar" MUST have value "Gregorian" and cannot be an URI + * If Gregorian calendar is used, then "calendar", the value must be "Gregorian" and cannot be an URI */ calendar: "Gregorian" | string; /** - * MAY have member "timeScale" with a URI as value - * If omitted, the timeScale defaults to UTC @external http://www.opengis.net/def/trs/BIPM/0/UTC. - * If timeScale is UTC, then "timeScale" member MUST be omitted + * If the timeScale is "UTC", then this member should be omitted, else the value should be an URI */ timeScale?: "UTC" | string; } -/** - * @section 9.5.2 - */ - export interface IdentifierBasedReferenceSystem { - /**MUST have member "type" with value "IdentifierRS" */ type: "IdentifierRS"; - /**MAY have member "id" where value MUST be a string and SHOULD be a common identifier for the RS */ + /** + * Common ID for the Reference System + */ id?: string; - /**MAY have member "label" which must be i18n */ label?: I18N; targetConcept?: TargetConcept; + /** */ /**MAY have member "identifiers" where value is an object where each key is an identifier referenced by the identifierRS and each value is an object describing the referenced concept equal to "targetConcept" */ identifiers?: { [key: string]: TargetConcept; }; } -/** - * TargetConcept - * MAY have member "targetConcept" where value is an object that MUST have member "label" and MAY have member "description" - */ + export interface TargetConcept { label: I18N; description?: I18N; - /**Not listed in the requirements but present in examples */ id?: string; } /** - * @description A domain object is a CoverageJSON object which defines a set of positions and their extent in one or more referencing systems. - * For interoperability reasons it is RECOMMENDED that a domain object has the - * member "domainType" with a string value to indicate that the domain follows a certain - * structure (e.g. a time series, a vertical profile, a spatio-temporal 4D grid). See the section - * Common Domain Types for details. Custom domain types may be used as recommended - * in the section Extensions + * A CoverageJSON object which defines a set of positions and their extent in one or more referencing systems. + * The "domainType" property indicates the structure of the domain and should be included */ export interface DomainObject { - /** value of "type" MUST be "Domain" */ type: "Domain"; - - domainType: DomainTypes; /** - * MUST have member "axes" which has as value an object where each key is an axis identifier and each value an axis object - * member "axes" MUST NOT be empty + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E6%2E1%2E1%2E%C2%A0%20Axis%20Objects */ axes: Domain["axes"]; /** - * MAY have member "referencing" where value is an an array of reference system connection objects - * MUST have "referencing" if the domain object is not part of a coverage collection or if the coverage collection does not have a "referencing" member. + * MUST be included if the domain object is not part of a coverage collection or if the coverage collection does not have a "referencing" member. */ referencing?: ReferenceSystemConnection[]; } /** - * A reference system connection object creates a link between values within domain axes and a - * reference system to be able to interpret those values, e.g. as coordinates in a certain coordinate reference system. + * Creates a link between values within domain axes and a reference system to be able to interpret those values, e.g. as coordinates in a certain coordinate reference system. */ -export interface ReferenceSystemConnection { - /** MUST have member "coordinates" which has as value an array of coordinate identifiers that are referenced in this object +export interface ReferenceSystemConnection< + T extends ReferenceSystemObject = ReferenceSystemObject, +> { + /** An array of coordinate identifiers that are referenced in this object * Depending on type of referencing, the ordering of the identifiers MAY be relevant e.g. for 2D/3D CRS. In this case, the order of the identifiers MUST match the order of axes in the CRS */ coordinates: string[]; - /** - * A reference system connection MUST have a member "system" whose value MUST be a Reference System Object - */ - system: ReferenceSystemObject; + system: T; } -export interface AxisObject { +export interface WithBounds { /** - * An axis object MAY have axis value bounds defined in the member "bounds" where the - * value is an array of values of length len*2 with len being the length of the "values" - * array. For each axis value at array index i in the "values" array, a lower and upper + * The value is an array of values of length len*2 with len being the length of the "values" array. + * For each axis value at array index i in the "values" array, a lower and upper * bounding value at positions 2*i and 2*i+1, respectively, are given in the bounds array. - * If a domain axis object has no "bounds" member, then a bounds array MAY be derived automatically + * Can be derived automatically if not provided */ - bounds?: number[]; + bounds?: T; } /** - * The values of "start" and "stop" MUST be numbers, and the value of "num" an integer - * greater than zero. If the value of "num" is 1, then "start" and "stop" MUST have - * identical values. For num > 1, the array elements of "values" MAY be reconstructed with - * the formula start + i * step where i is the ith element and in the interval [0, num-1] - * and step = (stop - start) / (num - 1). If num = 1 then "values" is [start]. Note - * that "start" can be greater than "stop" in which case the axis values are descending - * @todo review the usage of the RegularlySpacedAxis in a future Commit + * "num" MUST be an integer and must be > 0 + * If "num" = 1, then "start" and "stop" MUST have identical values + * If "num" > 1, then the array of values can be reconstructed with the formular `start + i * step` + * where `i` is the i-th element in the interval [0, num-1] and `step` = (stop - start) / (num - 1)` + * If "num" = 1, then the reconstructured array = [start] + * If `start > stop`, the values are monotonically decreasing */ export interface RegularlySpacedAxis { start: number; @@ -326,125 +271,104 @@ export interface RegularlySpacedAxis { export interface NdArrayObject { type: "NdArray"; /** - * An NdArray object MAY have a member with the name "shape" where the value is an array of integers. For 0D arrays, "shape" MAY be omitted (defaulting to []). For >= 1D arrays it MUST be included. + * An NdArray object MAY have a member with the name "shape" where the value is an array of integers. + * For 0D arrays, "shape" MAY be omitted (defaulting to []) but MUST be included for >= 1D arrays * Where "shape" is present and non-empty, the product of its values MUST equal the number of elements in the "values" array. */ shape?: number[]; /** - * MAY have a member with the name "axisNames" where the value is an array of strings of the same length as "shape", such that each string assigns a name to the corresponding dimension. For 0D arrays, "axisNames" MAY be omitted (defaulting to - * []). For >= 1D arrays it MUST be included. + * An array of strings of the same length as "shape", such that each string assigns a name to the corresponding dimension. + * Can be omitted for 0D array (defaults to []). Must be included for >= 1D arrays */ axisNames?: string[]; } /** - * A CoverageJSON object with the type "NdArray" is an NdArray object. It represents a multidimensional (>= 0D) array with named axes, encoded as a flat, one-dimensional JSON array in row-major order. + * Represents a multidimensional (>= 0D) array with named axes, encoded as a flat, one-dimensional JSON array in row-major order. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E6%2E2%2E%C2%A0%20NdArray%20Objects,-A */ export type NdArray = StringNdArray | NumberNdArray | TiledNdArray; -export interface NumberNdArray extends NdArrayObject { +export interface ValuesNdArray< + T extends string | number, +> extends NdArrayObject { /** - * MUST have member with the name "values" where value is a non-empty array of numbers and nulls, or strings and nulls where nulls represent missing data - * 0D NdArrays must have exactly one item in the "values" array - * Within the "values" array, the elements MUST be ordered such that the last dimension in "axisNames" varies fastest, i.e. row-major order. (This mimics the approach taken in NetCDF; see the example below.) - * Note that common JSON implementations use IEEE 754-2008 64-bit (double precision) floating point numbers as the data type for "values". Users SHOULD be aware of the - * limitations in precision when encoding numbers in this way. For example, when encoding integers, users SHOULD be aware that only values within the range [-253+1, 253-1] can be represented in a way that will ensure exact interoperability among such implementations - * [IETF RFC 7159] @external https://datatracker.ietf.org/doc/html/rfc7159 + * The data type of the non-null values in the "values" array */ - values: [number | null, ...(number | null)[]]; + dataType: T extends string ? "string" : "float" | "integer"; /** - * MUST have member with name "dataType" where value is either "float", "integer" or "string" - * MUST correspond to the data type of non-null values in "values" array + * For 0D arrays, the array must have exactly one item + * Elements MUST be ordered such that the last dimension in "axisNames" varies fastest, i.e. row-major order, mimicing the approach taken in NetCDF + * Note that common JSON implementations use IEEE 754-2008 64-bit (double precision) floating point numbers as the data type for "values" + * Users SHOULD be aware of the limitations in precision when encoding numbers in this way. + * For example, when encoding integers, users SHOULD be aware that only values within the range [-253+1, 253-1] can be represented in a way that will ensure exact interoperability among such implementations */ - dataType: "integer" | "float"; -} -/**See above */ -export interface StringNdArray extends NdArrayObject { - dataType: "string"; - values: [string | null, ...(string | null)[]]; + values: [T | null, ...(T | null)[]]; } +export type NumberNdArray = ValuesNdArray; +export type StringNdArray = ValuesNdArray; /** - * @description A CoverageJSON object with the type "TiledNdArray" is a TiledNdArray object. It represents - a multidimensional (>= 1D) array with named axes that is split up into sets of linked NdArray - OPEN GEOSPATIAL CONSORTIUM 21-069R2 35 - documents. Each tileset typically covers a specific data access scenario, for example, loading a - single time slice of a grid vs. loading a time series of a spatial subset of a grid + * It represents a multidimensional (>= 1D) array with named axes that is split up into sets of linked NdArray documents. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E6%2E3%2E%C2%A0%20TiledNdArray%20Objects,-A */ -export interface TiledNdArray { +export interface TiledNdArray extends Omit { type: "TiledNdArray"; dataType: "float" | "string" | "integer"; - /** - * A TiledNdArray object MUST have a member with the name "shape" where the value is a non-empty array of integers - */ shape: [number, ...number[]]; - /**MUST have member "tileSets" where value is a non-empty array of TileSet objects */ - tileSets: [TileSet, ...TileSet[]]; /** - * A TiledNdArray object MUST have a member with the name "axisNames" where the value is a string array of the same length as "shape" + * Each tileset typically covers a specific data access scenario, for example, loading a single time slice of a grid vs. loading a time series of a spatial subset of a grid */ + tileSets: [TileSet, ...TileSet[]]; axisNames: string[]; } -/** - * @description - */ export interface TileSet { /** - * MUST have member "tileShape" where value is an array of same length as "shape" - * and where each array element is either null or an integer lower or equal than the corresponding element in "shape" + * An array of same length as "shape" of the TiledNdArray object and where each array element is either null or an integer lower or equal than the corresponding element in "shape". * A null value denotes that the axis is not tiled */ tileShape: (number | null)[]; /** - * MUST have member "urlTemplate" where value is a Level 1 URI template as defined in RFC 6570 @external https://tools.ietf.org/html/rfc6570 - * The URI template MUST contain a variable for each axis name whose corresponding element in "tileShape" is not null - * A variable for an axis of total size totalSize (from "shape") and tile size tileSize (from "tileShape") and has as value one of the integers 0, 1, …, q + r - 1 where q and r are the quotient and remainder obtained by dividing totalSize by tileSize + * A Level 1 URI template as defined in RFC 6570 https://tools.ietf.org/html/rfc6570. + * The URI template MUST contain a variable for each axis name whose corresponding element in "tileShape" is not null. + * A variable for an axis of total size totalSize (from "shape") and tile size tileSize (from "tileShape") and has as value one of the integers 0, 1, …, q + r - 1 where q and r are the quotient and remainder obtained by dividing totalSize by tileSize. * Each URI that can be generated from the URI template MUST resolve to an NdArray CoverageJSON document where the members "dataType" and "axisNames`" are identical to the ones of the * TiledNdArray object, and where each value of `"shape" is an integer equal, or lower if an edge tile, to the corresponding element in "tileShape" while replacing null with the corresponding element of "shape" of the TiledNdArray. */ urlTemplate: string; } - /** - * @section 9.6.4 - * A CoverageJSON object with the type "Coverage" is a coverage object + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E6%2E4%2E%C2%A0%20Coverage%20Objects,-A */ -export interface Coverage { - /** */ +export interface Coverage { + [key: string]: Value; type: "Coverage"; - - /**Common identifier SHOULD be included if possible */ - id?: string; /** - * MUST have member "domain" where value is either a domain object or a URL + * Common ID for the Coverage */ - domain: D | string; + id?: string; /** - * If the value of "domain" is a URL and the referenced domain has a "domainType" member, * then the coverage object SHOULD have the member "domainType" where the value MUST equal that of the referenced domain - * If the coverage object is part of a coverage collection which has a "domainType" member then that member SHOULD be omitted in the coverage object. + * A domain object or an URL resolving to a domain object */ - domainType?: Domain["domainType"]; + domain: D; /** - * A coverage object MAY have a member with the name "parameters" where the value is an object where each member has as name a short identifier and as value a parameter - * object. The identifier corresponds to the commonly known concept of “variable name” and - * is merely used in clients for conveniently accessing the corresponding range object. - * A coverage object MUST have a "parameters" member if the coverage object is not part of a coverage collection or if the coverage collection does not have a "parameters" member. + * The expected value of the domain's "domainType" member. + * If the coverage is part of a coverage collection which has a "domainType" declared, this should be omitted */ - parameters?: { [key: string]: Parameter }; + domainType?: D extends Domain ? D["domainType"] : Domain["domainType"]; /** - * A coverage object MAY have a member with the name "parameterGroups" where the value is an array of ParameterGroup objects. + * A object where the key is an ID of a parameter and the value is the parameter object + * The ID corresponds to the commonly known concept of “variable name” and is merely used in for conveniently accessing the corresponding range object. + * Must be present if the Coverage is not part of a Coverage Collection */ + parameters?: { [key: string]: Parameter }; parameterGroups?: ParameterGroup[]; /** - * A coverage object MUST have a member with the name "ranges" where the value is a range set object. - * Any member of a range set object has as name any of the names in a "parameters" object in scope and as value either an NdArray or TiledNdArray object or - * a URL resolving to a CoverageJSON document of such object. A "parameters" member - * in scope is either within the enclosing coverage object or, if part of a coverage collection, - * in the parent coverage collection object. The shape and axis names of each NdArray - * or TiledNdArray object MUST correspond to the domain axes defined by "domain", - * while single-valued axes MAY be omitted. If the referenced parameter object has a - * "categoryEncoding" member, then each non-null array element of the "values" member - * of the NdArray object, or the linked NdArray objects within a TiledNdArray object, + * An object where the key is a key of the "parameters" member and the value is a NdArray object or an URL resolving to an NdArray object. + * The "parameters" member is either declared in the coverage object or in the parent coverage collection object. + * The shape and axis names of each NdArray or TiledNdArray object MUST correspond to the domain axes defined by "domain". + * Single-valued axes MAY be omitted. + * If the referenced parameter object has a "categoryEncoding" member, then each non-null array element of the "values" member of the NdArray object, or the linked NdArray objects within a TiledNdArray object, * MUST be equal to one of the values defined in the "categoryEncoding" object and be interpreted as the matching category */ ranges: Ranges; @@ -455,277 +379,214 @@ export interface Ranges { } /** - * @section 9.6.5 - * @description A CoverageJSON object with the type "CoverageCollection" is a coverage collection object. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E6%2E5%2E%C2%A0%20Coverage%20Collection%20Objects,-A */ - -export interface CoverageCollection { +export interface CoverageCollection< + D extends Domain | string = Domain | string, +> { type: "CoverageCollection"; /** - * A coverage collection object MAY have the member "domainType" with a string value to indicate that the coverage collection only contains coverages of the given domain type. - * See the section Common Domain Types for details. Custom domain types may be used as recommended in the section Extensions @external https://docs.ogc.org/cs/21-069r2/21-069r2.pdf#%5B%7B%22num%22%3A3041%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C99.212%2C338.319%2Cnull%5D - */ - domainType?: Domain["domainType"]; - /** - * MUST have a member "coverages" - * The value corresponding to "coverages" is an array. Each element in the array is a coverage object as defined above - */ - coverages: Array; - /** - * A coverage collection object MAY have a member with the name "parameters" where the value is an object where each member has as name a short identifier and as value a parameter object. + * Indicates that the coverage collection only contains coverages of the given domain type. */ + domainType?: D extends Domain ? D["domainType"] : Domain["domainType"]; + coverages: Coverage[]; parameters?: { [key: string]: Parameter }; - /** - * A coverage collection object MAY have a member with the name "parameterGroups" where the value is an array of ParameterGroup objects. - */ parameterGroups?: ParameterGroup[]; - /** - * A coverage collection object MAY have a member with t he name "referencing" where the value is an array of reference system connection objects - */ referencing?: ReferenceSystemConnection[]; } -/** - * @section 9.7 Extensions - * A CoverageJSON document can be extended with custom members and types in a robust and -interoperable way. For that, it makes use of absolute URIs and compact URIs (prefix:suffix) -in order to avoid conflicts with other extensions and future versions of the format. A central -registry of compact URI prefixes is provided which anyone can extend and which is a simple -mapping from compact URI prefix to namespace URI in order to avoid collisions with other -extensions that are based on compact URIs as well. Extensions that do not follow this -approach MAY use simple names instead of absolute or compact URIs but have to accept the -consequence of the document being less interoperable and future-proof. In certain use cases -this is not an issue and may be a preferred solution for simplicity reasons, for example, if such -CoverageJSON documents are only used internally and are not meant to be shared to a wider -audience. - */ +export type Position2D = [number, number]; +export type Position3D = [number, number, number]; +export type Position = Position2D | Position3D; /** - * MUST have the axes "x","y" - * MAY have axes "z" and "t" - * The usage of regularlyspacedaxis is subject to change + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E1%2E%C2%A0%20Grid,-A */ export interface Grid extends DomainObject { - domainType: "Grid"; + domainType?: "Grid"; axes: { - x: { values: number[] } | RegularlySpacedAxis; - y: { values: number[] } | RegularlySpacedAxis; - z?: { values: number[] } | RegularlySpacedAxis; - t?: { values: string[] }; + x: ({ values: number[] } & WithBounds) | RegularlySpacedAxis; + y: ({ values: number[] } & WithBounds) | RegularlySpacedAxis; + z?: ({ values: number[] } & WithBounds) | RegularlySpacedAxis; + t?: { values: string[] } & WithBounds; }; } + /** - * @section 9.10.2 - * A domain with VerticalProfile domain type MUST have the axes "x", "y", and "z", where "x" and "y" MUST have a single coordinate value only. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E2%2E%C2%A0%20VerticalProfile,-A */ export interface VerticalProfile extends DomainObject { - domainType: "VerticalProfile"; + domainType?: "VerticalProfile"; axes: { // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - x: { values: [number] }; + x: { values: [number] } & WithBounds<[number, number]>; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - y: { values: [number] }; - z: { values: number[] } | RegularlySpacedAxis; + y: { values: [number] } & WithBounds<[number, number]>; + z: ({ values: number[] } & WithBounds) | RegularlySpacedAxis; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - t?: { values: [string] }; + t?: { values: [string] } & WithBounds<[string, string]>; }; } /** - * @section 9.10.3 - * A domain with PointSeries domain type MUST have the axes "x", "y", and "t" where "x" and "y" MUST have a single coordinate value only. - * A domain with PointSeries domain type MAY have the axis "z" which MUST have a single coordinate value only. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E3%2E%C2%A0%20PointSeries,-A */ export interface PointSeries extends DomainObject { - domainType: "PointSeries"; - axes: { - dataType?: "primitive"; - // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - x: { values: [number] }; - // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - y: { values: [number] }; - t: { values: string[] }; - // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - z?: { values: [number] }; + domainType?: "PointSeries"; + axes: Omit & { + t: { values: string[] } & WithBounds; }; } - /** - * @section 9.10.4 - * A domain with Point domain type MUST have the axes "x" and "y" and MAY have the axes "z" and "t" where all MUST have a single coordinate value only. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E4%2E%C2%A0%20Point,-A */ export interface Point extends DomainObject { - domainType: "Point"; + domainType?: "Point"; axes: { // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - x: { values: [number] }; + x: { values: [number] } & WithBounds<[number, number]>; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - y: { values: [number] }; + y: { values: [number] } & WithBounds<[number, number]>; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - z?: { values: [number] }; + z?: { values: [number] } & WithBounds<[number, number]>; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - t?: { values: [string] }; + t?: { values: [string] } & WithBounds<[string, string]>; }; } -export type Position = [number, number] | [number, number, number]; /** - * @section 9.10.5 - * A domain with MultiPointSeries domain type MUST have the axes "composite" and "t". - * The axis "composite" MUST have the data type "tuple" and the coordinate identifiers "x","y","z" or "x","y", in that order. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E5%2E%C2%A0%20MultiPointSeries,-A */ - export interface MultiPointSeries extends DomainObject { - domainType: "MultiPointSeries"; - axes: { - composite: { - dataType: "tuple"; - coordinates: ["x", "y"] | ["x", "y", "z"]; - /**Essentially Multipoint coordinates */ - values: Position[]; - }; - t: { values: string[] }; + domainType?: "MultiPointSeries"; + axes: Omit & { + t: { values: string[] } & WithBounds; }; } - /** - * @section 9.10.6 MultiPoint - * domain with MultiPoint domain type MUST have the axis "composite" and MAY have the axis "t" where "t" MUST have a single coordinate value only. - * The axis "composite" MUST have the data type "tuple" and the coordinate identifiers "x","y","z" or "x","y", in that order + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E6%2E%C2%A0%20MultiPoint,-A */ export interface MultiPoint extends DomainObject { - domainType: "MultiPoint"; + domainType?: "MultiPoint"; axes: { - composite: { - dataType: "tuple"; - values: Position[]; - coordinates: ["x", "y"] | ["x", "y", "z"]; - }; + composite: + & { dataType: "tuple" } + & ( + | ( + & { coordinates: ["x", "y"]; values: Position2D[] } + & WithBounds< + Position2D[] + > + ) + | ( + & { coordinates: ["x", "y", "z"]; values: Position3D[] } + & WithBounds< + Position3D[] + > + ) + ); // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - t?: { values: [string] }; + t?: { values: [string] } & WithBounds<[string, string]>; }; } - /** - * @section 9.10.7 - * A domain with Trajectory domain type MUST have the axis "composite" and MAY have the axis "z" where "z" MUST have a single coordinate value only. -• The axis "composite" MUST have the data type "tuple" and the coordinate identifiers "t","x","y","z" or "t","x","y", in that order. -• The value ordering of the axis "composite" MUST follow the ordering of its "t" coordinate as defined in the corresponding reference system + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E7%2E%C2%A0%20Trajectory,-A */ export interface Trajectory extends DomainObject { - domainType: "Trajectory"; + domainType?: "Trajectory"; axes: { - composite: { - dataType: "tuple"; - coordinates: ["t", "x", "y"] | ["t", "x", "y", "z"]; - values: [string, number, number][] | [string, number, number, number][]; - }; - // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - z?: { values: [number] }; + composite: + & { + dataType: "tuple"; + } + & ( + | ({ + coordinates: ["t", "x", "y"]; + values: [string, ...Position2D][]; + } & WithBounds<[string, ...Position2D][]>) + | ({ + coordinates: ["t", "x", "y", "z"]; + values: [string, ...Position3D][]; + } & WithBounds<[string, ...Position3D][]>) + ); + z?: + // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type + { values: [number] } & WithBounds<[number, number]>; }; } - /** - * @section 9.10.8 - * A domain with Section domain type MUST have the axes "composite" and "z". - * The axis "composite" MUST have the data type "tuple" and the coordinate identifiers "t","x","y", in that order. - * The value ordering of the axis "composite" MUST follow the ordering of its "t" coordinate as defined in the corresponding reference system + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E8%2E%C2%A0%20Section,-A */ export interface Section extends DomainObject { - domainType: "Section"; + domainType?: "Section"; axes: { composite: { dataType: "tuple"; coordinates: ["t", "x", "y"]; - values: [string, number, number][]; + values: [string, ...Position2D][]; + bounds?: [string, ...Position2D][]; }; - z: { values: number[] } | RegularlySpacedAxis; + z: ({ values: number[] } & WithBounds) | RegularlySpacedAxis; }; } /** - * Section 9.10.9 Polygon - * Polygons in this domain domain type are defined equally to GeoJSON, except that they can only contain [x,y] positions (and not z or additional coordinates): - * A LinearRing is an array of 4 or more [x,y] arrays where each of x and y is a coordinate value. The first and last [x,y] elements are identical. - * A Polygon is an array of LinearRing arrays. For Polygons with multiple rings, the first MUST be the exterior ring and any others MUST be interior rings or holes. - * - * A domain with Polygon domain type MUST have the axis "composite" which has a single Polygon value. - * The axis "composite" MUST have the data type "polygon" and the coordinate identifiers "x","y", in that order. -• A Polygon domain MAY have the axes "z" and "t" which both MUST have a single coordinate value only + * An array of 4 or more [x,y] arrays where each of x and y is a coordinate value. + * The first and last [x,y] elements are identical. + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=Polygons,holes */ +export type LinearRing = Position2D[][]; +/** + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E9%2E%C2%A0%20Polygon,-Polygons + */ export interface Polygon extends DomainObject { - domainType: "Polygon"; + domainType?: "Polygon"; axes: { composite: { dataType: "polygon"; coordinates: ["x", "y"]; - values: [number, number][][][]; - }; + // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type + values: [LinearRing]; + } & WithBounds<[LinearRing, LinearRing]>; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - z?: { values: [number] }; + z?: { values: [number] } & WithBounds<[number, number]>; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - t?: { values: [string] }; + t?: { values: [string] } & WithBounds<[string, string]>; }; } - /** - * Section 9.10.10 PolygonSeries - * A domain with PolygonSeries domain type MUST have the axes "composite" and "t" where "composite" MUST have a single Polygon value. Polygons are defined in the Polygon domain type. - * A domain with PolygonSeries domain type MAY have the axis "z" which MUST have a single coordinate value only. - * The axis "composite" MUST have the data type "polygon" and the coordinate identifiers "x","y", in that order + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E10%2E%C2%A0%20PolygonSeries,-A */ - export interface PolygonSeries extends DomainObject { - domainType: "PolygonSeries"; - axes: { - composite: { - dataType: "polygon"; - coordinates: ["x", "y"]; - values: [number, number][][][]; - }; - t: { values: string[] }; - // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - z?: { values: [number] }; + domainType?: "PolygonSeries"; + axes: Omit & { + t: { values: string[] } & WithBounds; }; } /** - * Section 9.10.11 - * A domain with MultiPolygon domain type MUST have the axis "composite" where the values are Polygons. Polygons are defined in the Polygon domain type. - * The axis "composite" MUST have the data type "polygon" and the coordinate identifiers "x","y", in that order. - * A MultiPolygon domain MAY have the axes "z" and "t" which both MUST have a single coordinate value only + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E11%2E%C2%A0%20MultiPolygon,-A */ - export interface MultiPolygon extends DomainObject { - domainType: "MultiPolygon"; + domainType?: "MultiPolygon"; axes: { composite: { dataType: "polygon"; coordinates: ["x", "y"]; - values: [number, number][][][]; - }; + values: LinearRing[]; + } & WithBounds; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - t?: { values: [string] }; + t?: { values: [string] } & WithBounds<[string, string]>; // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - z?: { values: [number] }; + z?: { values: [number] } & WithBounds<[number, number]>; }; } /** - * Section 9.10.12 MultiPolygonSeries - * A domain with MultiPolygonSeries domain type MUST have the axes "composite" and "t" where the values of "composite" are Polygons. Polygons are defined in the Polygon domain type. - * The axis "composite" MUST have the data type "polygon" and the coordinate identifiers "x","y", in that order. - * A MultiPolygon domain MAY have the axis "z" which MUST have a single coordinate value only + * https://docs.ogc.org/cs/21-069r2/21-069r2.html#_d5c16418-1a20-4dbf-bf7a-8e685062df97:~:text=9%2E10%2E12%2E%C2%A0%20MultiPolygonSeries,-A */ export interface MultiPolygonSeries extends DomainObject { - domainType: "MultiPolygonSeries"; - axes: { - composite: { - dataType: "polygon"; - coordinates: ["x", "y"]; - values: [number, number][][][]; - }; - t: { values: string[] }; - // eslint-disable-next-line @definitelytyped/no-single-element-tuple-type - z?: { values: [number] }; + domainType?: "MultiPolygonSeries"; + axes: Omit & { + t: { values: string[] } & WithBounds; }; } diff --git a/types/coveragejson/package.json b/types/coveragejson/package.json index 55535d99f3c482..43974bf9e8fc6b 100644 --- a/types/coveragejson/package.json +++ b/types/coveragejson/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/coveragejson", - "version": "2.0.9999", + "version": "3.0.9999", "projects": [ "https://www.ogc.org/standard/coveragejson/" ], From 8589d93f3e9c6aaf4f9b2052d89e1455da2b28b3 Mon Sep 17 00:00:00 2001 From: Usman Sabuwala <51731966+max-programming@users.noreply.github.com> Date: Sat, 1 Aug 2026 01:32:34 +0530 Subject: [PATCH 17/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75286=20[cle?= =?UTF-8?q?aroutio=5F=5Fclearout]=20Remove,=20bundled=20with=20@clearoutio?= =?UTF-8?q?/clearout=20by=20@max-programming?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notNeededPackages.json | 4 + types/clearoutio__clearout/.npmignore | 5 - .../clearoutio__clearout-tests.ts | 175 ------- types/clearoutio__clearout/index.d.ts | 427 ------------------ types/clearoutio__clearout/package.json | 17 - types/clearoutio__clearout/tsconfig.json | 19 - 6 files changed, 4 insertions(+), 643 deletions(-) delete mode 100644 types/clearoutio__clearout/.npmignore delete mode 100644 types/clearoutio__clearout/clearoutio__clearout-tests.ts delete mode 100644 types/clearoutio__clearout/index.d.ts delete mode 100644 types/clearoutio__clearout/package.json delete mode 100644 types/clearoutio__clearout/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 8dc4e50cf6815e..07ac0866803e67 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1060,6 +1060,10 @@ "libraryName": "clear-module", "asOfVersion": "3.2.0" }, + "clearoutio__clearout": { + "libraryName": "@clearoutio/clearout", + "asOfVersion": "1.1.9" + }, "cli-boxes": { "libraryName": "cli-boxes", "asOfVersion": "2.0.0" diff --git a/types/clearoutio__clearout/.npmignore b/types/clearoutio__clearout/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/clearoutio__clearout/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/clearoutio__clearout/clearoutio__clearout-tests.ts b/types/clearoutio__clearout/clearoutio__clearout-tests.ts deleted file mode 100644 index 29ab5f73934935..00000000000000 --- a/types/clearoutio__clearout/clearoutio__clearout-tests.ts +++ /dev/null @@ -1,175 +0,0 @@ -import Clearout = require("@clearoutio/clearout"); - -// Construct with `new` and a config object. -const client = new Clearout("api-token", { timeout: 15000 }); - -// Construct by calling the factory directly (CommonJS style, no `new`). -const factoryClient = Clearout("api-token"); - -// Full config object. -const configured = new Clearout("api-token", { - timeout: 5000, - optimize: "highest_accuracy", - ignore_result: true, - ignore_duplicate_file: "false", - queue: true, -}); - -// @ts-expect-error - token is required. -new Clearout(); - -// @ts-expect-error - optimize must be one of the allowed strings. -new Clearout("api-token", { optimize: "fastest" }); - -// Mirrors real-world usage: dynamic import + default interop. -async function defaultClearoutVerify(email: string): Promise { - const { default: ClearoutDefault } = await import("@clearoutio/clearout"); - const c = new ClearoutDefault("api-token", { timeout: 15000 }); - return c.emailVerifier.verify({ email }); -} - -async function verifierExamples() { - // $ExpectType InstantVerifyResult - const result = await client.emailVerifier.verify({ email: "elon.musk@tesla.com" }); - // $ExpectType SafeToSend - result.safe_to_send; - // $ExpectType string - result.status; - // $ExpectType YesNo - result.disposable; - // $ExpectType number - result.sub_status.code; - // $ExpectType string - result.detail_info.domain; - - // timeout is optional and overridable. - await client.emailVerifier.verify({ email: "test@example.com", timeout: 90000 }); - - // @ts-expect-error - email is required. - await client.emailVerifier.verify({}); - - // $ExpectType BulkListResult - const bulk = await client.emailVerifier.bulkVerify({ - file: "/tmp/emails.csv", - optimize: "fastest_turnaround", - ignore_duplicate_file: "true", - }); - // $ExpectType string - bulk.list_id; - - // $ExpectType BulkVerifyProgressStatus - const progress = await client.emailVerifier.getBulkVerifyProgressStatus({ list_id: bulk.list_id }); - // $ExpectType number | undefined - progress.percentile; - // @ts-expect-error - percentage is a bulk-finder field, not a bulk-verify one. - progress.percentage; - - // $ExpectType DownloadResult - const download = await client.emailVerifier.downloadBulkVerifyResult({ list_id: bulk.list_id }); - // $ExpectType string - download.url; - - // $ExpectType ListActionResult - const removed = await client.emailVerifier.removeBulkVerifyList({ list_id: bulk.list_id, ignore_result: true }); - // $ExpectType string - removed.name; - - // $ExpectType ListActionResult - await client.emailVerifier.cancelBulkVerifyList({ list_id: bulk.list_id }); - - // $ExpectType CatchAllResult - const catchAll = await client.emailVerifier.isCatchAllEmail({ email: "mike.k@shopify.com" }); - // $ExpectType YesNo - catchAll.catchall; - - // $ExpectType DisposableResult - const disposable = await client.emailVerifier.isDisposableEmail({ email: "john@temp-mail.org" }); - // $ExpectType YesNo - disposable.disposable; - - // $ExpectType BusinessResult - const business = await client.emailVerifier.isBusinessEmail({ email: "us@clearout.io" }); - // $ExpectType YesNo - business.business_account; - - // $ExpectType FreeResult - const free = await client.emailVerifier.isFreeEmail({ email: "john@gmail.com" }); - // $ExpectType YesNo - free.free_account; - - // $ExpectType RoleResult - const role = await client.emailVerifier.isRoleEmail({ email: "info@gmail.com" }); - // $ExpectType YesNo - role.role_account; - - // $ExpectType GibberishResult - const gibberish = await client.emailVerifier.isGibberishEmail({ email: "abcd12345@gmail.com" }); - // $ExpectType YesNo - gibberish.gibberish; -} - -async function finderExamples() { - // $ExpectType EmailFinderResult - const found = await client.emailFinder.find({ - name: "Elon Musk", - domain: "tesla.com", - timeout: 10000, - queue: true, - }); - // $ExpectType string - found.emails[0].email_address; - // $ExpectType number - found.confidence_score; - // $ExpectType string - found.company.name; - - // domain is required. - // @ts-expect-error - await client.emailFinder.find({ name: "Elon Musk" }); - - // $ExpectType EmailFinderStatusResult - const status = await client.emailFinder.getStatus({ qid: "61008c4597947d45700f4bb2" }); - if ("emails" in status) { - // Completed: the full found-email payload is available. - // $ExpectType FoundEmail[] - status.emails; - // $ExpectType number - status.confidence_score; - } else { - // Still queued: only the progress status is available. - // $ExpectType string - status.query_status; - // @ts-expect-error - found-email fields are not present while queued. - status.emails; - } - - // $ExpectType BulkListResult - const bulk = await client.emailFinder.bulkFind({ file: "/tmp/people.csv", ignore_duplicate_file: "true" }); - - // $ExpectType BulkFinderProgressStatus - const progress = await client.emailFinder.getBulkFindProgressStatus({ list_id: bulk.list_id }); - // $ExpectType number | undefined - progress.percentage; - // @ts-expect-error - percentile is a bulk-verify field, not a bulk-finder one. - progress.percentile; - - // $ExpectType DownloadResult - await client.emailFinder.downloadBulkFindResult({ list_id: bulk.list_id }); - - // $ExpectType ListActionResult - await client.emailFinder.removeBulkFindList({ list_id: bulk.list_id }); - - // $ExpectType ListActionResult - await client.emailFinder.cancelBulkFinderList({ list_id: bulk.list_id }); -} - -async function accountExamples() { - // $ExpectType CreditsResult - const credits = await client.getCredits(); - // $ExpectType number - credits.available_credits; - // $ExpectType string | null - credits.credits.subs; - // $ExpectType number - credits.credits.total; -} diff --git a/types/clearoutio__clearout/index.d.ts b/types/clearoutio__clearout/index.d.ts deleted file mode 100644 index c736567013a42f..00000000000000 --- a/types/clearoutio__clearout/index.d.ts +++ /dev/null @@ -1,427 +0,0 @@ -/** - * Clearout Node.js client — a wrapper over the Clearout REST API - * (https://docs.clearout.io) for real-time and bulk email verification and - * email discovery. - * - * The module export is both callable and constructable: - * - * ```js - * const clearout = require("@clearoutio/clearout")("api-token", { timeout: 5000 }); - * // or - * import Clearout from "@clearoutio/clearout"; - * const clearout = new Clearout("api-token", { timeout: 5000 }); - * ``` - */ -declare const Clearout: Clearout.ClearoutStatic; - -declare namespace Clearout { - /** Optimization strategy for a bulk email verification request. */ - type Optimize = "highest_accuracy" | "fastest_turnaround"; - - /** - * Stringified boolean used by the API for the `ignore_duplicate_file` - * option (note: this is a string, not a boolean). - */ - type BooleanString = "true" | "false"; - - /** A `"yes"` / `"no"` flag as returned by the verification endpoints. */ - type YesNo = "yes" | "no"; - - /** Whether an email address is safe to send to. */ - type SafeToSend = "yes" | "no" | "risky"; - - /** - * Service-level configuration. Every option can be overridden per call when - * invoking a specific service method. - */ - interface ClearoutConfig { - /** - * Maximum time (in milliseconds) each request can take. - * @default 130000 // email verifier - * @default 30000 // email finder - */ - timeout?: number | undefined; - /** - * Bulk email verification optimization strategy. - * @default "highest_accuracy" - */ - optimize?: Optimize | undefined; - /** - * Ignore the result file even if it has not been downloaded. Used when - * removing a bulk list. - * @default false - */ - ignore_result?: boolean | undefined; - /** - * Whether to allow uploading a file whose name and size match a recent - * upload. - * @default "false" - */ - ignore_duplicate_file?: BooleanString | undefined; - /** - * For the email finder: whether discovery may continue in the - * background after the request times out. - * @default true - */ - queue?: boolean | undefined; - } - - /** Parameters for an instant verification / attribute-check request. */ - interface VerifyEmailParams { - /** Email address to verify. */ - email: string; - /** Overridable request timeout in milliseconds. */ - timeout?: number | undefined; - } - - /** Parameters for a bulk email verification request. */ - interface BulkVerifyParams { - /** Absolute path to the file containing the email addresses to upload. */ - file: string; - /** Optimization strategy. Defaults to the service-level config. */ - optimize?: Optimize | undefined; - /** Whether to allow a duplicate file upload. Defaults to the service-level config. */ - ignore_duplicate_file?: BooleanString | undefined; - } - - /** Parameters for an instant email finder request. */ - interface FindEmailParams { - /** Name of the person, e.g. `"Tony Stark"`. */ - name: string; - /** Domain or company name, e.g. `"marvel.com"` or `"Marvel Entertainment"`. */ - domain: string; - /** Overridable request timeout in milliseconds. */ - timeout?: number | undefined; - /** - * Whether email discovery may continue in the background after the - * request times out. Defaults to the service-level config. - */ - queue?: boolean | undefined; - } - - /** Parameters for a bulk email finder request. */ - interface BulkFindParams { - /** Absolute path to the file containing the people/domains to upload. */ - file: string; - /** Whether to allow a duplicate file upload. Defaults to the service-level config. */ - ignore_duplicate_file?: BooleanString | undefined; - } - - /** Parameters that reference a bulk list by id. */ - interface ListIdParams { - /** Id of the bulk list. */ - list_id: string; - } - - /** Parameters for removing a bulk list. */ - interface RemoveListParams { - /** Id of the bulk list to remove. */ - list_id: string; - /** - * Ignore the result file even if it has not been downloaded. Defaults - * to the service-level config. - */ - ignore_result?: boolean | undefined; - } - - /** Parameters for querying an instant email finder queue. */ - interface QueueStatusParams { - /** Queue id received from an instant email finder response. */ - qid: string; - } - - /** Additional details about an instant verification result. */ - interface VerifySubStatus { - /** Numeric sub-status code. */ - code: number; - /** Human-readable sub-status description. */ - desc: string; - } - - /** Parsed components of the verified email address. */ - interface VerifyDetailInfo { - /** Local part (account) of the email address. */ - account: string; - /** Domain part of the email address. */ - domain: string; - } - - /** Result of an instant email verification. */ - interface InstantVerifyResult { - /** The verified email address. */ - email_address: string; - /** Whether the address is safe to send to. */ - safe_to_send: SafeToSend; - /** Deliverability status, e.g. `"valid"`, `"invalid"`, `"unknown"`. */ - status: string; - /** ISO timestamp of when the address was verified. */ - verified_on: string; - /** Time taken to verify, in milliseconds. */ - time_taken: number; - /** Additional status detail. */ - sub_status: VerifySubStatus; - /** Parsed components of the email address. */ - detail_info: VerifyDetailInfo; - /** Blacklists the address or its domain was found on, if any. */ - blacklist_info?: string[] | undefined; - /** Whether the address is disposable/temporary. */ - disposable: YesNo; - /** Whether the address belongs to a free email provider. */ - free: YesNo; - /** Whether the address is a role/group account. */ - role: YesNo; - /** Whether the address looks gibberish. */ - gibberish: YesNo; - /** A corrected address when a typo is detected. */ - suggested_email_address?: string | undefined; - /** Reserved for profile information. */ - profile?: string | null | undefined; - /** Confidence score. */ - score?: number | undefined; - /** Bounce classification, when available. */ - bounce_type?: string | undefined; - } - - /** Result of a catch-all check. */ - interface CatchAllResult { - email_address: string; - catchall: YesNo; - verified_on: string; - time_taken: number; - } - - /** Result of a disposable-address check. */ - interface DisposableResult { - email_address: string; - disposable: YesNo; - verified_on: string; - time_taken: number; - } - - /** Result of a business-account check. */ - interface BusinessResult { - email_address: string; - business_account: YesNo; - verified_on: string; - time_taken: number; - } - - /** Result of a free-account check. */ - interface FreeResult { - email_address: string; - free_account: YesNo; - verified_on: string; - time_taken: number; - } - - /** Result of a role-account check. */ - interface RoleResult { - email_address: string; - role_account: YesNo; - verified_on: string; - time_taken: number; - } - - /** Result of a gibberish-account check. */ - interface GibberishResult { - email_address: string; - gibberish: YesNo; - verified_on: string; - time_taken: number; - } - - /** Result of a bulk verify/find submission. */ - interface BulkListResult { - /** Id of the created bulk list. */ - list_id: string; - } - - /** Progress status of a running bulk verify list. */ - interface BulkVerifyProgressStatus { - /** Progress stage, e.g. `"running"` or `"completed"`. */ - progress_status: string; - /** Completion percentage. */ - percentile?: number | undefined; - } - - /** Progress status of a running bulk finder list. */ - interface BulkFinderProgressStatus { - /** Progress stage, e.g. `"running"` or `"completed"`. */ - progress_status: string; - /** Completion percentage. */ - percentage?: number | undefined; - } - - /** Result of a bulk result-download request. */ - interface DownloadResult { - /** Signed URL to download the result file. */ - url: string; - } - - /** Result of a bulk list removal / cancellation. */ - interface ListActionResult { - /** Id of the affected list, when returned. */ - list_id?: string | undefined; - /** Name of the uploaded file. */ - name: string; - /** Source of the list, e.g. `"upload"`. */ - source?: string | undefined; - /** ISO timestamp of when the list was created. */ - created_on?: string | undefined; - } - - /** A single email discovered by the email finder. */ - interface FoundEmail { - /** The discovered email address. */ - email_address: string; - /** Whether the address is a role/group account. */ - role: string; - /** Whether the address is a business address. */ - business: string; - } - - /** Company details attached to an email finder result. */ - interface FinderCompany { - /** Company name. */ - name: string; - } - - /** Result of a completed instant email finder request. */ - interface EmailFinderResult { - /** Discovered email addresses, ordered by confidence. */ - emails: FoundEmail[]; - /** First name of the person. */ - first_name: string; - /** Last name of the person. */ - last_name: string; - /** Full name of the person. */ - full_name: string; - /** Domain searched. */ - domain: string; - /** Confidence score of the top match (0-100). */ - confidence_score: number; - /** Number of addresses discovered. */ - total: number; - /** Company details. */ - company: FinderCompany; - /** ISO timestamp of when the address was found. */ - found_on: string; - /** Queue status, when the result is fetched via `getStatus`. */ - query_status?: string | undefined; - } - - /** - * Progress-only payload returned by {@link EmailFinder.getStatus} while - * the queued finder request has not completed yet. - */ - interface EmailFinderQueueStatus { - /** Current status of the queued finder request. */ - query_status: string; - } - - /** - * Result of a queue-status lookup: the discovered emails once the request - * completes, or a progress-only payload while it is still queued. - */ - type EmailFinderStatusResult = EmailFinderResult | EmailFinderQueueStatus; - - /** Available credits and quota details for the account. */ - interface CreditsResult { - /** Total available credits. */ - available_credits: number; - /** Detailed credit breakdown. */ - credits: { - /** Currently available credits. */ - available: number; - /** Subscription details, if any. */ - subs: string | null; - /** Remaining daily verify limit, if any. */ - available_daily_verify_limit: string | null; - /** When the daily verify limit resets, if any. */ - reset_daily_verify_limit_date: string | null; - /** Total credits. */ - total: number; - }; - /** Threshold at which a low-credit balance is flagged. */ - low_credit_balance_min_threshold: number; - } - - /** Email verification service, exposed as `clearout.emailVerifier`. */ - interface EmailVerifier { - /** Instantly verify a single email address. */ - verify(params: VerifyEmailParams): Promise; - /** Verify email addresses in bulk by uploading a file. */ - bulkVerify(params: BulkVerifyParams): Promise; - /** Get the progress status of a bulk verify request. */ - getBulkVerifyProgressStatus(params: ListIdParams): Promise; - /** Get the signed download URL for a completed bulk verify result. */ - downloadBulkVerifyResult(params: ListIdParams): Promise; - /** Remove a bulk verify list. */ - removeBulkVerifyList(params: RemoveListParams): Promise; - /** Cancel a running bulk verify list. */ - cancelBulkVerifyList(params: ListIdParams): Promise; - /** Check whether an address belongs to a catch-all domain. */ - isCatchAllEmail(params: VerifyEmailParams): Promise; - /** Check whether an address is disposable/temporary. */ - isDisposableEmail(params: VerifyEmailParams): Promise; - /** Check whether an address belongs to a business account. */ - isBusinessEmail(params: VerifyEmailParams): Promise; - /** Check whether an address belongs to a free email provider. */ - isFreeEmail(params: VerifyEmailParams): Promise; - /** Check whether an address is a role/group account. */ - isRoleEmail(params: VerifyEmailParams): Promise; - /** Check whether an address looks gibberish. */ - isGibberishEmail(params: VerifyEmailParams): Promise; - } - - /** Email finder service, exposed as `clearout.emailFinder`. */ - interface EmailFinder { - /** Instantly discover a person's email address. */ - find(params: FindEmailParams): Promise; - /** Get the status of a queued instant email finder request. */ - getStatus(params: QueueStatusParams): Promise; - /** Discover email addresses in bulk by uploading a file. */ - bulkFind(params: BulkFindParams): Promise; - /** Get the progress status of a bulk find request. */ - getBulkFindProgressStatus(params: ListIdParams): Promise; - /** Get the signed download URL for a completed bulk find result. */ - downloadBulkFindResult(params: ListIdParams): Promise; - /** Remove a bulk find list. */ - removeBulkFindList(params: RemoveListParams): Promise; - /** Cancel a running bulk find list. */ - cancelBulkFinderList(params: ListIdParams): Promise; - } - - /** A configured Clearout client instance. */ - interface ClearoutClient { - /** Email verification service. */ - emailVerifier: EmailVerifier; - /** Email finder service. */ - emailFinder: EmailFinder; - /** Get the account's available credits. */ - getCredits(): Promise; - } - - /** - * The module export. Call it as a function or with `new` to create a - * {@link ClearoutClient}. - */ - interface ClearoutStatic { - /** - * Create a client instance. - * @param token Clearout server-app API token. - * @param config Optional service-level configuration. - */ - (token: string, config?: ClearoutConfig): ClearoutClient; - /** - * Create a client instance. - * @param token Clearout server-app API token. - * @param config Optional service-level configuration. - */ - new(token: string, config?: ClearoutConfig): ClearoutClient; - /** Self-reference exposed for interop with ES-module default imports. */ - default: ClearoutStatic; - } -} - -export = Clearout; diff --git a/types/clearoutio__clearout/package.json b/types/clearoutio__clearout/package.json deleted file mode 100644 index a25b3d084c23a2..00000000000000 --- a/types/clearoutio__clearout/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "private": true, - "name": "@types/clearoutio__clearout", - "version": "1.1.9999", - "projects": [ - "https://github.com/clearoutio/clearout-node" - ], - "devDependencies": { - "@types/clearoutio__clearout": "workspace:." - }, - "owners": [ - { - "name": "Usman S.", - "githubUsername": "max-programming" - } - ] -} diff --git a/types/clearoutio__clearout/tsconfig.json b/types/clearoutio__clearout/tsconfig.json deleted file mode 100644 index 241407cd98bb97..00000000000000 --- a/types/clearoutio__clearout/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "lib": [ - "es6" - ], - "module": "node16", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "clearoutio__clearout-tests.ts" - ] -} From df2b717c818ca71290a6e2db0b84af1d32c29642 Mon Sep 17 00:00:00 2001 From: Elizabeth Samuel Date: Fri, 31 Jul 2026 13:38:08 -0700 Subject: [PATCH 18/26] =?UTF-8?q?[office-js]=20[office-js-preview]=20(Acce?= =?UTF-8?q?ss)=20Ensure=20that=20deprecation=20warn=E2=80=A6=20(#75336)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/office-js-preview/index.d.ts | 2 +- types/office-js/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index c37967c03de82e..b4c5cf86b01644 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -910,7 +910,7 @@ declare namespace Office { */ Project, /** - * The Office application is Microsoft Access. + * The Office application is Microsoft Access. Warning: Microsoft Access is no longer supported. * * @deprecated Microsoft Access is no longer supported. */ diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 5e361b9f913730..6fd0bd20984cf7 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -910,7 +910,7 @@ declare namespace Office { */ Project, /** - * The Office application is Microsoft Access. + * The Office application is Microsoft Access. Warning: Microsoft Access is no longer supported. * * @deprecated Microsoft Access is no longer supported. */ From d939d775fdee3ab6c8af2a2d1ced8646c90ad579 Mon Sep 17 00:00:00 2001 From: Spenser Bushey Date: Fri, 31 Jul 2026 14:04:48 -0700 Subject: [PATCH 19/26] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75301=20Remo?= =?UTF-8?q?ve=20types=20for=20@commerce7/admin-ui=20by=20@Weldawadyathink?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- notNeededPackages.json | 4 + types/commerce7__admin-ui/.npmignore | 5 - .../commerce7__admin-ui-tests.tsx | 530 ------------ types/commerce7__admin-ui/index.d.ts | 771 ------------------ types/commerce7__admin-ui/package.json | 21 - types/commerce7__admin-ui/tsconfig.json | 21 - 6 files changed, 4 insertions(+), 1348 deletions(-) delete mode 100644 types/commerce7__admin-ui/.npmignore delete mode 100644 types/commerce7__admin-ui/commerce7__admin-ui-tests.tsx delete mode 100644 types/commerce7__admin-ui/index.d.ts delete mode 100644 types/commerce7__admin-ui/package.json delete mode 100644 types/commerce7__admin-ui/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 07ac0866803e67..3a50108de666a4 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1140,6 +1140,10 @@ "libraryName": "comment-json", "asOfVersion": "2.4.1" }, + "commerce7__admin-ui": { + "libraryName": "@commerce7/admin-ui", + "asOfVersion": "2.0.47" + }, "commitlint__load": { "libraryName": "@commitlint/load", "asOfVersion": "9.0.0" diff --git a/types/commerce7__admin-ui/.npmignore b/types/commerce7__admin-ui/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/commerce7__admin-ui/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/commerce7__admin-ui/commerce7__admin-ui-tests.tsx b/types/commerce7__admin-ui/commerce7__admin-ui-tests.tsx deleted file mode 100644 index a77cd4763aa296..00000000000000 --- a/types/commerce7__admin-ui/commerce7__admin-ui-tests.tsx +++ /dev/null @@ -1,530 +0,0 @@ -import { - Alert, - Avatar, - Breadcrumbs, - Button, - ButtonMenu, - Card, - CardLink, - Checkbox, - Columns, - Commerce7AdminUI, - ContextMenu, - DataDisplay, - DatePicker, - DisplayIcon, - Heading, - Icon, - InfoCard, - Input, - Legend, - LineBreak, - LinkButton, - Modal, - Nav, - NoRecords, - Picture, - PieChart, - ProgressBar, - Radio, - RadioGroup, - Region, - Select, - SelectButton, - Spinner, - Stepper, - SubMenu, - Switch, - Table, - Tabs, - Tag, - Text, - Textarea, - VividIcon, -} from "@commerce7/admin-ui"; -import * as React from "react"; - -const { Breadcrumb } = Breadcrumbs; -const { Column } = Columns; -const { InfoCardGrid } = InfoCard; -const { ModalBody, ModalFooter } = Modal; -const { ButtonMenuItem } = ButtonMenu; -const { ContextMenuItem, ContextMenuMoreActions } = ContextMenu; -const { SubNav, NavLink, SubNavLink } = Nav; -const { Step } = Stepper; -const { SubMenuItem } = SubMenu; -const { Tab, TabBody } = Tabs; -const { Thead, Tbody, Th, Td, Tr, Tfoot } = Table; - -// Test components are the first sample code from https://admin-ui-docs.commerce7.com -export function TestComponent() { - const [visible, setVisible] = React.useState(false); - const openModal = () => { - setVisible(true); - }; - const closeModal = () => { - setVisible(false); - }; - - const [currentPath, setPath] = React.useState("/dashboard"); - - const path = currentPath.split("/")[1]; - const heading = path.charAt(0).toUpperCase() + path.slice(1); - - const [checked, setChecked] = React.useState(false); - - const [date, setDate] = React.useState(); - - const [radioChecked, setRadioChecked] = React.useState(""); - - const [selectValue, setSelectValue] = React.useState(""); - - const [switched, setSwitched] = React.useState(false); - - const [textAreaValue, setTextAreaValue] = React.useState(""); - - return ( - - This is an alert - - - - - Settings - Departments - Edit - - - - - John Smith - - - "What did the grape say when the elephant stood on it? Nothing, it just let out a little wine." - - - - - - - - - - - - - - - - - - - - - - - - - Are you sure you want to proceed? - - - - - - - - - - - - - - - - Region with border below - - - Another region - - - - - Default - Info - Warning - Error - Success - - - - - - Export - - - Delete - - - - - - Export - - - - - - Export - - - - Delete - - - - - Button - - Basic - Loading - Can't touch this - - - View and manage general settings - - - View and manage staff - - - - - - - - setPath("/configure")} - className={currentPath === "/configure" ? "active" : ""} - icon="setting" - /> - setPath("/items")} - className={currentPath === "/items" ? "active" : ""} - icon="wine" - /> - setPath("/members")} - className={currentPath === "/members" ? "active" : ""} - icon="user" - /> - setPath("/inventory")} - className={currentPath === "/inventory" ? "active" : ""} - icon="inventory" - /> - - - - setPath("/customer")} - className={currentPath === "/customer" ? "active" : ""} - > - Customer - - setPath("/order")} className={currentPath === "/order" ? "active" : ""}> - Order - - setPath("/reservation")} - className={currentPath === "/reservation" ? "active" : ""} - > - Reservation - - - - - setPath("/summary")} className={currentPath === "/summary" ? "active" : ""}> - Summary - - setPath("/customers")} className={currentPath === "/customers" ? "active" : ""}> - Customers - - setPath("/products")} - className={currentPath === "/products" ? "bananas" : ""} - activeClassName="bananas" - > - Products - - - - {heading} - - - setChecked(!checked)} />; - - Jim Smith - - setDate(e)} /> - - - setRadioChecked(e.target.value)} - /> - setRadioChecked(e.target.value)} - /> - - -