@admoai/sdk-scenarios 1.1.0 → 1.3.0

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/CHANGELOG.md CHANGED
@@ -4,6 +4,34 @@ Versioning: a scenario added or an `expect` tightened is a **minor** release; a
4
4
  removed, or a `request`/`expect` key renamed (every SDK's interpreter must change), is a
5
5
  **major** one. Each SDK vendors one version and its own CI checks the vendored bytes against it.
6
6
 
7
+ ## 1.3.0 — 2026-11-05
8
+
9
+ Adds fixture scenarios F16–F25 with a `slideTracking` block (admoai/adhub#4733): what the app
10
+ dispatches when it reports slides and interactions on a decoded standard creative, offline.
11
+ A slide view goes out once per served response, keyed on its signed URL, and again for a new
12
+ response (F16, F17). A slide click before its view sends the view, then the click, then the
13
+ creative's applicable third-party click trackers once per click. A slide view never sends them
14
+ (F18-F20). A Carousel has no creative click (F21). `fireClick` with no key sends `default`
15
+ (F22). Expand, close and asset tap are verbatim custom events, not clicks (F23, F24). A
16
+ Standard Video without a destination sends no click (F25). New edit level `tracking` (the
17
+ creative's tracking object), used to inject third-party trackers on `.example` hosts. A
18
+ `schemaVersion` moves to 3, so a runner that knows only 2 refuses the manifest instead of
19
+ skipping `slideTracking` silently; adopting 1.3.0 requires executing it.
20
+
21
+ ## 1.2.0 — 2026-11-05
22
+
23
+ Adds `fixtureScenarios` F1–F15 and moves `schemaVersion` to 2 (admoai/adhub#4733): offline
24
+ scenarios for the six standard native formats, so every SDK proves it decodes them before the
25
+ engine serves them. Each decodes one golden decision-wire file, shipped in this package under
26
+ `fixtures/golden-wire/` (byte-identical to adhub's `ui/platform/lib/ad-formats/golden-wire/`,
27
+ copied at publish), optionally edited (`edits`: remove or add a field at one level), and asserts
28
+ what the app reads: the standard format, version and template source (null = absent), content
29
+ keys present and absent, slides in server order with their ids, positions and own trackers,
30
+ click, custom and video-event keys, and matched points. F14 is the gate-off wire (the three
31
+ standard fields removed); F15 adds unknown fields at every level. The 39 live scenarios are
32
+ unchanged. A runner that does not execute `fixtureScenarios` must refuse schemaVersion 2, so an
33
+ SDK cannot adopt this version and skip them silently.
34
+
7
35
  ## 1.1.0 — 2026-10-21
8
36
 
9
37
  Also ships `scenarios.feature`: the same 39 scenarios rendered as Gherkin for people to read
package/README.md CHANGED
@@ -20,11 +20,20 @@ curl -sSfL "https://registry.npmjs.org/@admoai/sdk-scenarios/-/sdk-scenarios-$VE
20
20
  | tar -xzO package/scenarios.json | cmp - path/to/vendored/scenarios.json
21
21
  ```
22
22
 
23
+ From `schemaVersion` 2 the manifest also holds `fixtureScenarios`: offline scenarios that decode
24
+ a golden decision-wire file, so vendor `fixtures/golden-wire/` (the whole directory) beside the
25
+ manifest and verify those bytes the same way, file by file, against the tarball's
26
+ `package/fixtures/golden-wire/<file>`. A runner that cannot execute `fixtureScenarios` must
27
+ refuse a schemaVersion 2 manifest.
28
+
23
29
  ## For adhub (the source)
24
30
 
25
31
  The source of truth is `sdk/scenarios/` in admoai/adhub. To change a scenario: edit
26
32
  `scenarios.json`, regenerate the Gherkin with `go run ./tools/sdkfeaturegen` from the
27
33
  repository root, bump `version` in `package.json` (minor: added or tightened; major: removed
28
34
  or a key renamed), add a `CHANGELOG.md` entry, and run `sdk/scenarios/check.sh`. Merging to
29
- `main` publishes the new version (`.github/workflows/sdk-scenarios-release.yml`); each SDK then
35
+ `main` publishes the new version (`.github/workflows/sdk-scenarios-release.yml`, which first runs
36
+ `sdk/scenarios/stage-fixtures.sh` to copy adhub's `ui/platform/lib/ad-formats/golden-wire/*.json`
37
+ into the package's `fixtures/golden-wire/`; that directory is never committed, and a change to a
38
+ golden file needs a version bump too); each SDK then
30
39
  moves to it in its own PR. See `docs/guides/sdk-ci.md`.
@@ -0,0 +1,74 @@
1
+ {
2
+ "success": true,
3
+ "data": [
4
+ {
5
+ "placement": "map_vehicles",
6
+ "creatives": [
7
+ {
8
+ "contents": [
9
+ {
10
+ "key": "branded_image",
11
+ "type": "image",
12
+ "value": "https://cdn.admoai.com/media/volta-car.png"
13
+ },
14
+ {
15
+ "key": "accessible_label",
16
+ "type": "text",
17
+ "value": "Volta Coffee car"
18
+ },
19
+ {
20
+ "key": "destination_url",
21
+ "type": "url",
22
+ "value": "https://volta.example/menu"
23
+ }
24
+ ],
25
+ "advertiser": {
26
+ "name": "Volta Coffee",
27
+ "legalName": "Volta Coffee SpA",
28
+ "logoUrl": "https://cdn.admoai.com/media/volta-logo.png"
29
+ },
30
+ "template": {
31
+ "key": "branded_assets",
32
+ "style": "branded_asset"
33
+ },
34
+ "tracking": {
35
+ "impressions": [
36
+ {
37
+ "key": "default",
38
+ "url": "https://api.admoai.com/v1/tracking?e=tok.branded_assets.full.impression"
39
+ }
40
+ ],
41
+ "clicks": [
42
+ {
43
+ "key": "default",
44
+ "url": "https://api.admoai.com/v1/tracking?e=tok.branded_assets.full.click"
45
+ }
46
+ ],
47
+ "custom": [
48
+ {
49
+ "key": "asset_tap",
50
+ "url": "https://api.admoai.com/v1/tracking?e=tok.branded_assets.full.asset_tap"
51
+ }
52
+ ]
53
+ },
54
+ "metadata": {
55
+ "adId": "ad_01JDBPXZN4D94EPQC5MVQB9MR6",
56
+ "creativeId": "creative_01JD1Z5CNM4GMHEJJFHCYWGKJ4",
57
+ "advertiserId": "advertiser_01JDH315KXW0FP82VY8WMV97YE",
58
+ "placementId": "placement_01JDGX7Z9JHJR8PN9HZJPDNFWA",
59
+ "templateId": "template_01JDKPBTZ611WAFQXYSNYMNXQ1",
60
+ "priority": "standard",
61
+ "language": "en",
62
+ "format": "native",
63
+ "effectiveStandardFormatKey": "branded_assets",
64
+ "effectiveStandardFormatVersion": 1,
65
+ "templateSource": "admoai_standard",
66
+ "assetContext": "vehicle_marker"
67
+ }
68
+ }
69
+ ]
70
+ }
71
+ ],
72
+ "errors": null,
73
+ "warnings": null
74
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "success": true,
3
+ "data": [
4
+ {
5
+ "placement": "map_vehicles",
6
+ "creatives": [
7
+ {
8
+ "contents": [
9
+ {
10
+ "key": "branded_image",
11
+ "type": "image",
12
+ "value": "https://cdn.admoai.com/media/volta-car.png"
13
+ }
14
+ ],
15
+ "advertiser": {
16
+ "name": "Volta Coffee",
17
+ "legalName": "Volta Coffee SpA",
18
+ "logoUrl": "https://cdn.admoai.com/media/volta-logo.png"
19
+ },
20
+ "template": {
21
+ "key": "branded_assets",
22
+ "style": "branded_asset"
23
+ },
24
+ "tracking": {
25
+ "impressions": [
26
+ {
27
+ "key": "default",
28
+ "url": "https://api.admoai.com/v1/tracking?e=tok.branded_assets.minimal.impression"
29
+ }
30
+ ],
31
+ "clicks": [],
32
+ "custom": [
33
+ {
34
+ "key": "asset_tap",
35
+ "url": "https://api.admoai.com/v1/tracking?e=tok.branded_assets.minimal.asset_tap"
36
+ }
37
+ ]
38
+ },
39
+ "metadata": {
40
+ "adId": "ad_01JD5G0KWPJS27NVHD88PECDV3",
41
+ "creativeId": "creative_01JDNVFDYH4MJS4NEPTAW7BTG8",
42
+ "advertiserId": "advertiser_01JDH315KXW0FP82VY8WMV97YE",
43
+ "placementId": "placement_01JDGX7Z9JHJR8PN9HZJPDNFWA",
44
+ "templateId": "template_01JDZZDBFPJPN49AB9VF53KXKX",
45
+ "priority": "standard",
46
+ "language": "en",
47
+ "format": "native",
48
+ "effectiveStandardFormatKey": "branded_assets",
49
+ "effectiveStandardFormatVersion": 1,
50
+ "templateSource": "admoai_standard",
51
+ "assetContext": "vehicle_marker"
52
+ }
53
+ }
54
+ ]
55
+ }
56
+ ],
57
+ "errors": null,
58
+ "warnings": null
59
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "success": true,
3
+ "data": [
4
+ {
5
+ "placement": "home_feed",
6
+ "creatives": [
7
+ {
8
+ "contents": [
9
+ {
10
+ "key": "image",
11
+ "type": "image",
12
+ "value": "https://cdn.admoai.com/media/volta-latte.jpg"
13
+ },
14
+ {
15
+ "key": "headline",
16
+ "type": "text",
17
+ "value": "Two lattes, one price"
18
+ },
19
+ {
20
+ "key": "destination_url",
21
+ "type": "url",
22
+ "value": "https://volta.example/menu"
23
+ },
24
+ {
25
+ "key": "promo_code",
26
+ "type": "text",
27
+ "value": "VOLTA2X1"
28
+ }
29
+ ],
30
+ "advertiser": {
31
+ "name": "Volta Coffee",
32
+ "legalName": "Volta Coffee SpA",
33
+ "logoUrl": "https://cdn.admoai.com/media/volta-logo.png"
34
+ },
35
+ "template": {
36
+ "key": "city_promo_display",
37
+ "style": "compact"
38
+ },
39
+ "tracking": {
40
+ "impressions": [
41
+ {
42
+ "key": "default",
43
+ "url": "https://api.admoai.com/v1/tracking?e=tok.card.derived.impression"
44
+ }
45
+ ],
46
+ "clicks": [
47
+ {
48
+ "key": "default",
49
+ "url": "https://api.admoai.com/v1/tracking?e=tok.card.derived.click"
50
+ }
51
+ ],
52
+ "custom": [
53
+ {
54
+ "key": "save_offer",
55
+ "url": "https://api.admoai.com/v1/tracking?e=tok.card.derived.save_offer"
56
+ }
57
+ ]
58
+ },
59
+ "metadata": {
60
+ "adId": "ad_01JDQA9PJQC1M206VCD5CCX4ZM",
61
+ "creativeId": "creative_01JDF9Z54P5KNER7PRNWGZB98F",
62
+ "advertiserId": "advertiser_01JDH315KXW0FP82VY8WMV97YE",
63
+ "placementId": "placement_01JDGX7Z9JHJR8PN9HZJPDNFWA",
64
+ "templateId": "template_01JD7MGVP04YN16MAY9WW89EVB",
65
+ "priority": "standard",
66
+ "language": "en",
67
+ "format": "native",
68
+ "effectiveStandardFormatKey": "card",
69
+ "effectiveStandardFormatVersion": 1,
70
+ "templateSource": "based_on_standard"
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ ],
76
+ "errors": null,
77
+ "warnings": null
78
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "success": true,
3
+ "data": [
4
+ {
5
+ "placement": "home_feed",
6
+ "creatives": [
7
+ {
8
+ "contents": [
9
+ {
10
+ "key": "image",
11
+ "type": "image",
12
+ "value": "https://cdn.admoai.com/media/volta-latte.jpg"
13
+ },
14
+ {
15
+ "key": "brand_logo",
16
+ "type": "image",
17
+ "value": "https://cdn.admoai.com/media/volta-logo.png"
18
+ },
19
+ {
20
+ "key": "headline",
21
+ "type": "text",
22
+ "value": "Two lattes, one price"
23
+ },
24
+ {
25
+ "key": "supporting_text",
26
+ "type": "text",
27
+ "value": "This week at every Volta in Santiago."
28
+ },
29
+ {
30
+ "key": "cta_text",
31
+ "type": "text",
32
+ "value": "See the menu"
33
+ },
34
+ {
35
+ "key": "destination_url",
36
+ "type": "url",
37
+ "value": "https://volta.example/menu"
38
+ }
39
+ ],
40
+ "advertiser": {
41
+ "name": "Volta Coffee",
42
+ "legalName": "Volta Coffee SpA",
43
+ "logoUrl": "https://cdn.admoai.com/media/volta-logo.png"
44
+ },
45
+ "template": {
46
+ "key": "card",
47
+ "style": "tall"
48
+ },
49
+ "tracking": {
50
+ "impressions": [
51
+ {
52
+ "key": "default",
53
+ "url": "https://api.admoai.com/v1/tracking?e=tok.card.full.impression"
54
+ }
55
+ ],
56
+ "clicks": [
57
+ {
58
+ "key": "default",
59
+ "url": "https://api.admoai.com/v1/tracking?e=tok.card.full.click"
60
+ }
61
+ ],
62
+ "custom": []
63
+ },
64
+ "metadata": {
65
+ "adId": "ad_01JDC69A0M6C0QGBF17PHDJ81B",
66
+ "creativeId": "creative_01JDJFV4GFKCR82452R7XXHX23",
67
+ "advertiserId": "advertiser_01JDH315KXW0FP82VY8WMV97YE",
68
+ "placementId": "placement_01JDGX7Z9JHJR8PN9HZJPDNFWA",
69
+ "templateId": "template_01JD19FWQSE5QZCVMVD705VQ89",
70
+ "priority": "standard",
71
+ "language": "en",
72
+ "format": "native",
73
+ "effectiveStandardFormatKey": "card",
74
+ "effectiveStandardFormatVersion": 1,
75
+ "templateSource": "admoai_standard"
76
+ }
77
+ }
78
+ ]
79
+ }
80
+ ],
81
+ "errors": null,
82
+ "warnings": null
83
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "success": true,
3
+ "data": [
4
+ {
5
+ "placement": "home_feed",
6
+ "creatives": [
7
+ {
8
+ "contents": [
9
+ {
10
+ "key": "image",
11
+ "type": "image",
12
+ "value": "https://cdn.admoai.com/media/volta-latte.jpg"
13
+ },
14
+ {
15
+ "key": "destination_url",
16
+ "type": "url",
17
+ "value": "https://volta.example/menu"
18
+ }
19
+ ],
20
+ "advertiser": {
21
+ "name": "Volta Coffee",
22
+ "legalName": "Volta Coffee SpA",
23
+ "logoUrl": "https://cdn.admoai.com/media/volta-logo.png"
24
+ },
25
+ "template": {
26
+ "key": "card",
27
+ "style": "default"
28
+ },
29
+ "tracking": {
30
+ "impressions": [
31
+ {
32
+ "key": "default",
33
+ "url": "https://api.admoai.com/v1/tracking?e=tok.card.minimal.impression"
34
+ }
35
+ ],
36
+ "clicks": [
37
+ {
38
+ "key": "default",
39
+ "url": "https://api.admoai.com/v1/tracking?e=tok.card.minimal.click"
40
+ }
41
+ ],
42
+ "custom": []
43
+ },
44
+ "metadata": {
45
+ "adId": "ad_01JD0R43Z2P97HWMHKNQKAY7EN",
46
+ "creativeId": "creative_01JD5WRV1EZCS0CB082W50BVNR",
47
+ "advertiserId": "advertiser_01JDH315KXW0FP82VY8WMV97YE",
48
+ "placementId": "placement_01JDGX7Z9JHJR8PN9HZJPDNFWA",
49
+ "templateId": "template_01JD1V81MZ1C8PC6HYXYPBQA8R",
50
+ "priority": "standard",
51
+ "language": "en",
52
+ "format": "native",
53
+ "effectiveStandardFormatKey": "card",
54
+ "effectiveStandardFormatVersion": 1,
55
+ "templateSource": "admoai_standard"
56
+ }
57
+ }
58
+ ]
59
+ }
60
+ ],
61
+ "errors": null,
62
+ "warnings": null
63
+ }
@@ -0,0 +1,119 @@
1
+ {
2
+ "success": true,
3
+ "data": [
4
+ {
5
+ "placement": "home_feed",
6
+ "creatives": [
7
+ {
8
+ "contents": [
9
+ {
10
+ "key": "slides",
11
+ "type": "group",
12
+ "value": [
13
+ {
14
+ "slideId": "slide_01JDS1H8VEM0ABE2PQ0JY6S38W",
15
+ "position": 1,
16
+ "contents": [
17
+ {
18
+ "key": "image",
19
+ "type": "image",
20
+ "value": "https://cdn.admoai.com/media/slide-a.jpg"
21
+ },
22
+ {
23
+ "key": "destination_url",
24
+ "type": "url",
25
+ "value": "https://volta.example/a"
26
+ }
27
+ ],
28
+ "tracking": {
29
+ "views": [
30
+ {
31
+ "key": "slide_view",
32
+ "url": "https://api.admoai.com/v1/tracking?e=tok.carousel.derived.slide1.slide_view"
33
+ }
34
+ ],
35
+ "clicks": [
36
+ {
37
+ "key": "default",
38
+ "url": "https://api.admoai.com/v1/tracking?e=tok.carousel.derived.slide1.click"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "slideId": "slide_01JDDGXJE0JDBY21Y9KEJDD54A",
45
+ "position": 2,
46
+ "contents": [
47
+ {
48
+ "key": "image",
49
+ "type": "image",
50
+ "value": "https://cdn.admoai.com/media/slide-b.jpg"
51
+ },
52
+ {
53
+ "key": "destination_url",
54
+ "type": "url",
55
+ "value": "https://volta.example/b"
56
+ }
57
+ ],
58
+ "tracking": {
59
+ "views": [
60
+ {
61
+ "key": "slide_view",
62
+ "url": "https://api.admoai.com/v1/tracking?e=tok.carousel.derived.slide2.slide_view"
63
+ }
64
+ ],
65
+ "clicks": [
66
+ {
67
+ "key": "default",
68
+ "url": "https://api.admoai.com/v1/tracking?e=tok.carousel.derived.slide2.click"
69
+ }
70
+ ]
71
+ }
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "key": "promo_code",
77
+ "type": "text",
78
+ "value": "VOLTA2X1"
79
+ }
80
+ ],
81
+ "advertiser": {
82
+ "name": "Volta Coffee",
83
+ "legalName": "Volta Coffee SpA",
84
+ "logoUrl": "https://cdn.admoai.com/media/volta-logo.png"
85
+ },
86
+ "template": {
87
+ "key": "city_carousel",
88
+ "style": "carousel"
89
+ },
90
+ "tracking": {
91
+ "impressions": [
92
+ {
93
+ "key": "default",
94
+ "url": "https://api.admoai.com/v1/tracking?e=tok.carousel.derived.impression"
95
+ }
96
+ ],
97
+ "clicks": [],
98
+ "custom": []
99
+ },
100
+ "metadata": {
101
+ "adId": "ad_01JD849HTYNJ7SX6H5JRBKZ069",
102
+ "creativeId": "creative_01JDS1H8VEM0ABE2PQ0JY6S38W",
103
+ "advertiserId": "advertiser_01JDH315KXW0FP82VY8WMV97YE",
104
+ "placementId": "placement_01JDGX7Z9JHJR8PN9HZJPDNFWA",
105
+ "templateId": "template_01JDDGXJE0JDBY21Y9KEJDD54A",
106
+ "priority": "standard",
107
+ "language": "en",
108
+ "format": "native",
109
+ "effectiveStandardFormatKey": "carousel",
110
+ "effectiveStandardFormatVersion": 1,
111
+ "templateSource": "based_on_standard"
112
+ }
113
+ }
114
+ ]
115
+ }
116
+ ],
117
+ "errors": null,
118
+ "warnings": null
119
+ }