prebid-universal-creative 1.16.0 → 1.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.circleci/config.yml +44 -30
- package/.github/workflows/codeql.yml +98 -0
- package/README.md +2 -2
- package/dist/0df2612ebfffd5ad651a.max.js +1050 -0
- package/dist/amp.js +3 -3
- package/dist/banner.js +3 -3
- package/dist/creative.js +3 -3
- package/dist/load-cookie-with-consent.html +1 -1
- package/dist/load-cookie.html +1 -1
- package/dist/mobile.js +3 -3
- package/dist/native-render.js +3 -3
- package/dist/native-trk.js +3 -3
- package/dist/native.js +3 -3
- package/dist/uid.js +2 -2
- package/dist/video.js +3 -3
- package/gulpfile.js +12 -24
- package/integ-test/fixtures/test.js +79 -0
- package/integ-test/pages/amp.html +80 -0
- package/integ-test/pages/banner.html +96 -0
- package/integ-test/pages/native_legacy.html +107 -0
- package/integ-test/spec/amp_spec.js +111 -0
- package/integ-test/spec/banner_spec.js +85 -0
- package/integ-test/spec/native_legacy_spec.js +213 -0
- package/package.json +7 -13
- package/playwright.config.js +108 -0
- package/src/adHtmlRender.js +15 -0
- package/src/cookieSync.js +3 -0
- package/src/cookieSyncWithConsent.js +3 -0
- package/src/domHelper.js +25 -15
- package/src/dynamicRenderer.js +56 -0
- package/src/messaging.js +23 -2
- package/src/mobileAndAmpRender.js +17 -20
- package/src/nativeAssetManager.js +98 -79
- package/src/nativeORTBTrackerManager.js +1 -1
- package/src/nativeRenderManager.js +7 -12
- package/src/nativeTrackerManager.js +2 -2
- package/src/renderingManager.js +13 -19
- package/test/helpers/mocks.js +1 -0
- package/test/spec/dynamicRenderer_spec.js +167 -0
- package/test/spec/messaging_spec.js +98 -3
- package/test/spec/mobileAndAmpRender_spec.js +59 -66
- package/test/spec/nativeAssetManager_spec.js +73 -23
- package/test/spec/renderingManager_spec.js +20 -6
- package/webpack.conf.js +0 -1
- package/.nvmrc +0 -1
- package/dist/creative.max.js +0 -3102
- package/src/postscribeRender.js +0 -10
- package/test/e2e/specs/hello_world_banner_non_sf.spec.js +0 -14
- package/test/e2e/specs/outstream_non_sf.spec.js +0 -14
- package/test/e2e/specs/outstream_sf.spec.js +0 -14
- package/wdio.conf.js +0 -50
package/.circleci/config.yml
CHANGED
@@ -3,48 +3,62 @@
|
|
3
3
|
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
|
4
4
|
#
|
5
5
|
version: 2
|
6
|
+
aliases:
|
7
|
+
- &environment
|
8
|
+
resource_class: xlarge
|
9
|
+
working_directory: ~/prebid-universal-creative
|
10
|
+
|
6
11
|
jobs:
|
7
|
-
|
12
|
+
unit-tests:
|
13
|
+
<<: *environment
|
8
14
|
docker:
|
9
|
-
|
10
|
-
- image: circleci/node:14.18.2-browsers
|
11
|
-
|
12
|
-
# Specify service dependencies here if necessary
|
13
|
-
# CircleCI maintains a library of pre-built images
|
14
|
-
# documented at https://circleci.com/docs/2.0/circleci-images/
|
15
|
-
# - image: circleci/mongo:3.4.4
|
16
|
-
|
17
|
-
working_directory: ~/prebid-universal-creative
|
15
|
+
- image: cimg/node:20.14.0-browsers
|
18
16
|
|
19
17
|
steps:
|
20
18
|
- checkout
|
21
|
-
|
22
|
-
# Download and cache dependencies
|
23
19
|
- restore_cache:
|
24
20
|
keys:
|
25
|
-
|
26
|
-
|
27
|
-
- v1-dependencies-
|
28
|
-
|
21
|
+
- v1-dependencies-unit-{{ checksum "package.json" }}
|
22
|
+
- v1-dependencies-unit
|
29
23
|
- run: npm install
|
30
|
-
|
31
24
|
- save_cache:
|
32
25
|
paths:
|
33
26
|
- node_modules
|
34
|
-
key: v1-dependencies-{{ checksum "package.json" }}
|
35
|
-
|
36
|
-
- run: sudo npm install -g gulp
|
37
|
-
# Download and run BrowserStack local
|
27
|
+
key: v1-dependencies-unit-{{ checksum "package.json" }}
|
38
28
|
- run:
|
39
|
-
name
|
40
|
-
command
|
41
|
-
# Download the browserstack binary file
|
42
|
-
wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip"
|
43
|
-
# Unzip it
|
44
|
-
unzip BrowserStackLocal-linux-x64.zip
|
45
|
-
# Run the file with user's access key
|
46
|
-
./BrowserStackLocal ${BROWSERSTACK_ACCESS_KEY} &
|
47
|
-
# run tests!
|
29
|
+
name: Install gulp cli
|
30
|
+
command: sudo npm install -g gulp-cli
|
48
31
|
- run:
|
49
32
|
name: BrowserStack testing
|
50
33
|
command: gulp test --browserstack
|
34
|
+
|
35
|
+
integ-tests:
|
36
|
+
<<: *environment
|
37
|
+
docker:
|
38
|
+
- image: mcr.microsoft.com/playwright:v1.26.0-focal
|
39
|
+
steps:
|
40
|
+
- checkout
|
41
|
+
- restore_cache:
|
42
|
+
keys:
|
43
|
+
- v1-dependencies-integ-{{ checksum "package.json" }}
|
44
|
+
- v1-dependencies-iteg
|
45
|
+
- run: npm install
|
46
|
+
- save_cache:
|
47
|
+
paths:
|
48
|
+
- node_modules
|
49
|
+
key: v1-dependencies-integ-{{ checksum "package.json" }}
|
50
|
+
- run:
|
51
|
+
name: Build
|
52
|
+
command: npx gulp build
|
53
|
+
- run:
|
54
|
+
name: Install playwright browsers
|
55
|
+
command: npx playwright install --with-deps
|
56
|
+
- run:
|
57
|
+
name: Integ tests
|
58
|
+
command: npx playwright test
|
59
|
+
workflows:
|
60
|
+
version: 2
|
61
|
+
commit:
|
62
|
+
jobs:
|
63
|
+
- unit-tests
|
64
|
+
- integ-tests
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# For most projects, this workflow file will not need changing; you simply need
|
2
|
+
# to commit it to your repository.
|
3
|
+
#
|
4
|
+
# You may wish to alter this file to override the set of languages analyzed,
|
5
|
+
# or to provide custom queries or build logic.
|
6
|
+
#
|
7
|
+
# ******** NOTE ********
|
8
|
+
# We have attempted to detect the languages in your repository. Please check
|
9
|
+
# the `language` matrix defined below to confirm you have the correct set of
|
10
|
+
# supported CodeQL languages.
|
11
|
+
#
|
12
|
+
name: "CodeQL Advanced"
|
13
|
+
|
14
|
+
on:
|
15
|
+
push:
|
16
|
+
branches: [ "master" ]
|
17
|
+
pull_request:
|
18
|
+
branches: [ "master" ]
|
19
|
+
schedule:
|
20
|
+
- cron: '34 11 * * 6'
|
21
|
+
|
22
|
+
jobs:
|
23
|
+
analyze:
|
24
|
+
name: Analyze (${{ matrix.language }})
|
25
|
+
# Runner size impacts CodeQL analysis time. To learn more, please see:
|
26
|
+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
|
27
|
+
# - https://gh.io/supported-runners-and-hardware-resources
|
28
|
+
# - https://gh.io/using-larger-runners (GitHub.com only)
|
29
|
+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
|
30
|
+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
31
|
+
permissions:
|
32
|
+
# required for all workflows
|
33
|
+
security-events: write
|
34
|
+
|
35
|
+
# required to fetch internal or private CodeQL packs
|
36
|
+
packages: read
|
37
|
+
|
38
|
+
# only required for workflows in private repositories
|
39
|
+
actions: read
|
40
|
+
contents: read
|
41
|
+
|
42
|
+
strategy:
|
43
|
+
fail-fast: false
|
44
|
+
matrix:
|
45
|
+
include:
|
46
|
+
- language: javascript-typescript
|
47
|
+
build-mode: none
|
48
|
+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
|
49
|
+
# Use `c-cpp` to analyze code written in C, C++ or both
|
50
|
+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
|
51
|
+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
|
52
|
+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
|
53
|
+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
|
54
|
+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
|
55
|
+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
56
|
+
steps:
|
57
|
+
- name: Checkout repository
|
58
|
+
uses: actions/checkout@v4
|
59
|
+
|
60
|
+
# Add any setup steps before running the `github/codeql-action/init` action.
|
61
|
+
# This includes steps like installing compilers or runtimes (`actions/setup-node`
|
62
|
+
# or others). This is typically only required for manual builds.
|
63
|
+
# - name: Setup runtime (example)
|
64
|
+
# uses: actions/setup-example@v1
|
65
|
+
|
66
|
+
# Initializes the CodeQL tools for scanning.
|
67
|
+
- name: Initialize CodeQL
|
68
|
+
uses: github/codeql-action/init@v3
|
69
|
+
with:
|
70
|
+
languages: ${{ matrix.language }}
|
71
|
+
build-mode: ${{ matrix.build-mode }}
|
72
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
73
|
+
# By default, queries listed here will override any specified in a config file.
|
74
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
75
|
+
|
76
|
+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
77
|
+
# queries: security-extended,security-and-quality
|
78
|
+
|
79
|
+
# If the analyze step fails for one of the languages you are analyzing with
|
80
|
+
# "We were unable to automatically build your code", modify the matrix above
|
81
|
+
# to set the build mode to "manual" for that language. Then modify this step
|
82
|
+
# to build your code.
|
83
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
84
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
85
|
+
- if: matrix.build-mode == 'manual'
|
86
|
+
shell: bash
|
87
|
+
run: |
|
88
|
+
echo 'If you are using a "manual" build mode for one or more of the' \
|
89
|
+
'languages you are analyzing, replace this with the commands to build' \
|
90
|
+
'your code, for example:'
|
91
|
+
echo ' make bootstrap'
|
92
|
+
echo ' make release'
|
93
|
+
exit 1
|
94
|
+
|
95
|
+
- name: Perform CodeQL Analysis
|
96
|
+
uses: github/codeql-action/analyze@v3
|
97
|
+
with:
|
98
|
+
category: "/language:${{matrix.language}}"
|
package/README.md
CHANGED
@@ -9,9 +9,9 @@ Prebid Universal Creative is a javascript api to render multiple formats. This f
|
|
9
9
|
|
10
10
|
## Usage
|
11
11
|
|
12
|
-
You can find a detailed explanations on the [Prebid Universal Creative](
|
12
|
+
You can find a detailed explanations on the [Prebid Universal Creative](https://docs.prebid.org/overview/prebid-universal-creative.html) and [AdOps - Add Creative](https://docs.prebid.org/adops/setting-up-prebid-with-the-appnexus-ad-server.html#step-3-add-creatives) pages.
|
13
13
|
|
14
|
-
> **important:** If you’re using the `Send All Bids` scenario (where every bidder has a separate order), the creative and targeting will be different from the example shown here. See [Send All Bids](
|
14
|
+
> **important:** If you’re using the `Send All Bids` scenario (where every bidder has a separate order), the creative and targeting will be different from the example shown here. See [Send All Bids](https://docs.prebid.org/adops/send-all-vs-top-price.html#send-all-bids) for details.
|
15
15
|
|
16
16
|
```html
|
17
17
|
<script src = "https://cdn.jsdelivr.net/npm/prebid-universal-creative@latest/dist/%%PATTERN:hb_format%%.js"></script>
|