@grwnd/pi-governance 1.4.2 → 1.5.1
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.
- package/README.md +75 -9
- package/dist/extensions/index.cjs +592 -3
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.js +594 -3
- package/dist/extensions/index.js.map +1 -1
- package/dist/index.cjs +387 -707
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +105 -2
- package/dist/index.d.ts +105 -2
- package/dist/index.js +380 -705
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
package/dist/index.cjs
CHANGED
|
@@ -187,705 +187,12 @@ var require_types = __commonJS({
|
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
189
|
|
|
190
|
-
// node_modules/.pnpm/lodash
|
|
191
|
-
var
|
|
192
|
-
"node_modules/.pnpm/lodash
|
|
190
|
+
// node_modules/.pnpm/lodash-isequal-shim@file+packages+lodash-isequal-shim/node_modules/lodash-isequal-shim/index.cjs
|
|
191
|
+
var require_lodash_isequal_shim = __commonJS({
|
|
192
|
+
"node_modules/.pnpm/lodash-isequal-shim@file+packages+lodash-isequal-shim/node_modules/lodash-isequal-shim/index.cjs"(exports2, module2) {
|
|
193
193
|
"use strict";
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
197
|
-
var COMPARE_UNORDERED_FLAG = 2;
|
|
198
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
199
|
-
var argsTag = "[object Arguments]";
|
|
200
|
-
var arrayTag = "[object Array]";
|
|
201
|
-
var asyncTag = "[object AsyncFunction]";
|
|
202
|
-
var boolTag = "[object Boolean]";
|
|
203
|
-
var dateTag = "[object Date]";
|
|
204
|
-
var errorTag = "[object Error]";
|
|
205
|
-
var funcTag = "[object Function]";
|
|
206
|
-
var genTag = "[object GeneratorFunction]";
|
|
207
|
-
var mapTag = "[object Map]";
|
|
208
|
-
var numberTag = "[object Number]";
|
|
209
|
-
var nullTag = "[object Null]";
|
|
210
|
-
var objectTag = "[object Object]";
|
|
211
|
-
var promiseTag = "[object Promise]";
|
|
212
|
-
var proxyTag = "[object Proxy]";
|
|
213
|
-
var regexpTag = "[object RegExp]";
|
|
214
|
-
var setTag = "[object Set]";
|
|
215
|
-
var stringTag = "[object String]";
|
|
216
|
-
var symbolTag = "[object Symbol]";
|
|
217
|
-
var undefinedTag = "[object Undefined]";
|
|
218
|
-
var weakMapTag = "[object WeakMap]";
|
|
219
|
-
var arrayBufferTag = "[object ArrayBuffer]";
|
|
220
|
-
var dataViewTag = "[object DataView]";
|
|
221
|
-
var float32Tag = "[object Float32Array]";
|
|
222
|
-
var float64Tag = "[object Float64Array]";
|
|
223
|
-
var int8Tag = "[object Int8Array]";
|
|
224
|
-
var int16Tag = "[object Int16Array]";
|
|
225
|
-
var int32Tag = "[object Int32Array]";
|
|
226
|
-
var uint8Tag = "[object Uint8Array]";
|
|
227
|
-
var uint8ClampedTag = "[object Uint8ClampedArray]";
|
|
228
|
-
var uint16Tag = "[object Uint16Array]";
|
|
229
|
-
var uint32Tag = "[object Uint32Array]";
|
|
230
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
231
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
232
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
233
|
-
var typedArrayTags = {};
|
|
234
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
235
|
-
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
236
|
-
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
237
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
238
|
-
var root = freeGlobal || freeSelf || Function("return this")();
|
|
239
|
-
var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
|
|
240
|
-
var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
|
|
241
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
242
|
-
var freeProcess = moduleExports && freeGlobal.process;
|
|
243
|
-
var nodeUtil = (function() {
|
|
244
|
-
try {
|
|
245
|
-
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
246
|
-
} catch (e) {
|
|
247
|
-
}
|
|
248
|
-
})();
|
|
249
|
-
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
250
|
-
function arrayFilter(array, predicate) {
|
|
251
|
-
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
252
|
-
while (++index < length) {
|
|
253
|
-
var value = array[index];
|
|
254
|
-
if (predicate(value, index, array)) {
|
|
255
|
-
result[resIndex++] = value;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return result;
|
|
259
|
-
}
|
|
260
|
-
function arrayPush(array, values) {
|
|
261
|
-
var index = -1, length = values.length, offset = array.length;
|
|
262
|
-
while (++index < length) {
|
|
263
|
-
array[offset + index] = values[index];
|
|
264
|
-
}
|
|
265
|
-
return array;
|
|
266
|
-
}
|
|
267
|
-
function arraySome(array, predicate) {
|
|
268
|
-
var index = -1, length = array == null ? 0 : array.length;
|
|
269
|
-
while (++index < length) {
|
|
270
|
-
if (predicate(array[index], index, array)) {
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
function baseTimes(n, iteratee) {
|
|
277
|
-
var index = -1, result = Array(n);
|
|
278
|
-
while (++index < n) {
|
|
279
|
-
result[index] = iteratee(index);
|
|
280
|
-
}
|
|
281
|
-
return result;
|
|
282
|
-
}
|
|
283
|
-
function baseUnary(func) {
|
|
284
|
-
return function(value) {
|
|
285
|
-
return func(value);
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function cacheHas(cache, key) {
|
|
289
|
-
return cache.has(key);
|
|
290
|
-
}
|
|
291
|
-
function getValue(object, key) {
|
|
292
|
-
return object == null ? void 0 : object[key];
|
|
293
|
-
}
|
|
294
|
-
function mapToArray(map) {
|
|
295
|
-
var index = -1, result = Array(map.size);
|
|
296
|
-
map.forEach(function(value, key) {
|
|
297
|
-
result[++index] = [key, value];
|
|
298
|
-
});
|
|
299
|
-
return result;
|
|
300
|
-
}
|
|
301
|
-
function overArg(func, transform) {
|
|
302
|
-
return function(arg) {
|
|
303
|
-
return func(transform(arg));
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
function setToArray(set) {
|
|
307
|
-
var index = -1, result = Array(set.size);
|
|
308
|
-
set.forEach(function(value) {
|
|
309
|
-
result[++index] = value;
|
|
310
|
-
});
|
|
311
|
-
return result;
|
|
312
|
-
}
|
|
313
|
-
var arrayProto = Array.prototype;
|
|
314
|
-
var funcProto = Function.prototype;
|
|
315
|
-
var objectProto = Object.prototype;
|
|
316
|
-
var coreJsData = root["__core-js_shared__"];
|
|
317
|
-
var funcToString = funcProto.toString;
|
|
318
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
319
|
-
var maskSrcKey = (function() {
|
|
320
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
321
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
322
|
-
})();
|
|
323
|
-
var nativeObjectToString = objectProto.toString;
|
|
324
|
-
var reIsNative = RegExp(
|
|
325
|
-
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
326
|
-
);
|
|
327
|
-
var Buffer2 = moduleExports ? root.Buffer : void 0;
|
|
328
|
-
var Symbol2 = root.Symbol;
|
|
329
|
-
var Uint8Array2 = root.Uint8Array;
|
|
330
|
-
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
331
|
-
var splice = arrayProto.splice;
|
|
332
|
-
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
333
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
334
|
-
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
|
|
335
|
-
var nativeKeys = overArg(Object.keys, Object);
|
|
336
|
-
var DataView = getNative(root, "DataView");
|
|
337
|
-
var Map2 = getNative(root, "Map");
|
|
338
|
-
var Promise2 = getNative(root, "Promise");
|
|
339
|
-
var Set2 = getNative(root, "Set");
|
|
340
|
-
var WeakMap2 = getNative(root, "WeakMap");
|
|
341
|
-
var nativeCreate = getNative(Object, "create");
|
|
342
|
-
var dataViewCtorString = toSource(DataView);
|
|
343
|
-
var mapCtorString = toSource(Map2);
|
|
344
|
-
var promiseCtorString = toSource(Promise2);
|
|
345
|
-
var setCtorString = toSource(Set2);
|
|
346
|
-
var weakMapCtorString = toSource(WeakMap2);
|
|
347
|
-
var symbolProto = Symbol2 ? Symbol2.prototype : void 0;
|
|
348
|
-
var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
349
|
-
function Hash(entries) {
|
|
350
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
351
|
-
this.clear();
|
|
352
|
-
while (++index < length) {
|
|
353
|
-
var entry = entries[index];
|
|
354
|
-
this.set(entry[0], entry[1]);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function hashClear() {
|
|
358
|
-
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
359
|
-
this.size = 0;
|
|
360
|
-
}
|
|
361
|
-
function hashDelete(key) {
|
|
362
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
363
|
-
this.size -= result ? 1 : 0;
|
|
364
|
-
return result;
|
|
365
|
-
}
|
|
366
|
-
function hashGet(key) {
|
|
367
|
-
var data = this.__data__;
|
|
368
|
-
if (nativeCreate) {
|
|
369
|
-
var result = data[key];
|
|
370
|
-
return result === HASH_UNDEFINED ? void 0 : result;
|
|
371
|
-
}
|
|
372
|
-
return hasOwnProperty.call(data, key) ? data[key] : void 0;
|
|
373
|
-
}
|
|
374
|
-
function hashHas(key) {
|
|
375
|
-
var data = this.__data__;
|
|
376
|
-
return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
|
|
377
|
-
}
|
|
378
|
-
function hashSet(key, value) {
|
|
379
|
-
var data = this.__data__;
|
|
380
|
-
this.size += this.has(key) ? 0 : 1;
|
|
381
|
-
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
382
|
-
return this;
|
|
383
|
-
}
|
|
384
|
-
Hash.prototype.clear = hashClear;
|
|
385
|
-
Hash.prototype["delete"] = hashDelete;
|
|
386
|
-
Hash.prototype.get = hashGet;
|
|
387
|
-
Hash.prototype.has = hashHas;
|
|
388
|
-
Hash.prototype.set = hashSet;
|
|
389
|
-
function ListCache(entries) {
|
|
390
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
391
|
-
this.clear();
|
|
392
|
-
while (++index < length) {
|
|
393
|
-
var entry = entries[index];
|
|
394
|
-
this.set(entry[0], entry[1]);
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
function listCacheClear() {
|
|
398
|
-
this.__data__ = [];
|
|
399
|
-
this.size = 0;
|
|
400
|
-
}
|
|
401
|
-
function listCacheDelete(key) {
|
|
402
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
403
|
-
if (index < 0) {
|
|
404
|
-
return false;
|
|
405
|
-
}
|
|
406
|
-
var lastIndex = data.length - 1;
|
|
407
|
-
if (index == lastIndex) {
|
|
408
|
-
data.pop();
|
|
409
|
-
} else {
|
|
410
|
-
splice.call(data, index, 1);
|
|
411
|
-
}
|
|
412
|
-
--this.size;
|
|
413
|
-
return true;
|
|
414
|
-
}
|
|
415
|
-
function listCacheGet(key) {
|
|
416
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
417
|
-
return index < 0 ? void 0 : data[index][1];
|
|
418
|
-
}
|
|
419
|
-
function listCacheHas(key) {
|
|
420
|
-
return assocIndexOf(this.__data__, key) > -1;
|
|
421
|
-
}
|
|
422
|
-
function listCacheSet(key, value) {
|
|
423
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
424
|
-
if (index < 0) {
|
|
425
|
-
++this.size;
|
|
426
|
-
data.push([key, value]);
|
|
427
|
-
} else {
|
|
428
|
-
data[index][1] = value;
|
|
429
|
-
}
|
|
430
|
-
return this;
|
|
431
|
-
}
|
|
432
|
-
ListCache.prototype.clear = listCacheClear;
|
|
433
|
-
ListCache.prototype["delete"] = listCacheDelete;
|
|
434
|
-
ListCache.prototype.get = listCacheGet;
|
|
435
|
-
ListCache.prototype.has = listCacheHas;
|
|
436
|
-
ListCache.prototype.set = listCacheSet;
|
|
437
|
-
function MapCache(entries) {
|
|
438
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
439
|
-
this.clear();
|
|
440
|
-
while (++index < length) {
|
|
441
|
-
var entry = entries[index];
|
|
442
|
-
this.set(entry[0], entry[1]);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
function mapCacheClear() {
|
|
446
|
-
this.size = 0;
|
|
447
|
-
this.__data__ = {
|
|
448
|
-
"hash": new Hash(),
|
|
449
|
-
"map": new (Map2 || ListCache)(),
|
|
450
|
-
"string": new Hash()
|
|
451
|
-
};
|
|
452
|
-
}
|
|
453
|
-
function mapCacheDelete(key) {
|
|
454
|
-
var result = getMapData(this, key)["delete"](key);
|
|
455
|
-
this.size -= result ? 1 : 0;
|
|
456
|
-
return result;
|
|
457
|
-
}
|
|
458
|
-
function mapCacheGet(key) {
|
|
459
|
-
return getMapData(this, key).get(key);
|
|
460
|
-
}
|
|
461
|
-
function mapCacheHas(key) {
|
|
462
|
-
return getMapData(this, key).has(key);
|
|
463
|
-
}
|
|
464
|
-
function mapCacheSet(key, value) {
|
|
465
|
-
var data = getMapData(this, key), size = data.size;
|
|
466
|
-
data.set(key, value);
|
|
467
|
-
this.size += data.size == size ? 0 : 1;
|
|
468
|
-
return this;
|
|
469
|
-
}
|
|
470
|
-
MapCache.prototype.clear = mapCacheClear;
|
|
471
|
-
MapCache.prototype["delete"] = mapCacheDelete;
|
|
472
|
-
MapCache.prototype.get = mapCacheGet;
|
|
473
|
-
MapCache.prototype.has = mapCacheHas;
|
|
474
|
-
MapCache.prototype.set = mapCacheSet;
|
|
475
|
-
function SetCache(values) {
|
|
476
|
-
var index = -1, length = values == null ? 0 : values.length;
|
|
477
|
-
this.__data__ = new MapCache();
|
|
478
|
-
while (++index < length) {
|
|
479
|
-
this.add(values[index]);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
function setCacheAdd(value) {
|
|
483
|
-
this.__data__.set(value, HASH_UNDEFINED);
|
|
484
|
-
return this;
|
|
485
|
-
}
|
|
486
|
-
function setCacheHas(value) {
|
|
487
|
-
return this.__data__.has(value);
|
|
488
|
-
}
|
|
489
|
-
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
490
|
-
SetCache.prototype.has = setCacheHas;
|
|
491
|
-
function Stack(entries) {
|
|
492
|
-
var data = this.__data__ = new ListCache(entries);
|
|
493
|
-
this.size = data.size;
|
|
494
|
-
}
|
|
495
|
-
function stackClear() {
|
|
496
|
-
this.__data__ = new ListCache();
|
|
497
|
-
this.size = 0;
|
|
498
|
-
}
|
|
499
|
-
function stackDelete(key) {
|
|
500
|
-
var data = this.__data__, result = data["delete"](key);
|
|
501
|
-
this.size = data.size;
|
|
502
|
-
return result;
|
|
503
|
-
}
|
|
504
|
-
function stackGet(key) {
|
|
505
|
-
return this.__data__.get(key);
|
|
506
|
-
}
|
|
507
|
-
function stackHas(key) {
|
|
508
|
-
return this.__data__.has(key);
|
|
509
|
-
}
|
|
510
|
-
function stackSet(key, value) {
|
|
511
|
-
var data = this.__data__;
|
|
512
|
-
if (data instanceof ListCache) {
|
|
513
|
-
var pairs = data.__data__;
|
|
514
|
-
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
515
|
-
pairs.push([key, value]);
|
|
516
|
-
this.size = ++data.size;
|
|
517
|
-
return this;
|
|
518
|
-
}
|
|
519
|
-
data = this.__data__ = new MapCache(pairs);
|
|
520
|
-
}
|
|
521
|
-
data.set(key, value);
|
|
522
|
-
this.size = data.size;
|
|
523
|
-
return this;
|
|
524
|
-
}
|
|
525
|
-
Stack.prototype.clear = stackClear;
|
|
526
|
-
Stack.prototype["delete"] = stackDelete;
|
|
527
|
-
Stack.prototype.get = stackGet;
|
|
528
|
-
Stack.prototype.has = stackHas;
|
|
529
|
-
Stack.prototype.set = stackSet;
|
|
530
|
-
function arrayLikeKeys(value, inherited) {
|
|
531
|
-
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
532
|
-
for (var key in value) {
|
|
533
|
-
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
534
|
-
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
535
|
-
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
536
|
-
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
537
|
-
isIndex(key, length)))) {
|
|
538
|
-
result.push(key);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
return result;
|
|
542
|
-
}
|
|
543
|
-
function assocIndexOf(array, key) {
|
|
544
|
-
var length = array.length;
|
|
545
|
-
while (length--) {
|
|
546
|
-
if (eq(array[length][0], key)) {
|
|
547
|
-
return length;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
return -1;
|
|
551
|
-
}
|
|
552
|
-
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
553
|
-
var result = keysFunc(object);
|
|
554
|
-
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
555
|
-
}
|
|
556
|
-
function baseGetTag(value) {
|
|
557
|
-
if (value == null) {
|
|
558
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
559
|
-
}
|
|
560
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
561
|
-
}
|
|
562
|
-
function baseIsArguments(value) {
|
|
563
|
-
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
564
|
-
}
|
|
565
|
-
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
566
|
-
if (value === other) {
|
|
567
|
-
return true;
|
|
568
|
-
}
|
|
569
|
-
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
570
|
-
return value !== value && other !== other;
|
|
571
|
-
}
|
|
572
|
-
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
573
|
-
}
|
|
574
|
-
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
575
|
-
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
576
|
-
objTag = objTag == argsTag ? objectTag : objTag;
|
|
577
|
-
othTag = othTag == argsTag ? objectTag : othTag;
|
|
578
|
-
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
579
|
-
if (isSameTag && isBuffer(object)) {
|
|
580
|
-
if (!isBuffer(other)) {
|
|
581
|
-
return false;
|
|
582
|
-
}
|
|
583
|
-
objIsArr = true;
|
|
584
|
-
objIsObj = false;
|
|
585
|
-
}
|
|
586
|
-
if (isSameTag && !objIsObj) {
|
|
587
|
-
stack || (stack = new Stack());
|
|
588
|
-
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
589
|
-
}
|
|
590
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
591
|
-
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
592
|
-
if (objIsWrapped || othIsWrapped) {
|
|
593
|
-
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
594
|
-
stack || (stack = new Stack());
|
|
595
|
-
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
if (!isSameTag) {
|
|
599
|
-
return false;
|
|
600
|
-
}
|
|
601
|
-
stack || (stack = new Stack());
|
|
602
|
-
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
603
|
-
}
|
|
604
|
-
function baseIsNative(value) {
|
|
605
|
-
if (!isObject(value) || isMasked(value)) {
|
|
606
|
-
return false;
|
|
607
|
-
}
|
|
608
|
-
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
609
|
-
return pattern.test(toSource(value));
|
|
610
|
-
}
|
|
611
|
-
function baseIsTypedArray(value) {
|
|
612
|
-
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
613
|
-
}
|
|
614
|
-
function baseKeys(object) {
|
|
615
|
-
if (!isPrototype(object)) {
|
|
616
|
-
return nativeKeys(object);
|
|
617
|
-
}
|
|
618
|
-
var result = [];
|
|
619
|
-
for (var key in Object(object)) {
|
|
620
|
-
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
621
|
-
result.push(key);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
return result;
|
|
625
|
-
}
|
|
626
|
-
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
627
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
628
|
-
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
629
|
-
return false;
|
|
630
|
-
}
|
|
631
|
-
var stacked = stack.get(array);
|
|
632
|
-
if (stacked && stack.get(other)) {
|
|
633
|
-
return stacked == other;
|
|
634
|
-
}
|
|
635
|
-
var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
|
|
636
|
-
stack.set(array, other);
|
|
637
|
-
stack.set(other, array);
|
|
638
|
-
while (++index < arrLength) {
|
|
639
|
-
var arrValue = array[index], othValue = other[index];
|
|
640
|
-
if (customizer) {
|
|
641
|
-
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
642
|
-
}
|
|
643
|
-
if (compared !== void 0) {
|
|
644
|
-
if (compared) {
|
|
645
|
-
continue;
|
|
646
|
-
}
|
|
647
|
-
result = false;
|
|
648
|
-
break;
|
|
649
|
-
}
|
|
650
|
-
if (seen) {
|
|
651
|
-
if (!arraySome(other, function(othValue2, othIndex) {
|
|
652
|
-
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
653
|
-
return seen.push(othIndex);
|
|
654
|
-
}
|
|
655
|
-
})) {
|
|
656
|
-
result = false;
|
|
657
|
-
break;
|
|
658
|
-
}
|
|
659
|
-
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
660
|
-
result = false;
|
|
661
|
-
break;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
stack["delete"](array);
|
|
665
|
-
stack["delete"](other);
|
|
666
|
-
return result;
|
|
667
|
-
}
|
|
668
|
-
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
669
|
-
switch (tag) {
|
|
670
|
-
case dataViewTag:
|
|
671
|
-
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
672
|
-
return false;
|
|
673
|
-
}
|
|
674
|
-
object = object.buffer;
|
|
675
|
-
other = other.buffer;
|
|
676
|
-
case arrayBufferTag:
|
|
677
|
-
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
678
|
-
return false;
|
|
679
|
-
}
|
|
680
|
-
return true;
|
|
681
|
-
case boolTag:
|
|
682
|
-
case dateTag:
|
|
683
|
-
case numberTag:
|
|
684
|
-
return eq(+object, +other);
|
|
685
|
-
case errorTag:
|
|
686
|
-
return object.name == other.name && object.message == other.message;
|
|
687
|
-
case regexpTag:
|
|
688
|
-
case stringTag:
|
|
689
|
-
return object == other + "";
|
|
690
|
-
case mapTag:
|
|
691
|
-
var convert = mapToArray;
|
|
692
|
-
case setTag:
|
|
693
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
694
|
-
convert || (convert = setToArray);
|
|
695
|
-
if (object.size != other.size && !isPartial) {
|
|
696
|
-
return false;
|
|
697
|
-
}
|
|
698
|
-
var stacked = stack.get(object);
|
|
699
|
-
if (stacked) {
|
|
700
|
-
return stacked == other;
|
|
701
|
-
}
|
|
702
|
-
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
703
|
-
stack.set(object, other);
|
|
704
|
-
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
705
|
-
stack["delete"](object);
|
|
706
|
-
return result;
|
|
707
|
-
case symbolTag:
|
|
708
|
-
if (symbolValueOf) {
|
|
709
|
-
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
return false;
|
|
713
|
-
}
|
|
714
|
-
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
715
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
716
|
-
if (objLength != othLength && !isPartial) {
|
|
717
|
-
return false;
|
|
718
|
-
}
|
|
719
|
-
var index = objLength;
|
|
720
|
-
while (index--) {
|
|
721
|
-
var key = objProps[index];
|
|
722
|
-
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
723
|
-
return false;
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
var stacked = stack.get(object);
|
|
727
|
-
if (stacked && stack.get(other)) {
|
|
728
|
-
return stacked == other;
|
|
729
|
-
}
|
|
730
|
-
var result = true;
|
|
731
|
-
stack.set(object, other);
|
|
732
|
-
stack.set(other, object);
|
|
733
|
-
var skipCtor = isPartial;
|
|
734
|
-
while (++index < objLength) {
|
|
735
|
-
key = objProps[index];
|
|
736
|
-
var objValue = object[key], othValue = other[key];
|
|
737
|
-
if (customizer) {
|
|
738
|
-
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
739
|
-
}
|
|
740
|
-
if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
741
|
-
result = false;
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
skipCtor || (skipCtor = key == "constructor");
|
|
745
|
-
}
|
|
746
|
-
if (result && !skipCtor) {
|
|
747
|
-
var objCtor = object.constructor, othCtor = other.constructor;
|
|
748
|
-
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
749
|
-
result = false;
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
stack["delete"](object);
|
|
753
|
-
stack["delete"](other);
|
|
754
|
-
return result;
|
|
755
|
-
}
|
|
756
|
-
function getAllKeys(object) {
|
|
757
|
-
return baseGetAllKeys(object, keys, getSymbols);
|
|
758
|
-
}
|
|
759
|
-
function getMapData(map, key) {
|
|
760
|
-
var data = map.__data__;
|
|
761
|
-
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
762
|
-
}
|
|
763
|
-
function getNative(object, key) {
|
|
764
|
-
var value = getValue(object, key);
|
|
765
|
-
return baseIsNative(value) ? value : void 0;
|
|
766
|
-
}
|
|
767
|
-
function getRawTag(value) {
|
|
768
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
769
|
-
try {
|
|
770
|
-
value[symToStringTag] = void 0;
|
|
771
|
-
var unmasked = true;
|
|
772
|
-
} catch (e) {
|
|
773
|
-
}
|
|
774
|
-
var result = nativeObjectToString.call(value);
|
|
775
|
-
if (unmasked) {
|
|
776
|
-
if (isOwn) {
|
|
777
|
-
value[symToStringTag] = tag;
|
|
778
|
-
} else {
|
|
779
|
-
delete value[symToStringTag];
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return result;
|
|
783
|
-
}
|
|
784
|
-
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
785
|
-
if (object == null) {
|
|
786
|
-
return [];
|
|
787
|
-
}
|
|
788
|
-
object = Object(object);
|
|
789
|
-
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
790
|
-
return propertyIsEnumerable.call(object, symbol);
|
|
791
|
-
});
|
|
792
|
-
};
|
|
793
|
-
var getTag = baseGetTag;
|
|
794
|
-
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
|
|
795
|
-
getTag = function(value) {
|
|
796
|
-
var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
797
|
-
if (ctorString) {
|
|
798
|
-
switch (ctorString) {
|
|
799
|
-
case dataViewCtorString:
|
|
800
|
-
return dataViewTag;
|
|
801
|
-
case mapCtorString:
|
|
802
|
-
return mapTag;
|
|
803
|
-
case promiseCtorString:
|
|
804
|
-
return promiseTag;
|
|
805
|
-
case setCtorString:
|
|
806
|
-
return setTag;
|
|
807
|
-
case weakMapCtorString:
|
|
808
|
-
return weakMapTag;
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
return result;
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
function isIndex(value, length) {
|
|
815
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
816
|
-
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
817
|
-
}
|
|
818
|
-
function isKeyable(value) {
|
|
819
|
-
var type = typeof value;
|
|
820
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
821
|
-
}
|
|
822
|
-
function isMasked(func) {
|
|
823
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
824
|
-
}
|
|
825
|
-
function isPrototype(value) {
|
|
826
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
827
|
-
return value === proto;
|
|
828
|
-
}
|
|
829
|
-
function objectToString(value) {
|
|
830
|
-
return nativeObjectToString.call(value);
|
|
831
|
-
}
|
|
832
|
-
function toSource(func) {
|
|
833
|
-
if (func != null) {
|
|
834
|
-
try {
|
|
835
|
-
return funcToString.call(func);
|
|
836
|
-
} catch (e) {
|
|
837
|
-
}
|
|
838
|
-
try {
|
|
839
|
-
return func + "";
|
|
840
|
-
} catch (e) {
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
return "";
|
|
844
|
-
}
|
|
845
|
-
function eq(value, other) {
|
|
846
|
-
return value === other || value !== value && other !== other;
|
|
847
|
-
}
|
|
848
|
-
var isArguments = baseIsArguments(/* @__PURE__ */ (function() {
|
|
849
|
-
return arguments;
|
|
850
|
-
})()) ? baseIsArguments : function(value) {
|
|
851
|
-
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
852
|
-
};
|
|
853
|
-
var isArray = Array.isArray;
|
|
854
|
-
function isArrayLike(value) {
|
|
855
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
856
|
-
}
|
|
857
|
-
var isBuffer = nativeIsBuffer || stubFalse;
|
|
858
|
-
function isEqual(value, other) {
|
|
859
|
-
return baseIsEqual(value, other);
|
|
860
|
-
}
|
|
861
|
-
function isFunction(value) {
|
|
862
|
-
if (!isObject(value)) {
|
|
863
|
-
return false;
|
|
864
|
-
}
|
|
865
|
-
var tag = baseGetTag(value);
|
|
866
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
867
|
-
}
|
|
868
|
-
function isLength(value) {
|
|
869
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
870
|
-
}
|
|
871
|
-
function isObject(value) {
|
|
872
|
-
var type = typeof value;
|
|
873
|
-
return value != null && (type == "object" || type == "function");
|
|
874
|
-
}
|
|
875
|
-
function isObjectLike(value) {
|
|
876
|
-
return value != null && typeof value == "object";
|
|
877
|
-
}
|
|
878
|
-
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
879
|
-
function keys(object) {
|
|
880
|
-
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
881
|
-
}
|
|
882
|
-
function stubArray() {
|
|
883
|
-
return [];
|
|
884
|
-
}
|
|
885
|
-
function stubFalse() {
|
|
886
|
-
return false;
|
|
887
|
-
}
|
|
888
|
-
module2.exports = isEqual;
|
|
194
|
+
var { isDeepStrictEqual } = require("util");
|
|
195
|
+
module2.exports = isDeepStrictEqual;
|
|
889
196
|
}
|
|
890
197
|
});
|
|
891
198
|
|
|
@@ -901,7 +208,7 @@ var require_helpers = __commonJS({
|
|
|
901
208
|
var fs_1 = require("fs");
|
|
902
209
|
var errors_1 = require_errors();
|
|
903
210
|
var types_1 = require_types();
|
|
904
|
-
var isEqual =
|
|
211
|
+
var isEqual = require_lodash_isequal_shim();
|
|
905
212
|
function ancestors(cls) {
|
|
906
213
|
if (!isConstructor(cls))
|
|
907
214
|
return [];
|
|
@@ -1526,18 +833,18 @@ var require_Query = __commonJS({
|
|
|
1526
833
|
if (receiver === null || receiver === void 0)
|
|
1527
834
|
throw new (args ? errors_1.InvalidCallError : errors_1.InvalidAttributeError)(receiver, attr);
|
|
1528
835
|
const rel = (_b = (_a = __classPrivateFieldGet(this, _Query_host, "f").getType(receiver.constructor)) === null || _a === void 0 ? void 0 : _a.fields) === null || _b === void 0 ? void 0 : _b.get(attr);
|
|
1529
|
-
const
|
|
836
|
+
const self = receiver;
|
|
1530
837
|
if (rel instanceof filter_1.Relation)
|
|
1531
|
-
value = await this.handleRelation(
|
|
838
|
+
value = await this.handleRelation(self, rel);
|
|
1532
839
|
else if (args) {
|
|
1533
|
-
if (typeof
|
|
840
|
+
if (typeof self[attr] !== "function")
|
|
1534
841
|
throw new errors_1.InvalidCallError(receiver, attr);
|
|
1535
842
|
const jsArgs = await Promise.all(args.map((a) => __classPrivateFieldGet(this, _Query_host, "f").toJs(a)));
|
|
1536
|
-
value =
|
|
1537
|
-
} else if (!(attr in
|
|
843
|
+
value = self[attr](...jsArgs);
|
|
844
|
+
} else if (!(attr in self))
|
|
1538
845
|
throw new errors_1.InvalidAttributeError(receiver, attr);
|
|
1539
846
|
else
|
|
1540
|
-
value =
|
|
847
|
+
value = self[attr];
|
|
1541
848
|
} catch (e) {
|
|
1542
849
|
if (e instanceof TypeError || e instanceof errors_1.InvalidCallError || e instanceof errors_1.InvalidAttributeError) {
|
|
1543
850
|
this.applicationError(e.message);
|
|
@@ -3759,6 +3066,10 @@ __export(index_exports, {
|
|
|
3759
3066
|
ConfigValidationError: () => ConfigValidationError,
|
|
3760
3067
|
ConfigWatcher: () => ConfigWatcher,
|
|
3761
3068
|
DANGEROUS_PATTERNS: () => DANGEROUS_PATTERNS,
|
|
3069
|
+
DLP_PII_PATTERNS: () => PII_PATTERNS,
|
|
3070
|
+
DLP_SECRET_PATTERNS: () => SECRET_PATTERNS,
|
|
3071
|
+
DlpMasker: () => DlpMasker,
|
|
3072
|
+
DlpScanner: () => DlpScanner,
|
|
3762
3073
|
EnvIdentityProvider: () => EnvIdentityProvider,
|
|
3763
3074
|
IdentityChain: () => IdentityChain,
|
|
3764
3075
|
JsonlAuditSink: () => JsonlAuditSink,
|
|
@@ -3770,6 +3081,7 @@ __export(index_exports, {
|
|
|
3770
3081
|
WebhookAuditSink: () => WebhookAuditSink,
|
|
3771
3082
|
YamlFactStore: () => YamlFactStore,
|
|
3772
3083
|
YamlPolicyEngine: () => YamlPolicyEngine,
|
|
3084
|
+
compareSeverity: () => compareSeverity,
|
|
3773
3085
|
createApprovalFlow: () => createApprovalFlow,
|
|
3774
3086
|
createIdentityChain: () => createIdentityChain,
|
|
3775
3087
|
createPolicyEngine: () => createPolicyEngine,
|
|
@@ -3856,12 +3168,78 @@ var OrgUnitOverride = import_typebox.Type.Object({
|
|
|
3856
3168
|
})
|
|
3857
3169
|
)
|
|
3858
3170
|
});
|
|
3171
|
+
var DlpMaskingConfig = import_typebox.Type.Object({
|
|
3172
|
+
strategy: import_typebox.Type.Union([import_typebox.Type.Literal("partial"), import_typebox.Type.Literal("full"), import_typebox.Type.Literal("hash")], {
|
|
3173
|
+
default: "partial"
|
|
3174
|
+
}),
|
|
3175
|
+
show_chars: import_typebox.Type.Optional(import_typebox.Type.Number({ default: 4, minimum: 0 })),
|
|
3176
|
+
placeholder: import_typebox.Type.Optional(import_typebox.Type.String({ default: "***" }))
|
|
3177
|
+
});
|
|
3178
|
+
var DlpCustomPatternConfig = import_typebox.Type.Object({
|
|
3179
|
+
name: import_typebox.Type.String(),
|
|
3180
|
+
pattern: import_typebox.Type.String(),
|
|
3181
|
+
severity: import_typebox.Type.Union([
|
|
3182
|
+
import_typebox.Type.Literal("low"),
|
|
3183
|
+
import_typebox.Type.Literal("medium"),
|
|
3184
|
+
import_typebox.Type.Literal("high"),
|
|
3185
|
+
import_typebox.Type.Literal("critical")
|
|
3186
|
+
]),
|
|
3187
|
+
action: import_typebox.Type.Optional(
|
|
3188
|
+
import_typebox.Type.Union([import_typebox.Type.Literal("audit"), import_typebox.Type.Literal("mask"), import_typebox.Type.Literal("block")])
|
|
3189
|
+
)
|
|
3190
|
+
});
|
|
3191
|
+
var DlpAllowlistEntryConfig = import_typebox.Type.Object({
|
|
3192
|
+
pattern: import_typebox.Type.String()
|
|
3193
|
+
});
|
|
3194
|
+
var DlpRoleOverrideConfig = import_typebox.Type.Object({
|
|
3195
|
+
enabled: import_typebox.Type.Optional(import_typebox.Type.Boolean()),
|
|
3196
|
+
mode: import_typebox.Type.Optional(
|
|
3197
|
+
import_typebox.Type.Union([import_typebox.Type.Literal("audit"), import_typebox.Type.Literal("mask"), import_typebox.Type.Literal("block")])
|
|
3198
|
+
),
|
|
3199
|
+
on_input: import_typebox.Type.Optional(
|
|
3200
|
+
import_typebox.Type.Union([import_typebox.Type.Literal("audit"), import_typebox.Type.Literal("mask"), import_typebox.Type.Literal("block")])
|
|
3201
|
+
),
|
|
3202
|
+
on_output: import_typebox.Type.Optional(
|
|
3203
|
+
import_typebox.Type.Union([import_typebox.Type.Literal("audit"), import_typebox.Type.Literal("mask"), import_typebox.Type.Literal("block")])
|
|
3204
|
+
)
|
|
3205
|
+
});
|
|
3206
|
+
var DlpConfig = import_typebox.Type.Object({
|
|
3207
|
+
enabled: import_typebox.Type.Boolean({ default: false }),
|
|
3208
|
+
mode: import_typebox.Type.Optional(
|
|
3209
|
+
import_typebox.Type.Union([import_typebox.Type.Literal("audit"), import_typebox.Type.Literal("mask"), import_typebox.Type.Literal("block")], {
|
|
3210
|
+
default: "audit"
|
|
3211
|
+
})
|
|
3212
|
+
),
|
|
3213
|
+
on_input: import_typebox.Type.Optional(
|
|
3214
|
+
import_typebox.Type.Union([import_typebox.Type.Literal("audit"), import_typebox.Type.Literal("mask"), import_typebox.Type.Literal("block")])
|
|
3215
|
+
),
|
|
3216
|
+
on_output: import_typebox.Type.Optional(
|
|
3217
|
+
import_typebox.Type.Union([import_typebox.Type.Literal("audit"), import_typebox.Type.Literal("mask"), import_typebox.Type.Literal("block")])
|
|
3218
|
+
),
|
|
3219
|
+
masking: import_typebox.Type.Optional(DlpMaskingConfig),
|
|
3220
|
+
severity_threshold: import_typebox.Type.Optional(
|
|
3221
|
+
import_typebox.Type.Union(
|
|
3222
|
+
[import_typebox.Type.Literal("low"), import_typebox.Type.Literal("medium"), import_typebox.Type.Literal("high"), import_typebox.Type.Literal("critical")],
|
|
3223
|
+
{ default: "low" }
|
|
3224
|
+
)
|
|
3225
|
+
),
|
|
3226
|
+
built_in: import_typebox.Type.Optional(
|
|
3227
|
+
import_typebox.Type.Object({
|
|
3228
|
+
secrets: import_typebox.Type.Boolean({ default: true }),
|
|
3229
|
+
pii: import_typebox.Type.Boolean({ default: true })
|
|
3230
|
+
})
|
|
3231
|
+
),
|
|
3232
|
+
custom_patterns: import_typebox.Type.Optional(import_typebox.Type.Array(DlpCustomPatternConfig)),
|
|
3233
|
+
allowlist: import_typebox.Type.Optional(import_typebox.Type.Array(DlpAllowlistEntryConfig)),
|
|
3234
|
+
role_overrides: import_typebox.Type.Optional(import_typebox.Type.Record(import_typebox.Type.String(), DlpRoleOverrideConfig))
|
|
3235
|
+
});
|
|
3859
3236
|
var GovernanceConfigSchema = import_typebox.Type.Object({
|
|
3860
3237
|
auth: import_typebox.Type.Optional(AuthConfig),
|
|
3861
3238
|
policy: import_typebox.Type.Optional(PolicyConfig),
|
|
3862
3239
|
templates: import_typebox.Type.Optional(TemplatesConfig),
|
|
3863
3240
|
hitl: import_typebox.Type.Optional(HitlConfig),
|
|
3864
3241
|
audit: import_typebox.Type.Optional(AuditConfig),
|
|
3242
|
+
dlp: import_typebox.Type.Optional(DlpConfig),
|
|
3865
3243
|
org_units: import_typebox.Type.Optional(import_typebox.Type.Record(import_typebox.Type.String(), OrgUnitOverride))
|
|
3866
3244
|
});
|
|
3867
3245
|
|
|
@@ -3892,6 +3270,9 @@ var DEFAULTS = {
|
|
|
3892
3270
|
},
|
|
3893
3271
|
audit: {
|
|
3894
3272
|
sinks: [{ type: "jsonl", path: "~/.pi/agent/audit.jsonl" }]
|
|
3273
|
+
},
|
|
3274
|
+
dlp: {
|
|
3275
|
+
enabled: false
|
|
3895
3276
|
}
|
|
3896
3277
|
};
|
|
3897
3278
|
|
|
@@ -4363,6 +3744,300 @@ var BashClassifier = class {
|
|
|
4363
3744
|
}
|
|
4364
3745
|
};
|
|
4365
3746
|
|
|
3747
|
+
// src/lib/dlp/patterns.ts
|
|
3748
|
+
var SECRET_PATTERNS = [
|
|
3749
|
+
// AWS
|
|
3750
|
+
{
|
|
3751
|
+
name: "aws_access_key",
|
|
3752
|
+
pattern: /\b(AKIA[0-9A-Z]{16})\b/g,
|
|
3753
|
+
severity: "critical",
|
|
3754
|
+
category: "secret"
|
|
3755
|
+
},
|
|
3756
|
+
{
|
|
3757
|
+
name: "aws_secret_key",
|
|
3758
|
+
pattern: /\b([A-Za-z0-9/+=]{40})(?=\s|$|"|')/g,
|
|
3759
|
+
severity: "critical",
|
|
3760
|
+
category: "secret"
|
|
3761
|
+
},
|
|
3762
|
+
// GitHub
|
|
3763
|
+
{
|
|
3764
|
+
name: "github_pat",
|
|
3765
|
+
pattern: /\b(ghp_[A-Za-z0-9]{36,})\b/g,
|
|
3766
|
+
severity: "critical",
|
|
3767
|
+
category: "secret"
|
|
3768
|
+
},
|
|
3769
|
+
{
|
|
3770
|
+
name: "github_oauth",
|
|
3771
|
+
pattern: /\b(gho_[A-Za-z0-9]{36,})\b/g,
|
|
3772
|
+
severity: "high",
|
|
3773
|
+
category: "secret"
|
|
3774
|
+
},
|
|
3775
|
+
{
|
|
3776
|
+
name: "github_app_token",
|
|
3777
|
+
pattern: /\b(ghu_[A-Za-z0-9]{36,})\b/g,
|
|
3778
|
+
severity: "high",
|
|
3779
|
+
category: "secret"
|
|
3780
|
+
},
|
|
3781
|
+
// Anthropic
|
|
3782
|
+
{
|
|
3783
|
+
name: "anthropic_api_key",
|
|
3784
|
+
pattern: /\b(sk-ant-api03-[A-Za-z0-9_-]{90,})\b/g,
|
|
3785
|
+
severity: "critical",
|
|
3786
|
+
category: "secret"
|
|
3787
|
+
},
|
|
3788
|
+
// OpenAI
|
|
3789
|
+
{
|
|
3790
|
+
name: "openai_api_key",
|
|
3791
|
+
pattern: /\b(sk-[A-Za-z0-9]{20,}T3BlbkFJ[A-Za-z0-9]{20,})\b/g,
|
|
3792
|
+
severity: "critical",
|
|
3793
|
+
category: "secret"
|
|
3794
|
+
},
|
|
3795
|
+
// JWT
|
|
3796
|
+
{
|
|
3797
|
+
name: "jwt_token",
|
|
3798
|
+
pattern: /\b(eyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,})\b/g,
|
|
3799
|
+
severity: "high",
|
|
3800
|
+
category: "secret"
|
|
3801
|
+
},
|
|
3802
|
+
// Private key headers
|
|
3803
|
+
{
|
|
3804
|
+
name: "private_key",
|
|
3805
|
+
pattern: /-----BEGIN\s+(RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----/g,
|
|
3806
|
+
severity: "critical",
|
|
3807
|
+
category: "secret"
|
|
3808
|
+
},
|
|
3809
|
+
// Database connection strings
|
|
3810
|
+
{
|
|
3811
|
+
name: "database_url",
|
|
3812
|
+
pattern: /\b((?:postgres|mysql|mongodb|redis):\/\/[^\s'"]{10,})\b/g,
|
|
3813
|
+
severity: "high",
|
|
3814
|
+
category: "secret"
|
|
3815
|
+
},
|
|
3816
|
+
// Slack
|
|
3817
|
+
{
|
|
3818
|
+
name: "slack_token",
|
|
3819
|
+
pattern: /\b(xox[bpras]-[A-Za-z0-9-]{10,})\b/g,
|
|
3820
|
+
severity: "high",
|
|
3821
|
+
category: "secret"
|
|
3822
|
+
},
|
|
3823
|
+
// Stripe
|
|
3824
|
+
{
|
|
3825
|
+
name: "stripe_key",
|
|
3826
|
+
pattern: /\b([rs]k_(?:live|test)_[A-Za-z0-9]{20,})\b/g,
|
|
3827
|
+
severity: "critical",
|
|
3828
|
+
category: "secret"
|
|
3829
|
+
},
|
|
3830
|
+
// npm
|
|
3831
|
+
{
|
|
3832
|
+
name: "npm_token",
|
|
3833
|
+
pattern: /\b(npm_[A-Za-z0-9]{36,})\b/g,
|
|
3834
|
+
severity: "high",
|
|
3835
|
+
category: "secret"
|
|
3836
|
+
},
|
|
3837
|
+
// SendGrid
|
|
3838
|
+
{
|
|
3839
|
+
name: "sendgrid_key",
|
|
3840
|
+
pattern: /\b(SG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,})\b/g,
|
|
3841
|
+
severity: "high",
|
|
3842
|
+
category: "secret"
|
|
3843
|
+
},
|
|
3844
|
+
// Generic API key patterns (env-var style assignments)
|
|
3845
|
+
{
|
|
3846
|
+
name: "generic_api_key",
|
|
3847
|
+
pattern: /\b(?:API_KEY|API_SECRET|ACCESS_TOKEN|AUTH_TOKEN|SECRET_KEY)\s*[=:]\s*['"]?([A-Za-z0-9_-]{16,})['"]?/gi,
|
|
3848
|
+
severity: "medium",
|
|
3849
|
+
category: "secret"
|
|
3850
|
+
},
|
|
3851
|
+
// High-entropy string near keyword context
|
|
3852
|
+
{
|
|
3853
|
+
name: "generic_secret_assignment",
|
|
3854
|
+
pattern: /\b(?:password|passwd|secret|token|credential)\s*[=:]\s*['"]([^'"]{8,})['"]?/gi,
|
|
3855
|
+
severity: "medium",
|
|
3856
|
+
category: "secret"
|
|
3857
|
+
}
|
|
3858
|
+
];
|
|
3859
|
+
var PII_PATTERNS = [
|
|
3860
|
+
// SSN (US)
|
|
3861
|
+
{
|
|
3862
|
+
name: "ssn",
|
|
3863
|
+
pattern: /\b(\d{3}-\d{2}-\d{4})\b/g,
|
|
3864
|
+
severity: "critical",
|
|
3865
|
+
category: "pii"
|
|
3866
|
+
},
|
|
3867
|
+
// Credit card numbers
|
|
3868
|
+
{
|
|
3869
|
+
name: "credit_card",
|
|
3870
|
+
pattern: /\b(4\d{3}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}|5[1-5]\d{2}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}|3[47]\d{2}[\s-]?\d{6}[\s-]?\d{5}|6(?:011|5\d{2})[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4})\b/g,
|
|
3871
|
+
severity: "critical",
|
|
3872
|
+
category: "pii"
|
|
3873
|
+
},
|
|
3874
|
+
// Email address
|
|
3875
|
+
{
|
|
3876
|
+
name: "email",
|
|
3877
|
+
pattern: /\b([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,})\b/g,
|
|
3878
|
+
severity: "low",
|
|
3879
|
+
category: "pii"
|
|
3880
|
+
},
|
|
3881
|
+
// US phone number
|
|
3882
|
+
{
|
|
3883
|
+
name: "phone_us",
|
|
3884
|
+
pattern: /\b(\+?1?[-.\s]?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4})\b/g,
|
|
3885
|
+
severity: "medium",
|
|
3886
|
+
category: "pii"
|
|
3887
|
+
},
|
|
3888
|
+
// IPv4 address
|
|
3889
|
+
{
|
|
3890
|
+
name: "ipv4",
|
|
3891
|
+
pattern: /\b((?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?))\b/g,
|
|
3892
|
+
severity: "low",
|
|
3893
|
+
category: "pii"
|
|
3894
|
+
}
|
|
3895
|
+
];
|
|
3896
|
+
|
|
3897
|
+
// src/lib/dlp/scanner.ts
|
|
3898
|
+
var SEVERITY_ORDER = {
|
|
3899
|
+
low: 0,
|
|
3900
|
+
medium: 1,
|
|
3901
|
+
high: 2,
|
|
3902
|
+
critical: 3
|
|
3903
|
+
};
|
|
3904
|
+
var DlpScanner = class {
|
|
3905
|
+
patterns;
|
|
3906
|
+
allowlistRegexps;
|
|
3907
|
+
severityThreshold;
|
|
3908
|
+
config;
|
|
3909
|
+
constructor(config) {
|
|
3910
|
+
this.config = config;
|
|
3911
|
+
this.severityThreshold = SEVERITY_ORDER[config.severity_threshold];
|
|
3912
|
+
this.patterns = [];
|
|
3913
|
+
this.allowlistRegexps = [];
|
|
3914
|
+
if (config.built_in.secrets) {
|
|
3915
|
+
for (const def of SECRET_PATTERNS) {
|
|
3916
|
+
this.patterns.push({ def });
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
if (config.built_in.pii) {
|
|
3920
|
+
for (const def of PII_PATTERNS) {
|
|
3921
|
+
this.patterns.push({ def });
|
|
3922
|
+
}
|
|
3923
|
+
}
|
|
3924
|
+
for (const cp of config.custom_patterns) {
|
|
3925
|
+
const def = {
|
|
3926
|
+
name: cp.name,
|
|
3927
|
+
pattern: new RegExp(cp.pattern, "g"),
|
|
3928
|
+
severity: cp.severity,
|
|
3929
|
+
category: "custom"
|
|
3930
|
+
};
|
|
3931
|
+
this.patterns.push({ def, action: cp.action });
|
|
3932
|
+
}
|
|
3933
|
+
for (const compiled of this.patterns) {
|
|
3934
|
+
const override = config.pattern_overrides.get(compiled.def.name);
|
|
3935
|
+
if (override) {
|
|
3936
|
+
compiled.action = override;
|
|
3937
|
+
}
|
|
3938
|
+
}
|
|
3939
|
+
for (const entry of config.allowlist) {
|
|
3940
|
+
this.allowlistRegexps.push(new RegExp(entry.pattern));
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3943
|
+
scan(text) {
|
|
3944
|
+
if (!this.config.enabled || text.length === 0) {
|
|
3945
|
+
return { hasMatches: false, matches: [] };
|
|
3946
|
+
}
|
|
3947
|
+
const matches = [];
|
|
3948
|
+
for (const compiled of this.patterns) {
|
|
3949
|
+
if (SEVERITY_ORDER[compiled.def.severity] < this.severityThreshold) {
|
|
3950
|
+
continue;
|
|
3951
|
+
}
|
|
3952
|
+
const regex = new RegExp(compiled.def.pattern.source, compiled.def.pattern.flags);
|
|
3953
|
+
let match;
|
|
3954
|
+
while ((match = regex.exec(text)) !== null) {
|
|
3955
|
+
const matched = match[1] ?? match[0];
|
|
3956
|
+
const start = match[1] ? match.index + match[0].indexOf(match[1]) : match.index;
|
|
3957
|
+
const end = start + matched.length;
|
|
3958
|
+
if (this.isAllowlisted(matched)) {
|
|
3959
|
+
continue;
|
|
3960
|
+
}
|
|
3961
|
+
matches.push({
|
|
3962
|
+
patternName: compiled.def.name,
|
|
3963
|
+
category: compiled.def.category,
|
|
3964
|
+
severity: compiled.def.severity,
|
|
3965
|
+
start,
|
|
3966
|
+
end,
|
|
3967
|
+
matched
|
|
3968
|
+
});
|
|
3969
|
+
}
|
|
3970
|
+
}
|
|
3971
|
+
return { hasMatches: matches.length > 0, matches };
|
|
3972
|
+
}
|
|
3973
|
+
getAction(direction) {
|
|
3974
|
+
if (direction === "input" && this.config.on_input) {
|
|
3975
|
+
return this.config.on_input;
|
|
3976
|
+
}
|
|
3977
|
+
if (direction === "output" && this.config.on_output) {
|
|
3978
|
+
return this.config.on_output;
|
|
3979
|
+
}
|
|
3980
|
+
return this.config.mode;
|
|
3981
|
+
}
|
|
3982
|
+
getPatternAction(match, direction) {
|
|
3983
|
+
const compiled = this.patterns.find((p) => p.def.name === match.patternName);
|
|
3984
|
+
if (compiled?.action) {
|
|
3985
|
+
return compiled.action;
|
|
3986
|
+
}
|
|
3987
|
+
return this.getAction(direction);
|
|
3988
|
+
}
|
|
3989
|
+
isAllowlisted(value) {
|
|
3990
|
+
for (const re of this.allowlistRegexps) {
|
|
3991
|
+
if (re.test(value)) return true;
|
|
3992
|
+
}
|
|
3993
|
+
return false;
|
|
3994
|
+
}
|
|
3995
|
+
};
|
|
3996
|
+
function compareSeverity(a, b) {
|
|
3997
|
+
return SEVERITY_ORDER[a] - SEVERITY_ORDER[b];
|
|
3998
|
+
}
|
|
3999
|
+
|
|
4000
|
+
// src/lib/dlp/masker.ts
|
|
4001
|
+
var import_node_crypto = require("crypto");
|
|
4002
|
+
var DEFAULT_CONFIG = {
|
|
4003
|
+
strategy: "partial",
|
|
4004
|
+
show_chars: 4,
|
|
4005
|
+
placeholder: "***"
|
|
4006
|
+
};
|
|
4007
|
+
var DlpMasker = class {
|
|
4008
|
+
config;
|
|
4009
|
+
constructor(config) {
|
|
4010
|
+
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
4011
|
+
}
|
|
4012
|
+
maskValue(value) {
|
|
4013
|
+
switch (this.config.strategy) {
|
|
4014
|
+
case "full":
|
|
4015
|
+
return this.config.placeholder;
|
|
4016
|
+
case "hash": {
|
|
4017
|
+
const hash = (0, import_node_crypto.createHash)("sha256").update(value).digest("hex").slice(0, 8);
|
|
4018
|
+
return `[REDACTED:${hash}]`;
|
|
4019
|
+
}
|
|
4020
|
+
case "partial":
|
|
4021
|
+
default: {
|
|
4022
|
+
if (value.length <= this.config.show_chars) {
|
|
4023
|
+
return this.config.placeholder;
|
|
4024
|
+
}
|
|
4025
|
+
return this.config.placeholder + value.slice(-this.config.show_chars);
|
|
4026
|
+
}
|
|
4027
|
+
}
|
|
4028
|
+
}
|
|
4029
|
+
maskText(text, matches) {
|
|
4030
|
+
if (matches.length === 0) return text;
|
|
4031
|
+
const sorted = [...matches].sort((a, b) => b.start - a.start);
|
|
4032
|
+
let result = text;
|
|
4033
|
+
for (const match of sorted) {
|
|
4034
|
+
const masked = this.maskValue(match.matched);
|
|
4035
|
+
result = result.slice(0, match.start) + masked + result.slice(match.end);
|
|
4036
|
+
}
|
|
4037
|
+
return result;
|
|
4038
|
+
}
|
|
4039
|
+
};
|
|
4040
|
+
|
|
4366
4041
|
// src/lib/budget/tracker.ts
|
|
4367
4042
|
var BudgetTracker = class {
|
|
4368
4043
|
_used = 0;
|
|
@@ -4488,7 +4163,7 @@ function render(templateContent, variables) {
|
|
|
4488
4163
|
}
|
|
4489
4164
|
|
|
4490
4165
|
// src/lib/audit/logger.ts
|
|
4491
|
-
var
|
|
4166
|
+
var import_node_crypto2 = require("crypto");
|
|
4492
4167
|
|
|
4493
4168
|
// src/lib/audit/sinks/jsonl.ts
|
|
4494
4169
|
var import_promises = require("fs/promises");
|
|
@@ -4585,7 +4260,7 @@ var AuditLogger = class {
|
|
|
4585
4260
|
async log(record) {
|
|
4586
4261
|
const full = {
|
|
4587
4262
|
...record,
|
|
4588
|
-
id: (0,
|
|
4263
|
+
id: (0, import_node_crypto2.randomUUID)(),
|
|
4589
4264
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
4590
4265
|
};
|
|
4591
4266
|
this.counts.set(full.event, (this.counts.get(full.event) ?? 0) + 1);
|
|
@@ -4709,6 +4384,10 @@ function createApprovalFlow(config, ui) {
|
|
|
4709
4384
|
ConfigValidationError,
|
|
4710
4385
|
ConfigWatcher,
|
|
4711
4386
|
DANGEROUS_PATTERNS,
|
|
4387
|
+
DLP_PII_PATTERNS,
|
|
4388
|
+
DLP_SECRET_PATTERNS,
|
|
4389
|
+
DlpMasker,
|
|
4390
|
+
DlpScanner,
|
|
4712
4391
|
EnvIdentityProvider,
|
|
4713
4392
|
IdentityChain,
|
|
4714
4393
|
JsonlAuditSink,
|
|
@@ -4720,6 +4399,7 @@ function createApprovalFlow(config, ui) {
|
|
|
4720
4399
|
WebhookAuditSink,
|
|
4721
4400
|
YamlFactStore,
|
|
4722
4401
|
YamlPolicyEngine,
|
|
4402
|
+
compareSeverity,
|
|
4723
4403
|
createApprovalFlow,
|
|
4724
4404
|
createIdentityChain,
|
|
4725
4405
|
createPolicyEngine,
|