module-develop-kit 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/commonjs-virtual-dir/browser.js +5 -2
  2. package/dist/commonjs-virtual-dir/browser2.js +2 -5
  3. package/dist/commonjs-virtual-dir/index.js +3 -5
  4. package/dist/commonjs-virtual-dir/index2.js +5 -3
  5. package/dist/commonjs-virtual-dir/index3.js +5 -2
  6. package/dist/commonjs-virtual-dir/index4.js +2 -4
  7. package/dist/commonjs-virtual-dir/index5.js +2 -2
  8. package/dist/commonjs-virtual-dir/index7.js +4 -0
  9. package/dist/commonjs-virtual-dir/index8.js +4 -0
  10. package/dist/main.d.ts +107 -21
  11. package/dist/main.js +44 -40
  12. package/dist/src/outside-call/utils.js +1 -1
  13. package/dist/src/shield/crypto/index.js +53 -0
  14. package/dist/src/shield/crypto/sm2.js +4 -4
  15. package/dist/src/shield/crypto/sm4.js +15 -0
  16. package/dist/src/shield/crypto/util.js +23 -11
  17. package/dist/src/shield/gcm-crypto/axios-adapter.js +82 -0
  18. package/dist/src/shield/gcm-crypto/constants.js +4 -0
  19. package/dist/src/shield/gcm-crypto/gcm.config.js +60 -0
  20. package/dist/src/shield/gcm-crypto/index.js +20 -17
  21. package/dist/src/shield/gcm-crypto/utils.js +40 -0
  22. package/dist/types/axios.d.ts +10 -8
  23. package/dist/vendor/@tokenizer/inflate/lib/ZipHandler.js +1 -1
  24. package/dist/vendor/base64-js/index.js +52 -0
  25. package/dist/vendor/debug/src/browser.js +1 -1
  26. package/dist/vendor/gm-crypt/index.js +10 -0
  27. package/dist/vendor/gm-crypt/src/crypt.js +60 -0
  28. package/dist/vendor/gm-crypt/src/sm4.js +513 -0
  29. package/dist/vendor/ieee754/index.js +1 -1
  30. package/dist/vendor/sdp-transform/lib/index.js +1 -1
  31. package/dist/vendor/token-types/lib/index.js +1 -1
  32. package/package.json +1 -1
  33. package/dist/src/shield/gcm-crypto/gcm.service.js +0 -29
  34. package/dist/src/shield/gcm-crypto/hex.js +0 -18
  35. package/dist/src/shield/gcm-crypto/init.js +0 -61
  36. package/dist/src/shield/gcm-crypto/string.js +0 -10
