rtblint-core 0.7.0 → 0.8.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/index.cjs +68 -0
- package/index.d.ts +87 -0
- package/index.mjs +62 -0
- package/package.json +1 -1
- package/wasm/rtblint_wasm.d.ts +39 -0
- package/wasm/rtblint_wasm.js +144 -1
- package/wasm/rtblint_wasm_bg.wasm +0 -0
- package/wasm/rtblint_wasm_bg.wasm.d.ts +6 -0
package/index.cjs
CHANGED
|
@@ -41,6 +41,68 @@ function validateResponseAgainstRequest(response, request, version) {
|
|
|
41
41
|
return wasm.validate_response_against_request(version ?? "", request, response);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Validate an OpenRTB bid request written in a specific JSON dialect.
|
|
46
|
+
* "spec-json" (default) types flag fields such as imp.secure, regs.coppa and
|
|
47
|
+
* pmp.private_auction as integers, the way the specification does.
|
|
48
|
+
* "proto-json" follows the IAB OpenRTB protobuf schema, which declares 28 of
|
|
49
|
+
* those fields bool; see protoBoolDivergences().
|
|
50
|
+
* @param {string} input - Raw bid request JSON.
|
|
51
|
+
* @param {"spec-json"|"proto-json"} dialect - JSON dialect the payload is written in.
|
|
52
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
53
|
+
*/
|
|
54
|
+
function validateDialect(input, dialect, version) {
|
|
55
|
+
return wasm.validate_dialect(version ?? "", dialect, input);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Validate an OpenRTB bid response written in a specific JSON dialect.
|
|
60
|
+
* @param {string} input - Raw bid response JSON.
|
|
61
|
+
* @param {"spec-json"|"proto-json"} dialect - JSON dialect the payload is written in.
|
|
62
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
63
|
+
*/
|
|
64
|
+
function validateResponseDialect(input, dialect, version) {
|
|
65
|
+
return wasm.validate_response_dialect(version ?? "", dialect, input);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Every field the IAB OpenRTB protobuf schema types differently from the spec. */
|
|
69
|
+
function protoBoolDivergences() {
|
|
70
|
+
return wasm.proto_bool_divergences();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Validate an ARTF RTBRequest envelope and the OpenRTB payloads it carries.
|
|
75
|
+
* @param {string} input - Raw RTBRequest JSON.
|
|
76
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
77
|
+
*/
|
|
78
|
+
function validateArtfRequest(input, version) {
|
|
79
|
+
return wasm.validate_artf_request(version ?? "", input);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Validate an ARTF RTBResponse mutation set against the RTBRequest it answers:
|
|
84
|
+
* intent eligibility, operation and payload coherence, and semantic path
|
|
85
|
+
* resolution against the auction.
|
|
86
|
+
* @param {string} rtbResponse - Raw RTBResponse JSON.
|
|
87
|
+
* @param {string} rtbRequest - Raw RTBRequest envelope JSON.
|
|
88
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
89
|
+
*/
|
|
90
|
+
function validateArtfResponse(rtbResponse, rtbRequest, version) {
|
|
91
|
+
return wasm.validate_artf_response(version ?? "", rtbRequest, rtbResponse);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Apply an ARTF mutation set and revalidate. Returns { result, application }:
|
|
96
|
+
* result carries the mutation findings plus the OpenRTB findings the mutations
|
|
97
|
+
* introduced, application carries the mutated payloads.
|
|
98
|
+
* @param {string} rtbResponse - Raw RTBResponse JSON.
|
|
99
|
+
* @param {string} rtbRequest - Raw RTBRequest envelope JSON.
|
|
100
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
101
|
+
*/
|
|
102
|
+
function validateArtfResponseApplied(rtbResponse, rtbRequest, version) {
|
|
103
|
+
return wasm.validate_artf_response_applied(version ?? "", rtbRequest, rtbResponse);
|
|
104
|
+
}
|
|
105
|
+
|
|
44
106
|
/** Every tracked OpenRTB version id. */
|
|
45
107
|
function versions() {
|
|
46
108
|
return wasm.versions();
|
|
@@ -60,6 +122,12 @@ module.exports = {
|
|
|
60
122
|
validate,
|
|
61
123
|
validateResponse,
|
|
62
124
|
validateResponseAgainstRequest,
|
|
125
|
+
validateDialect,
|
|
126
|
+
validateResponseDialect,
|
|
127
|
+
protoBoolDivergences,
|
|
128
|
+
validateArtfRequest,
|
|
129
|
+
validateArtfResponse,
|
|
130
|
+
validateArtfResponseApplied,
|
|
63
131
|
versions,
|
|
64
132
|
rules,
|
|
65
133
|
coreVersion,
|
package/index.d.ts
CHANGED
|
@@ -53,6 +53,93 @@ export function validateResponseAgainstRequest(
|
|
|
53
53
|
version?: string
|
|
54
54
|
): ValidationResult;
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* JSON dialect a payload is written in. "spec-json" types flag fields such as
|
|
58
|
+
* imp.secure, regs.coppa and pmp.private_auction as integers, the way the
|
|
59
|
+
* OpenRTB specification does. "proto-json" follows the IAB OpenRTB protobuf
|
|
60
|
+
* schema, which declares 28 of those fields bool.
|
|
61
|
+
*/
|
|
62
|
+
export type Dialect = "spec-json" | "proto-json";
|
|
63
|
+
|
|
64
|
+
/** A field the OpenRTB protobuf schema types differently from the spec. */
|
|
65
|
+
export interface ProtoBoolField {
|
|
66
|
+
object: string;
|
|
67
|
+
field: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** What applying an ARTF mutation set produced. */
|
|
71
|
+
export interface ArtfApplication {
|
|
72
|
+
/** The bid request after every applicable mutation was applied. */
|
|
73
|
+
bid_request: string | null;
|
|
74
|
+
/** The bid response after every applicable mutation was applied. */
|
|
75
|
+
bid_response: string | null;
|
|
76
|
+
/** Indexes into `mutations` that were applied. */
|
|
77
|
+
applied: number[];
|
|
78
|
+
/** Indexes that were not applied: unresolved target, or no OpenRTB field to write to. */
|
|
79
|
+
skipped: number[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface ArtfMutationOutcome {
|
|
83
|
+
result: ValidationResult;
|
|
84
|
+
application: ArtfApplication;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Validate an OpenRTB bid request written in a specific JSON dialect.
|
|
89
|
+
* @param input Raw bid request JSON.
|
|
90
|
+
* @param dialect Dialect the payload is written in.
|
|
91
|
+
* @param version OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
92
|
+
*/
|
|
93
|
+
export function validateDialect(
|
|
94
|
+
input: string,
|
|
95
|
+
dialect: Dialect,
|
|
96
|
+
version?: string
|
|
97
|
+
): ValidationResult;
|
|
98
|
+
|
|
99
|
+
/** Validate an OpenRTB bid response written in a specific JSON dialect. */
|
|
100
|
+
export function validateResponseDialect(
|
|
101
|
+
input: string,
|
|
102
|
+
dialect: Dialect,
|
|
103
|
+
version?: string
|
|
104
|
+
): ValidationResult;
|
|
105
|
+
|
|
106
|
+
/** Every field the OpenRTB protobuf schema types differently from the spec. */
|
|
107
|
+
export function protoBoolDivergences(): ProtoBoolField[];
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Validate an ARTF RTBRequest envelope and the OpenRTB payloads it carries.
|
|
111
|
+
* @param input Raw RTBRequest JSON.
|
|
112
|
+
* @param version OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
113
|
+
*/
|
|
114
|
+
export function validateArtfRequest(input: string, version?: string): ValidationResult;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Validate an ARTF RTBResponse mutation set against the RTBRequest it answers:
|
|
118
|
+
* intent eligibility, operation and payload coherence, and semantic path
|
|
119
|
+
* resolution against the auction.
|
|
120
|
+
* @param rtbResponse Raw RTBResponse JSON.
|
|
121
|
+
* @param rtbRequest Raw RTBRequest envelope JSON.
|
|
122
|
+
* @param version OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
123
|
+
*/
|
|
124
|
+
export function validateArtfResponse(
|
|
125
|
+
rtbResponse: string,
|
|
126
|
+
rtbRequest: string,
|
|
127
|
+
version?: string
|
|
128
|
+
): ValidationResult;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Apply an ARTF mutation set and revalidate, reporting the mutation findings
|
|
132
|
+
* plus the OpenRTB findings the mutations introduced.
|
|
133
|
+
* @param rtbResponse Raw RTBResponse JSON.
|
|
134
|
+
* @param rtbRequest Raw RTBRequest envelope JSON.
|
|
135
|
+
* @param version OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
136
|
+
*/
|
|
137
|
+
export function validateArtfResponseApplied(
|
|
138
|
+
rtbResponse: string,
|
|
139
|
+
rtbRequest: string,
|
|
140
|
+
version?: string
|
|
141
|
+
): ArtfMutationOutcome;
|
|
142
|
+
|
|
56
143
|
/** Every tracked OpenRTB version id. */
|
|
57
144
|
export function versions(): string[];
|
|
58
145
|
|
package/index.mjs
CHANGED
|
@@ -42,6 +42,68 @@ export function validateResponseAgainstRequest(response, request, version) {
|
|
|
42
42
|
return wasm.validate_response_against_request(version ?? "", request, response);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Validate an OpenRTB bid request written in a specific JSON dialect.
|
|
47
|
+
* "spec-json" (default) types flag fields such as imp.secure, regs.coppa and
|
|
48
|
+
* pmp.private_auction as integers, the way the specification does.
|
|
49
|
+
* "proto-json" follows the IAB OpenRTB protobuf schema, which declares 28 of
|
|
50
|
+
* those fields bool; see protoBoolDivergences().
|
|
51
|
+
* @param {string} input - Raw bid request JSON.
|
|
52
|
+
* @param {"spec-json"|"proto-json"} dialect - JSON dialect the payload is written in.
|
|
53
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
54
|
+
*/
|
|
55
|
+
export function validateDialect(input, dialect, version) {
|
|
56
|
+
return wasm.validate_dialect(version ?? "", dialect, input);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Validate an OpenRTB bid response written in a specific JSON dialect.
|
|
61
|
+
* @param {string} input - Raw bid response JSON.
|
|
62
|
+
* @param {"spec-json"|"proto-json"} dialect - JSON dialect the payload is written in.
|
|
63
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
64
|
+
*/
|
|
65
|
+
export function validateResponseDialect(input, dialect, version) {
|
|
66
|
+
return wasm.validate_response_dialect(version ?? "", dialect, input);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Every field the IAB OpenRTB protobuf schema types differently from the spec. */
|
|
70
|
+
export function protoBoolDivergences() {
|
|
71
|
+
return wasm.proto_bool_divergences();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Validate an ARTF RTBRequest envelope and the OpenRTB payloads it carries.
|
|
76
|
+
* @param {string} input - Raw RTBRequest JSON.
|
|
77
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
78
|
+
*/
|
|
79
|
+
export function validateArtfRequest(input, version) {
|
|
80
|
+
return wasm.validate_artf_request(version ?? "", input);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Validate an ARTF RTBResponse mutation set against the RTBRequest it answers:
|
|
85
|
+
* intent eligibility, operation and payload coherence, and semantic path
|
|
86
|
+
* resolution against the auction.
|
|
87
|
+
* @param {string} rtbResponse - Raw RTBResponse JSON.
|
|
88
|
+
* @param {string} rtbRequest - Raw RTBRequest envelope JSON.
|
|
89
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
90
|
+
*/
|
|
91
|
+
export function validateArtfResponse(rtbResponse, rtbRequest, version) {
|
|
92
|
+
return wasm.validate_artf_response(version ?? "", rtbRequest, rtbResponse);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Apply an ARTF mutation set and revalidate. Returns { result, application }:
|
|
97
|
+
* result carries the mutation findings plus the OpenRTB findings the mutations
|
|
98
|
+
* introduced, application carries the mutated payloads.
|
|
99
|
+
* @param {string} rtbResponse - Raw RTBResponse JSON.
|
|
100
|
+
* @param {string} rtbRequest - Raw RTBRequest envelope JSON.
|
|
101
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
102
|
+
*/
|
|
103
|
+
export function validateArtfResponseApplied(rtbResponse, rtbRequest, version) {
|
|
104
|
+
return wasm.validate_artf_response_applied(version ?? "", rtbRequest, rtbResponse);
|
|
105
|
+
}
|
|
106
|
+
|
|
45
107
|
/** Every tracked OpenRTB version id. */
|
|
46
108
|
export function versions() {
|
|
47
109
|
return wasm.versions();
|
package/package.json
CHANGED
package/wasm/rtblint_wasm.d.ts
CHANGED
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export function core_version(): string;
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Every field where the IAB OpenRTB protobuf schema and the specification
|
|
11
|
+
* disagree on the type, as `{ object, field }` pairs. Drives the dialect
|
|
12
|
+
* documentation.
|
|
13
|
+
*/
|
|
14
|
+
export function proto_bool_divergences(): any;
|
|
15
|
+
|
|
9
16
|
/**
|
|
10
17
|
* The full versioned rule catalog: one entry per coded rule across every
|
|
11
18
|
* tracked OpenRTB version. Drives the per-rule documentation pages.
|
|
@@ -19,6 +26,33 @@ export function rules(): any;
|
|
|
19
26
|
*/
|
|
20
27
|
export function validate(input: string): any;
|
|
21
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Validate an ARTF RTBRequest envelope and the OpenRTB payloads it carries.
|
|
31
|
+
*/
|
|
32
|
+
export function validate_artf_request(version_id: string, input: string): any;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Validate an ARTF RTBResponse mutation set against the RTBRequest envelope
|
|
36
|
+
* it answers: intent eligibility, operation and payload coherence, and
|
|
37
|
+
* semantic path resolution against the auction.
|
|
38
|
+
*/
|
|
39
|
+
export function validate_artf_response(version_id: string, rtb_request: string, rtb_response: string): any;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Apply an ARTF mutation set and revalidate: returns `{ result, application }`
|
|
43
|
+
* where result carries the mutation findings plus the OpenRTB findings the
|
|
44
|
+
* mutations introduced, and application carries the mutated payloads.
|
|
45
|
+
*/
|
|
46
|
+
export function validate_artf_response_applied(version_id: string, rtb_request: string, rtb_response: string): any;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Validate an OpenRTB bid request written in a specific JSON dialect
|
|
50
|
+
* ("spec-json" or "proto-json"). protobuf JSON declares 28 of the spec's
|
|
51
|
+
* integer flag fields as bool, so the two encodings disagree in both
|
|
52
|
+
* directions; see `proto_bool_divergences`.
|
|
53
|
+
*/
|
|
54
|
+
export function validate_dialect(version_id: string, dialect_id: string, input: string): any;
|
|
55
|
+
|
|
22
56
|
/**
|
|
23
57
|
* Validate an OpenRTB bid response payload against the latest tracked 2.6 snapshot.
|
|
24
58
|
*
|
|
@@ -35,6 +69,11 @@ export function validate_response(input: string): any;
|
|
|
35
69
|
*/
|
|
36
70
|
export function validate_response_against_request(version_id: string, request: string, response: string): any;
|
|
37
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Validate an OpenRTB bid response written in a specific JSON dialect.
|
|
74
|
+
*/
|
|
75
|
+
export function validate_response_dialect(version_id: string, dialect_id: string, input: string): any;
|
|
76
|
+
|
|
38
77
|
/**
|
|
39
78
|
* Validate an OpenRTB bid response payload against a specific tracked version id
|
|
40
79
|
* (for example "2.6-202606"). Unknown ids fall back to the latest 2.6 snapshot.
|
package/wasm/rtblint_wasm.js
CHANGED
|
@@ -18,6 +18,21 @@ function core_version() {
|
|
|
18
18
|
}
|
|
19
19
|
exports.core_version = core_version;
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Every field where the IAB OpenRTB protobuf schema and the specification
|
|
23
|
+
* disagree on the type, as `{ object, field }` pairs. Drives the dialect
|
|
24
|
+
* documentation.
|
|
25
|
+
* @returns {any}
|
|
26
|
+
*/
|
|
27
|
+
function proto_bool_divergences() {
|
|
28
|
+
const ret = wasm.proto_bool_divergences();
|
|
29
|
+
if (ret[2]) {
|
|
30
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
31
|
+
}
|
|
32
|
+
return takeFromExternrefTable0(ret[0]);
|
|
33
|
+
}
|
|
34
|
+
exports.proto_bool_divergences = proto_bool_divergences;
|
|
35
|
+
|
|
21
36
|
/**
|
|
22
37
|
* The full versioned rule catalog: one entry per coded rule across every
|
|
23
38
|
* tracked OpenRTB version. Drives the per-rule documentation pages.
|
|
@@ -50,6 +65,98 @@ function validate(input) {
|
|
|
50
65
|
}
|
|
51
66
|
exports.validate = validate;
|
|
52
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Validate an ARTF RTBRequest envelope and the OpenRTB payloads it carries.
|
|
70
|
+
* @param {string} version_id
|
|
71
|
+
* @param {string} input
|
|
72
|
+
* @returns {any}
|
|
73
|
+
*/
|
|
74
|
+
function validate_artf_request(version_id, input) {
|
|
75
|
+
const ptr0 = passStringToWasm0(version_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
76
|
+
const len0 = WASM_VECTOR_LEN;
|
|
77
|
+
const ptr1 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
78
|
+
const len1 = WASM_VECTOR_LEN;
|
|
79
|
+
const ret = wasm.validate_artf_request(ptr0, len0, ptr1, len1);
|
|
80
|
+
if (ret[2]) {
|
|
81
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
82
|
+
}
|
|
83
|
+
return takeFromExternrefTable0(ret[0]);
|
|
84
|
+
}
|
|
85
|
+
exports.validate_artf_request = validate_artf_request;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Validate an ARTF RTBResponse mutation set against the RTBRequest envelope
|
|
89
|
+
* it answers: intent eligibility, operation and payload coherence, and
|
|
90
|
+
* semantic path resolution against the auction.
|
|
91
|
+
* @param {string} version_id
|
|
92
|
+
* @param {string} rtb_request
|
|
93
|
+
* @param {string} rtb_response
|
|
94
|
+
* @returns {any}
|
|
95
|
+
*/
|
|
96
|
+
function validate_artf_response(version_id, rtb_request, rtb_response) {
|
|
97
|
+
const ptr0 = passStringToWasm0(version_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
98
|
+
const len0 = WASM_VECTOR_LEN;
|
|
99
|
+
const ptr1 = passStringToWasm0(rtb_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
100
|
+
const len1 = WASM_VECTOR_LEN;
|
|
101
|
+
const ptr2 = passStringToWasm0(rtb_response, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
102
|
+
const len2 = WASM_VECTOR_LEN;
|
|
103
|
+
const ret = wasm.validate_artf_response(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
104
|
+
if (ret[2]) {
|
|
105
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
106
|
+
}
|
|
107
|
+
return takeFromExternrefTable0(ret[0]);
|
|
108
|
+
}
|
|
109
|
+
exports.validate_artf_response = validate_artf_response;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Apply an ARTF mutation set and revalidate: returns `{ result, application }`
|
|
113
|
+
* where result carries the mutation findings plus the OpenRTB findings the
|
|
114
|
+
* mutations introduced, and application carries the mutated payloads.
|
|
115
|
+
* @param {string} version_id
|
|
116
|
+
* @param {string} rtb_request
|
|
117
|
+
* @param {string} rtb_response
|
|
118
|
+
* @returns {any}
|
|
119
|
+
*/
|
|
120
|
+
function validate_artf_response_applied(version_id, rtb_request, rtb_response) {
|
|
121
|
+
const ptr0 = passStringToWasm0(version_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
122
|
+
const len0 = WASM_VECTOR_LEN;
|
|
123
|
+
const ptr1 = passStringToWasm0(rtb_request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
124
|
+
const len1 = WASM_VECTOR_LEN;
|
|
125
|
+
const ptr2 = passStringToWasm0(rtb_response, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
126
|
+
const len2 = WASM_VECTOR_LEN;
|
|
127
|
+
const ret = wasm.validate_artf_response_applied(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
128
|
+
if (ret[2]) {
|
|
129
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
130
|
+
}
|
|
131
|
+
return takeFromExternrefTable0(ret[0]);
|
|
132
|
+
}
|
|
133
|
+
exports.validate_artf_response_applied = validate_artf_response_applied;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Validate an OpenRTB bid request written in a specific JSON dialect
|
|
137
|
+
* ("spec-json" or "proto-json"). protobuf JSON declares 28 of the spec's
|
|
138
|
+
* integer flag fields as bool, so the two encodings disagree in both
|
|
139
|
+
* directions; see `proto_bool_divergences`.
|
|
140
|
+
* @param {string} version_id
|
|
141
|
+
* @param {string} dialect_id
|
|
142
|
+
* @param {string} input
|
|
143
|
+
* @returns {any}
|
|
144
|
+
*/
|
|
145
|
+
function validate_dialect(version_id, dialect_id, input) {
|
|
146
|
+
const ptr0 = passStringToWasm0(version_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
147
|
+
const len0 = WASM_VECTOR_LEN;
|
|
148
|
+
const ptr1 = passStringToWasm0(dialect_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
149
|
+
const len1 = WASM_VECTOR_LEN;
|
|
150
|
+
const ptr2 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
151
|
+
const len2 = WASM_VECTOR_LEN;
|
|
152
|
+
const ret = wasm.validate_dialect(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
153
|
+
if (ret[2]) {
|
|
154
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
155
|
+
}
|
|
156
|
+
return takeFromExternrefTable0(ret[0]);
|
|
157
|
+
}
|
|
158
|
+
exports.validate_dialect = validate_dialect;
|
|
159
|
+
|
|
53
160
|
/**
|
|
54
161
|
* Validate an OpenRTB bid response payload against the latest tracked 2.6 snapshot.
|
|
55
162
|
*
|
|
@@ -94,6 +201,28 @@ function validate_response_against_request(version_id, request, response) {
|
|
|
94
201
|
}
|
|
95
202
|
exports.validate_response_against_request = validate_response_against_request;
|
|
96
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Validate an OpenRTB bid response written in a specific JSON dialect.
|
|
206
|
+
* @param {string} version_id
|
|
207
|
+
* @param {string} dialect_id
|
|
208
|
+
* @param {string} input
|
|
209
|
+
* @returns {any}
|
|
210
|
+
*/
|
|
211
|
+
function validate_response_dialect(version_id, dialect_id, input) {
|
|
212
|
+
const ptr0 = passStringToWasm0(version_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
213
|
+
const len0 = WASM_VECTOR_LEN;
|
|
214
|
+
const ptr1 = passStringToWasm0(dialect_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
215
|
+
const len1 = WASM_VECTOR_LEN;
|
|
216
|
+
const ptr2 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
217
|
+
const len2 = WASM_VECTOR_LEN;
|
|
218
|
+
const ret = wasm.validate_response_dialect(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
219
|
+
if (ret[2]) {
|
|
220
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
221
|
+
}
|
|
222
|
+
return takeFromExternrefTable0(ret[0]);
|
|
223
|
+
}
|
|
224
|
+
exports.validate_response_dialect = validate_response_dialect;
|
|
225
|
+
|
|
97
226
|
/**
|
|
98
227
|
* Validate an OpenRTB bid response payload against a specific tracked version id
|
|
99
228
|
* (for example "2.6-202606"). Unknown ids fall back to the latest 2.6 snapshot.
|
|
@@ -149,6 +278,10 @@ exports.versions = versions;
|
|
|
149
278
|
function __wbg_get_imports() {
|
|
150
279
|
const import0 = {
|
|
151
280
|
__proto__: null,
|
|
281
|
+
__wbg_Error_fdd633d4bb5dd76a: function(arg0, arg1) {
|
|
282
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
283
|
+
return ret;
|
|
284
|
+
},
|
|
152
285
|
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
153
286
|
const ret = String(arg1);
|
|
154
287
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -173,11 +306,21 @@ function __wbg_get_imports() {
|
|
|
173
306
|
__wbg_set_dc601f4a69da0bc2: function(arg0, arg1, arg2) {
|
|
174
307
|
arg0[arg1 >>> 0] = arg2;
|
|
175
308
|
},
|
|
176
|
-
__wbindgen_cast_0000000000000001: function(arg0
|
|
309
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
310
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
311
|
+
const ret = arg0;
|
|
312
|
+
return ret;
|
|
313
|
+
},
|
|
314
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
177
315
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
178
316
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
179
317
|
return ret;
|
|
180
318
|
},
|
|
319
|
+
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
320
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
321
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
322
|
+
return ret;
|
|
323
|
+
},
|
|
181
324
|
__wbindgen_init_externref_table: function() {
|
|
182
325
|
const table = wasm.__wbindgen_externrefs;
|
|
183
326
|
const offset = table.grow(4);
|
|
Binary file
|
|
@@ -2,10 +2,16 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const core_version: () => [number, number];
|
|
5
|
+
export const proto_bool_divergences: () => [number, number, number];
|
|
5
6
|
export const rules: () => [number, number, number];
|
|
6
7
|
export const validate: (a: number, b: number) => [number, number, number];
|
|
8
|
+
export const validate_artf_request: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
9
|
+
export const validate_artf_response: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
10
|
+
export const validate_artf_response_applied: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
11
|
+
export const validate_dialect: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
7
12
|
export const validate_response: (a: number, b: number) => [number, number, number];
|
|
8
13
|
export const validate_response_against_request: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
14
|
+
export const validate_response_dialect: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
9
15
|
export const validate_response_version: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
10
16
|
export const validate_version: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
11
17
|
export const versions: () => [number, number, number];
|