rtblint-core 0.2.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/LICENSE +185 -0
- package/NOTICE +19 -0
- package/README.md +48 -0
- package/index.cjs +46 -0
- package/index.d.ts +48 -0
- package/index.mjs +45 -0
- package/package.json +46 -0
- package/wasm/rtblint_wasm.d.ts +44 -0
- package/wasm/rtblint_wasm.js +260 -0
- package/wasm/rtblint_wasm_bg.wasm +0 -0
- package/wasm/rtblint_wasm_bg.wasm.d.ts +16 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
42
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
43
|
+
of this License, Derivative Works shall not include works that remain
|
|
44
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
45
|
+
the Work and its Derivative Works thereof.
|
|
46
|
+
|
|
47
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
48
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
49
|
+
authorized to submit on behalf of the copyright owner. For the purposes
|
|
50
|
+
of this definition, "submitted" means any form of electronic, verbal,
|
|
51
|
+
or written communication sent to the Licensor or its representatives,
|
|
52
|
+
including but not limited to communication on electronic mailing lists,
|
|
53
|
+
source code control systems, and issue tracking systems that are managed
|
|
54
|
+
by, or on behalf of, the Licensor for the purpose of discussing and
|
|
55
|
+
improving the Work, but excluding communication that is conspicuously
|
|
56
|
+
marked or designated in writing by the copyright owner as "Not a
|
|
57
|
+
Contribution."
|
|
58
|
+
|
|
59
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
60
|
+
whom a Contribution has been received by the Licensor and included
|
|
61
|
+
within the Work.
|
|
62
|
+
|
|
63
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
64
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
65
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
66
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
67
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
68
|
+
Work and such Derivative Works in Source or Object form.
|
|
69
|
+
|
|
70
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
71
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
72
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
73
|
+
(except as stated in this section) patent license to make, have made,
|
|
74
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
75
|
+
where such license applies only to those patent claims licensable
|
|
76
|
+
by such Contributor that are necessarily infringed by their
|
|
77
|
+
Contribution(s) alone or by the combination of their Contribution(s)
|
|
78
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
79
|
+
institute patent litigation against any entity (including a cross-claim
|
|
80
|
+
or counterclaim in a lawsuit) alleging that the Work or any
|
|
81
|
+
Contribution embodied within the Work constitutes direct or
|
|
82
|
+
contributory patent infringement, then any patent licenses granted to
|
|
83
|
+
You under this License for that Work shall terminate as of the date
|
|
84
|
+
such litigation is filed.
|
|
85
|
+
|
|
86
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
87
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
88
|
+
modifications, and in Source or Object form, provided that You
|
|
89
|
+
meet the following conditions:
|
|
90
|
+
|
|
91
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
92
|
+
Works a copy of this License; and
|
|
93
|
+
|
|
94
|
+
(b) You must cause any modified files to carry prominent notices
|
|
95
|
+
stating that You changed the files; and
|
|
96
|
+
|
|
97
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
98
|
+
that You distribute, all copyright, patent, trademark, and
|
|
99
|
+
attribution notices from the Source form of the Work,
|
|
100
|
+
excluding those notices that do not pertain to any part of
|
|
101
|
+
the Derivative Works; and
|
|
102
|
+
|
|
103
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
104
|
+
distribution, You must include a readable copy of the
|
|
105
|
+
attribution notices contained within such NOTICE file, in
|
|
106
|
+
at least one of the following places: within a NOTICE text
|
|
107
|
+
file distributed as part of the Derivative Works; within
|
|
108
|
+
the Source form or documentation, if provided along with the
|
|
109
|
+
Derivative Works; or, within a display generated by the
|
|
110
|
+
Derivative Works, if and wherever such third-party notices
|
|
111
|
+
normally appear. The contents of the NOTICE file are for
|
|
112
|
+
informational purposes only and do not modify the License.
|
|
113
|
+
You may add Your own attribution notices within Derivative
|
|
114
|
+
Works that You distribute, alongside or as an addendum to
|
|
115
|
+
the NOTICE text from the Work, provided that such additional
|
|
116
|
+
attribution notices cannot be construed as modifying the
|
|
117
|
+
License.
|
|
118
|
+
|
|
119
|
+
You may add Your own license statement for Your modifications and
|
|
120
|
+
may provide additional grant of rights to use, reproduce, modify,
|
|
121
|
+
prepare Derivative Works of, collect, publish, distribute, sublicense,
|
|
122
|
+
and/or sell copies of Your modifications or for such Derivative Works
|
|
123
|
+
as a whole, provided Your use, reproduction, and distribution of the
|
|
124
|
+
Work otherwise complies with the conditions stated in this License.
|
|
125
|
+
|
|
126
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
127
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
128
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
129
|
+
this License, without any additional terms or conditions.
|
|
130
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
131
|
+
the terms of any separate license agreement you may have executed
|
|
132
|
+
with Licensor regarding such Contributions.
|
|
133
|
+
|
|
134
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
135
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
136
|
+
except as required for reasonable and customary use in describing the
|
|
137
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
138
|
+
|
|
139
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
140
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
141
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
142
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
143
|
+
implied, including, without limitation, any warranties or conditions
|
|
144
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
145
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
146
|
+
appropriateness of using or reproducing the Work and assume any
|
|
147
|
+
risks associated with Your exercise of permissions under this License.
|
|
148
|
+
|
|
149
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
150
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
151
|
+
unless required by applicable law (such as deliberate and grossly
|
|
152
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
153
|
+
liable to You for damages, including any direct, indirect, special,
|
|
154
|
+
incidental, or exemplary damages of any character arising as a
|
|
155
|
+
result of this License or out of the use or inability to use the
|
|
156
|
+
Work (even if such Contributor has been advised of the possibility
|
|
157
|
+
of such damages).
|
|
158
|
+
|
|
159
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
160
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
161
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
162
|
+
or other liability obligations and/or rights consistent with this
|
|
163
|
+
License. However, in accepting such obligations, You may offer such
|
|
164
|
+
obligations only on Your own behalf and on Your sole responsibility,
|
|
165
|
+
not on behalf of any other Contributor, and only if You agree to
|
|
166
|
+
indemnify, defend, and hold each Contributor harmless for any
|
|
167
|
+
liability incurred by, or claims asserted against, such Contributor
|
|
168
|
+
by reason of your accepting any such warranty or additional liability.
|
|
169
|
+
|
|
170
|
+
END OF TERMS AND CONDITIONS
|
|
171
|
+
|
|
172
|
+
Copyright 2026 aleksUIX
|
|
173
|
+
https://github.com/aleksUIX/vastlint
|
|
174
|
+
|
|
175
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
176
|
+
you may not use this file except in compliance with the License.
|
|
177
|
+
You may obtain a copy of the License at
|
|
178
|
+
|
|
179
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
180
|
+
|
|
181
|
+
Unless required by applicable law or agreed to in writing, software
|
|
182
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
183
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
184
|
+
See the License for the specific language governing permissions and
|
|
185
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
rtblint
|
|
2
|
+
Copyright 2026 Aleksander Sekowski
|
|
3
|
+
https://github.com/aleksUIX/rtblint
|
|
4
|
+
|
|
5
|
+
An OpenRTB linter. Validates OpenRTB 2.x bid request and bid response
|
|
6
|
+
payloads against the versioned IAB Tech Lab OpenRTB specifications.
|
|
7
|
+
|
|
8
|
+
OpenRTB is a specification published by IAB Tech Lab
|
|
9
|
+
(https://iabtechlab.com, https://github.com/InteractiveAdvertisingBureau).
|
|
10
|
+
This product includes structured metadata (object names, field names, type
|
|
11
|
+
notations, section references, and enumerated value sets) derived from the
|
|
12
|
+
OpenRTB specifications. rtblint is not affiliated with or endorsed by IAB
|
|
13
|
+
Tech Lab.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
This product includes software developed by the rtblint project.
|
|
18
|
+
If you distribute this software or a derivative work, you must include
|
|
19
|
+
this NOTICE file in your distribution.
|
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# rtblint
|
|
2
|
+
|
|
3
|
+
**OpenRTB linter for Node.** Validates OpenRTB 2.x bid requests and bid responses against versioned IAB spec snapshots, from 2.0 through the monthly 2.6 releases. Backed by the rtblint Rust core compiled to WASM; no native dependencies.
|
|
4
|
+
|
|
5
|
+
Website and playground: [rtblint.org](https://rtblint.org)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install rtblint-core
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { validate, validateResponse, versions, rules } from "rtblint-core";
|
|
17
|
+
// or: const { validate } = require("rtblint-core");
|
|
18
|
+
|
|
19
|
+
const report = validate(JSON.stringify(bidRequest)); // latest tracked 2.6
|
|
20
|
+
const legacy = validate(JSON.stringify(bidRequest), "2.5"); // version-aware
|
|
21
|
+
const response = validateResponse(JSON.stringify(bidResponse));
|
|
22
|
+
|
|
23
|
+
if (!report.valid) {
|
|
24
|
+
for (const issue of report.issues) {
|
|
25
|
+
console.log(`[${issue.severity}] ${issue.path}: ${issue.message} (${issue.id})`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log(versions()); // every tracked OpenRTB version id
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## API
|
|
33
|
+
|
|
34
|
+
- `validate(input, version?)` validates a bid request JSON string
|
|
35
|
+
- `validateResponse(input, version?)` validates a bid response JSON string
|
|
36
|
+
- `versions()` lists every tracked OpenRTB version id
|
|
37
|
+
- `rules()` returns the versioned rule catalog (codes, paths, summaries, spec sections)
|
|
38
|
+
- `coreVersion()` reports the rtblint-core build version
|
|
39
|
+
|
|
40
|
+
Findings carry a stable rule id, a severity (`error` or `warning`), a message, and a JSON path into the payload.
|
|
41
|
+
|
|
42
|
+
## Other surfaces
|
|
43
|
+
|
|
44
|
+
Rust CLI and library on [crates.io](https://crates.io/crates/rtblint), MCP server as [rtblint-mcp](https://crates.io/crates/rtblint-mcp).
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
Apache-2.0. See LICENSE and NOTICE.
|
package/index.cjs
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* rtblint: OpenRTB bid request / bid response linter.
|
|
5
|
+
* CJS entry point backed by the rtblint-core WASM build.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const wasm = require("./wasm/rtblint_wasm.js");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Validate an OpenRTB bid request JSON string.
|
|
12
|
+
* @param {string} input - Raw bid request JSON.
|
|
13
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
14
|
+
* @returns {{valid: boolean, issues: Array<{id: string, severity: string, message: string, path?: string}>}}
|
|
15
|
+
*/
|
|
16
|
+
function validate(input, version) {
|
|
17
|
+
return version === undefined ? wasm.validate(input) : wasm.validate_version(version, input);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Validate an OpenRTB bid response JSON string.
|
|
22
|
+
* @param {string} input - Raw bid response JSON.
|
|
23
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
24
|
+
*/
|
|
25
|
+
function validateResponse(input, version) {
|
|
26
|
+
return version === undefined
|
|
27
|
+
? wasm.validate_response(input)
|
|
28
|
+
: wasm.validate_response_version(version, input);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Every tracked OpenRTB version id. */
|
|
32
|
+
function versions() {
|
|
33
|
+
return wasm.versions();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The full versioned rule catalog, one entry per coded rule. */
|
|
37
|
+
function rules() {
|
|
38
|
+
return wasm.rules();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The rtblint-core version this build was compiled against. */
|
|
42
|
+
function coreVersion() {
|
|
43
|
+
return wasm.core_version();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = { validate, validateResponse, versions, rules, coreVersion };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface Issue {
|
|
2
|
+
id: string;
|
|
3
|
+
severity: "error" | "warning";
|
|
4
|
+
message: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
/** OpenRTB spec section the finding derives from, e.g. "3.2.7". */
|
|
7
|
+
section?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ValidationResult {
|
|
11
|
+
valid: boolean;
|
|
12
|
+
issues: Issue[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Rule {
|
|
16
|
+
code: string;
|
|
17
|
+
version: string;
|
|
18
|
+
release_date: string;
|
|
19
|
+
kind: string;
|
|
20
|
+
paths: string[];
|
|
21
|
+
replacement_paths: string[];
|
|
22
|
+
summary: string;
|
|
23
|
+
section: string;
|
|
24
|
+
source: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Validate an OpenRTB bid request JSON string.
|
|
29
|
+
* @param input Raw bid request JSON.
|
|
30
|
+
* @param version OpenRTB version id, e.g. "2.6-202505" (default: latest tracked 2.6 snapshot).
|
|
31
|
+
*/
|
|
32
|
+
export function validate(input: string, version?: string): ValidationResult;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Validate an OpenRTB bid response JSON string.
|
|
36
|
+
* @param input Raw bid response JSON.
|
|
37
|
+
* @param version OpenRTB version id, e.g. "2.6-202505" (default: latest tracked 2.6 snapshot).
|
|
38
|
+
*/
|
|
39
|
+
export function validateResponse(input: string, version?: string): ValidationResult;
|
|
40
|
+
|
|
41
|
+
/** Every tracked OpenRTB version id. */
|
|
42
|
+
export function versions(): string[];
|
|
43
|
+
|
|
44
|
+
/** The full versioned rule catalog, one entry per coded rule. */
|
|
45
|
+
export function rules(): Rule[];
|
|
46
|
+
|
|
47
|
+
/** The rtblint-core version this build was compiled against. */
|
|
48
|
+
export function coreVersion(): string;
|
package/index.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rtblint: OpenRTB bid request / bid response linter.
|
|
3
|
+
* ESM entry point backed by the rtblint-core WASM build.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const wasm = require("./wasm/rtblint_wasm.js");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Validate an OpenRTB bid request JSON string.
|
|
13
|
+
* @param {string} input - Raw bid request JSON.
|
|
14
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
15
|
+
* @returns {{valid: boolean, issues: Array<{id: string, severity: string, message: string, path?: string}>}}
|
|
16
|
+
*/
|
|
17
|
+
export function validate(input, version) {
|
|
18
|
+
return version === undefined ? wasm.validate(input) : wasm.validate_version(version, input);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Validate an OpenRTB bid response JSON string.
|
|
23
|
+
* @param {string} input - Raw bid response JSON.
|
|
24
|
+
* @param {string} [version] - OpenRTB version id (default: latest tracked 2.6 snapshot).
|
|
25
|
+
*/
|
|
26
|
+
export function validateResponse(input, version) {
|
|
27
|
+
return version === undefined
|
|
28
|
+
? wasm.validate_response(input)
|
|
29
|
+
: wasm.validate_response_version(version, input);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Every tracked OpenRTB version id. */
|
|
33
|
+
export function versions() {
|
|
34
|
+
return wasm.versions();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The full versioned rule catalog, one entry per coded rule. */
|
|
38
|
+
export function rules() {
|
|
39
|
+
return wasm.rules();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The rtblint-core version this build was compiled against. */
|
|
43
|
+
export function coreVersion() {
|
|
44
|
+
return wasm.core_version();
|
|
45
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rtblint-core",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "OpenRTB linter: validates OpenRTB 2.x bid requests and bid responses against versioned IAB spec snapshots",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "Aleks <aleks@vastlint.org>",
|
|
7
|
+
"homepage": "https://rtblint.org",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/aleksUIX/rtblint.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"openrtb",
|
|
14
|
+
"rtb",
|
|
15
|
+
"adtech",
|
|
16
|
+
"programmatic",
|
|
17
|
+
"validator",
|
|
18
|
+
"linter",
|
|
19
|
+
"wasm"
|
|
20
|
+
],
|
|
21
|
+
"main": "./index.cjs",
|
|
22
|
+
"module": "./index.mjs",
|
|
23
|
+
"types": "./index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./index.d.ts",
|
|
27
|
+
"import": "./index.mjs",
|
|
28
|
+
"require": "./index.cjs"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"index.mjs",
|
|
33
|
+
"index.cjs",
|
|
34
|
+
"index.d.ts",
|
|
35
|
+
"wasm/rtblint_wasm.js",
|
|
36
|
+
"wasm/rtblint_wasm.d.ts",
|
|
37
|
+
"wasm/rtblint_wasm_bg.wasm",
|
|
38
|
+
"wasm/rtblint_wasm_bg.wasm.d.ts",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE",
|
|
41
|
+
"NOTICE"
|
|
42
|
+
],
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The rtblint-core version this build was compiled against.
|
|
6
|
+
*/
|
|
7
|
+
export function core_version(): string;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The full versioned rule catalog: one entry per coded rule across every
|
|
11
|
+
* tracked OpenRTB version. Drives the per-rule documentation pages.
|
|
12
|
+
*/
|
|
13
|
+
export function rules(): any;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Validate an OpenRTB bid request payload against the latest tracked 2.6 snapshot.
|
|
17
|
+
*
|
|
18
|
+
* Returns `{ valid: boolean, issues: Array<{ id, severity, message, path }> }`.
|
|
19
|
+
*/
|
|
20
|
+
export function validate(input: string): any;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Validate an OpenRTB bid response payload against the latest tracked 2.6 snapshot.
|
|
24
|
+
*
|
|
25
|
+
* Returns `{ valid: boolean, issues: Array<{ id, severity, message, path }> }`.
|
|
26
|
+
*/
|
|
27
|
+
export function validate_response(input: string): any;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Validate an OpenRTB bid response payload against a specific tracked version id
|
|
31
|
+
* (for example "2.6-202606"). Unknown ids fall back to the latest 2.6 snapshot.
|
|
32
|
+
*/
|
|
33
|
+
export function validate_response_version(version_id: string, input: string): any;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Validate an OpenRTB bid request payload against a specific tracked version id
|
|
37
|
+
* (for example "2.6-202606"). Unknown ids fall back to the latest 2.6 snapshot.
|
|
38
|
+
*/
|
|
39
|
+
export function validate_version(version_id: string, input: string): any;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* List every tracked OpenRTB version id, newest snapshots last.
|
|
43
|
+
*/
|
|
44
|
+
export function versions(): any;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/* @ts-self-types="./rtblint_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The rtblint-core version this build was compiled against.
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
function core_version() {
|
|
8
|
+
let deferred1_0;
|
|
9
|
+
let deferred1_1;
|
|
10
|
+
try {
|
|
11
|
+
const ret = wasm.core_version();
|
|
12
|
+
deferred1_0 = ret[0];
|
|
13
|
+
deferred1_1 = ret[1];
|
|
14
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
15
|
+
} finally {
|
|
16
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.core_version = core_version;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The full versioned rule catalog: one entry per coded rule across every
|
|
23
|
+
* tracked OpenRTB version. Drives the per-rule documentation pages.
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
function rules() {
|
|
27
|
+
const ret = wasm.rules();
|
|
28
|
+
if (ret[2]) {
|
|
29
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
30
|
+
}
|
|
31
|
+
return takeFromExternrefTable0(ret[0]);
|
|
32
|
+
}
|
|
33
|
+
exports.rules = rules;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Validate an OpenRTB bid request payload against the latest tracked 2.6 snapshot.
|
|
37
|
+
*
|
|
38
|
+
* Returns `{ valid: boolean, issues: Array<{ id, severity, message, path }> }`.
|
|
39
|
+
* @param {string} input
|
|
40
|
+
* @returns {any}
|
|
41
|
+
*/
|
|
42
|
+
function validate(input) {
|
|
43
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
44
|
+
const len0 = WASM_VECTOR_LEN;
|
|
45
|
+
const ret = wasm.validate(ptr0, len0);
|
|
46
|
+
if (ret[2]) {
|
|
47
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
48
|
+
}
|
|
49
|
+
return takeFromExternrefTable0(ret[0]);
|
|
50
|
+
}
|
|
51
|
+
exports.validate = validate;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Validate an OpenRTB bid response payload against the latest tracked 2.6 snapshot.
|
|
55
|
+
*
|
|
56
|
+
* Returns `{ valid: boolean, issues: Array<{ id, severity, message, path }> }`.
|
|
57
|
+
* @param {string} input
|
|
58
|
+
* @returns {any}
|
|
59
|
+
*/
|
|
60
|
+
function validate_response(input) {
|
|
61
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
62
|
+
const len0 = WASM_VECTOR_LEN;
|
|
63
|
+
const ret = wasm.validate_response(ptr0, len0);
|
|
64
|
+
if (ret[2]) {
|
|
65
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
66
|
+
}
|
|
67
|
+
return takeFromExternrefTable0(ret[0]);
|
|
68
|
+
}
|
|
69
|
+
exports.validate_response = validate_response;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Validate an OpenRTB bid response payload against a specific tracked version id
|
|
73
|
+
* (for example "2.6-202606"). Unknown ids fall back to the latest 2.6 snapshot.
|
|
74
|
+
* @param {string} version_id
|
|
75
|
+
* @param {string} input
|
|
76
|
+
* @returns {any}
|
|
77
|
+
*/
|
|
78
|
+
function validate_response_version(version_id, input) {
|
|
79
|
+
const ptr0 = passStringToWasm0(version_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
80
|
+
const len0 = WASM_VECTOR_LEN;
|
|
81
|
+
const ptr1 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
82
|
+
const len1 = WASM_VECTOR_LEN;
|
|
83
|
+
const ret = wasm.validate_response_version(ptr0, len0, ptr1, len1);
|
|
84
|
+
if (ret[2]) {
|
|
85
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
86
|
+
}
|
|
87
|
+
return takeFromExternrefTable0(ret[0]);
|
|
88
|
+
}
|
|
89
|
+
exports.validate_response_version = validate_response_version;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Validate an OpenRTB bid request payload against a specific tracked version id
|
|
93
|
+
* (for example "2.6-202606"). Unknown ids fall back to the latest 2.6 snapshot.
|
|
94
|
+
* @param {string} version_id
|
|
95
|
+
* @param {string} input
|
|
96
|
+
* @returns {any}
|
|
97
|
+
*/
|
|
98
|
+
function validate_version(version_id, input) {
|
|
99
|
+
const ptr0 = passStringToWasm0(version_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
100
|
+
const len0 = WASM_VECTOR_LEN;
|
|
101
|
+
const ptr1 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
102
|
+
const len1 = WASM_VECTOR_LEN;
|
|
103
|
+
const ret = wasm.validate_version(ptr0, len0, ptr1, len1);
|
|
104
|
+
if (ret[2]) {
|
|
105
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
106
|
+
}
|
|
107
|
+
return takeFromExternrefTable0(ret[0]);
|
|
108
|
+
}
|
|
109
|
+
exports.validate_version = validate_version;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* List every tracked OpenRTB version id, newest snapshots last.
|
|
113
|
+
* @returns {any}
|
|
114
|
+
*/
|
|
115
|
+
function versions() {
|
|
116
|
+
const ret = wasm.versions();
|
|
117
|
+
if (ret[2]) {
|
|
118
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
119
|
+
}
|
|
120
|
+
return takeFromExternrefTable0(ret[0]);
|
|
121
|
+
}
|
|
122
|
+
exports.versions = versions;
|
|
123
|
+
function __wbg_get_imports() {
|
|
124
|
+
const import0 = {
|
|
125
|
+
__proto__: null,
|
|
126
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
127
|
+
const ret = String(arg1);
|
|
128
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
129
|
+
const len1 = WASM_VECTOR_LEN;
|
|
130
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
131
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
132
|
+
},
|
|
133
|
+
__wbg___wbindgen_throw_ea4887a5f8f9a9db: function(arg0, arg1) {
|
|
134
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
135
|
+
},
|
|
136
|
+
__wbg_new_2e117a478906f062: function() {
|
|
137
|
+
const ret = new Object();
|
|
138
|
+
return ret;
|
|
139
|
+
},
|
|
140
|
+
__wbg_new_36e147a8ced3c6e0: function() {
|
|
141
|
+
const ret = new Array();
|
|
142
|
+
return ret;
|
|
143
|
+
},
|
|
144
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
145
|
+
arg0[arg1] = arg2;
|
|
146
|
+
},
|
|
147
|
+
__wbg_set_dc601f4a69da0bc2: function(arg0, arg1, arg2) {
|
|
148
|
+
arg0[arg1 >>> 0] = arg2;
|
|
149
|
+
},
|
|
150
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
151
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
152
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
153
|
+
return ret;
|
|
154
|
+
},
|
|
155
|
+
__wbindgen_init_externref_table: function() {
|
|
156
|
+
const table = wasm.__wbindgen_externrefs;
|
|
157
|
+
const offset = table.grow(4);
|
|
158
|
+
table.set(0, undefined);
|
|
159
|
+
table.set(offset + 0, undefined);
|
|
160
|
+
table.set(offset + 1, null);
|
|
161
|
+
table.set(offset + 2, true);
|
|
162
|
+
table.set(offset + 3, false);
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
return {
|
|
166
|
+
__proto__: null,
|
|
167
|
+
"./rtblint_wasm_bg.js": import0,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
let cachedDataViewMemory0 = null;
|
|
172
|
+
function getDataViewMemory0() {
|
|
173
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
174
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
175
|
+
}
|
|
176
|
+
return cachedDataViewMemory0;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function getStringFromWasm0(ptr, len) {
|
|
180
|
+
return decodeText(ptr >>> 0, len);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let cachedUint8ArrayMemory0 = null;
|
|
184
|
+
function getUint8ArrayMemory0() {
|
|
185
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
186
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
187
|
+
}
|
|
188
|
+
return cachedUint8ArrayMemory0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
192
|
+
if (realloc === undefined) {
|
|
193
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
194
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
195
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
196
|
+
WASM_VECTOR_LEN = buf.length;
|
|
197
|
+
return ptr;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
let len = arg.length;
|
|
201
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
202
|
+
|
|
203
|
+
const mem = getUint8ArrayMemory0();
|
|
204
|
+
|
|
205
|
+
let offset = 0;
|
|
206
|
+
|
|
207
|
+
for (; offset < len; offset++) {
|
|
208
|
+
const code = arg.charCodeAt(offset);
|
|
209
|
+
if (code > 0x7F) break;
|
|
210
|
+
mem[ptr + offset] = code;
|
|
211
|
+
}
|
|
212
|
+
if (offset !== len) {
|
|
213
|
+
if (offset !== 0) {
|
|
214
|
+
arg = arg.slice(offset);
|
|
215
|
+
}
|
|
216
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
217
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
218
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
219
|
+
|
|
220
|
+
offset += ret.written;
|
|
221
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
WASM_VECTOR_LEN = offset;
|
|
225
|
+
return ptr;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function takeFromExternrefTable0(idx) {
|
|
229
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
230
|
+
wasm.__externref_table_dealloc(idx);
|
|
231
|
+
return value;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
235
|
+
cachedTextDecoder.decode();
|
|
236
|
+
function decodeText(ptr, len) {
|
|
237
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const cachedTextEncoder = new TextEncoder();
|
|
241
|
+
|
|
242
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
243
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
244
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
245
|
+
view.set(buf);
|
|
246
|
+
return {
|
|
247
|
+
read: arg.length,
|
|
248
|
+
written: buf.length
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
let WASM_VECTOR_LEN = 0;
|
|
254
|
+
|
|
255
|
+
const wasmPath = `${__dirname}/rtblint_wasm_bg.wasm`;
|
|
256
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
257
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
258
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
259
|
+
let wasm = wasmInstance.exports;
|
|
260
|
+
wasm.__wbindgen_start();
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const core_version: () => [number, number];
|
|
5
|
+
export const rules: () => [number, number, number];
|
|
6
|
+
export const validate: (a: number, b: number) => [number, number, number];
|
|
7
|
+
export const validate_response: (a: number, b: number) => [number, number, number];
|
|
8
|
+
export const validate_response_version: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
9
|
+
export const validate_version: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
10
|
+
export const versions: () => [number, number, number];
|
|
11
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
12
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
13
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
14
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
15
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
16
|
+
export const __wbindgen_start: () => void;
|