diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index bfa457a490c61a..0b829dbf0554a9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1056,7 +1056,7 @@ /types/connect-history-api-fallback-exclusions/ @tonystonee /types/connect-livereload/ @SomaticIT /types/connect-memcached/ @danielb7390 -/types/connect-mongodb-session/ @NattapongSiri @HoldYourWaffle +/types/connect-mongodb-session/ @NattapongSiri /types/connect-pg-simple/ @pasieronen @samarmohan /types/connect-redis/ @xstoudi @sbutler2901 @JipSterk /types/connect-route/ @cthompson92 @@ -1383,6 +1383,7 @@ /types/dagre/ @qinfchen @vilterp @rustedgrail @GrahamLea /types/dagre-d3/ @simmonmt @markwongsk /types/dagre-layout/ @qinfchen @vilterp +/types/dailymotion__vast-client/ @connorfitzgerald-sa /types/damerau-levenshtein/ @g3ru1a /types/danish-ssn/ @yuriyg86 /types/dashdash/ @adamvoss @peterblazejewicz @@ -2185,7 +2186,6 @@ /types/float-regex/ @wanganjun /types/floreal/ @mlc /types/flot/ @burlandm @Anticom @admiralsmaster -/types/flowdoc/ @animify /types/flowjs/ @martinnuc /types/flowjs__flow.js/ @gentoo90 /types/floyd-steinberg/ @tajnymag @@ -4906,7 +4906,6 @@ /types/minimist/ @Bartvds @Necroskillz @kamranayub @peterblazejewicz /types/miniprogram/ @rockSandy @LynneXu @xdoer /types/miniprogram-wxs/ @NewFuture @wechat-miniprogram-admin -/types/minizlib/ @nokel81 /types/mirrorx/ @aaronphy /types/mithril/ @spacejack @dead-claudia /types/mithril-global/ @spacejack @dead-claudia @@ -5178,7 +5177,7 @@ /types/noble/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko @claytonkucera /types/noble-mac/ @swook @shantanubhadoria @lukel99 @bioball @keton @thegecko /types/nodal/ @charrondev -/types/node/ @Microsoft @jkomyno @alvis @r3nya @btoueg @smac89 @touffy @DeividasBakanas @eyqs @Hannes-Magnusson-CK @hoo29 @kjin @ajafff @islishude @mwiktorczyk @mohsen1 @galkin @parambirs @eps1lon @ThomasdenH @WilcoBakker @wwwy3y3 @samuela @kuehlein @bhongy @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @NodeJS @LinusU @wafuwafu13 @mcollina @Semigradsky +/types/node/ @Microsoft @jkomyno @alvis @r3nya @btoueg @smac89 @touffy @DeividasBakanas @eyqs @Hannes-Magnusson-CK @hoo29 @kjin @ajafff @islishude @mwiktorczyk @mohsen1 @galkin @parambirs @eps1lon @ThomasdenH @WilcoBakker @wwwy3y3 @samuela @kuehlein @bhongy @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @NodeJS @LinusU @wafuwafu13 @mcollina @Semigradsky @Renegade334 /types/node/v18/ @Microsoft @jkomyno @alvis @r3nya @btoueg @smac89 @touffy @DeividasBakanas @eyqs @Hannes-Magnusson-CK @hoo29 @kjin @ajafff @islishude @mwiktorczyk @mohsen1 @galkin @parambirs @eps1lon @SimonSchick @ThomasdenH @WilcoBakker @wwwy3y3 @samuela @kuehlein @bhongy @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @NodeJS @LinusU @wafuwafu13 @mcollina @Semigradsky /types/node/v20/ @Microsoft @jkomyno @alvis @r3nya @btoueg @smac89 @touffy @DeividasBakanas @eyqs @Hannes-Magnusson-CK @hoo29 @kjin @ajafff @islishude @mwiktorczyk @mohsen1 @galkin @parambirs @eps1lon @ThomasdenH @WilcoBakker @wwwy3y3 @samuela @kuehlein @bhongy @chyzwar @trivikr @yoursunny @qwelias @ExE-Boss @peterblazejewicz @addaleax @victorperin @NodeJS @LinusU @wafuwafu13 @mcollina @Semigradsky /types/node-7z/ @erkie @colin969 @@ -5578,7 +5577,6 @@ /types/parse-mockdb/ @dpoetzsch /types/parse-multipart/ @pharrukh /types/parse-node-version/ @niksy -/types/parse-numeric-range/ @eoin-obrien /types/parse-package-name/ @fa93hws /types/parse-passwd/ @BendingBender /types/parse-path/ @ffflorian @@ -6567,7 +6565,6 @@ /types/react-onclickoutside/ @LKay @surgeboris @NilSet /types/react-onclickoutside/v5/ @LKay /types/react-onsenui/ @salim7 @jemmyw @uztbt @LaBlazer -/types/react-otp-input/ @anupbui /types/react-outside-click-handler/ @zubivan @JadowityHerbatnik @domdomegg /types/react-page-visibility/ @dannycochran /types/react-paginate/ @deevus @wouterhardeman @pegel03 @archy-bold @yasupeke @sugarshin @SPWizard01 @kevinrambaud @@ -7600,6 +7597,7 @@ /types/stream-array/ @Tyler-Murphy /types/stream-buffers/ @Jason3S /types/stream-chain/ @uhop +/types/stream-concat/ @tpluscode /types/stream-counter/ @MasterOdin /types/stream-csv-as-json/ @uhop /types/stream-demux/ @DanielRose @Methuselah96 @@ -8164,7 +8162,6 @@ /types/url-search-params/ @nick121212 @nrathi /types/url-slugify/ @tpluscode /types/url-state/ @tpluscode -/types/url-template/ @marcinporebski /types/urlparser/ @OpenByteDev /types/urlrouter/ @soywiz /types/urlsafe-base64/ @tkrotoff diff --git a/notNeededPackages.json b/notNeededPackages.json index cc30364015935b..346ae17ddc74b9 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -4205,6 +4205,10 @@ "libraryName": "minipass", "asOfVersion": "3.3.5" }, + "minizlib": { + "libraryName": "minizlib", + "asOfVersion": "3.0.0" + }, "mkdirp": { "libraryName": "mkdirp", "asOfVersion": "2.0.0" @@ -5979,6 +5983,10 @@ "libraryName": "react-notifications-component", "asOfVersion": "3.2.0" }, + "react-otp-input": { + "libraryName": "react-otp-input", + "asOfVersion": "2.3.0" + }, "react-overlays": { "libraryName": "react-overlays", "asOfVersion": "3.1.0" @@ -7375,6 +7383,10 @@ "libraryName": "url-regex", "asOfVersion": "5.0.0" }, + "url-template": { + "libraryName": "url-template", + "asOfVersion": "3.0.0" + }, "urlencode": { "libraryName": "urlencode", "asOfVersion": "2.0.0" diff --git a/types/minizlib/.npmignore b/types/dailymotion__vast-client/.npmignore similarity index 100% rename from types/minizlib/.npmignore rename to types/dailymotion__vast-client/.npmignore diff --git a/types/dailymotion__vast-client/dailymotion__vast-client-tests.ts b/types/dailymotion__vast-client/dailymotion__vast-client-tests.ts new file mode 100644 index 00000000000000..01aaf46e5dc28d --- /dev/null +++ b/types/dailymotion__vast-client/dailymotion__vast-client-tests.ts @@ -0,0 +1,553 @@ +import { + Ad, + CompanionAd, + Creative, + CreativeCompanion, + CreativeLinear, + CreativeNonLinear, + Macros, + parseDuration, + Storage, + VASTClient, + VastParseEvent, + VASTParser, + VastResponse, + VASTTracker, +} from "@dailymotion/vast-client"; + +const domParser = new DOMParser(); + +const isLinearCreative = (creative: Creative): creative is CreativeLinear => true; +const isNonLinearCreative = ( + creative: Creative, +): creative is CreativeNonLinear => true; +const isCompanion = (creative: Creative): creative is CreativeCompanion => true; + +const url = "https://test.com"; + +const clientTests = async () => { + class TestStorage extends Storage {} + + // With default values + const vastClient = new VASTClient(); + + // With cappingFreeLunch + new VASTClient(2); + + // With cappingMinimumTimeInterval + new VASTClient(0, 2000); + + // With customStorage + new VASTClient(0, 0, new TestStorage()); + + const vast = await vastClient.get(url, { + timeout: 10, + }); + + for (const ad of vast.ads) { + for (const creative of ad.creatives) { + if (isLinearCreative(creative)) { + creative.mediaFiles[0].apiFramework; + } else if (isNonLinearCreative(creative)) { + creative.variations[0].apiFramework; + } else if (isCompanion(creative)) { + creative.type; + } + } + } + + const doc = domParser.parseFromString("", "text/xml"); + + const parsedVast = await vastClient.parseVAST(doc, { + urlHandler: { + get: async (url, opts) => ({ + xml: doc, + }), + }, + }); + + parsedVast.ads; + + vastClient.hasRemainingAds() === true; + (await vastClient.getNextAds()).ads; + vastClient.getParser().on("VAST-ad-parsed", () => {}); + vastClient.addURLTemplateFilter((url) => url); + vastClient.removeLastURLTemplateFilter(); + vastClient.countURLTemplateFilters() === 1; + vastClient.clearURLTemplateFilters(); +}; + +const vastParserTests = async () => { + const parser = new VASTParser(); + + parser.on("VAST-error", ({ maxWrapperDepth }) => {}); + parser.on("VAST-warning", ({ ERRORCODE }) => {}); + parser.on("VAST-resolving", ({ ERRORMESSAGE }) => {}); + parser.on("VAST-resolved", ({ parentElement }) => {}); + parser.on("VAST-ad-parsed", ({ message }) => {}); + + parser.trackVastError( + [ + { + id: null, + url, + }, + ], + { + anyObj: true, + }, + { + anyObj: true, + }, + { + anyObj: true, + }, + ); + + await parser.fetchVAST(url); + await parser.fetchVAST(url, 1); + await parser.fetchVAST(url, 1, url); + const fetchedVast = await parser.fetchVAST(url, 1, url, {} as Ad); + fetchedVast.replace("", ""); + + await parser.parseVAST( + domParser.parseFromString("", "text/xml"), + ); + const parsedVast = await parser.parseVAST( + domParser.parseFromString("", "text/xml"), + { + allowMultipleAds: false, + }, + ); + parsedVast.ads; + + parser.getEstimatedBitrate() === 5; +}; + +const vastTrackerTests = async () => { + const client = new VASTClient(); + const ad = {} as Ad; + const creative = {} as Creative; + const variation = {} as CompanionAd; + + // With a client instance + new VASTTracker(client, ad, creative); + // For a companion ad + new VASTTracker(client, ad, creative, variation); + // With the initial muted state + new VASTTracker(client, ad, creative, null, false); + + // Without a client instance + const vastTracker = new VASTTracker(null, ad, creative); + + const macros: Macros = { + test: "123", + }; + + vastTracker.error(); + vastTracker.error(macros); + vastTracker.error(macros, false); + + vastTracker.load(); + vastTracker.load(macros); + + vastTracker.complete(); + vastTracker.complete(macros); + + vastTracker.click(); + vastTracker.click(url); + vastTracker.click(url, macros); + + vastTracker.close(); + vastTracker.close(macros); + + vastTracker.skip(); + vastTracker.skip(macros); + + vastTracker.setDuration(5); + + vastTracker.setExpand(true); + + vastTracker.setFullscreen(true); + + vastTracker.setMuted(true); + + vastTracker.setPaused(true); + + vastTracker.setProgress(5); + vastTracker.setProgress(5, macros); + vastTracker.setProgress(5, macros, true); + + vastTracker.setSkipDelay(5); + + vastTracker.trackImpression(); + vastTracker.trackImpression(macros); + + vastTracker.trackViewableImpression(); + vastTracker.trackViewableImpression(macros); + + vastTracker.trackNotViewableImpression(); + vastTracker.trackNotViewableImpression(macros); + + vastTracker.trackUndeterminedImpression(); + vastTracker.trackUndeterminedImpression(macros); + + vastTracker.notUsed(); + vastTracker.notUsed(macros); + + vastTracker.otherAdInteraction(); + vastTracker.otherAdInteraction(macros); + + vastTracker.acceptInvitation(); + vastTracker.acceptInvitation(macros); + + vastTracker.adExpand(); + vastTracker.adExpand(macros); + + vastTracker.adCollapse(); + vastTracker.adCollapse(macros); + + vastTracker.minimize(); + vastTracker.minimize(macros); + + vastTracker.convertToTimecode(5); + + vastTracker.overlayViewDuration("00:00:00"); + vastTracker.overlayViewDuration("00:00:00", macros); + + vastTracker.verificationNotExecuted(); + vastTracker.verificationNotExecuted(macros); + + vastTracker.track("impression"); + vastTracker.track("impression", macros); + vastTracker.track("impression", macros, true); +}; + +const vastResponseTests = () => { + const vastTest: VastResponse = { + ads: [ + { + id: null, + sequence: null, + adType: null, + adServingId: null, + categories: [], + expires: null, + viewableImpression: [], + system: { + value: "string", + version: "string", + }, + title: "string", + description: "string", + advertiser: null, + pricing: null, + survey: null, + errorURLTemplates: [ + "url", + ], + impressionURLTemplates: [ + { + id: "string", + url: "url", + }, + ], + creatives: [ + { + id: "string", + adId: null, + sequence: null, + apiFramework: null, + type: "string", + duration: 30, + skipDelay: -1, + mediaFiles: [ + { + id: "string", + fileURL: "url", + fileSize: 0, + deliveryType: "string", + mimeType: "string", + mediaType: "string", + codec: "string", + bitrate: 177, + minBitrate: 0, + maxBitrate: 0, + width: 640, + height: 360, + apiFramework: "string", + scalable: null, + maintainAspectRatio: null, + }, + ], + mezzanine: null, + interactiveCreativeFile: null, + closedCaptionFiles: [], + videoClickThroughURLTemplate: { + id: "string", + url: "url", + }, + videoClickTrackingURLTemplates: [ + { + id: "string", + url: "url", + }, + ], + videoCustomClickURLTemplates: [ + { + id: "string", + url: "url", + }, + ], + adParameters: null, + icons: [], + trackingEvents: { + acceptInvitationLinear: [ + "url", + ], + closeLinear: [ + "url", + ], + complete: [ + "url", + ], + creativeView: [ + "url", + ], + exitFullscreen: [ + "url", + ], + firstQuartile: [ + "url", + ], + fullscreen: [ + "url", + ], + midpoint: [ + "url", + ], + mute: [ + "url", + ], + pause: [ + "url", + ], + resume: [ + "url", + ], + rewind: [ + "url", + ], + start: [ + "url", + ], + thirdQuartile: [ + "url", + ], + unmute: [ + "url", + ], + }, + universalAdIds: [], + }, + ], + extensions: [], + adVerifications: [], + blockedAdCategories: [], + followAdditionalWrappers: true, + allowMultipleAds: false, + fallbackOnNoAd: null, + }, + ], + errorURLTemplates: [], + version: "string", + }; + + const vpaidTest: VastResponse = { + ads: [ + { + id: "id", + sequence: null, + adType: null, + adServingId: null, + categories: [], + expires: null, + viewableImpression: [], + system: { + value: "string", + version: null, + }, + title: "string", + description: "string", + advertiser: null, + pricing: null, + survey: null, + errorURLTemplates: ["url"], + impressionURLTemplates: [ + { + id: null, + url: "string", + }, + { + id: "id", + url: "string", + }, + { + id: null, + url: "string", + }, + { + id: null, + url: "string", + }, + ], + creatives: [ + { + id: null, + adId: null, + sequence: null, + apiFramework: null, + type: "string", + duration: 15, + skipDelay: -1, + mediaFiles: [ + { + id: "id", + fileURL: "url", + fileSize: 0, + deliveryType: "string", + mimeType: "string", + mediaType: "string", + codec: "", + bitrate: 0, + minBitrate: 0, + maxBitrate: 0, + width: 1422, + height: 800, + apiFramework: "string", + scalable: null, + maintainAspectRatio: null, + }, + ], + mezzanine: null, + interactiveCreativeFile: null, + closedCaptionFiles: [], + videoClickThroughURLTemplate: { + id: null, + url: "string", + }, + videoClickTrackingURLTemplates: [ + { + id: null, + url: "string", + }, + { + id: null, + url: "string", + }, + { + id: null, + url: "string", + }, + ], + videoCustomClickURLTemplates: [], + adParameters: { + value: "string", + xmlEncoded: null, + }, + icons: [], + trackingEvents: { + creativeView: ["url", "string"], + start: ["url", "string", "string"], + firstQuartile: ["url", "string", "string"], + midpoint: ["url", "string", "string"], + thirdQuartile: ["url", "string", "string"], + complete: ["url", "string", "string"], + mute: ["url", "string", "string"], + unmute: ["url", "string", "string"], + pause: ["url", "string"], + fullscreen: ["url", "string"], + rewind: ["url", "string"], + resume: ["url", "string"], + expand: ["url", "string"], + collapse: ["url", "string"], + acceptInvitation: ["url;"], + close: ["url", "string"], + skip: ["string"], + }, + universalAdIds: [], + }, + ], + extensions: [ + { + name: "string", + value: null, + attributes: { + type: "string", + }, + children: [ + { + name: "string", + value: null, + attributes: {}, + children: [ + { + name: "string", + value: null, + attributes: { + vendor: "string", + }, + children: [ + { + name: "string", + value: "string", + attributes: { + apiFramework: "string", + browserOptional: "string", + }, + children: [], + }, + { + name: "string", + value: "string", + attributes: {}, + children: [], + }, + ], + }, + ], + }, + ], + }, + ], + adVerifications: [ + { + resource: "string", + vendor: "string", + browserOptional: true, + apiFramework: "string", + type: null, + parameters: "string", + trackingEvents: {}, + }, + ], + blockedAdCategories: [], + followAdditionalWrappers: true, + allowMultipleAds: false, + fallbackOnNoAd: null, + }, + ], + errorURLTemplates: [], + version: "string", + }; +}; + +const otherTests = async () => { + parseDuration("00:00:00") === 0; + + const storage = new Storage(); + storage.getItem("123"); + storage.setItem("123", "123"); + storage.removeItem("123"); + storage.clear(); +}; diff --git a/types/dailymotion__vast-client/index.d.ts b/types/dailymotion__vast-client/index.d.ts new file mode 100644 index 00000000000000..e10464522309fa --- /dev/null +++ b/types/dailymotion__vast-client/index.d.ts @@ -0,0 +1,432 @@ +/// + +import { EventEmitter } from "events"; + +export class VASTClient { + constructor( + cappingFreeLunch?: number, + cappingMinimumTimeInterval?: number, + customStorage?: Storage, + ); + + get(url: string, opts?: GetOptions): Promise; + parseVAST( + vastXml: Document, + opts?: ClientParseOptions, + ): Promise; + hasRemainingAds(): boolean; + getNextAds(): Promise; + getParser(): VASTParser; + addURLTemplateFilter(filter: URLTemplateFilter): void; + removeLastURLTemplateFilter(): void; + countURLTemplateFilters(): number; + clearURLTemplateFilters(): void; +} + +export class VASTParser extends EventEmitter { + on(type: VastParseEvent, listener: VastListener): this; + trackVastError( + urlTemplates: URLTemplate[], + errorCode: GenericObject, + ...data: GenericObject[] + ): void; + fetchVAST( + url: string, + wrapperDepth?: number, + previousUrl?: string, + wrapperAd?: Ad, + ): Promise; + parseVAST( + vastXml: Document, + opts?: ParserParseOptions, + ): Promise; + getEstimatedBitrate(): number; +} + +export function parseDuration(duration: string): number; + +export type GenericObject = Record; + +export class VASTTracker extends EventEmitter { + constructor( + client: VASTClient | null, + ad: Ad, + creative: Creative, + variation?: CompanionAd | NonLinearAd | null, + muted?: boolean, + ); + + error(macros?: Macros, isCustomCode?: boolean): void; + load(macros?: Macros): void; + complete(macros?: Macros): void; + click(fallbackClickThroughURL?: string, macros?: Macros): void; + close(macros?: Macros): void; + skip(macros?: Macros): void; + setDuration(duration: number): void; + setExpand(expanded: boolean, macros?: Macros): void; + setFullscreen(fullscreen: boolean, macros?: Macros): void; + setMuted(muted: boolean, macros?: Macros): void; + setPaused(paused: boolean, macros?: Macros): void; + setProgress(progress: number, macros?: Macros, trackOnce?: boolean): void; + setSkipDelay(delay: number): void; + trackImpression(macros?: Macros): void; + trackViewableImpression(macros?: Macros): void; + trackNotViewableImpression(macros?: Macros): void; + trackUndeterminedImpression(macros?: Macros): void; + notUsed(macros?: Macros): void; + otherAdInteraction(macros?: Macros): void; + acceptInvitation(macros?: Macros): void; + adExpand(macros?: Macros): void; + adCollapse(macros?: Macros): void; + minimize(macros?: Macros): void; + convertToTimecode(seconds: number): string; + overlayViewDuration(duration: string, macros?: Macros): void; + verificationNotExecuted(macros?: Macros): void; + track(eventName: string, macros?: Macros, once?: boolean): void; +} + +export class Storage { + getItem(key: string): string | undefined; + setItem(key: string, value: any): void; + removeItem(key: string): void; + clear(): void; +} + +export interface GetOptions { + timeout?: number; + withCredentials?: boolean; + wrapperLimit?: number; + urlHandler?: URLHandler; + resolveAll?: boolean; + allowMultipleAds?: boolean; + followAdditionalWrappers?: boolean; +} + +export interface ClientParseOptions { + timeout?: number; + withCredentials?: boolean; + wrapperLimit?: number; + urlHandler?: URLHandler; + allowMultipleAds?: boolean; + followAdditionalWrappers?: boolean; + requestDuration?: number; + byteLength?: number; +} + +export interface ParserParseOptions { + allowMultipleAds?: boolean; + byteLength?: number; + resolveAll?: boolean; +} + +export interface URLHandler { + get: (url: string, opts: URLHandlerOptions) => Promise; +} + +export interface URLHandlerOptions { + timeout?: number; + withCredentials?: boolean; +} + +export interface URLHandlerResponse { + error?: Error; + statusCode?: number; + xml?: Document; + details?: URLHandlerResponseDetails; +} + +export interface URLHandlerResponseDetails { + byteLength: number; + statusCode: number; + rawXml: string; +} + +export type Macros = Record; + +export type URLTemplateFilter = (url: string) => string; + +export type VastParseEvent = + | "VAST-error" + | "VAST-warning" + | "VAST-resolving" + | "VAST-resolved" + | "VAST-ad-parsed"; + +export interface VastResponse { + ads: Ad[]; + errorURLTemplates: string[]; + version: string; +} + +export interface Ad { + id: string | null; + sequence: number | null; + adType: string | null; + adServingId: string | null; + categories: Category[]; + expires: number | null; + viewableImpression: ViewableImpression[]; + system: AdSystem | null; + title: string | null; + description: string | null; + advertiser: string | null; + pricing: string | null; + survey: Survey | null; + errorURLTemplates: string[]; + impressionURLTemplates: URLTemplate[]; + creatives: Creative[]; + extensions: Extension[]; + adVerifications: AdVerification[]; + blockedAdCategories: BlockedAdCategories[]; + followAdditionalWrappers: boolean | null; + allowMultipleAds: boolean | null; + fallbackOnNoAd: boolean | null; +} + +export interface AdSystem { + value: string | null; + version: string | null; +} + +export interface URLTemplate { + id: string | null; + url: string; +} + +export interface CreativeBase { + id: string | null; + adId: string | null; + sequence: number | null; + apiFramework: string | null; + universalAdIds: UniversalAdId[]; + creativeExtensions?: Extension[]; +} + +export interface CreativeLinear extends CreativeBase { + type: string; + duration: number; + skipDelay: number | null; + mediaFiles: MediaFile[]; + mezzanine: Mezzanine | null; + interactiveCreativeFile: InteractiveCreativeFile | null; + closedCaptionFiles: ClosedCaptionFile[]; + videoClickThroughURLTemplate: URLTemplate | null; + videoClickTrackingURLTemplates: URLTemplate[]; + videoCustomClickURLTemplates: URLTemplate[]; + adParameters: AdParameters | null; + icons: Icon[]; + trackingEvents: TrackingEvents; +} + +export type TrackingEvents = Record; + +export interface CreativeNonLinear extends CreativeBase { + type: string; + variations: NonLinearAd[]; + trackingEvents: TrackingEvents; +} + +export interface CreativeCompanion extends CreativeBase { + type: string; + required: string | null; + variations: CompanionAd[]; +} + +export type Creative = CreativeLinear | CreativeNonLinear | CreativeCompanion; + +export interface MediaFile { + id: string | null; + fileURL: string | null; + deliveryType: string; + mimeType: string | null; + codec: string | null; + bitrate: number; + minBitrate: number; + maxBitrate: number; + width: number; + height: number; + fileSize: number | null; + mediaType: string | null; + apiFramework: string | null; + scalable: boolean | null; + maintainAspectRatio: boolean | null; +} + +export interface Mezzanine { + delivery: string; + type: string; + width: number; + height: number; + codec: string | null; + id: string | null; + fileSize: number | null; + mediaType: string | null; + fileURL: string | null; +} + +export interface InteractiveCreativeFile { + type: string | null; + apiFramework: string | null; + variableDuration: boolean | null; + fileURL: string | null; +} + +export interface ClosedCaptionFile { + type: string | null; + language: string | null; + fileURL: string | null; +} + +export interface NonLinearAd { + id: string | null; + width: number; + height: number; + expandedWidth: number; + expandedHeight: number; + scalable: boolean; + maintainAspectRatio: boolean; + minSuggestedDuration: number; + apiFramework: string; + type: string | null; + staticResource: string | null; + htmlResource: string | null; + iframeResource: string | null; + nonlinearClickThroughURLTemplate: URLTemplate | null; + nonlinearClickTrackingURLTemplates: URLTemplate[]; + adParameters: AdParameters | null; +} + +export interface CompanionAd { + id: string | null; + width: number; + height: number; + assetWidth: number | null; + assetHeight: number | null; + expandedWidth: number | null; + expandedHeight: number | null; + apiFramework: string | null; + adSlotId: string | null; + pxratio: string; + renderingMode: string; + staticResources: StaticResource[]; + htmlResources: string[]; + iframeResources: string[]; + altText: string | null; + companionClickThroughURLTemplate: URLTemplate | null; + companionClickTrackingURLTemplates: URLTemplate[]; + trackingEvents: TrackingEvents; + adParameters: AdParameters | null; +} + +export interface StaticResource { + url: string; + creativeType: string | null; +} + +export interface Icon { + program: string | null; + height: number; + width: number; + xPosition: number; + yPosition: number; + apiFramework: string | null; + offset: string | null; + duration: number; + type: string | null; + pxratio: string; + staticResource: string | null; + htmlResource: string | null; + iframeResource: string | null; + iconClickThroughURLTemplate: URLTemplate | null; + iconClickTrackingURLTemplates: URLTemplate[]; + iconViewTrackingURLTemplate: URLTemplate | null; + iconClickFallbackImages: IconClickFallbackImage[]; + altText: string | null; + hoverText: string | null; +} + +export interface Extension { + name: string | null; + value: string | null; + attributes: ExtensionAttributes; + children: Extension[]; +} + +export interface ExtensionAttributes { + type?: string | null; + vendor?: string | null; + apiFramework?: string | null; + browserOptional?: string | null; +} + +export interface UniversalAdId { + idRegistry: string; + idValue: string; +} + +export interface AdVerification { + apiFramework: string | null; + browserOptional: boolean; + resource: string | null; + vendor: string | null; + type: string | null; + parameters: string | null; + trackingEvents: TrackingEvents; +} + +export interface Category { + authority: string; + value: string; +} + +export interface ViewableImpression { + id: string | null; + viewable: string[]; + notViewable: string[]; + viewUndetermined: string[]; +} + +export interface BlockedAdCategories { + authority: string; + value: string; +} + +export interface AdParameters { + value: string; + xmlEncoded: string | null; +} + +export interface Survey { + value: string; + type: string | null; +} + +export interface IconClickFallbackImage { + url: string | null; + width: string | null; + height: string | null; +} + +export type VastListener = (values: EventValues) => void; + +export interface EventValues { + ERRORCODE?: number; + ERRORMESSAGE?: string; + extensions?: Extension[]; + system?: AdSystem; + message?: string; + parentElement?: string; + specVersion?: number; + url?: string; + previousUrl?: string; + wrapperDepth?: number; + maxWrapperDepth?: number; + timeout?: number; + wrapperAd?: Ad; + error?: Error; + duration?: number; + byteLength?: number; + statusCode?: number; + type?: string; + adIndex?: number; +} diff --git a/types/dailymotion__vast-client/package.json b/types/dailymotion__vast-client/package.json new file mode 100644 index 00000000000000..04511fcb2c1dfc --- /dev/null +++ b/types/dailymotion__vast-client/package.json @@ -0,0 +1,20 @@ +{ + "private": true, + "name": "@types/dailymotion__vast-client", + "version": "6.3.9999", + "projects": [ + "https://github.com/dailymotion/vast-client-js#readme" + ], + "devDependencies": { + "@types/dailymotion__vast-client": "workspace:." + }, + "dependencies": { + "@types/node": "*" + }, + "owners": [ + { + "name": "Connor Fitzgerald", + "githubUsername": "connorfitzgerald-sa" + } + ] +} diff --git a/types/react-otp-input/tsconfig.json b/types/dailymotion__vast-client/tsconfig.json similarity index 86% rename from types/react-otp-input/tsconfig.json rename to types/dailymotion__vast-client/tsconfig.json index a69d645fe87297..f61aff2f6ada9d 100644 --- a/types/react-otp-input/tsconfig.json +++ b/types/dailymotion__vast-client/tsconfig.json @@ -7,15 +7,14 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": true, "strictFunctionTypes": true, - "jsx": "react", + "strictNullChecks": true, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", - "react-otp-input-tests.tsx" + "dailymotion__vast-client-tests.ts" ] } diff --git a/types/minizlib/index.d.ts b/types/minizlib/index.d.ts deleted file mode 100644 index 6d9d690a9120fe..00000000000000 --- a/types/minizlib/index.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -/// - -// Import from dependencies -import MiniPass = require("minipass"); -import zlib = require("zlib"); - -// Exports only from typings -export { constants } from "zlib"; - -type BrotliMode = "BrotliCompress" | "BrotliDecompress"; -type ZlibMode = "Gzip" | "Gunzip" | "Deflate" | "Inflate" | "DeflateRaw" | "InflateRaw" | "Unzip"; - -interface MiniPassOptions extends Omit { - encoding?: BufferEncoding | "buffer" | null; -} - -interface ZlibBaseOptions extends MiniPassOptions { - flush?: number | undefined; - finishFlush?: number | undefined; -} - -declare class ZlibBase extends MiniPass { - readonly ended: boolean; - constructor(opts: ZlibBaseOptions & zlib.BrotliOptions, mode: BrotliMode); - constructor(opts: ZlibBaseOptions & zlib.ZlibOptions, mode: ZlibMode); - - close(): void; - reset(): void; - flush(flushFlag?: number): void; - - end(chunk: any, cb?: () => void): this; - end(chunk?: any, encoding?: string | null, cb?: () => void): this; - - write(chunk: any, cb?: () => void): boolean; - write(chunk?: any, encoding?: string | null, cb?: () => void): boolean; -} - -interface ZlibOptions extends ZlibBaseOptions { - level?: number | undefined; - strategy?: number | undefined; -} - -declare class Zlib extends ZlibBase { - constructor(opts: ZlibOptions & zlib.ZlibOptions, mode: ZlibMode); - - params(level?: number, strategy?: number): void; -} - -export class Deflate extends Zlib { - constructor(opts: ZlibOptions & zlib.ZlibOptions); -} - -export class Inflate extends Zlib { - constructor(opts: ZlibOptions & zlib.ZlibOptions); -} - -export class Gzip extends Zlib { - constructor(opts: ZlibOptions & zlib.ZlibOptions); -} - -export class Gunzip extends Zlib { - constructor(opts: ZlibOptions & zlib.ZlibOptions); -} - -export class DeflateRaw extends Zlib { - constructor(opts: ZlibOptions & zlib.ZlibOptions); -} - -export class InflateRaw extends Zlib { - constructor(opts: ZlibOptions & zlib.ZlibOptions); -} - -export class Unzip extends Zlib { - constructor(opts: ZlibOptions & zlib.ZlibOptions); -} - -declare class Brotli extends ZlibBase { - constructor(opts: ZlibOptions & zlib.BrotliOptions, mode: BrotliMode); -} - -export class BrotliCompress extends Brotli { - constructor(opts: ZlibOptions & zlib.BrotliOptions); -} - -export class BrotliDecompress extends Brotli { - constructor(opts: ZlibOptions & zlib.BrotliOptions); -} diff --git a/types/minizlib/minizlib-tests.ts b/types/minizlib/minizlib-tests.ts deleted file mode 100644 index ad08c150336f4b..00000000000000 --- a/types/minizlib/minizlib-tests.ts +++ /dev/null @@ -1,28 +0,0 @@ -import zlib = require("minizlib"); - -// $ExpectType BrotliCompress -new zlib.BrotliCompress({}); - -// $ExpectType BrotliDecompress -new zlib.BrotliDecompress({}); - -// $ExpectType Deflate -new zlib.Deflate({}); - -// $ExpectType Inflate -new zlib.Inflate({}); - -// $ExpectType Gzip -new zlib.Gzip({}); - -// $ExpectType Gunzip -new zlib.Gunzip({}); - -// $ExpectType DeflateRaw -new zlib.DeflateRaw({}); - -// $ExpectType InflateRaw -new zlib.InflateRaw({}); - -// $ExpectType Unzip -new zlib.Unzip({}); diff --git a/types/minizlib/package.json b/types/minizlib/package.json deleted file mode 100644 index 4f3b67c7316e37..00000000000000 --- a/types/minizlib/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "name": "@types/minizlib", - "version": "2.1.9999", - "projects": [ - "https://github.com/isaacs/minizlib" - ], - "dependencies": { - "@types/node": "*", - "minipass": "^3.3.5" - }, - "devDependencies": { - "@types/minizlib": "workspace:." - }, - "owners": [ - { - "name": "Sebastian Malton", - "githubUsername": "nokel81" - } - ] -} diff --git a/types/minizlib/tsconfig.json b/types/minizlib/tsconfig.json deleted file mode 100644 index 89b53c9ea50e63..00000000000000 --- a/types/minizlib/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "strictFunctionTypes": true - }, - "files": [ - "index.d.ts", - "minizlib-tests.ts" - ] -} diff --git a/types/node-red__registry/index.d.ts b/types/node-red__registry/index.d.ts index 298b27bd180c2b..c4623cab444f32 100644 --- a/types/node-red__registry/index.d.ts +++ b/types/node-red__registry/index.d.ts @@ -184,6 +184,7 @@ declare namespace registry { payload?: unknown | undefined; topic?: string | undefined; _msgid?: string | undefined; + [key: string]: unknown; } interface NodeMessageParts { diff --git a/types/node-red__registry/node-red__registry-tests.ts b/types/node-red__registry/node-red__registry-tests.ts index 4b26c54b4e1f4d..07e63585f31922 100644 --- a/types/node-red__registry/node-red__registry-tests.ts +++ b/types/node-red__registry/node-red__registry-tests.ts @@ -94,6 +94,14 @@ function registryTests() { topic: "topic", }); + // send messages with additional parameters + + send({ + payload: "payload", + foo: "bar", + test: { property: "example" }, + }); + // send messages to a subset of the outputs send([ diff --git a/types/node-red__util/node-red__util-tests.ts b/types/node-red__util/node-red__util-tests.ts index d653f5ca480ade..4d1b238c80a083 100644 --- a/types/node-red__util/node-red__util-tests.ts +++ b/types/node-red__util/node-red__util-tests.ts @@ -69,8 +69,6 @@ function utilTests(someNode: Node) { const msgClone = util.cloneMessage(msg); // $ExpectType string const msgKey = msgClone.key; - // @ts-expect-error - const msgWrongKey = msgClone.wrongKey; // $ExpectType boolean util.compareObjects({}, {}); diff --git a/types/node/test/tls.ts b/types/node/test/tls.ts index 9bfbe67421233c..067544eca18b13 100644 --- a/types/node/test/tls.ts +++ b/types/node/test/tls.ts @@ -71,6 +71,15 @@ import { tlsSocket.getPeerX509Certificate(); // $ExpectType X509Certificate | undefined tlsSocket.getX509Certificate(); // $ExpectType X509Certificate | undefined + + tlsSocket.setKeyCert({ + cert: fs.readFileSync("cert_filepath"), + key: fs.readFileSync("key_filepath"), + }); + tlsSocket.setKeyCert(createSecureContext({ + key: "NOT REALLY A KEY", + cert: "SOME CERTIFICATE", + })); } { diff --git a/types/node/tls.d.ts b/types/node/tls.d.ts index 2eada6e71262f1..252412160bb41b 100644 --- a/types/node/tls.d.ts +++ b/types/node/tls.d.ts @@ -398,6 +398,14 @@ declare module "tls" { }, callback: (err: Error | null) => void, ): undefined | boolean; + /** + * The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket. + * This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`. + * @since v22.5.0, v20.17.0 + * @param context An object containing at least `key` and `cert` properties from the {@link createSecureContext()} `options`, + * or a TLS context object created with {@link createSecureContext()} itself. + */ + setKeyCert(context: SecureContextOptions | SecureContext): void; /** * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. * Returns `true` if setting the limit succeeded; `false` otherwise. diff --git a/types/node/v20/test/tls.ts b/types/node/v20/test/tls.ts index e76e2ab54e9907..aecade9a2427b3 100644 --- a/types/node/v20/test/tls.ts +++ b/types/node/v20/test/tls.ts @@ -69,6 +69,15 @@ import { tlsSocket.getPeerX509Certificate(); // $ExpectType X509Certificate | undefined tlsSocket.getX509Certificate(); // $ExpectType X509Certificate | undefined + + tlsSocket.setKeyCert({ + cert: fs.readFileSync("cert_filepath"), + key: fs.readFileSync("key_filepath"), + }); + tlsSocket.setKeyCert(createSecureContext({ + key: "NOT REALLY A KEY", + cert: "SOME CERTIFICATE", + })); } { diff --git a/types/node/v20/tls.d.ts b/types/node/v20/tls.d.ts index 8406f62156ed20..103ca626df9430 100644 --- a/types/node/v20/tls.d.ts +++ b/types/node/v20/tls.d.ts @@ -398,6 +398,14 @@ declare module "tls" { }, callback: (err: Error | null) => void, ): undefined | boolean; + /** + * The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket. + * This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`. + * @since v22.5.0, v20.17.0 + * @param context An object containing at least `key` and `cert` properties from the {@link createSecureContext()} `options`, + * or a TLS context object created with {@link createSecureContext()} itself. + */ + setKeyCert(context: SecureContextOptions | SecureContext): void; /** * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. * Returns `true` if setting the limit succeeded; `false` otherwise. diff --git a/types/react-otp-input/.npmignore b/types/react-otp-input/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/react-otp-input/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/react-otp-input/index.d.ts b/types/react-otp-input/index.d.ts deleted file mode 100644 index 1662570db52f53..00000000000000 --- a/types/react-otp-input/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import * as React from "react"; - -export interface OTPInputProps { - value: number | string; - onChange: any; - numInputs: number; - separator?: React.JSX.Element | undefined; - isDisabled?: boolean | undefined; - shouldAutoFocus?: boolean | undefined; - hasErrored?: boolean | undefined; - isInputNum?: boolean | undefined; - containerStyle?: string | React.CSSProperties | undefined; - inputStyle?: string | React.CSSProperties | undefined; - focusStyle?: string | React.CSSProperties | undefined; - disabledStyle?: string | React.CSSProperties | undefined; - errorStyle?: string | React.CSSProperties | undefined; -} - -export default class extends React.Component {} diff --git a/types/react-otp-input/package.json b/types/react-otp-input/package.json deleted file mode 100644 index e1c71f50da0396..00000000000000 --- a/types/react-otp-input/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "private": true, - "name": "@types/react-otp-input", - "version": "2.0.9999", - "projects": [ - "https://github.com/devfolioco/react-otp-input" - ], - "dependencies": { - "@types/react": "*" - }, - "devDependencies": { - "@types/react-otp-input": "workspace:." - }, - "owners": [ - { - "name": "Anup Bhatkhande", - "githubUsername": "anupbui" - } - ] -} diff --git a/types/react-otp-input/react-otp-input-tests.tsx b/types/react-otp-input/react-otp-input-tests.tsx deleted file mode 100644 index 1fe0ede3d689d7..00000000000000 --- a/types/react-otp-input/react-otp-input-tests.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import * as React from "react"; -import OTPInput from "react-otp-input"; - -interface InputOtpProps { - inputCount: number; -} - -interface OtpInputState { - otp: number; -} - -class OtpInputPage extends React.Component { - state = { - otp: 123456, - }; - - handleChange = (otp: number) => { - this.setState({ otp }); - }; - - render() { - const { otp } = this.state; - - return ( - <> - -} - /> - - ); - } -} diff --git a/types/url-template/.npmignore b/types/url-template/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/url-template/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/url-template/index.d.ts b/types/url-template/index.d.ts deleted file mode 100644 index 643106309f26c7..00000000000000 --- a/types/url-template/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -declare var urlTemplate: UrlTemplate.TemplateParser; - -export = urlTemplate; -export as namespace urltemplate; - -declare namespace UrlTemplate { - interface TemplateParser { - parse(template: string): Template; - } - - interface Template { - expand(parameters: any): string; - } -} diff --git a/types/url-template/package.json b/types/url-template/package.json deleted file mode 100644 index 5e84ed98747a43..00000000000000 --- a/types/url-template/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "private": true, - "name": "@types/url-template", - "version": "2.0.9999", - "projects": [ - "https://github.com/bramstein/url-template" - ], - "devDependencies": { - "@types/url-template": "workspace:." - }, - "owners": [ - { - "name": "Marcin Porębski", - "githubUsername": "marcinporebski" - } - ] -} diff --git a/types/url-template/tsconfig.json b/types/url-template/tsconfig.json deleted file mode 100644 index 93e3bd52848a38..00000000000000 --- a/types/url-template/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "url-template-tests.ts" - ] -} diff --git a/types/url-template/url-template-tests.ts b/types/url-template/url-template-tests.ts deleted file mode 100644 index 3502d00f163307..00000000000000 --- a/types/url-template/url-template-tests.ts +++ /dev/null @@ -1,10 +0,0 @@ -import urlTemplate = require("url-template"); - -var emailUrl = urlTemplate.parse("/{email}/{folder}/{id}"); - -// Returns '/user@domain/test/42' -emailUrl.expand({ - email: "user@domain", - folder: "test", - id: 42, -});