/var/www/greso.tech/server/nsm/node_modules/google-gax/build/src
NameSizeModeActions
bundlingCalls/-0755rm
longRunningCalls/-0755rm
normalCalls/-0755rm
paginationCalls/-0755rm
streamingCalls/-0755rm
apiCaller.d.ts17460644editdlrm
apiCaller.js10370644editdlrm
apiCaller.js.map3220644editdlrm
apitypes.d.ts27900644editdlrm
apitypes.js7090644editdlrm
apitypes.js.map1340644editdlrm
call.d.ts19570644editdlrm
call.js38850644editdlrm
call.js.map21100644editdlrm
clientInterface.d.ts17520644editdlrm
clientInterface.js9080644editdlrm
clientInterface.js.map3330644editdlrm
createApiCall.d.ts18020644editdlrm
createApiCall.js44980644editdlrm
createApiCall.js.map18740644editdlrm
descriptor.d.ts10730644editdlrm
descriptor.js16910644editdlrm
descriptor.js.map2860644editdlrm
fallback.d.ts77610644editdlrm
fallback.js169910644editdlrm
fallback.js.map71960644editdlrm
fallbackProto.d.ts9460644editdlrm
fallbackProto.js22660644editdlrm
fallbackProto.js.map14290644editdlrm
fallbackRest.d.ts9690644editdlrm
fallbackRest.js33530644editdlrm
fallbackRest.js.map21390644editdlrm
fallbackServiceStub.d.ts16830644editdlrm
fallbackServiceStub.js63260644editdlrm
fallbackServiceStub.js.map36630644editdlrm
featureDetection.d.ts8560644editdlrm
featureDetection.js21140644editdlrm
featureDetection.js.map9240644editdlrm
gax.d.ts150500644editdlrm
gax.js225200644editdlrm
gax.js.map83600644editdlrm
googleError.d.ts24260644editdlrm
googleError.js98850644editdlrm
googleError.js.map60230644editdlrm
grpc.d.ts90250644editdlrm
grpc.js206320644editdlrm
grpc.js.map114160644editdlrm
iamService.d.ts59540644editdlrm
iamService.js90530644editdlrm
iamService.js.map59480644editdlrm
iam_policy_service_client_config.json10630644editdlrm
index.d.ts31010644editdlrm
index.js74500644editdlrm
index.js.map16800644editdlrm
locationService.d.ts74100644editdlrm
locationService.js170790644editdlrm
locationService.js.map70410644editdlrm
locations_client_config.json9330644editdlrm
operationsClient.d.ts163130644editdlrm
operationsClient.js199830644editdlrm
operationsClient.js.map57430644editdlrm
operations_client_config.json12490644editdlrm
pathTemplate.d.ts19660644editdlrm
pathTemplate.js99330644editdlrm
pathTemplate.js.map65950644editdlrm
protobuf.d.ts6510644editdlrm
protobuf.js10370644editdlrm
protobuf.js.map2070644editdlrm
protosList.json49210644editdlrm
routingHeader.d.ts11240644editdlrm
routingHeader.js13170644editdlrm
routingHeader.js.map2830644editdlrm
status.d.ts11530644editdlrm
status.js32290644editdlrm
status.js.map15700644editdlrm
streamArrayParser.d.ts22730644editdlrm
streamArrayParser.js61690644editdlrm
streamArrayParser.js.map32590644editdlrm
transcoding.d.ts23710644editdlrm
transcoding.js108770644editdlrm
transcoding.js.map86740644editdlrm
util.d.ts12540644editdlrm
util.js34730644editdlrm
util.js.map23590644editdlrm
warnings.d.ts6820644editdlrm
warnings.js13810644editdlrm
warnings.js.map6340644editdlrm
Edit: /var/www/greso.tech/server/nsm/node_modules/google-gax/build/src/transcoding.js (10877B)
"use strict"; /** * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.overrideHttpRules = exports.transcode = exports.isProto3OptionalField = exports.flattenObject = exports.match = exports.applyPattern = exports.encodeWithoutSlashes = exports.encodeWithSlashes = exports.buildQueryStringComponents = exports.deleteField = exports.deepCopyWithoutMatchedFields = exports.getField = void 0; const util_1 = require("./util"); const httpOptionName = '(google.api.http)'; const proto3OptionalName = 'proto3_optional'; // List of methods as defined in google/api/http.proto (see HttpRule) const supportedHttpMethods = ['get', 'post', 'put', 'patch', 'delete']; function getField(request, field, allowObjects = false // in most cases, we need leaf fields ) { const parts = field.split('.'); let value = request; for (const part of parts) { if (typeof value !== 'object') { return undefined; } value = value[part]; } if (!allowObjects && typeof value === 'object' && !Array.isArray(value) && value !== null) { return undefined; } return value; } exports.getField = getField; function deepCopyWithoutMatchedFields(request, fieldsToSkip, fullNamePrefix = '') { if (typeof request !== 'object' || request === null) { return request; } const copy = Object.assign({}, request); for (const key in copy) { if (fieldsToSkip.has(`${fullNamePrefix}${key}`)) { delete copy[key]; continue; } const nextFullNamePrefix = `${fullNamePrefix}${key}.`; if (Array.isArray(copy[key])) { // a field of an array cannot be addressed as "request.field", so we omit the skipping logic for array descendants copy[key] = copy[key].map(value => deepCopyWithoutMatchedFields(value, new Set())); } else if (typeof copy[key] === 'object' && copy[key] !== null) { copy[key] = deepCopyWithoutMatchedFields(copy[key], fieldsToSkip, nextFullNamePrefix); } } return copy; } exports.deepCopyWithoutMatchedFields = deepCopyWithoutMatchedFields; function deleteField(request, field) { const parts = field.split('.'); while (parts.length > 1) { if (typeof request !== 'object') { return; } const part = parts.shift(); request = request[part]; } const part = parts.shift(); if (typeof request !== 'object') { return; } delete request[part]; } exports.deleteField = deleteField; function buildQueryStringComponents(request, prefix = '') { const resultList = []; for (const key in request) { if (Array.isArray(request[key])) { for (const value of request[key]) { resultList.push(`${prefix}${encodeWithoutSlashes(key)}=${encodeWithoutSlashes(value.toString())}`); } } else if (typeof request[key] === 'object' && request[key] !== null) { resultList.push(...buildQueryStringComponents(request[key], `${key}.`)); } else { resultList.push(`${prefix}${encodeWithoutSlashes(key)}=${encodeWithoutSlashes(request[key] === null ? 'null' : request[key].toString())}`); } } return resultList; } exports.buildQueryStringComponents = buildQueryStringComponents; function encodeWithSlashes(str) { return str .split('') .map(c => (c.match(/[-_.~0-9a-zA-Z]/) ? c : encodeURIComponent(c))) .join(''); } exports.encodeWithSlashes = encodeWithSlashes; function encodeWithoutSlashes(str) { return str .split('') .map(c => (c.match(/[-_.~0-9a-zA-Z/]/) ? c : encodeURIComponent(c))) .join(''); } exports.encodeWithoutSlashes = encodeWithoutSlashes; function escapeRegExp(str) { return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } function applyPattern(pattern, fieldValue) { if (!pattern || pattern === '*') { return encodeWithSlashes(fieldValue); } if (!pattern.includes('*') && pattern !== fieldValue) { return undefined; } // since we're converting the pattern to a regex, make necessary precautions: const regex = new RegExp('^' + escapeRegExp(pattern) .replace(/\\\*\\\*/g, '(.+)') .replace(/\\\*/g, '([^/]+)') + '$'); if (!fieldValue.match(regex)) { return undefined; } return encodeWithoutSlashes(fieldValue); } exports.applyPattern = applyPattern; function fieldToCamelCase(field) { const parts = field.split('.'); return parts.map(part => (0, util_1.toCamelCase)(part)).join('.'); } function match(request, pattern) { let url = pattern; const matchedFields = []; for (;;) { const match = url.match(/^(.*)\{([^}=]+)(?:=([^}]*))?\}(.*)/); if (!match) { break; } const [, before, field, pattern, after] = match; const camelCasedField = fieldToCamelCase(field); matchedFields.push(fieldToCamelCase(camelCasedField)); const fieldValue = getField(request, camelCasedField); if (fieldValue === undefined) { return undefined; } const appliedPattern = applyPattern(pattern, fieldValue === null ? 'null' : fieldValue.toString()); if (appliedPattern === undefined) { return undefined; } url = before + appliedPattern + after; } return { matchedFields, url }; } exports.match = match; function flattenObject(request) { const result = {}; for (const key in request) { if (request[key] === undefined) { continue; } if (Array.isArray(request[key])) { // According to the http.proto comments, a repeated field may only // contain primitive types, so no extra recursion here. result[key] = request[key]; continue; } if (typeof request[key] === 'object' && request[key] !== null) { const nested = flattenObject(request[key]); for (const nestedKey in nested) { result[`${key}.${nestedKey}`] = nested[nestedKey]; } continue; } result[key] = request[key]; } return result; } exports.flattenObject = flattenObject; function isProto3OptionalField(field) { return field && field.options && field.options[proto3OptionalName]; } exports.isProto3OptionalField = isProto3OptionalField; function transcode(request, parsedOptions) { const httpRules = []; for (const option of parsedOptions) { if (!(httpOptionName in option)) { continue; } const httpRule = option[httpOptionName]; httpRules.push(httpRule); if (httpRule === null || httpRule === void 0 ? void 0 : httpRule.additional_bindings) { const additionalBindings = Array.isArray(httpRule.additional_bindings) ? httpRule.additional_bindings : [httpRule.additional_bindings]; httpRules.push(...additionalBindings); } } for (const httpRule of httpRules) { for (const httpMethod of supportedHttpMethods) { if (!(httpMethod in httpRule)) { continue; } const pathTemplate = httpRule[httpMethod]; const matchResult = match(request, pathTemplate); if (matchResult === undefined) { continue; } const { url, matchedFields } = matchResult; let data = deepCopyWithoutMatchedFields(request, new Set(matchedFields)); if (httpRule.body === '*') { return { httpMethod, url, queryString: '', data }; } // one field possibly goes to request data, others go to query string const queryStringObject = data; if (httpRule.body) { data = getField(queryStringObject, fieldToCamelCase(httpRule.body), /*allowObjects:*/ true); deleteField(queryStringObject, fieldToCamelCase(httpRule.body)); } else { data = ''; } const queryStringComponents = buildQueryStringComponents(queryStringObject); const queryString = queryStringComponents.join('&'); if (!data || (typeof data === 'object' && Object.keys(data).length === 0)) { data = ''; } return { httpMethod, url, queryString, data }; } } return undefined; } exports.transcode = transcode; // Override the protobuf json's the http rules. function overrideHttpRules(httpRules, protoJson) { for (const rule of httpRules) { if (!rule.selector) { continue; } const rpc = protoJson.lookup(rule.selector); // Not support override on non-exist RPC or a RPC without an annotation. // We could reconsider if we have the use case later. if (!rpc || !rpc.parsedOptions) { continue; } for (const item of rpc.parsedOptions) { if (!(httpOptionName in item)) { continue; } const httpOptions = item[httpOptionName]; for (const httpMethod in httpOptions) { if (httpMethod in rule) { if (httpMethod === 'additional_bindings') { continue; } httpOptions[httpMethod] = rule[httpMethod]; } if (rule.additional_bindings) { httpOptions['additional_bindings'] = !httpOptions['additional_bindings'] ? [] : Array.isArray(httpOptions['additional_bindings']) ? httpOptions['additional_bindings'] : [httpOptions['additional_bindings']]; // Make the additional_binding to be an array if it is not. httpOptions['additional_bindings'].push(...rule.additional_bindings); } } } } } exports.overrideHttpRules = overrideHttpRules; //# sourceMappingURL=transcoding.js.map