@@ -0,0 +1,513 @@
1
+ import { __require as B } from "./crypt.js";
2
+ var b, k;
3
+ function w() {
4
+ if (k) return b;
5
+ k = 1;
6
+ const h = B(), l = 16, y = Uint8Array.from([
7
+ 214,
8
+ 144,
9
+ 233,
10
+ 254,
11
+ 204,
12
+ 225,
13
+ 61,
14
+ 183,
15
+ 22,
16
+ 182,
17
+ 20,
18
+ 194,
19
+ 40,
20
+ 251,
21
+ 44,
22
+ 5,
23
+ 43,
24
+ 103,
25
+ 154,
26
+ 118,
27
+ 42,
28
+ 190,
29
+ 4,
30
+ 195,
31
+ 170,
32
+ 68,
33
+ 19,
34
+ 38,
35
+ 73,
36
+ 134,
37
+ 6,
38
+ 153,
39
+ 156,
40
+ 66,
41
+ 80,
42
+ 244,
43
+ 145,
44
+ 239,
45
+ 152,
46
+ 122,
47
+ 51,
48
+ 84,
49
+ 11,
50
+ 67,
51
+ 237,
52
+ 207,
53
+ 172,
54
+ 98,
55
+ 228,
56
+ 179,
57
+ 28,
58
+ 169,
59
+ 201,
60
+ 8,
61
+ 232,
62
+ 149,
63
+ 128,
64
+ 223,
65
+ 148,
66
+ 250,
67
+ 117,
68
+ 143,
69
+ 63,
70
+ 166,
71
+ 71,
72
+ 7,
73
+ 167,
74
+ 252,
75
+ 243,
76
+ 115,
77
+ 23,
78
+ 186,
79
+ 131,
80
+ 89,
81
+ 60,
82
+ 25,
83
+ 230,
84
+ 133,
85
+ 79,
86
+ 168,
87
+ 104,
88
+ 107,
89
+ 129,
90
+ 178,
91
+ 113,
92
+ 100,
93
+ 218,
94
+ 139,
95
+ 248,
96
+ 235,
97
+ 15,
98
+ 75,
99
+ 112,
100
+ 86,
101
+ 157,
102
+ 53,
103
+ 30,
104
+ 36,
105
+ 14,
106
+ 94,
107
+ 99,
108
+ 88,
109
+ 209,
110
+ 162,
111
+ 37,
112
+ 34,
113
+ 124,
114
+ 59,
115
+ 1,
116
+ 33,
117
+ 120,
118
+ 135,
119
+ 212,
120
+ 0,
121
+ 70,
122
+ 87,
123
+ 159,
124
+ 211,
125
+ 39,
126
+ 82,
127
+ 76,
128
+ 54,
129
+ 2,
130
+ 231,
131
+ 160,
132
+ 196,
133
+ 200,
134
+ 158,
135
+ 234,
136
+ 191,
137
+ 138,
138
+ 210,
139
+ 64,
140
+ 199,
141
+ 56,
142
+ 181,
143
+ 163,
144
+ 247,
145
+ 242,
146
+ 206,
147
+ 249,
148
+ 97,
149
+ 21,
150
+ 161,
151
+ 224,
152
+ 174,
153
+ 93,
154
+ 164,
155
+ 155,
156
+ 52,
157
+ 26,
158
+ 85,
159
+ 173,
160
+ 147,
161
+ 50,
162
+ 48,
163
+ 245,
164
+ 140,
165
+ 177,
166
+ 227,
167
+ 29,
168
+ 246,
169
+ 226,
170
+ 46,
171
+ 130,
172
+ 102,
173
+ 202,
174
+ 96,
175
+ 192,
176
+ 41,
177
+ 35,
178
+ 171,
179
+ 13,
180
+ 83,
181
+ 78,
182
+ 111,
183
+ 213,
184
+ 219,
185
+ 55,
186
+ 69,
187
+ 222,
188
+ 253,
189
+ 142,
190
+ 47,
191
+ 3,
192
+ 255,
193
+ 106,
194
+ 114,
195
+ 109,
196
+ 108,
197
+ 91,
198
+ 81,
199
+ 141,
200
+ 27,
201
+ 175,
202
+ 146,
203
+ 187,
204
+ 221,
205
+ 188,
206
+ 127,
207
+ 17,
208
+ 217,
209
+ 92,
210
+ 65,
211
+ 31,
212
+ 16,
213
+ 90,
214
+ 216,
215
+ 10,
216
+ 193,
217
+ 49,
218
+ 136,
219
+ 165,
220
+ 205,
221
+ 123,
222
+ 189,
223
+ 45,
224
+ 116,
225
+ 208,
226
+ 18,
227
+ 184,
228
+ 229,
229
+ 180,
230
+ 176,
231
+ 137,
232
+ 105,
233
+ 151,
234
+ 74,
235
+ 12,
236
+ 150,
237
+ 119,
238
+ 126,
239
+ 101,
240
+ 185,
241
+ 241,
242
+ 9,
243
+ 197,
244
+ 110,
245
+ 198,
246
+ 132,
247
+ 24,
248
+ 240,
249
+ 125,
250
+ 236,
251
+ 58,
252
+ 220,
253
+ 77,
254
+ 32,
255
+ 121,
256
+ 238,
257
+ 95,
258
+ 62,
259
+ 215,
260
+ 203,
261
+ 57,
262
+ 72
263
+ ]), p = Uint32Array.from([
264
+ 462357,
265
+ 472066609,
266
+ 943670861,
267
+ 1415275113,
268
+ 1886879365,
269
+ 2358483617,
270
+ 2830087869,
271
+ 3301692121,
272
+ 3773296373,
273
+ 4228057617,
274
+ 404694573,
275
+ 876298825,
276
+ 1347903077,
277
+ 1819507329,
278
+ 2291111581,
279
+ 2762715833,
280
+ 3234320085,
281
+ 3705924337,
282
+ 4177462797,
283
+ 337322537,
284
+ 808926789,
285
+ 1280531041,
286
+ 1752135293,
287
+ 2223739545,
288
+ 2695343797,
289
+ 3166948049,
290
+ 3638552301,
291
+ 4110090761,
292
+ 269950501,
293
+ 741554753,
294
+ 1213159005,
295
+ 1684763257
296
+ ]), u = Uint32Array.from([
297
+ 2746333894,
298
+ 1453994832,
299
+ 1736282519,
300
+ 2993693404
301
+ ]);
302
+ class T {
303
+ /**
304
+ * Creates an instance of SM4.
305
+ * @param {Object} config
306
+ * @memberof SM4
307
+ */
308
+ constructor(x) {
309
+ let e = h.stringToArrayBufferInUtf8(x.key);
310
+ if (e.length !== 16)
311
+ throw new Error("key should be a 16 bytes string");
312
+ this.key = e;
313
+ let t = new Uint8Array(0);
314
+ if (x.iv !== void 0 && x.iv !== null && (t = h.stringToArrayBufferInUtf8(x.iv), t.length !== 16))
315
+ throw new Error("iv should be a 16 bytes string");
316
+ this.iv = t, this.mode = "cbc", ["cbc", "ecb"].indexOf(x.mode) >= 0 && (this.mode = x.mode), this.cipherType = "base64", ["base64", "text"].indexOf(x.outType) >= 0 && (this.cipherType = x.outType), this.encryptRoundKeys = new Uint32Array(32), this.spawnEncryptRoundKeys(), this.decryptRoundKeys = Uint32Array.from(this.encryptRoundKeys), this.decryptRoundKeys.reverse();
317
+ }
318
+ /**
319
+ * general sm4 encrypt/decrypt algorithm for a 16 bytes block using roundKey
320
+ *
321
+ * @param {Uint32Array} blockData
322
+ * @param {Uint32Array} roundKeys
323
+ * @return {Uint32Array} return a 16 bytes cipher block
324
+ * @memberof SM4
325
+ */
326
+ doBlockCrypt(x, e) {
327
+ let t = new Uint32Array(36);
328
+ t.set(x, 0);
329
+ for (let n = 0; n < 32; n++)
330
+ t[n + 4] = t[n] ^ this.tTransform1(t[n + 1] ^ t[n + 2] ^ t[n + 3] ^ e[n]);
331
+ let o = new Uint32Array(4);
332
+ return o[0] = t[35], o[1] = t[34], o[2] = t[33], o[3] = t[32], o;
333
+ }
334
+ /**
335
+ * spawn round key array for encrypt. reverse this key array when decrypt.
336
+ * every round key's length is 32 bytes.
337
+ * there are 32 round keys.
338
+ * @return {Uint32Array}
339
+ * @memberof SM4
340
+ */
341
+ spawnEncryptRoundKeys() {
342
+ let x = new Uint32Array(4);
343
+ x[0] = this.key[0] << 24 | this.key[1] << 16 | this.key[2] << 8 | this.key[3], x[1] = this.key[4] << 24 | this.key[5] << 16 | this.key[6] << 8 | this.key[7], x[2] = this.key[8] << 24 | this.key[9] << 16 | this.key[10] << 8 | this.key[11], x[3] = this.key[12] << 24 | this.key[13] << 16 | this.key[14] << 8 | this.key[15];
344
+ let e = new Uint32Array(36);
345
+ e[0] = x[0] ^ u[0], e[1] = x[1] ^ u[1], e[2] = x[2] ^ u[2], e[3] = x[3] ^ u[3];
346
+ for (let t = 0; t < 32; t++)
347
+ e[t + 4] = e[t] ^ this.tTransform2(e[t + 1] ^ e[t + 2] ^ e[t + 3] ^ p[t]), this.encryptRoundKeys[t] = e[t + 4];
348
+ }
349
+ /**
350
+ * left rotate x by y bits
351
+ *
352
+ * @param {*} x
353
+ * @param {Number} y
354
+ * @returns
355
+ * @memberof SM4
356
+ */
357
+ rotateLeft(x, e) {
358
+ return x << e | x >>> 32 - e;
359
+ }
360
+ /**
361
+ * L transform function for encrypt
362
+ *
363
+ * @param {Uint32Number} b
364
+ * @returns {Uint32Number}
365
+ * @memberof SM4
366
+ */
367
+ linearTransform1(x) {
368
+ return x ^ this.rotateLeft(x, 2) ^ this.rotateLeft(x, 10) ^ this.rotateLeft(x, 18) ^ this.rotateLeft(x, 24);
369
+ }
370
+ /**
371
+ * L' transform function for key expand
372
+ *
373
+ * @param {Uint32Number} b
374
+ * @returns {Uint32Number}
375
+ * @memberof SM4
376
+ */
377
+ linearTransform2(x) {
378
+ return x ^ this.rotateLeft(x, 13) ^ this.rotateLeft(x, 23);
379
+ }
380
+ /**
381
+ * τ transform function
382
+ *
383
+ * @param {Uint32Number} a
384
+ * @returns {Uint32Number}
385
+ * @memberof SM4
386
+ */
387
+ tauTransform(x) {
388
+ return y[x >>> 24 & 255] << 24 | y[x >>> 16 & 255] << 16 | y[x >>> 8 & 255] << 8 | y[x & 255];
389
+ }
390
+ /**
391
+ * mix replacement T transform for encrypt
392
+ *
393
+ * @param {Uint32Number} z
394
+ * @returns {Uint32Number}
395
+ * @memberof SM4
396
+ */
397
+ tTransform1(x) {
398
+ let e = this.tauTransform(x);
399
+ return this.linearTransform1(e);
400
+ }
401
+ /**
402
+ * mix replacement T transform for key expand
403
+ *
404
+ * @param {Uint32Number} z
405
+ * @returns {Uint32Number}
406
+ * @memberof SM4
407
+ */
408
+ tTransform2(x) {
409
+ let e = this.tauTransform(x);
410
+ return this.linearTransform2(e);
411
+ }
412
+ /**
413
+ * padding the array length to multiple of BLOCK
414
+ *
415
+ * @param {ByteArray} originalBuffer
416
+ * @returns {ByteArray}
417
+ * @memberof SM4
418
+ */
419
+ padding(x) {
420
+ if (x === null)
421
+ return null;
422
+ let e = l - x.length % l, t = new Uint8Array(x.length + e);
423
+ return t.set(x, 0), t.fill(e, x.length), t;
424
+ }
425
+ /**
426
+ * depadding the byte array to its original length
427
+ *
428
+ * @param {ByteArray} paddedBuffer
429
+ * @returns {ByteArray}
430
+ * @memberof SM4
431
+ */
432
+ dePadding(x) {
433
+ if (x === null)
434
+ return null;
435
+ let e = x[x.length - 1];
436
+ return x.slice(0, x.length - e);
437
+ }
438
+ /**
439
+ * exctract uint32 array block from uint8 array
440
+ *
441
+ * @param {Uint8Array} uint8Array
442
+ * @param {Number} baseIndex
443
+ * @returns {Uint32Array}
444
+ * @memberof SM4
445
+ */
446
+ uint8ToUint32Block(x, e = 0) {
447
+ let t = new Uint32Array(4);
448
+ return t[0] = x[e] << 24 | x[e + 1] << 16 | x[e + 2] << 8 | x[e + 3], t[1] = x[e + 4] << 24 | x[e + 5] << 16 | x[e + 6] << 8 | x[e + 7], t[2] = x[e + 8] << 24 | x[e + 9] << 16 | x[e + 10] << 8 | x[e + 11], t[3] = x[e + 12] << 24 | x[e + 13] << 16 | x[e + 14] << 8 | x[e + 15], t;
449
+ }
450
+ /**
451
+ * encrypt the string plaintext
452
+ *
453
+ * @param {String} plaintext
454
+ * @memberof SM4
455
+ * @return {String} ciphertext
456
+ */
457
+ encrypt(x) {
458
+ let e = h.stringToArrayBufferInUtf8(x), t = this.padding(e), o = t.length / l, n = new Uint8Array(t.length);
459
+ if (this.mode === "cbc") {
460
+ if (this.iv === null || this.iv.length !== 16)
461
+ throw new Error("iv error");
462
+ let r = this.uint8ToUint32Block(this.iv);
463
+ for (let f = 0; f < o; f++) {
464
+ let a = f * l, s = this.uint8ToUint32Block(t, a);
465
+ r[0] = r[0] ^ s[0], r[1] = r[1] ^ s[1], r[2] = r[2] ^ s[2], r[3] = r[3] ^ s[3];
466
+ let i = this.doBlockCrypt(r, this.encryptRoundKeys);
467
+ r = i;
468
+ for (let c = 0; c < l; c++)
469
+ n[a + c] = i[parseInt(c / 4)] >> (3 - c) % 4 * 8 & 255;
470
+ }
471
+ } else
472
+ for (let r = 0; r < o; r++) {
473
+ let f = r * l, a = this.uint8ToUint32Block(t, f), s = this.doBlockCrypt(a, this.encryptRoundKeys);
474
+ for (let i = 0; i < l; i++)
475
+ n[f + i] = s[parseInt(i / 4)] >> (3 - i) % 4 * 8 & 255;
476
+ }
477
+ return this.cipherType === "base64" ? h.arrayBufferToBase64(n) : h.utf8ArrayBufferToString(n);
478
+ }
479
+ /**
480
+ * decrypt the string ciphertext
481
+ *
482
+ * @param {String} ciphertext
483
+ * @memberof SM4
484
+ */
485
+ decrypt(x) {
486
+ let e = new Uint8Array();
487
+ this.cipherType === "base64" ? e = h.base64ToArrayBuffer(x) : e = h.stringToArrayBufferInUtf8(x);
488
+ let t = e.length / l, o = new Uint8Array(e.length);
489
+ if (this.mode === "cbc") {
490
+ if (this.iv === null || this.iv.length !== 16)
491
+ throw new Error("iv error");
492
+ let r = this.uint8ToUint32Block(this.iv);
493
+ for (let f = 0; f < t; f++) {
494
+ let a = f * l, s = this.uint8ToUint32Block(e, a), i = this.doBlockCrypt(s, this.decryptRoundKeys), c = new Uint32Array(4);
495
+ c[0] = r[0] ^ i[0], c[1] = r[1] ^ i[1], c[2] = r[2] ^ i[2], c[3] = r[3] ^ i[3], r = s;
496
+ for (let d = 0; d < l; d++)
497
+ o[a + d] = c[parseInt(d / 4)] >> (3 - d) % 4 * 8 & 255;
498
+ }
499
+ } else
500
+ for (let r = 0; r < t; r++) {
501
+ let f = r * l, a = this.uint8ToUint32Block(e, f), s = this.doBlockCrypt(a, this.decryptRoundKeys);
502
+ for (let i = 0; i < l; i++)
503
+ o[f + i] = s[parseInt(i / 4)] >> (3 - i) % 4 * 8 & 255;
504
+ }
505
+ let n = this.dePadding(o);
506
+ return h.utf8ArrayBufferToString(n);
507
+ }
508
+ }
509
+ return b = T, b;
510
+ }
511
+ export {
512
+ w as __require
513
+ };
@@ -1,4 +1,4 @@
1
- import { __exports as n } from "../../commonjs-virtual-dir/index5.js";
1
+ import { __exports as n } from "../../commonjs-virtual-dir/index7.js";
2
2
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
3
  var d;
