/
var
/
www
/
p4ela.kz
/
server
/
delivery
/
node_modules
/
google-gax
/
build
/
src
/
/var/www/p4ela.kz/server/delivery/node_modules/google-gax/build/src
mkdir
upload
Name
Size
Mode
Actions
bundlingCalls/
-
0755
rm
longRunningCalls/
-
0755
rm
normalCalls/
-
0755
rm
paginationCalls/
-
0755
rm
streamingCalls/
-
0755
rm
apiCaller.d.ts
1746
0644
edit
dl
rm
apiCaller.js
1037
0644
edit
dl
rm
apiCaller.js.map
322
0644
edit
dl
rm
apitypes.d.ts
2872
0644
edit
dl
rm
apitypes.js
709
0644
edit
dl
rm
apitypes.js.map
134
0644
edit
dl
rm
call.d.ts
1957
0644
edit
dl
rm
call.js
3885
0644
edit
dl
rm
call.js.map
2110
0644
edit
dl
rm
clientInterface.d.ts
1722
0644
edit
dl
rm
clientInterface.js
908
0644
edit
dl
rm
clientInterface.js.map
333
0644
edit
dl
rm
createApiCall.d.ts
1762
0644
edit
dl
rm
createApiCall.js
4352
0644
edit
dl
rm
createApiCall.js.map
1811
0644
edit
dl
rm
descriptor.d.ts
1073
0644
edit
dl
rm
descriptor.js
1572
0644
edit
dl
rm
descriptor.js.map
285
0644
edit
dl
rm
fallback.d.ts
6544
0644
edit
dl
rm
fallback.js
13673
0644
edit
dl
rm
fallback.js.map
6254
0644
edit
dl
rm
fallbackProto.d.ts
946
0644
edit
dl
rm
fallbackProto.js
2266
0644
edit
dl
rm
fallbackProto.js.map
1429
0644
edit
dl
rm
fallbackRest.d.ts
946
0644
edit
dl
rm
fallbackRest.js
3355
0644
edit
dl
rm
fallbackRest.js.map
2153
0644
edit
dl
rm
fallbackServiceStub.d.ts
1575
0644
edit
dl
rm
fallbackServiceStub.js
5257
0644
edit
dl
rm
fallbackServiceStub.js.map
3037
0644
edit
dl
rm
featureDetection.d.ts
856
0644
edit
dl
rm
featureDetection.js
2106
0644
edit
dl
rm
featureDetection.js.map
914
0644
edit
dl
rm
gax.d.ts
14958
0644
edit
dl
rm
gax.js
22090
0644
edit
dl
rm
gax.js.map
8298
0644
edit
dl
rm
googleError.d.ts
2211
0644
edit
dl
rm
googleError.js
7216
0644
edit
dl
rm
googleError.js.map
4504
0644
edit
dl
rm
grpc.d.ts
8930
0644
edit
dl
rm
grpc.js
20671
0644
edit
dl
rm
grpc.js.map
11442
0644
edit
dl
rm
iamService.d.ts
5961
0644
edit
dl
rm
iamService.js
9252
0644
edit
dl
rm
iamService.js.map
6100
0644
edit
dl
rm
iam_policy_service_client_config.json
1063
0644
edit
dl
rm
index.d.ts
3101
0644
edit
dl
rm
index.js
6687
0644
edit
dl
rm
index.js.map
1680
0644
edit
dl
rm
locationService.d.ts
7382
0644
edit
dl
rm
locationService.js
17280
0644
edit
dl
rm
locationService.js.map
7154
0644
edit
dl
rm
locations_client_config.json
933
0644
edit
dl
rm
operationsClient.d.ts
16266
0644
edit
dl
rm
operationsClient.js
19699
0644
edit
dl
rm
operationsClient.js.map
5566
0644
edit
dl
rm
operations_client_config.json
1249
0644
edit
dl
rm
pathTemplate.d.ts
1966
0644
edit
dl
rm
pathTemplate.js
9933
0644
edit
dl
rm
pathTemplate.js.map
6595
0644
edit
dl
rm
protosList.json
4921
0644
edit
dl
rm
routingHeader.d.ts
1124
0644
edit
dl
rm
routingHeader.js
1317
0644
edit
dl
rm
routingHeader.js.map
283
0644
edit
dl
rm
status.d.ts
1153
0644
edit
dl
rm
status.js
3229
0644
edit
dl
rm
status.js.map
1570
0644
edit
dl
rm
streamArrayParser.d.ts
2145
0644
edit
dl
rm
streamArrayParser.js
6212
0644
edit
dl
rm
streamArrayParser.js.map
3262
0644
edit
dl
rm
transcoding.d.ts
2592
0644
edit
dl
rm
transcoding.js
12095
0644
edit
dl
rm
transcoding.js.map
9467
0644
edit
dl
rm
util.d.ts
987
0644
edit
dl
rm
util.js
1984
0644
edit
dl
rm
util.js.map
1064
0644
edit
dl
rm
warnings.d.ts
682
0644
edit
dl
rm
warnings.js
1376
0644
edit
dl
rm
warnings.js.map
629
0644
edit
dl
rm
Edit:
/var/www/p4ela.kz/server/delivery/node_modules/google-gax/build/src/pathTemplate.js
(9933B)
"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.PathTemplate = void 0; class PathTemplate { /** * @param {String} data the of the template * * @constructor */ constructor(data) { this.bindings = {}; this.data = data; this.segments = this.parsePathTemplate(data); this.size = this.segments.length; } /** * Matches a fully-qualified path template string. * * @param {String} path a fully-qualified path template string * @return {Object} contains const names matched to binding values * @throws {TypeError} if path can't be matched to this template */ match(path) { let pathSegments = path.split('/'); const bindings = {}; if (pathSegments.length !== this.segments.length) { // if the path contains a wildcard, then the length may differ by 1. if (!this.data.includes('**')) { throw new TypeError(`This path ${path} does not match path template ${this.data}, the number of parameters is not same.`); } else if (pathSegments.length !== this.segments.length + 1) { throw new TypeError(`This path ${path} does not match path template ${this.data}, the number of parameters is not same with one wildcard.`); } } for (let index = 0; index < this.segments.length && pathSegments.length > 0; index++) { if (this.segments[index] !== pathSegments[0]) { if (!this.segments[index].includes('*')) { throw new TypeError(`segment does not match, ${this.segments[index]} and ${pathSegments[index]}.`); } else { let segment = this.segments[index]; const matches = segment.match(/\{[$0-9a-zA-Z_]+=.*?\}/g); if (!matches) { throw new Error(`Error processing path template segment ${segment}`); } const variables = matches.map(str => str.replace(/^\{/, '').replace(/=.*/, '')); if (segment.includes('**')) { bindings[variables[0]] = pathSegments[0] + '/' + pathSegments[1]; pathSegments = pathSegments.slice(2); } else { // atomic resource if (variables.length === 1) { bindings[variables[0]] = pathSegments[0]; } else { // non-slash resource // segment: {blurb_id=*}.{legacy_user=*} to match pathSegments: ['bar.user2'] // split the match pathSegments[0] -> value: ['bar', 'user2'] // compare the length of two arrays, and compare array items const value = pathSegments[0].split(/[-_.~]/); if (value.length !== variables.length) { throw new Error(`segment ${segment} does not match ${pathSegments[0]}`); } for (const v of variables) { bindings[v] = value[0]; segment = segment.replace(`{${v}=*}`, `${value[0]}`); value.shift(); } // segment: {blurb_id=*}.{legacy_user=*} matching pathSegments: ['bar~user2'] should fail if (segment !== pathSegments[0]) { throw new TypeError(`non slash resource pattern ${this.segments[index]} and ${pathSegments[0]} should have same separator`); } } pathSegments.shift(); } } } else { pathSegments.shift(); } } return bindings; } /** * Renders a path template using the provided bindings. * * @param {Object} bindings a mapping of const names to binding strings * @return {String} a rendered representation of the path template * @throws {TypeError} if a key is missing, or if a sub-template cannot be * parsed */ render(bindings) { if (Object.keys(bindings).length !== Object.keys(this.bindings).length) { throw new TypeError(`The number of variables ${Object.keys(bindings).length} does not match the number of needed variables ${Object.keys(this.bindings).length}`); } let path = this.inspect(); for (const key of Object.keys(bindings)) { const b = bindings[key].toString(); if (!this.bindings[key]) { throw new TypeError(`render fails for not matching ${bindings[key]}`); } const variable = this.bindings[key]; if (variable === '*') { if (!b.match(/[^/{}]+/)) { throw new TypeError(`render fails for not matching ${b}`); } path = path.replace(`{${key}=*}`, `${b}`); } else if (variable === '**') { if (!b.match(/[^{}]+/)) { throw new TypeError(`render fails for not matching ${b}`); } path = path.replace(`{${key}=**}`, `${b}`); } } return path; } /** * Renders the path template. * * @return {string} contains const names matched to binding values */ inspect() { return this.segments.join('/'); } /** * Parse the path template. * * @return {string[]} return segments of the input path. * For example: 'buckets/{hello}'' will give back ['buckets', {hello=*}] */ parsePathTemplate(data) { const pathSegments = splitPathTemplate(data); let index = 0; let wildCardCount = 0; const segments = []; let matches; pathSegments.forEach(segment => { // * or ** -> segments.push('{$0=*}'); // -> bindings['$0'] = '*' if (segment === '*' || segment === '**') { this.bindings[`$${index}`] = segment; segments.push(`{$${index}=${segment}}`); index = index + 1; if (segment === '**') { ++wildCardCount; } } else if ((matches = segment.match(/\{[0-9a-zA-Z-.~_]+(?:=.*?)?\}/g))) { for (const subsegment of matches) { const pairMatch = subsegment.match(/^\{([0-9a-zA-Z-.~_]+)(?:=(.*?))?\}$/); if (!pairMatch) { throw new Error(`Cannot process path template segment ${subsegment}`); } const key = pairMatch[1]; let value = pairMatch[2]; if (!value) { value = '*'; segment = segment.replace(key, key + '=*'); this.bindings[key] = value; } else if (value === '*') { this.bindings[key] = value; } else if (value === '**') { ++wildCardCount; this.bindings[key] = value; } } segments.push(segment); } else if (segment.match(/[0-9a-zA-Z-.~_]+/)) { segments.push(segment); } }); if (wildCardCount > 1) { throw new TypeError('Can not have more than one wildcard.'); } return segments; } } exports.PathTemplate = PathTemplate; /** * Split the path template by `/`. * It can not be simply splitted by `/` because there might be `/` in the segments. * For example: 'a/b/{a=hello/world}' we do not want to break the brackets pair * so above path will be splitted as ['a', 'b', '{a=hello/world}'] */ function splitPathTemplate(data) { let left = 0; let right = 0; let bracketCount = 0; const segments = []; while (right >= left && right < data.length) { if (data.charAt(right) === '{') { bracketCount = bracketCount + 1; } else if (data.charAt(right) === '}') { bracketCount = bracketCount - 1; } else if (data.charAt(right) === '/') { if (right === data.length - 1) { throw new TypeError('Invalid path, it can not be ended by /'); } if (bracketCount === 0) { // complete bracket, to avoid the case a/b/**/*/{a=hello/world} segments.push(data.substring(left, right)); left = right + 1; } } if (right === data.length - 1) { if (bracketCount !== 0) { throw new TypeError('Brackets are invalid.'); } segments.push(data.substring(left)); } right = right + 1; } return segments; } //# sourceMappingURL=pathTemplate.js.map
Save
cmd:
run