1 2window.onload = function() { 3 // Build a system 4 let url = window.location.search.match(/url=([^&]+)/); 5 if (url && url.length > 1) { 6 url = decodeURIComponent(url[1]); 7 } else { 8 url = window.location.origin; 9 } 10 let options = { 11 "swaggerDoc": { 12 "openapi": "3.0.0", 13 "paths": { 14 "/api/catalog/page": { 15 "post": { 16 "operationId": "CatalogController_getPage", 17 "summary": "Paginated + filtered catalog listing", 18 "description": "Returns a page of products with optional simple/advanced filters, full-text search on `name`, and default sorting by `createdAt` DESC. ", 19 "parameters": [], 20 "requestBody": { 21 "required": true, 22 "description": "Pagination, table filters, sorting, and optional advanced filters. `filters` and `sortingState` mirror TanStack Table shapes.", 23 "content": { 24 "application/json": { 25 "schema": { 26 "type": "object", 27 "required": [ 28 "page", 29 "limit", 30 "filters", 31 "sortingState" 32 ], 33 "properties": { 34 "page": { 35 "type": "integer", 36 "minimum": 0, 37 "description": "Zero-based page index.", 38 "example": 0 39 }, 40 "limit": { 41 "type": "integer", 42 "minimum": 1, 43 "maximum": 100, 44 "description": "Items per page.", 45 "example": 25 46 }, 47 "filters": { 48 "type": "array", 49 "description": "Column filters (TanStack Table `ColumnFiltersState`). Example filters on name/category/price.", 50 "items": { 51 "type": "object", 52 "properties": { 53 "id": { 54 "type": "string", 55 "description": "Column ID, e.g. \"name\"" 56 }, 57 "value": { 58 "description": "Filter value; shape depends on column.", 59 "oneOf": [ 60 { 61 "type": "string" 62 }, 63 { 64 "type": "number" 65 }, 66 { 67 "type": "object" 68 }, 69 { 70 "type": "array" 71 } 72 ] 73 } 74 } 75 }, 76 "example": [ 77 { 78 "id": "name", 79 "value": "laptop" 80 } 81 ] 82 }, 83 "sortingState": { 84 "type": "array", 85 "description": "Sorting array (TanStack Table `SortingState`). Defaults to `[ { id: \"createdAt\", desc: true } ]` if empty.", 86 "items": { 87 "type": "object", 88 "required": [ 89 "id", 90 "desc" 91 ], 92 "properties": { 93 "id": { 94 "type": "string", 95 "description": "Column ID, e.g. \"createdAt\"" 96 }, 97 "desc": { 98 "type": "boolean", 99 "description": "Sort descending?" 100 } 101 } 102 }, 103 "example": [ 104 { 105 "id": "createdAt", 106 "desc": true 107 } 108 ] 109 }, 110 "advancedFilters": { 111 "type": "array", 112 "description": "Optional advanced filters (field can be any field from the product object note that not all are indexed).", 113 "items": { 114 "type": "object", 115 "additionalProperties": true 116 }, 117 "example": [ 118 { 119 "field": "buyboxPrice", 120 "condition": "gt", 121 "value": 100 122 } 123 ] 124 } 125 } 126 } 127 } 128 } 129 }, 130 "responses": { 131 "200": { 132 "description": "A page of products. `offers` to supp
132ort master/detail tables.", 133 "content": { 134 "application/json": { 135 "schema": { 136 "type": "object", 137 "properties": { 138 "data": { 139 "type": "array", 140 "items": { 141 "type": "object", 142 "description": "product with related offers and category.", 143 "properties": { 144 "id": { 145 "type": "string", 146 "example": "prd_01HXYZ..." 147 }, 148 "name": { 149 "type": "string", 150 "example": "ACME 15\" Laptop" 151 }, 152 "createdAt": { 153 "type": "string", 154 "format": "date-time" 155 }, 156 "updatedAt": { 157 "type": "string", 158 "format": "date-time" 159 }, 160 "price": { 161 "type": "number", 162 "example": 1299.99, 163 "nullable": true 164 }, 165 "categoryId": { 166 "type": "string", 167 "nullable": true 168 }, 169 "category": { 170 "type": "object", 171 "nullable": true, 172 "properties": { 173 "id": { 174 "type": "string" 175 }, 176 "name": { 177 "type": "string" 178 } 179 } 180 }, 181 "offers": { 182 "type": "array", 183 "items": { 184 "type": "object", 185 "properties": { 186 "id": { 187 "type": "string" 188 }, 189 "productId": { 190 "type": "string" 191 }, 192 "retailer": { 193 "type": "string", 194 "example": "Walmart" 195 }, 196 "url": { 197 "type": "string", 198 "example": "https://..." 199 }, 200 "price": { 201 "type": "number", 202 "example": 1199, 203 "nullable": true 204 }, 205 "createdAt": { 206 "type": "string", 207 "format": "date-time" 208 } 209 } 210 } 211 }, 212 "subRows": { 213 "type": "array", 214 "description": "Alias of `offers` for table row expansion.", 215 "items": { 216 "type": "object", 217 "additionalProperties": true 218 } 219 } 220 }, 221 "additionalProperties": true 222 } 223 }, 224 "success": { 225 "type": "string", 226 "nullable": true, 227 "description": "Present only when no products were found due to timeout handling.", 228 "example": "No products found" 229 }, 230 "error": { 231 "type": "string", 232 "nullable": true, 233 "description": "Error message when the operation fails.", 234 "example": "Could not fetch products" 235 } 236 } 237 } 238 } 239 } 240 }, 241 "400": { 242 "description": "Invalid input (e.g., malformed filters, invalid pagination, or unsafe search term)." 243 }, 244 "401": { 245 "description": "Unauthorized (no or invalid credentials)." 246 }, 247 "500": { 248 "description": "Unexpected server error." 249 } 250 }, 251 "tags": [ 252 "Catalog" 253 ], 254 "security": [ 255 {
256 "bearer": [] 257 } 258 ] 259 } 260 }, 261 "/api/product/lookup": { 262 "get": { 263 "operationId": "ProductController_lookup", 264 "summary": "Lookup products by identifiers or title", 265 "description": "Find products by `upc`, `gtin`, `walmartId` (`productId`), or full-text search on `title` (PostgreSQL FTS). At least one query parameter is required.", 266 "parameters": [ 267 { 268 "name": "title", 269 "required": false, 270 "in": "query", 271 "description": "Full-text search on product name.", 272 "schema": { 273 "example": "gaming laptop 15 inch" 274 } 275 }, 276 { 277 "name": "gtin", 278 "required": false, 279 "in": "query", 280 "description": "Global Trade Item Number", 281 "schema": { 282 "example": "00012345600012" 283 } 284 }, 285 { 286 "name": "walmartId", 287 "required": false, 288 "in": "query", 289 "description": "Retailer-specific product ID (Walmart)", 290 "schema": { 291 "example": "12345678" 292 } 293 }, 294 { 295 "name": "upc", 296 "required": false, 297 "in": "query", 298 "description": "Universal Product Code", 299 "schema": { 300 "example": "123456789012" 301 } 302 } 303 ], 304 "responses": { 305 "200": { 306 "description": "Matching products list (possibly empty).", 307 "content": { 308 "application/json": { 309 "schema": { 310 "type": "object", 311 "properties": { 312 "products": { 313 "type": "array", 314 "items": { 315 "type": "object", 316 "additionalProperties": true 317 } 318 }, 319 "error": { 320 "oneOf": [ 321 { 322 "type": "string" 323 }, 324 { 325 "type": "null" 326 } 327 ], 328 "example": "No products found" 329 }, 330 "debug": { 331 "oneOf": [ 332 { 333 "type": "string" 334 }, 335 { 336 "type": "null" 337 } 338 ] 339 } 340 } 341 } 342 } 343 } 344 }, 345 "400": { 346 "description": "No query parameters provided. You must pass at least one of `upc`, `walmartId`, `gtin`, or `title`." 347 }, 348 "500": { 349 "description": "Unexpected server error." 350 } 351 }, 352 "tags": [ 353 "Product" 354 ], 355 "security": [ 356 { 357 "bearer": [] 358 } 359 ] 360 } 361 }, 362 "/api/product/{id}": { 363 "get": { 364 "operationId": "ProductController_getProduct", 365 "summary": "Get a product by ID", 366 "description": "Fetches a single product by its ID, including related `offers`. Returns `{ product: null }` if not found.", 367 "parameters": [ 368 { 369 "name": "id", 370 "required": true, 371 "in": "path", 372 "description": "Product ID", 373 "schema": { 374 "example": "prd_01HXYZABC123" 375 } 376 } 377 ], 378 "responses": { 379 "200": { 380 "description": "Product returned (or `null` with an error message).", 381 "content": { 382 "application/json": { 383 "schema": { 384 "type": "object", 385 "properties": { 386 "product": { 387 "oneOf": [ 388 { 389 "type": "object", 390 "properties": { 391 "id": { 392 "type": "string" 393 }, 394 "name": { 395 "type": "string", 396 "example": "ACME 15\" Laptop" 397 }, 398 "upc": { 399 "type": "string", 400 "nullable": true, 401 "example": "123456789012" 402 }, 403 "gtin": { 404 "type": "string", 405 "nullable": true, 406 "example": "00012345600012" 407 }, 408 "productId": { 409 "type": "string", 410 "nullable": true, 411 "description": "Retailer-specific ID (e.g., Walmart)" 412 }, 413 "createdAt": { 414 "type": "string", 415 "format": "date-time" 416 }, 417 "updatedAt": { 418 "type": "string", 419 "format": "date-time" 420 }, 421 "offers": { 422 "type": "array", 423 "items": { 424 "type": "object", 425 "properties": { 426 "id": { 427 "type": "string" 428 }, 429 "productId": { 430 "type": "string" 431 }, 432 "retailer": { 433 "type": "string", 434 "example": "Walmart" 435 }, 436 "url": { 437 "type": "string", 438 "example": "https://..." 439 }, 440 "price": { 441 "type": "number", 442 "nullable": true, 443 "example": 1199 444 }, 445 "createdAt": { 446 "type": "string", 447 "format": "date-time" 448 } 449 } 450 } 451 } 452 }, 453 "additionalProperties": true 454 }, 455 { 456 "type": "null" 457 } 458 ] 459 }, 460 "error": { 461 "type": "string", 462 "nullable": true, 463 "example": "No product found" 464 } 465 } 466 } 467 } 468 } 469 }, 470 "500": { 471 "description": "Unexpected server error." 472 } 473 }, 474 "tags": [ 475 "Product" 476 ], 477 "security": [ 478 {
479 "bearer": [] 480 } 481 ] 482 } 483 }, 484 "/api/historical/{id}/{model}": { 485 "get": { 486 "operationId": "HistoricalController_getSnapshots", 487 "summary": "Get historical snapshots for a product", 488 "description": "Returns time-bounded snapshot data for the requested `model` (`products` or `offers`) related to a specific product `id` between `from` and `to`.", 489 "parameters": [ 490 { 491 "name": "id", 492 "required": false, 493 "in": "path", 494 "description": "The product ID to fetch snapshots for. (uuid)", 495 "schema": { 496 "example": "b468e485-3ef7-4461-86b5-d3d0e92ad625", 497 "type": "string" 498 } 499 }, 500 { 501 "name": "model", 502 "required": true, 503 "in": "path", 504 "description": "Snapshot model to query.", 505 "schema": { 506 "enum": [ 507 "products", 508 "offers" 509 ], 510 "type": "string" 511 } 512 }, 513 { 514 "name": "to", 515 "required": true, 516 "in": "query", 517 "description": "End of the time window (exclusive/inclusive depending on backend implementation). Accepts ISO8601 string or epoch milliseconds.", 518 "schema": { 519 "oneOf": [ 520 { 521 "type": "string", 522 "format": "date-time", 523 "example": "2025-08-31T23:59:59.999Z" 524 }, 525 { 526 "type": "integer", 527 "example": 1754006399999 528 } 529 ] 530 } 531 }, 532 { 533 "name": "from", 534 "required": true, 535 "in": "query", 536 "description": "Start of the time window (inclusive). Accepts ISO8601 string or epoch milliseconds.", 537 "schema": { 538 "oneOf": [ 539 { 540 "type": "string", 541 "format": "date-time", 542 "example": "2025-08-01T00:00:00.000Z" 543 }, 544 { 545 "type": "integer", 546 "example": 1722470400000 547 } 548 ] 549 } 550 }, 551 { 552 "name": "upc", 553 "required": false, 554 "in": "path", 555 "description": "The product upc", 556 "schema": { 557 "example": "" 558 } 559 } 560 ], 561 "responses": { 562 "200": { 563 "description": "Historical snapshots for the requested model.", 564 "content": { 565 "application/json": { 566 "schema": { 567 "type": "object", 568 "properties": { 569 "snapshots": { 570 "type": "array", 571 "description": "Array of snapshot records. Shape depends on the chosen model (`products` or `offers`).", 572 "items": { 573 "type": "object", 574 "additionalProperties": true 575 } 576 } 577 } 578 } 579 } 580 } 581 }, 582 "400": { 583 "description": "Missing/invalid query parameters (e.g., `from`/`to` not provided or `model` not supported)." 584 }, 585 "500": { 586 "description": "Unexpected server error." 587 } 588 }, 589 "tags": [ 590 "Historical" 591 ], 592 "security": [ 593 { 594 "bearer": [] 595 } 596 ] 597 } 598 } 599 }, 600 "info": { 601 "title": "Pricelink api", 602 "description": "Api to interact programatically with our services!", 603 "version": "0.1", 604 "contact": {} 605 }, 606 "tags": [], 607 "servers": [], 608 "components": { 609 "securitySchemes": {
610 "bearer": { 611 "scheme": "bearer", 612 "bearerFormat": "JWT", 613 "type": "http" 614 } 615 }, 616 "schemas": {} 617 } 618 }, 619 "customOptions": {} 620}; 621 url = options.swaggerUrl || url 622 let urls = options.swaggerUrls 623 let customOptions = options.customOptions 624 let spec1 = options.swaggerDoc 625 let swaggerOptions = { 626 spec: spec1, 627 url: url, 628 urls: urls, 629 dom_id: '#swagger-ui', 630 deepLinking: true, 631 presets: [ 632 SwaggerUIBundle.presets.apis, 633 SwaggerUIStandalonePreset 634 ], 635 plugins: [ 636 SwaggerUIBundle.plugins.DownloadUrl 637 ], 638 layout: "StandaloneLayout" 639 } 640 for (let attrname in customOptions) { 641 swaggerOptions[attrname] = customOptions[attrname]; 642 } 643 let ui = SwaggerUIBundle(swaggerOptions) 644 645 if (customOptions.initOAuth) { 646 ui.initOAuth(customOptions.initOAuth) 647 } 648 649 if (customOptions.authAction) { 650 ui.authActions.authorize(customOptions.authAction) 651 } 652 653 window.ui = ui 654}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.