!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/wincloud_gateway/node_modules/apollo-cache-control/dist/   drwxr-xr-x
Free 13.22 GB of 57.97 GB (22.8%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.js (5.9 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.__testing__ = exports.plugin = exports.CacheScope = void 0;
const graphql_1 = require("graphql");
var CacheScope;
(function (CacheScope) {
    CacheScope["Public"] = "PUBLIC";
    CacheScope["Private"] = "PRIVATE";
})(CacheScope = exports.CacheScope || (exports.CacheScope = {}));
exports.plugin = (options = Object.create(null)) => ({
    requestDidStart(requestContext) {
        const defaultMaxAge = options.defaultMaxAge || 0;
        const hints = new Map();
        function setOverallCachePolicyWhenUnset() {
            if (!requestContext.overallCachePolicy) {
                requestContext.overallCachePolicy = computeOverallCachePolicy(hints);
            }
        }
        return {
            executionDidStart: () => ({
                executionDidEnd: () => setOverallCachePolicyWhenUnset(),
                willResolveField({ info }) {
                    let hint = {};
                    const targetType = graphql_1.getNamedType(info.returnType);
                    if (targetType instanceof graphql_1.GraphQLObjectType ||
                        targetType instanceof graphql_1.GraphQLInterfaceType) {
                        if (targetType.astNode) {
                            hint = mergeHints(hint, cacheHintFromDirectives(targetType.astNode.directives));
                        }
                    }
                    const fieldDef = info.parentType.getFields()[info.fieldName];
                    if (fieldDef.astNode) {
                        hint = mergeHints(hint, cacheHintFromDirectives(fieldDef.astNode.directives));
                    }
                    if ((targetType instanceof graphql_1.GraphQLObjectType ||
                        targetType instanceof graphql_1.GraphQLInterfaceType ||
                        !info.path.prev) &&
                        hint.maxAge === undefined) {
                        hint.maxAge = defaultMaxAge;
                    }
                    if (hint.maxAge !== undefined || hint.scope !== undefined) {
                        addHint(hints, info.path, hint);
                    }
                    info.cacheControl = {
                        setCacheHint: (hint) => {
                            addHint(hints, info.path, hint);
                        },
                        cacheHint: hint,
                    };
                },
            }),
            responseForOperation() {
                setOverallCachePolicyWhenUnset();
                return null;
            },
            willSendResponse(requestContext) {
                const { response, overallCachePolicy: overallCachePolicyOverride, } = requestContext;
                if (response.errors) {
                    return;
                }
                const overallCachePolicy = overallCachePolicyOverride ||
                    (requestContext.overallCachePolicy =
                        computeOverallCachePolicy(hints));
                if (overallCachePolicy &&
                    options.calculateHttpHeaders &&
                    response.http) {
                    response.http.headers.set('Cache-Control', `max-age=${overallCachePolicy.maxAge}, ${overallCachePolicy.scope.toLowerCase()}`);
                }
                if (options.stripFormattedExtensions !== false)
                    return;
                const extensions = response.extensions || (response.extensions = Object.create(null));
                if (typeof extensions.cacheControl !== 'undefined') {
                    throw new Error("The cacheControl information already existed.");
                }
                extensions.cacheControl = {
                    version: 1,
                    hints: Array.from(hints).map(([path, hint]) => (Object.assign({ path: [...graphql_1.responsePathAsArray(path)] }, hint))),
                };
            }
        };
    }
});
function cacheHintFromDirectives(directives) {
    if (!directives)
        return undefined;
    const cacheControlDirective = directives.find(directive => directive.name.value === 'cacheControl');
    if (!cacheControlDirective)
        return undefined;
    if (!cacheControlDirective.arguments)
        return undefined;
    const maxAgeArgument = cacheControlDirective.arguments.find(argument => argument.name.value === 'maxAge');
    const scopeArgument = cacheControlDirective.arguments.find(argument => argument.name.value === 'scope');
    return {
        maxAge: maxAgeArgument &&
            maxAgeArgument.value &&
            maxAgeArgument.value.kind === 'IntValue'
            ? parseInt(maxAgeArgument.value.value)
            : undefined,
        scope: scopeArgument &&
            scopeArgument.value &&
            scopeArgument.value.kind === 'EnumValue'
            ? scopeArgument.value.value
            : undefined,
    };
}
function mergeHints(hint, otherHint) {
    if (!otherHint)
        return hint;
    return {
        maxAge: otherHint.maxAge !== undefined ? otherHint.maxAge : hint.maxAge,
        scope: otherHint.scope || hint.scope,
    };
}
function computeOverallCachePolicy(hints) {
    let lowestMaxAge = undefined;
    let scope = CacheScope.Public;
    for (const hint of hints.values()) {
        if (hint.maxAge !== undefined) {
            lowestMaxAge =
                lowestMaxAge !== undefined
                    ? Math.min(lowestMaxAge, hint.maxAge)
                    : hint.maxAge;
        }
        if (hint.scope === CacheScope.Private) {
            scope = CacheScope.Private;
        }
    }
    return lowestMaxAge
        ? {
            maxAge: lowestMaxAge,
            scope,
        }
        : undefined;
}
function addHint(hints, path, hint) {
    const existingCacheHint = hints.get(path);
    if (existingCacheHint) {
        hints.set(path, mergeHints(existingCacheHint, hint));
    }
    else {
        hints.set(path, hint);
    }
}
exports.__testing__ = {
    addHint,
    computeOverallCachePolicy,
};
//# sourceMappingURL=index.js.map

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0341 ]--