From 4abe267a418604bf3fb495d4df45280732ac55ef Mon Sep 17 00:00:00 2001 From: diogopxrnextday <159882035+diogopxrnextday@users.noreply.github.com> Date: Thu, 13 Mar 2025 08:55:59 +0100 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72179=20Featur?= =?UTF-8?q?e/pxr=20oneline=20add=20two=20missing=20methods=20show=20cmp=20?= =?UTF-8?q?and=20loadscript=20by=20@diogopxrnextday?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/pxr-oneline/index.d.ts | 5 +++-- types/pxr-oneline/oneline-tests.ts | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/types/pxr-oneline/index.d.ts b/types/pxr-oneline/index.d.ts index 35460301854cb7..a1bb0a1790b8f6 100644 --- a/types/pxr-oneline/index.d.ts +++ b/types/pxr-oneline/index.d.ts @@ -4,6 +4,8 @@ declare namespace OneLine { adUnitRequest(arrFoAdIds?: string[], allowReload?: boolean): void; preBidAdUnit(prebidBids: PrebidBids, gtag: string, isDebug: boolean): any; requestVideoPlayerAds(onBiddingComplete: () => void): void; + showCmp(): void; + loadScript(src: string, priority: 'async' | 'defer' | 'instant' | 'async'): void; buildVideoUrl( bidder: BidderConfig[], placementID: string, @@ -72,6 +74,5 @@ declare namespace OneLine { type NoParamFunction = () => void; type ParamFunction = (arg: any) => void; } - declare const OneLine: OneLine.OneLine; -export = OneLine; +export = OneLine; \ No newline at end of file diff --git a/types/pxr-oneline/oneline-tests.ts b/types/pxr-oneline/oneline-tests.ts index e84cf4c47723e1..fb569dee76b174 100644 --- a/types/pxr-oneline/oneline-tests.ts +++ b/types/pxr-oneline/oneline-tests.ts @@ -71,6 +71,20 @@ const ndOne: OneLine.OneLine = { // This is a mock implementation and should be replaced with your actual logic return `https://example.com/video?placement=${placementID}&bidder=${bidder.map(b => b.bidder).join(",")}`; }, + showCmp: () => { + // Mock implementation for showCmp + console.log('Showing CMP screen...'); + const currentDomain = window.location.origin; + if (currentDomain) { + console.log(`Redirecting to: ${currentDomain}/#cmpscreen`); + } else { + console.warn("NDM: Unable to show CMP"); + } + }, + loadScript: (src: string, priority: 'async' | 'defer' | 'instant' | 'async'): void => { + // Mock implementation for loadScript + console.log(`Loading script from: ${src} with priority: ${priority}`); + }, }; // Test cases @@ -80,4 +94,4 @@ ndOne.adUnitRequest(["push-up-all"], true); ndOne.buildVideoUrl([{ bidder: "testBidder", params: { placementId: "testPlacementId" } }], "testPlacementId", {}); ndOne.requestVideoPlayerAds(() => { console.log("Video player ads bidding complete"); -}); +}); \ No newline at end of file From ab19e5186566bfb97be06dedd4bb60880affcd75 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 13 Mar 2025 07:56:59 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/pxr-oneline/index.d.ts | 4 ++-- types/pxr-oneline/oneline-tests.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/types/pxr-oneline/index.d.ts b/types/pxr-oneline/index.d.ts index a1bb0a1790b8f6..2eabc8e7911aa9 100644 --- a/types/pxr-oneline/index.d.ts +++ b/types/pxr-oneline/index.d.ts @@ -5,7 +5,7 @@ declare namespace OneLine { preBidAdUnit(prebidBids: PrebidBids, gtag: string, isDebug: boolean): any; requestVideoPlayerAds(onBiddingComplete: () => void): void; showCmp(): void; - loadScript(src: string, priority: 'async' | 'defer' | 'instant' | 'async'): void; + loadScript(src: string, priority: "async" | "defer" | "instant" | "async"): void; buildVideoUrl( bidder: BidderConfig[], placementID: string, @@ -75,4 +75,4 @@ declare namespace OneLine { type ParamFunction = (arg: any) => void; } declare const OneLine: OneLine.OneLine; -export = OneLine; \ No newline at end of file +export = OneLine; diff --git a/types/pxr-oneline/oneline-tests.ts b/types/pxr-oneline/oneline-tests.ts index fb569dee76b174..1eec022fae255d 100644 --- a/types/pxr-oneline/oneline-tests.ts +++ b/types/pxr-oneline/oneline-tests.ts @@ -73,7 +73,7 @@ const ndOne: OneLine.OneLine = { }, showCmp: () => { // Mock implementation for showCmp - console.log('Showing CMP screen...'); + console.log("Showing CMP screen..."); const currentDomain = window.location.origin; if (currentDomain) { console.log(`Redirecting to: ${currentDomain}/#cmpscreen`); @@ -81,7 +81,7 @@ const ndOne: OneLine.OneLine = { console.warn("NDM: Unable to show CMP"); } }, - loadScript: (src: string, priority: 'async' | 'defer' | 'instant' | 'async'): void => { + loadScript: (src: string, priority: "async" | "defer" | "instant" | "async"): void => { // Mock implementation for loadScript console.log(`Loading script from: ${src} with priority: ${priority}`); }, @@ -94,4 +94,4 @@ ndOne.adUnitRequest(["push-up-all"], true); ndOne.buildVideoUrl([{ bidder: "testBidder", params: { placementId: "testPlacementId" } }], "testPlacementId", {}); ndOne.requestVideoPlayerAds(() => { console.log("Video player ads bidding complete"); -}); \ No newline at end of file +}); From 7c75cbcebcdeaed1835f48d625f43593a551667a Mon Sep 17 00:00:00 2001 From: diogopxrnextday <159882035+diogopxrnextday@users.noreply.github.com> Date: Thu, 13 Mar 2025 08:57:12 +0100 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72180=20Add=20?= =?UTF-8?q?co-owners=20by=20@diogopxrnextday?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/pxr-oneline/package.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/types/pxr-oneline/package.json b/types/pxr-oneline/package.json index cf742f0c36ea5f..776121c7ca3e5e 100644 --- a/types/pxr-oneline/package.json +++ b/types/pxr-oneline/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/pxr-oneline", - "version": "1.5.9999", + "version": "1.6.9999", "nonNpm": true, "nonNpmDescription": "The OneLine handles all the logic needed for a publisher to serve ads.", "projects": [ @@ -12,8 +12,16 @@ }, "owners": [ { - "name": "PXR Advertising", + "name": "Diogo", "githubUsername": "diogopxrnextday" + }, + { + "name": "Edwin", + "githubUsername": "edwinveldhuizen" + }, + { + "name": "Bart", + "githubUsername": "bart-digitalenterprises" } ] } From 4f8782f5dfed4357491755686472091533fbf646 Mon Sep 17 00:00:00 2001 From: agachuma <52526593+agachuma@users.noreply.github.com> Date: Thu, 13 Mar 2025 15:41:43 +0100 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72190=20Featur?= =?UTF-8?q?e/mapping=20editor=20by=20@agachuma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jan Hörnle Co-authored-by: Paul Kellett --- types/gorilla-engine/components/MappingEditor.d.ts | 9 +++++---- types/gorilla-engine/gorilla-engine-tests.ts | 3 ++- types/gorilla-engine/index.d.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/types/gorilla-engine/components/MappingEditor.d.ts b/types/gorilla-engine/components/MappingEditor.d.ts index 10f12f49d8a1c5..6ea8478d750f21 100644 --- a/types/gorilla-engine/components/MappingEditor.d.ts +++ b/types/gorilla-engine/components/MappingEditor.d.ts @@ -1,19 +1,20 @@ declare namespace GorillaEngine.UI { + interface Zone { + path: string; + name: string; index: number; rootKey: number; lowKey: number; highKey: number; lowVel: number; highVel: number; - samplePath: string; } interface MappingEditorProps extends Common, Bounds, Background { - parentPath: string; zones?: Zone[]; refreshView(index?: number): void; - addZone(zone: Partial): Zone; - removeZone(zone: Partial): void; + addZone(zone: Partial ): Zone; + removeZone(zone: Partial ): void; } // tslint:disable-next-line:no-empty-interface diff --git a/types/gorilla-engine/gorilla-engine-tests.ts b/types/gorilla-engine/gorilla-engine-tests.ts index 6237c1f881f63b..e8ae1380dedc9d 100644 --- a/types/gorilla-engine/gorilla-engine-tests.ts +++ b/types/gorilla-engine/gorilla-engine-tests.ts @@ -1,3 +1,4 @@ + const mylabel = new GorillaEngine.UI.Label({ text: "rr" }); const combo = new GorillaEngine.UI.ComboBox({ id: "myCombo", x: 0 }); @@ -14,4 +15,4 @@ const label = new GorillaEngine.UI.Label({ margin: 5 }); const slider = new GorillaEngine.UI.Slider({ id: "slider", x: 0 }); -const mappingEditor = new GorillaEngine.UI.MappingEditor({ id: "myMapping" }); +const mappingEditor = new GorillaEngine.UI.MappingEditor({ id: 'myMappingEditor'}) diff --git a/types/gorilla-engine/index.d.ts b/types/gorilla-engine/index.d.ts index 722a26ad33d83c..e89ef2e08299a3 100755 --- a/types/gorilla-engine/index.d.ts +++ b/types/gorilla-engine/index.d.ts @@ -598,4 +598,4 @@ declare namespace GorillaEngine { */ function setSettingsButtonPosition(x: number, y: number): void; } -} +} \ No newline at end of file From 6811a6e969d2ce8d77287f8d313ab4c8afdda57d Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Thu, 13 Mar 2025 14:42:41 +0000 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/gorilla-engine/components/MappingEditor.d.ts | 5 ++--- types/gorilla-engine/gorilla-engine-tests.ts | 3 +-- types/gorilla-engine/index.d.ts | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/types/gorilla-engine/components/MappingEditor.d.ts b/types/gorilla-engine/components/MappingEditor.d.ts index 6ea8478d750f21..cf9429c2285d19 100644 --- a/types/gorilla-engine/components/MappingEditor.d.ts +++ b/types/gorilla-engine/components/MappingEditor.d.ts @@ -1,5 +1,4 @@ declare namespace GorillaEngine.UI { - interface Zone { path: string; name: string; @@ -13,8 +12,8 @@ declare namespace GorillaEngine.UI { interface MappingEditorProps extends Common, Bounds, Background { zones?: Zone[]; refreshView(index?: number): void; - addZone(zone: Partial ): Zone; - removeZone(zone: Partial ): void; + addZone(zone: Partial): Zone; + removeZone(zone: Partial): void; } // tslint:disable-next-line:no-empty-interface diff --git a/types/gorilla-engine/gorilla-engine-tests.ts b/types/gorilla-engine/gorilla-engine-tests.ts index e8ae1380dedc9d..d2624d4c643e7a 100644 --- a/types/gorilla-engine/gorilla-engine-tests.ts +++ b/types/gorilla-engine/gorilla-engine-tests.ts @@ -1,4 +1,3 @@ - const mylabel = new GorillaEngine.UI.Label({ text: "rr" }); const combo = new GorillaEngine.UI.ComboBox({ id: "myCombo", x: 0 }); @@ -15,4 +14,4 @@ const label = new GorillaEngine.UI.Label({ margin: 5 }); const slider = new GorillaEngine.UI.Slider({ id: "slider", x: 0 }); -const mappingEditor = new GorillaEngine.UI.MappingEditor({ id: 'myMappingEditor'}) +const mappingEditor = new GorillaEngine.UI.MappingEditor({ id: "myMappingEditor" }); diff --git a/types/gorilla-engine/index.d.ts b/types/gorilla-engine/index.d.ts index e89ef2e08299a3..722a26ad33d83c 100755 --- a/types/gorilla-engine/index.d.ts +++ b/types/gorilla-engine/index.d.ts @@ -598,4 +598,4 @@ declare namespace GorillaEngine { */ function setSettingsButtonPosition(x: number, y: number): void; } -} \ No newline at end of file +} From 880802ce3b991dfc0df17fc9ba7f259116355afe Mon Sep 17 00:00:00 2001 From: Kyle Bloom Date: Thu, 13 Mar 2025 15:47:46 +0000 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72181=20Allow?= =?UTF-8?q?=20MultiSelect=20Attribute=20to=20use=20enum=20in=20XRM=20by=20?= =?UTF-8?q?@aquacash5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/xrm/index.d.ts | 2 +- types/xrm/xrm-tests.ts | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/types/xrm/index.d.ts b/types/xrm/index.d.ts index 71cda66fbe0812..cfd6766b31ea94 100644 --- a/types/xrm/index.d.ts +++ b/types/xrm/index.d.ts @@ -2923,7 +2923,7 @@ declare namespace Xrm { * Interface an OptionSet attribute. * @see {@link EnumAttribute} */ - interface MultiSelectOptionSetAttribute extends EnumAttribute { + interface MultiSelectOptionSetAttribute extends EnumAttribute { /** * Gets the attribute format. * @returns The format of the attribute. diff --git a/types/xrm/xrm-tests.ts b/types/xrm/xrm-tests.ts index 64fb810e518861..ed8f45ec48126f 100644 --- a/types/xrm/xrm-tests.ts +++ b/types/xrm/xrm-tests.ts @@ -153,7 +153,7 @@ alert(`The current form type is: ${formContext.ui.getFormType()}`); alert(`The current entity type is: ${formContext.data.entity.getEntityName()}`); -/// Demonstrate Optionset Value as int in Turbo Forms +/// Demonstrate OptionSet Value as int const optionSetAttribute = formContext.getAttribute("statuscode"); if (optionSetAttribute !== null) { @@ -170,6 +170,41 @@ if (optionSetAttribute !== null) { } } +/// Demonstrate OptionSet Value as enum + +enum TestOptionSet { + Option1 = 56666000, + Option2 = 56666001, +} + +const optionSetAttributeEnum = formContext.getAttribute>("statuscode"); +if (optionSetAttributeEnum !== null) { + const optionEnumValue: TestOptionSet | null = optionSetAttributeEnum.getValue(); +} + +/// Demonstrate MultiSelectOptionSet Value as int + +const multiSelectOptionSetAttribute = formContext.getAttribute( + "statuscode", +); +if (multiSelectOptionSetAttribute !== null) { + const multiSelectOptionValue: number = multiSelectOptionSetAttribute.getOptions()[0].value; +} + +/// Demonstrate MultiSelectOptionSet Value as enum + +enum TestMultiSelectOptionSet { + Option1 = 56666000, + Option2 = 56666001, +} + +const multiSelectOptionSetAttributeEnum = formContext.getAttribute< + Xrm.Attributes.MultiSelectOptionSetAttribute +>("statuscode"); +if (multiSelectOptionSetAttributeEnum !== null) { + const multiSelectOptionEnumValue: TestMultiSelectOptionSet[] | null = multiSelectOptionSetAttributeEnum.getValue(); +} + /// Demonstrate setFormNotification let level: Xrm.FormNotificationLevel; @@ -634,7 +669,7 @@ const multiSelectOptionSetControl = formContext.getControl multiSelectOptionSetControl.getAttribute(); // Demonstrates getWebResourceUrl From ccb4f1f25899c83fbbb8cbc40dea1faffeecd640 Mon Sep 17 00:00:00 2001 From: Kyle Bloom Date: Thu, 13 Mar 2025 15:48:43 +0000 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72182=20Add=20?= =?UTF-8?q?return=20type=20to=20Xrm.WebApi.updateRecord=20by=20@aquacash5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/xrm/index.d.ts | 10 +++++++++- types/xrm/xrm-tests.ts | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/xrm/index.d.ts b/types/xrm/index.d.ts index cfd6766b31ea94..21c6fa5bb1e6b1 100644 --- a/types/xrm/index.d.ts +++ b/types/xrm/index.d.ts @@ -6083,7 +6083,7 @@ declare namespace Xrm { * @returns On success, returns a promise object containing the attributes specified earlier in the description of the successCallback parameter. * @see {@link https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/xrm-webapi/updaterecord External Link: updateRecord (Client API reference)} */ - updateRecord(entityLogicalName: string, id: string, data: any): Async.PromiseLike; + updateRecord(entityLogicalName: string, id: string, data: any): Async.PromiseLike; } /** @@ -6094,6 +6094,14 @@ declare namespace Xrm { id: string; } + /** + * Interface for the WebAPI UpdateRecord request response + */ + interface UpdateResponse { + entityType: string; + id: string; + } + /** * Interface for the Promise error response arguments */ diff --git a/types/xrm/xrm-tests.ts b/types/xrm/xrm-tests.ts index ed8f45ec48126f..131723fb6946c4 100644 --- a/types/xrm/xrm-tests.ts +++ b/types/xrm/xrm-tests.ts @@ -255,6 +255,16 @@ Xrm.Utility.getEntityMetadata("account", ["telephone1"]).then((metadata) => { console.log(metadata.Attributes["statuscode"].OptionSet[0].Label.LocalizedLabels[0].Label); }); +// Demonstrate WebAPI CreateRecord +Xrm.WebApi.createRecord("contact", { fullname: "Neo" }).then((response) => { + console.log(response.entityType, response.id); +}); + +// Demonstrate WebAPI UpdateRecord +Xrm.WebApi.updateRecord("contact", "1d-123", { fullname: "Neo" }).then((response) => { + console.log(response.entityType, response.id); +}); + // Demonstrate WebAPI RetrieveMultiple Xrm.WebApi.retrieveMultipleRecords( "contact",