@@ -1487,6 +1487,36 @@ module.exports = {
1487
1487
1488
1488
/***/ } ) ,
1489
1489
1490
+ /***/ "./node_modules/fast-xml-parser/src/ignoreAttributes.js" :
1491
+ /*!**************************************************************!*\
1492
+ !*** ./node_modules/fast-xml-parser/src/ignoreAttributes.js ***!
1493
+ \**************************************************************/
1494
+ /*! no static exports found */
1495
+ /***/ ( function ( module , exports ) {
1496
+
1497
+ function getIgnoreAttributesFn ( ignoreAttributes ) {
1498
+ if ( typeof ignoreAttributes === 'function' ) {
1499
+ return ignoreAttributes
1500
+ }
1501
+ if ( Array . isArray ( ignoreAttributes ) ) {
1502
+ return ( attrName ) => {
1503
+ for ( const pattern of ignoreAttributes ) {
1504
+ if ( typeof pattern === 'string' && attrName === pattern ) {
1505
+ return true
1506
+ }
1507
+ if ( pattern instanceof RegExp && pattern . test ( attrName ) ) {
1508
+ return true
1509
+ }
1510
+ }
1511
+ }
1512
+ }
1513
+ return ( ) => false
1514
+ }
1515
+
1516
+ module . exports = getIgnoreAttributesFn
1517
+
1518
+ /***/ } ) ,
1519
+
1490
1520
/***/ "./node_modules/fast-xml-parser/src/util.js" :
1491
1521
/*!**************************************************!*\
1492
1522
!*** ./node_modules/fast-xml-parser/src/util.js ***!
@@ -2019,6 +2049,7 @@ function getPositionFromMatch(match) {
2019
2049
2020
2050
//parse Empty Node as self closing node
2021
2051
const buildFromOrderedJs = __webpack_require__ ( /*! ./orderedJs2Xml */ "./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js" ) ;
2052
+ const getIgnoreAttributesFn = __webpack_require__ ( /*! ../ignoreAttributes */ "./node_modules/fast-xml-parser/src/ignoreAttributes.js" )
2022
2053
2023
2054
const defaultOptions = {
2024
2055
attributeNamePrefix : '@_' ,
@@ -2056,11 +2087,12 @@ const defaultOptions = {
2056
2087
2057
2088
function Builder ( options ) {
2058
2089
this . options = Object . assign ( { } , defaultOptions , options ) ;
2059
- if ( this . options . ignoreAttributes || this . options . attributesGroupName ) {
2090
+ if ( this . options . ignoreAttributes === true || this . options . attributesGroupName ) {
2060
2091
this . isAttribute = function ( /*a*/ ) {
2061
2092
return false ;
2062
2093
} ;
2063
2094
} else {
2095
+ this . ignoreAttributesFn = getIgnoreAttributesFn ( this . options . ignoreAttributes )
2064
2096
this . attrPrefixLen = this . options . attributeNamePrefix . length ;
2065
2097
this . isAttribute = isAttribute ;
2066
2098
}
@@ -2089,13 +2121,14 @@ Builder.prototype.build = function(jObj) {
2089
2121
[ this . options . arrayNodeName ] : jObj
2090
2122
}
2091
2123
}
2092
- return this . j2x ( jObj , 0 ) . val ;
2124
+ return this . j2x ( jObj , 0 , [ ] ) . val ;
2093
2125
}
2094
2126
} ;
2095
2127
2096
- Builder . prototype . j2x = function ( jObj , level ) {
2128
+ Builder . prototype . j2x = function ( jObj , level , ajPath ) {
2097
2129
let attrStr = '' ;
2098
2130
let val = '' ;
2131
+ const jPath = ajPath . join ( '.' )
2099
2132
for ( let key in jObj ) {
2100
2133
if ( ! Object . prototype . hasOwnProperty . call ( jObj , key ) ) continue ;
2101
2134
if ( typeof jObj [ key ] === 'undefined' ) {
@@ -2118,9 +2151,9 @@ Builder.prototype.j2x = function(jObj, level) {
2118
2151
} else if ( typeof jObj [ key ] !== 'object' ) {
2119
2152
//premitive type
2120
2153
const attr = this . isAttribute ( key ) ;
2121
- if ( attr ) {
2154
+ if ( attr && ! this . ignoreAttributesFn ( attr , jPath ) ) {
2122
2155
attrStr += this . buildAttrPairStr ( attr , '' + jObj [ key ] ) ;
2123
- } else {
2156
+ } else if ( ! attr ) {
2124
2157
//tag value
2125
2158
if ( key === this . options . textNodeName ) {
2126
2159
let newval = this . options . tagValueProcessor ( key , '' + jObj [ key ] ) ;
@@ -2133,6 +2166,7 @@ Builder.prototype.j2x = function(jObj, level) {
2133
2166
//repeated nodes
2134
2167
const arrLen = jObj [ key ] . length ;
2135
2168
let listTagVal = "" ;
2169
+ let listTagAttr = "" ;
2136
2170
for ( let j = 0 ; j < arrLen ; j ++ ) {
2137
2171
const item = jObj [ key ] [ j ] ;
2138
2172
if ( typeof item === 'undefined' ) {
@@ -2142,17 +2176,27 @@ Builder.prototype.j2x = function(jObj, level) {
2142
2176
else val += this . indentate ( level ) + '<' + key + '/' + this . tagEndChar ;
2143
2177
// val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;
2144
2178
} else if ( typeof item === 'object' ) {
2145
- if ( this . options . oneListGroup ) {
2146
- listTagVal += this . j2x ( item , level + 1 ) . val ;
2179
+ if ( this . options . oneListGroup ) {
2180
+ const result = this . j2x ( item , level + 1 , ajPath . concat ( key ) ) ;
2181
+ listTagVal += result . val ;
2182
+ if ( this . options . attributesGroupName && item . hasOwnProperty ( this . options . attributesGroupName ) ) {
2183
+ listTagAttr += result . attrStr
2184
+ }
2147
2185
} else {
2148
- listTagVal += this . processTextOrObjNode ( item , key , level )
2186
+ listTagVal += this . processTextOrObjNode ( item , key , level , ajPath )
2149
2187
}
2150
2188
} else {
2151
- listTagVal += this . buildTextValNode ( item , key , '' , level ) ;
2189
+ if ( this . options . oneListGroup ) {
2190
+ let textValue = this . options . tagValueProcessor ( key , item ) ;
2191
+ textValue = this . replaceEntitiesValue ( textValue ) ;
2192
+ listTagVal += textValue ;
2193
+ } else {
2194
+ listTagVal += this . buildTextValNode ( item , key , '' , level ) ;
2195
+ }
2152
2196
}
2153
2197
}
2154
2198
if ( this . options . oneListGroup ) {
2155
- listTagVal = this . buildObjectNode ( listTagVal , key , '' , level ) ;
2199
+ listTagVal = this . buildObjectNode ( listTagVal , key , listTagAttr , level ) ;
2156
2200
}
2157
2201
val += listTagVal ;
2158
2202
} else {
@@ -2164,7 +2208,7 @@ Builder.prototype.j2x = function(jObj, level) {
2164
2208
attrStr += this . buildAttrPairStr ( Ks [ j ] , '' + jObj [ key ] [ Ks [ j ] ] ) ;
2165
2209
}
2166
2210
} else {
2167
- val += this . processTextOrObjNode ( jObj [ key ] , key , level )
2211
+ val += this . processTextOrObjNode ( jObj [ key ] , key , level , ajPath )
2168
2212
}
2169
2213
}
2170
2214
}
@@ -2179,8 +2223,8 @@ Builder.prototype.buildAttrPairStr = function(attrName, val){
2179
2223
} else return ' ' + attrName + '="' + val + '"' ;
2180
2224
}
2181
2225
2182
- function processTextOrObjNode ( object , key , level ) {
2183
- const result = this . j2x ( object , level + 1 ) ;
2226
+ function processTextOrObjNode ( object , key , level , ajPath ) {
2227
+ const result = this . j2x ( object , level + 1 , ajPath . concat ( key ) ) ;
2184
2228
if ( object [ this . options . textNodeName ] !== undefined && Object . keys ( object ) . length === 1 ) {
2185
2229
return this . buildTextValNode ( object [ this . options . textNodeName ] , key , result . attrStr , level ) ;
2186
2230
} else {
@@ -2672,6 +2716,7 @@ const util = __webpack_require__(/*! ../util */ "./node_modules/fast-xml-parser/
2672
2716
const xmlNode = __webpack_require__ ( /*! ./xmlNode */ "./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js" ) ;
2673
2717
const readDocType = __webpack_require__ ( /*! ./DocTypeReader */ "./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js" ) ;
2674
2718
const toNumber = __webpack_require__ ( /*! strnum */ "./node_modules/strnum/strnum.js" ) ;
2719
+ const getIgnoreAttributesFn = __webpack_require__ ( /*! ../ignoreAttributes */ "./node_modules/fast-xml-parser/src/ignoreAttributes.js" )
2675
2720
2676
2721
// const regx =
2677
2722
// '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)'
@@ -2720,6 +2765,7 @@ class OrderedObjParser{
2720
2765
this . readStopNodeData = readStopNodeData ;
2721
2766
this . saveTextToParentTag = saveTextToParentTag ;
2722
2767
this . addChild = addChild ;
2768
+ this . ignoreAttributesFn = getIgnoreAttributesFn ( this . options . ignoreAttributes )
2723
2769
}
2724
2770
2725
2771
}
@@ -2792,7 +2838,7 @@ function resolveNameSpace(tagname) {
2792
2838
const attrsRegx = new RegExp ( '([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?' , 'gm' ) ;
2793
2839
2794
2840
function buildAttributesMap ( attrStr , jPath , tagName ) {
2795
- if ( ! this . options . ignoreAttributes && typeof attrStr === 'string' ) {
2841
+ if ( this . options . ignoreAttributes !== true && typeof attrStr === 'string' ) {
2796
2842
// attrStr = attrStr.replace(/\r?\n/g, ' ');
2797
2843
//attrStr = attrStr || attrStr.trim();
2798
2844
@@ -2801,6 +2847,9 @@ function buildAttributesMap(attrStr, jPath, tagName) {
2801
2847
const attrs = { } ;
2802
2848
for ( let i = 0 ; i < len ; i ++ ) {
2803
2849
const attrName = this . resolveNameSpace ( matches [ i ] [ 1 ] ) ;
2850
+ if ( this . ignoreAttributesFn ( attrName , jPath ) ) {
2851
+ continue
2852
+ }
2804
2853
let oldVal = matches [ i ] [ 4 ] ;
2805
2854
let aName = this . options . attributeNamePrefix + attrName ;
2806
2855
if ( attrName . length ) {
@@ -3883,7 +3932,7 @@ module.exports = function(module) {
3883
3932
/*! exports provided: name, version, description, main, types, scripts, repository, keywords, author, license, bugs, homepage, dependencies, devDependencies, default */
3884
3933
/***/ ( function ( module ) {
3885
3934
3886
- module . exports = JSON . parse ( "{\"name\":\"cos-js-sdk-v5\",\"version\":\"1.8.6\",\"description\":\"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)\",\"main\":\"dist/cos-js-sdk-v5.js\",\"types\":\"index.d.ts\",\"scripts\":{\"prettier\":\"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts\",\"server\":\"node server/sts.js\",\"dev\":\"cross-env NODE_ENV=development webpack -w --mode=development\",\"build\":\"cross-env NODE_ENV=production webpack --mode=production\",\"cos-auth.min.js\":\"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m\",\"test\":\"jest --runInBand --coverage\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tencentyun/cos-js-sdk-v5.git\"},\"keywords\":[],\"author\":\"carsonxu\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/tencentyun/cos-js-sdk-v5/issues\"},\"homepage\":\"https://github.com/tencentyun/cos-js-sdk-v5#readme\",\"dependencies\":{\"fast-xml-parser\":\"^4.4.0\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/plugin-transform-runtime\":\"7.18.10\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^5.2.0\",\"express\":\"^4.16.4\",\"jest\":\"^29.3.1\",\"jest-environment-jsdom\":\"^29.3.1\",\"prettier\":\"^3.0.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"request\":\"^2.87.0\",\"terser-webpack-plugin\":\"4.2.3\",\"uglifyjs\":\"^2.4.11\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}" ) ;
3935
+ module . exports = JSON . parse ( "{\"name\":\"cos-js-sdk-v5\",\"version\":\"1.8.7\",\"description\":\"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)\",\"main\":\"dist/cos-js-sdk-v5.js\",\"types\":\"index.d.ts\",\"scripts\":{\"prettier\":\"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts\",\"server\":\"node server/sts.js\",\"dev\":\"cross-env NODE_ENV=development webpack -w --mode=development\",\"build\":\"cross-env NODE_ENV=production webpack --mode=production\",\"cos-auth.min.js\":\"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m\",\"test\":\"jest --runInBand --coverage\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tencentyun/cos-js-sdk-v5.git\"},\"keywords\":[],\"author\":\"carsonxu\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/tencentyun/cos-js-sdk-v5/issues\"},\"homepage\":\"https://github.com/tencentyun/cos-js-sdk-v5#readme\",\"dependencies\":{\"fast-xml-parser\":\"4.5.0\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/plugin-transform-runtime\":\"7.18.10\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^5.2.0\",\"express\":\"^4.16.4\",\"jest\":\"^29.3.1\",\"jest-environment-jsdom\":\"^29.3.1\",\"prettier\":\"^3.0.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"request\":\"^2.87.0\",\"terser-webpack-plugin\":\"4.2.3\",\"uglifyjs\":\"^2.4.11\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}" ) ;
3887
3936
3888
3937
/***/ } ) ,
3889
3938
@@ -9135,6 +9184,8 @@ function _submitRequest(params, callback) {
9135
9184
params . AuthData . ClientIP && ( opt . headers [ 'clientIP' ] = params . AuthData . ClientIP ) ;
9136
9185
params . AuthData . ClientUA && ( opt . headers [ 'clientUA' ] = params . AuthData . ClientUA ) ;
9137
9186
params . AuthData . SecurityToken && ( opt . headers [ token ] = params . AuthData . SecurityToken ) ;
9187
+ params . Action && ( opt . action = params . Action ) ;
9188
+ opt . key = params . Key || params . ResourceKey ;
9138
9189
9139
9190
// 清理 undefined 和 null 字段
9140
9191
opt . headers && ( opt . headers = util . clearKey ( opt . headers ) ) ;
@@ -10394,9 +10445,9 @@ module.exports = Tracker;
10394
10445
/* WEBPACK VAR INJECTION */ ( function ( process ) {
10395
10446
10396
10447
var _typeof = __webpack_require__ ( /*! @babel/runtime/helpers/typeof */ "./node_modules/@babel/runtime/helpers/typeof.js" ) ;
10397
- function _createForOfIteratorHelper ( o , allowArrayLike ) { var it = typeof Symbol !== "undefined" && o [ Symbol . iterator ] || o [ "@@iterator" ] ; if ( ! it ) { if ( Array . isArray ( o ) || ( it = _unsupportedIterableToArray ( o ) ) || allowArrayLike && o && typeof o . length === "number" ) { if ( it ) o = it ; var i = 0 ; var F = function F ( ) { } ; return { s : F , n : function n ( ) { if ( i >= o . length ) return { done : true } ; return { done : false , value : o [ i ++ ] } ; } , e : function e ( _e ) { throw _e ; } , f : F } ; } throw new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ; } var normalCompletion = true , didErr = false , err ; return { s : function s ( ) { it = it . call ( o ) ; } , n : function n ( ) { var step = it . next ( ) ; normalCompletion = step . done ; return step ; } , e : function e ( _e2 ) { didErr = true ; err = _e2 ; } , f : function f ( ) { try { if ( ! normalCompletion && it . return != null ) it . return ( ) ; } finally { if ( didErr ) throw err ; } } } ; }
10398
- function _unsupportedIterableToArray ( o , minLen ) { if ( ! o ) return ; if ( typeof o === "string" ) return _arrayLikeToArray ( o , minLen ) ; var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ; if ( n === "Object" && o . constructor ) n = o . constructor . name ; if ( n === "Map" || n === "Set" ) return Array . from ( o ) ; if ( n === "Arguments" || / ^ (?: U i | I ) n t (?: 8 | 1 6 | 3 2 ) (?: C l a m p e d ) ? A r r a y $ / . test ( n ) ) return _arrayLikeToArray ( o , minLen ) ; }
10399
- function _arrayLikeToArray ( arr , len ) { if ( len == null || len > arr . length ) len = arr . length ; for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) arr2 [ i ] = arr [ i ] ; return arr2 ; }
10448
+ function _createForOfIteratorHelper ( r , e ) { var t = "undefined" != typeof Symbol && r [ Symbol . iterator ] || r [ "@@iterator" ] ; if ( ! t ) { if ( Array . isArray ( r ) || ( t = _unsupportedIterableToArray ( r ) ) || e && r && "number" == typeof r . length ) { t && ( r = t ) ; var _n = 0 , F = function F ( ) { } ; return { s : F , n : function n ( ) { return _n >= r . length ? { done : ! 0 } : { done : ! 1 , value : r [ _n ++ ] } ; } , e : function e ( r ) { throw r ; } , f : F } ; } throw new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ; } var o , a = ! 0 , u = ! 1 ; return { s : function s ( ) { t = t . call ( r ) ; } , n : function n ( ) { var r = t . next ( ) ; return a = r . done , r ; } , e : function e ( r ) { u = ! 0 , o = r ; } , f : function f ( ) { try { a || null == t . return || t . return ( ) ; } finally { if ( u ) throw o ; } } } ; }
10449
+ function _unsupportedIterableToArray ( r , a ) { if ( r ) { if ( "string" == typeof r ) return _arrayLikeToArray ( r , a ) ; var t = { } . toString . call ( r ) . slice ( 8 , - 1 ) ; return "Object" === t && r . constructor && ( t = r . constructor . name ) , "Map" === t || "Set" === t ? Array . from ( r ) : "Arguments" === t || / ^ (?: U i | I ) n t (?: 8 | 1 6 | 3 2 ) (?: C l a m p e d ) ? A r r a y $ / . test ( t ) ? _arrayLikeToArray ( r , a ) : void 0 ; } }
10450
+ function _arrayLikeToArray ( r , a ) { ( null == a || a > r . length ) && ( a = r . length ) ; for ( var e = 0 , n = Array ( a ) ; e < a ; e ++ ) n [ e ] = r [ e ] ; return n ; }
10400
10451
var md5 = __webpack_require__ ( /*! ../lib/md5 */ "./lib/md5.js" ) ;
10401
10452
var CryptoJS = __webpack_require__ ( /*! ../lib/crypto */ "./lib/crypto.js" ) ;
10402
10453
var _require = __webpack_require__ ( /*! fast-xml-parser */ "./node_modules/fast-xml-parser/src/fxp.js" ) ,
0 commit comments