4
4
  function q() {
@@ -1,4 +1,4 @@
1
- import { __exports as r } from "../../../commonjs-virtual-dir/index4.js";
1
+ import { __exports as r } from "../../../commonjs-virtual-dir/index5.js";
2
2
  import { __require as t } from "./parser.js";
3
3
  import { __require as m } from "./writer.js";
4
4
  import { __require as p } from "./grammar.js";
@@ -1,4 +1,4 @@
1
- import "../../../commonjs-virtual-dir/index3.js";
1
+ import "../../../commonjs-virtual-dir/index4.js";
2
2
  import { textDecode as i } from "../../@borewit/text-codec/lib/index.js";
3
3
  function r(e) {
4
4
  return new DataView(e.buffer, e.byteOffset);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "module-develop-kit",
3
3
  "author": "Front-End team",
4
- "version": "1.4.1",
4
+ "version": "1.4.3",
5
5
  "type": "module",
6
6
  "description": "前端项目通用工具包",
7
7
  "module": "dist/main.js",
@@ -1,29 +0,0 @@
1
- class i {
2
- /**
3
- * 公钥
4
- */
5
- publicKey = "";
6
- /**
7
- * 是否加密
8
- */
9
- isEncrypt = !1;
10
- /**
11
- * 获取公钥
12
- */
13
- // eslint-disable-next-line
14
- getPublicKeyApi = () => Promise.resolve("");
15
- requestBeforeCryptoCallBacks = [];
16
- init(e) {
17
- this.getPublicKeyApi = e.getPublicKeyApi, this.isEncrypt = e.isEncrypt;
18
- }
19
- async initPublicKey() {
20
- this.publicKey || (this.publicKey = await this.getPublicKeyApi());
21
- }
22
- addRequestBeforeCryptoCallback(e) {
23
- this.requestBeforeCryptoCallBacks.push(e);
24
- }
25
- }
26
- const c = new i();
27
- export {
28
- c as gcmService
29
- };
@@ -1,18 +0,0 @@
1
- const o = (e) => Array.from(crypto.getRandomValues(new Uint8Array(e))).map((n) => n.toString(16).padStart(2, "0")).join(""), a = (e) => {
2
- let n = "";
3
- for (let t = 0; t < e.length; t += 32768)
4
- n += String.fromCharCode(...e.subarray(t, t + 32768));
5
- return btoa(n);
6
- }, c = (e) => new TextEncoder().encode(e), i = (e) => new TextDecoder().decode(e), s = (e) => {
7
- const n = atob(e), r = new Uint8Array(n.length);
8
- for (let t = 0; t < n.length; t++)
9
- r[t] = n.charCodeAt(t);
10
- return Array.from(r, (t) => t.toString(16).padStart(2, "0")).join("");
11
- };
12
- export {
13
- s as base64ToHex,
14
- a as bytesToBase64,
15
- o as generateHex,
16
- c as stringToUtf8Bytes,
17
- i as utf8BytesToString
18
- };
@@ -1,61 +0,0 @@
1
- import { sm2 as K } from "../../../vendor/sm-crypto-v2/dist/index.js";
2
- import { EHeaderKey as r } from "../crypto/const.js";
3
- import { sm2Decrypt as b } from "../crypto/sm2.js";
4
- import { base64ToHex as f } from "../crypto/util.js";
5
- import { gcmService as o } from "./gcm.service.js";
6
- import { requestDataEncryption as C, responseDataDecryption as D } from "./index.js";
7
- import { formatUrlToGcmCryptoUri as s } from "./string.js";
8
- import { isNullOrUndefined as n } from "../../utils/is.js";
9
- import "vue";
10
- const B = {
11
- install: (t, e) => {
12
- o.init(e);
13
- }
14
- }, G = () => o.initPublicKey(), I = (t) => {
15
- o.addRequestBeforeCryptoCallback(t);
16
- }, m = /* @__PURE__ */ new Map(), c = (t, e) => t && (t[e] || t.get(e)) || "", k = (t) => {
17
- if (!o.isEncrypt || !o.publicKey)
18
- return t;
19
- if (!t.isNotAutoEncryption && t.url) {
20
- o.requestBeforeCryptoCallBacks.forEach((a) => {
21
- a(t);
22
- });
23
- const { headers: e, data: p } = C(
24
- o.publicKey,
25
- t.data,
26
- s(t.url)
27
- );
28
- if (c(t.headers, "Content-Type") !== "multipart/form-data" && (t.data = n(t.data) ? t.data : p), t.isAutoDecryptionResponse) {
29
- const { publicKey: a, privateKey: i } = K.generateKeyPairHex();
30
- m.set(a, i), t.headers.set(r.gcmPublicKey, a);
31
- }
32
- t.headers.set(e);
33
- }
34
- return t;
35
- }, R = (t) => {
36
- if (t.config.isAutoDecryptionResponse && t.request.responseType !== "blob") {
37
- const { data: e, ...p } = t.data, a = c(t.headers, r.gcmPublicKey);
38
- if (!a)
39
- return t;
40
- const i = m.get(a);
41
- if (i && !n(e)) {
42
- const u = c(t.headers, r.encryptIv), d = c(t.headers, r.encryptKey), l = c(t.headers, r.encryptTag), y = b(i, f(d));
43
- t.data = {
44
- ...p,
45
- data: D(y, e, s(t.config.url), {
46
- [r.encryptIv]: u,
47
- [r.encryptKey]: y,
48
- [r.encryptTag]: l
49
- })
50
- };
51
- }
52
- }
53
- return t;
54
- };
55
- export {
56
- B as gcmCrypto,
57
- G as initPublicKey,
58
- I as requestDataBeforeGcmCrypto,
59
- k as requestDataGcmCryptoInterceptor,
60
- R as responseDataGcmCryptoInterceptor
61
- };
@@ -1,10 +0,0 @@
1
- const t = (o) => typeof o == "object" ? JSON.stringify(o ?? {}) : typeof o == "number" ? String(o) : o ?? "", i = (o) => {
2
- if (!o)
3
- return "";
4
- const r = o.split("/").filter(Boolean);
5
- return r.shift(), `/${r.join("/")}`;
6
- };
7
- export {
8
- t as dataToStr,
9
- i as formatUrlToGcmCryptoUri
10
- };