PageSourceSearch

https://www.bananashop.ai/site/web/aws.js?v=1.0.9

js bananashop.ai collected 2026-10-05 11:49:42 UTC 2,374 bytes, 73 lines download raw bytes

1"use strict";
2var params = {};
3var s3BucketURL = "";
4var presignedPostLink = null;
5var managedUploadReady = false;
6function initiateAWS() {
7    managedUploadReady = true;
8    return Promise.resolve(true);
9}
10
11function resolveManagedVendorID(vendorId) {
12    var resolved = Number(vendorId);
13    if (!resolved && typeof VendorID !== "undefined") resolved = Number(VendorID);
14    return resolved > 0 ? resolved : -1;
15}
16
17function requestManagedUploadTicket(file, options) {
18    options = options || {};
19    return $.ajax({
20        url: "/Shared/GetS3UploadUrl",
21        type: "POST",
22        data: {
23            fileName: options.fileName || (file ? file.name : ""),
24            contentType: options.contentType || (file && file.type ? file.type : "application/octet-stream"),
25            key: options.key || "",
26            category: options.category || "",
27            vendorId: resolveManagedVendorID(options.vendorId)
28        }
29    });
30}
31
32function uploadManagedFile(file, options) {
33    options = options || {};
34    var deferred = $.Deferred();
35
36    requestManagedUploadTicket(file, options).done(function (ticket) {
37        if (!ticket || ticket.Result !== "OK" || !ticket.UploadUrl) {
38            deferred.reject({ Message: "Upload ticket failed.", ticket: ticket });
39            return;
40        }
41
42        $.ajax({
43            url: ticket.UploadUrl,
44            type: "PUT",
45            data: file,
46            processData: false,
47            contentType: options.contentType || (file && file.type ? file.type : "application/octet-stream"),
48            xhr: function () {
49                var xhr = $.ajaxSettings.xhr();
50                if (xhr.upload && typeof options.onProgress === "function") {
51                    xhr.upload.addEventListener("progress", function (event) {
52                        options.onProgress(event);
53                    }, false);
54                }
55                return xhr;
56            }
57        }).done(function () {
58            deferred.resolve({
59                Result: "OK",
60                Key: ticket.Key,
61                Url: ticket.PublicUrl,
62                PublicUrl: ticket.PublicUrl,
63                serverFileName: ticket.Key
64            });
65        }).fail(function (xhr) {
66            deferred.reject(xhr);
67        });
68    }).fail(function (xhr) {
69        deferred.reject(xhr);
70    });
71
72    return deferred.promise();
73}

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.