@transcend-io/cli 7.0.0-alpha.8 → 7.0.0
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 +10 -6
- package/dist/bin/bash-complete.cjs +4 -0
- package/dist/bin/bash-complete.cjs.map +1 -0
- package/dist/bin/bash-complete.d.cts +1 -0
- package/dist/bin/cli.cjs +3 -0
- package/dist/bin/cli.cjs.map +1 -0
- package/dist/bin/cli.d.cts +1 -0
- package/dist/bin/deprecated-command.cjs +7 -0
- package/dist/bin/deprecated-command.cjs.map +1 -0
- package/dist/bin/deprecated-command.d.cts +1 -0
- package/dist/chunk-ANCIGXE5.cjs +4 -0
- package/dist/chunk-ANCIGXE5.cjs.map +1 -0
- package/dist/chunk-AW6I4V4F.cjs +3 -0
- package/dist/chunk-AW6I4V4F.cjs.map +1 -0
- package/dist/chunk-BY7W4UQF.cjs +2 -0
- package/dist/chunk-BY7W4UQF.cjs.map +1 -0
- package/dist/chunk-CHTWXNEA.cjs +2 -0
- package/dist/chunk-CHTWXNEA.cjs.map +1 -0
- package/dist/chunk-DS6VH676.cjs +2 -0
- package/dist/chunk-DS6VH676.cjs.map +1 -0
- package/dist/chunk-EG4L6YAJ.cjs +2 -0
- package/dist/chunk-EG4L6YAJ.cjs.map +1 -0
- package/dist/chunk-ETNRSKUM.cjs +2 -0
- package/dist/chunk-ETNRSKUM.cjs.map +1 -0
- package/dist/chunk-GM2EDRKN.cjs +12 -0
- package/dist/chunk-GM2EDRKN.cjs.map +1 -0
- package/dist/chunk-IBTP5OXE.cjs +2 -0
- package/dist/chunk-IBTP5OXE.cjs.map +1 -0
- package/dist/chunk-KOV2SQO2.cjs +4 -0
- package/dist/chunk-KOV2SQO2.cjs.map +1 -0
- package/dist/chunk-LBDIZJ23.cjs +2844 -0
- package/dist/chunk-LBDIZJ23.cjs.map +1 -0
- package/dist/chunk-LZYEIVWM.cjs +94 -0
- package/dist/chunk-LZYEIVWM.cjs.map +1 -0
- package/dist/chunk-MPJABCSW.cjs +75 -0
- package/dist/chunk-MPJABCSW.cjs.map +1 -0
- package/dist/chunk-R5N2S5UU.cjs +2 -0
- package/dist/chunk-R5N2S5UU.cjs.map +1 -0
- package/dist/chunk-RW5GSSAA.cjs +2 -0
- package/dist/chunk-RW5GSSAA.cjs.map +1 -0
- package/dist/chunk-RZWMOCW3.cjs +2 -0
- package/dist/chunk-RZWMOCW3.cjs.map +1 -0
- package/dist/chunk-SAEKBZGF.cjs +2 -0
- package/dist/chunk-SAEKBZGF.cjs.map +1 -0
- package/dist/chunk-T462ONFX.cjs +2 -0
- package/dist/chunk-T462ONFX.cjs.map +1 -0
- package/dist/chunk-TD7ADMVO.cjs +2 -0
- package/dist/chunk-TD7ADMVO.cjs.map +1 -0
- package/dist/chunk-UBUNHRCG.cjs +2 -0
- package/dist/chunk-UBUNHRCG.cjs.map +1 -0
- package/dist/chunk-UEGX6GZ2.cjs +2 -0
- package/dist/chunk-UEGX6GZ2.cjs.map +1 -0
- package/dist/chunk-VCWGXJ2H.cjs +9 -0
- package/dist/chunk-VCWGXJ2H.cjs.map +1 -0
- package/dist/chunk-ZUNVPK23.cjs +2 -0
- package/dist/chunk-ZUNVPK23.cjs.map +1 -0
- package/dist/chunk-ZVK4HIDF.cjs +6 -0
- package/dist/chunk-ZVK4HIDF.cjs.map +1 -0
- package/dist/impl-2GU6CYMY.cjs +2 -0
- package/dist/impl-2GU6CYMY.cjs.map +1 -0
- package/dist/impl-2OEHQTIR.cjs +2 -0
- package/dist/impl-2OEHQTIR.cjs.map +1 -0
- package/dist/impl-2QXJ3WST.cjs +9 -0
- package/dist/impl-2QXJ3WST.cjs.map +1 -0
- package/dist/impl-442H4ODN.cjs +7 -0
- package/dist/impl-442H4ODN.cjs.map +1 -0
- package/dist/impl-44QRPPUX.cjs +6 -0
- package/dist/impl-44QRPPUX.cjs.map +1 -0
- package/dist/impl-4DOGSDPC.cjs +2 -0
- package/dist/impl-4DOGSDPC.cjs.map +1 -0
- package/dist/impl-5J3MG42D.cjs +2 -0
- package/dist/impl-5J3MG42D.cjs.map +1 -0
- package/dist/impl-5YMSNFJU.cjs +2 -0
- package/dist/impl-5YMSNFJU.cjs.map +1 -0
- package/dist/impl-6TBKGA4Y.cjs +2 -0
- package/dist/impl-6TBKGA4Y.cjs.map +1 -0
- package/dist/impl-7VYQSZVO.cjs +2 -0
- package/dist/impl-7VYQSZVO.cjs.map +1 -0
- package/dist/impl-BB24LU3N.cjs +2 -0
- package/dist/impl-BB24LU3N.cjs.map +1 -0
- package/dist/impl-CWZ26FTN.cjs +2 -0
- package/dist/impl-CWZ26FTN.cjs.map +1 -0
- package/dist/impl-EFTKRWUA.cjs +2 -0
- package/dist/impl-EFTKRWUA.cjs.map +1 -0
- package/dist/impl-EJT3AX73.cjs +2 -0
- package/dist/impl-EJT3AX73.cjs.map +1 -0
- package/dist/impl-EKQ6ZNN3.cjs +2 -0
- package/dist/impl-EKQ6ZNN3.cjs.map +1 -0
- package/dist/impl-EV6T5UOK.cjs +6 -0
- package/dist/impl-EV6T5UOK.cjs.map +1 -0
- package/dist/impl-FPFUAY4Q.cjs +2 -0
- package/dist/impl-FPFUAY4Q.cjs.map +1 -0
- package/dist/impl-GDKUHX2J.cjs +2 -0
- package/dist/impl-GDKUHX2J.cjs.map +1 -0
- package/dist/impl-GXDABG5X.cjs +2 -0
- package/dist/impl-GXDABG5X.cjs.map +1 -0
- package/dist/impl-IG7QEF6D.cjs +2 -0
- package/dist/impl-IG7QEF6D.cjs.map +1 -0
- package/dist/impl-JQLYJA5L.cjs +2 -0
- package/dist/impl-JQLYJA5L.cjs.map +1 -0
- package/dist/impl-LPI3M7L3.cjs +6 -0
- package/dist/impl-LPI3M7L3.cjs.map +1 -0
- package/dist/impl-M7WMSIK4.cjs +4 -0
- package/dist/impl-M7WMSIK4.cjs.map +1 -0
- package/dist/impl-MRGZ5OLO.cjs +2 -0
- package/dist/impl-MRGZ5OLO.cjs.map +1 -0
- package/dist/impl-OI4UWRAU.cjs +12 -0
- package/dist/impl-OI4UWRAU.cjs.map +1 -0
- package/dist/impl-OX24YDRR.cjs +2 -0
- package/dist/impl-OX24YDRR.cjs.map +1 -0
- package/dist/impl-PFQKPCUL.cjs +2 -0
- package/dist/impl-PFQKPCUL.cjs.map +1 -0
- package/dist/impl-PXJZK6BV.cjs +2 -0
- package/dist/impl-PXJZK6BV.cjs.map +1 -0
- package/dist/impl-QOGUUIE6.cjs +2 -0
- package/dist/impl-QOGUUIE6.cjs.map +1 -0
- package/dist/impl-QR3LLBZL.cjs +2 -0
- package/dist/impl-QR3LLBZL.cjs.map +1 -0
- package/dist/impl-RODUB22E.cjs +2 -0
- package/dist/impl-RODUB22E.cjs.map +1 -0
- package/dist/impl-S56PHXGG.cjs +2 -0
- package/dist/impl-S56PHXGG.cjs.map +1 -0
- package/dist/impl-SDGCTSWN.cjs +2 -0
- package/dist/impl-SDGCTSWN.cjs.map +1 -0
- package/dist/impl-VEMQEG27.cjs +2 -0
- package/dist/impl-VEMQEG27.cjs.map +1 -0
- package/dist/impl-VFWBSWT5.cjs +2 -0
- package/dist/impl-VFWBSWT5.cjs.map +1 -0
- package/dist/impl-XRRNIJUK.cjs +2 -0
- package/dist/impl-XRRNIJUK.cjs.map +1 -0
- package/dist/impl-YA7HWMYB.cjs +2 -0
- package/dist/impl-YA7HWMYB.cjs.map +1 -0
- package/dist/impl-YOWRUVYG.cjs +2 -0
- package/dist/impl-YOWRUVYG.cjs.map +1 -0
- package/dist/impl-ZHZOMOST.cjs +2 -0
- package/dist/impl-ZHZOMOST.cjs.map +1 -0
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +117658 -0
- package/package.json +67 -62
- package/dist/bin/bash-complete.js +0 -3
- package/dist/bin/cli.js +0 -2
- package/dist/bin/deprecated-command.js +0 -6
- package/dist/chunk-3KYYR6WM.js +0 -74
- package/dist/chunk-4W2NF2OS.js +0 -1
- package/dist/chunk-5SI3ACV3.js +0 -8
- package/dist/chunk-64RBCV3H.js +0 -93
- package/dist/chunk-AHYJJKNA.js +0 -1
- package/dist/chunk-APA5PR4U.js +0 -1
- package/dist/chunk-EZCJGIOS.js +0 -1
- package/dist/chunk-FXYTXR6R.js +0 -2
- package/dist/chunk-HMF46LB7.js +0 -1
- package/dist/chunk-HXMONGHM.js +0 -1
- package/dist/chunk-HXYCZ5UY.js +0 -3
- package/dist/chunk-MBAKYLJ3.js +0 -2830
- package/dist/chunk-OERYFLN2.js +0 -1
- package/dist/chunk-QQRMUEM7.js +0 -3
- package/dist/chunk-RBOBI6B6.js +0 -5
- package/dist/chunk-SVDDU4R6.js +0 -1
- package/dist/chunk-T2PLXAEM.js +0 -1
- package/dist/chunk-TD5AG6IF.js +0 -1
- package/dist/chunk-UPHD5UAO.js +0 -1
- package/dist/chunk-UVJSNZM5.js +0 -1
- package/dist/chunk-W6GUOMVP.js +0 -1
- package/dist/chunk-XMGVDVM2.js +0 -1
- package/dist/chunk-XQTNSPJ3.js +0 -11
- package/dist/chunk-ZB5DNAF3.js +0 -1
- package/dist/impl-2AQG2DEN.js +0 -1
- package/dist/impl-2CT4WQB5.js +0 -1
- package/dist/impl-4KGHP2BC.js +0 -1
- package/dist/impl-75Y3OM5Z.js +0 -1
- package/dist/impl-AKN4Q3ON.js +0 -1
- package/dist/impl-B45RAXAK.js +0 -1
- package/dist/impl-C4HUZZJO.js +0 -5
- package/dist/impl-DHTPY5AB.js +0 -1
- package/dist/impl-FCRKJBOS.js +0 -11
- package/dist/impl-GUEUJOOC.js +0 -1
- package/dist/impl-H57BW5MO.js +0 -1
- package/dist/impl-HCNN3NZK.js +0 -1
- package/dist/impl-IME3ONWF.js +0 -1
- package/dist/impl-L3UJQJZ6.js +0 -1
- package/dist/impl-LC3UNIDE.js +0 -1
- package/dist/impl-LEZFRF7Y.js +0 -1
- package/dist/impl-LJLXQ3QL.js +0 -1
- package/dist/impl-MZ6D4BQ3.js +0 -1
- package/dist/impl-NKKIQKJ6.js +0 -1
- package/dist/impl-NYB4YSNU.js +0 -1
- package/dist/impl-OQFT2DYM.js +0 -1
- package/dist/impl-OQUKAZLQ.js +0 -6
- package/dist/impl-P63ATAHR.js +0 -1
- package/dist/impl-PATZGQVZ.js +0 -1
- package/dist/impl-PWZF46AT.js +0 -8
- package/dist/impl-QD62F5PJ.js +0 -1
- package/dist/impl-S5PLONJN.js +0 -1
- package/dist/impl-SBN3KA7O.js +0 -5
- package/dist/impl-T4ODLBML.js +0 -1
- package/dist/impl-TG65PIBJ.js +0 -3
- package/dist/impl-UQR3O4M3.js +0 -1
- package/dist/impl-V5KJW35Z.js +0 -1
- package/dist/impl-WLQF5X2U.js +0 -5
- package/dist/impl-X6FJHMP5.js +0 -1
- package/dist/impl-XRYV4FW7.js +0 -1
- package/dist/impl-YFDEKBXT.js +0 -1
- package/dist/impl-YQW4KNXL.js +0 -1
- package/dist/impl-YWNLYZI4.js +0 -1
- package/dist/impl-ZBLHGXKD.js +0 -1
- package/dist/index.js +0 -4
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkLBDIZJ23cjs = require('./chunk-LBDIZJ23.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _privacytypes = require('@transcend-io/privacy-types');var _cliprogress = require('cli-progress'); var _cliprogress2 = _interopRequireDefault(_cliprogress);var _graphqlrequest = require('graphql-request');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function q(u,{dataSiloIds:e=[],includeGuessedCategories:l,includeAttributes:a,parentCategories:c=[],subCategories:t=[],pageSize:p=1e3}={}){let n=[],m=new Date().getTime(),d=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),s={...c.length>0?{category:c}:{},...t.length>0?{subCategoryIds:t}:{},...c.length+t.length>0&&!l?{status:_privacytypes.SubDataPointDataSubCategoryGuessStatus.Approved}:{},...e.length>0?{dataSilos:e}:{}},{subDataPoints:{totalCount:o}}=await _chunkLBDIZJ23cjs.gc.call(void 0, u,_chunkLBDIZJ23cjs.f,{filterBy:s});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("[Step 1/3] Pulling in all subdatapoints")),d.start(o,0);let y=0,D=!1,r,b=0;do try{let{subDataPoints:{nodes:P}}=await _chunkLBDIZJ23cjs.gc.call(void 0, u,_graphqlrequest.gql`
|
|
2
|
+
query TranscendCliSubDataPointCsvExport(
|
|
3
|
+
$filterBy: SubDataPointFiltersInput
|
|
4
|
+
$first: Int!
|
|
5
|
+
$offset: Int!
|
|
6
|
+
) {
|
|
7
|
+
subDataPoints(
|
|
8
|
+
filterBy: $filterBy
|
|
9
|
+
first: $first
|
|
10
|
+
offset: $offset
|
|
11
|
+
useMaster: false
|
|
12
|
+
) {
|
|
13
|
+
nodes {
|
|
14
|
+
id
|
|
15
|
+
name
|
|
16
|
+
description
|
|
17
|
+
dataPointId
|
|
18
|
+
dataSiloId
|
|
19
|
+
purposes {
|
|
20
|
+
name
|
|
21
|
+
purpose
|
|
22
|
+
}
|
|
23
|
+
categories {
|
|
24
|
+
name
|
|
25
|
+
category
|
|
26
|
+
}
|
|
27
|
+
${l?`pendingCategoryGuesses {
|
|
28
|
+
category {
|
|
29
|
+
name
|
|
30
|
+
category
|
|
31
|
+
}
|
|
32
|
+
status
|
|
33
|
+
classifierVersion
|
|
34
|
+
}`:""}
|
|
35
|
+
${a?`attributeValues {
|
|
36
|
+
attributeKey {
|
|
37
|
+
name
|
|
38
|
+
}
|
|
39
|
+
name
|
|
40
|
+
}`:""}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
`,{first:p,offset:b,filterBy:{...s}});r=_optionalChain([P, 'access', _2 => _2[P.length-1], 'optionalAccess', _3 => _3.id]),n.push(...P),D=P.length===p,y+=P.length,b+=P.length,d.update(y)}catch(P){throw _chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error fetching subdatapoints for cursor ${r} and offset ${b}`)),P}while(D);d.stop();let C=new Date().getTime()-m,g=_chunkLBDIZJ23cjs.cc.call(void 0, n,"name");return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully pulled in ${g.length} subdatapoints in ${C/1e3} seconds!`)),g}async function F(u,{dataPointIds:e=[],pageSize:l=100}){let a=[],c=new Date().getTime(),t=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`[Step 2/3] Fetching metadata for ${e.length} datapoints`));let p=_chunkLBDIZJ23cjs._b.call(void 0, e,l);t.start(e.length,0);let n=0;await _chunkLBDIZJ23cjs.a.call(void 0, p,async s=>{try{let{dataPoints:{nodes:o}}=await _chunkLBDIZJ23cjs.gc.call(void 0, u,_chunkLBDIZJ23cjs.i,{first:l,filterBy:{ids:s}});a.push(...o),n+=s.length,t.update(n)}catch(o){throw _chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error fetching subdatapoints for IDs ${s.join(", ")}`)),o}}),t.stop();let d=new Date().getTime()-c;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully pulled in ${a.length} dataPoints in ${d/1e3} seconds!`)),a}async function Q(u,{dataSiloIds:e=[],pageSize:l=100}){let a=[],c=new Date().getTime(),t=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`[Step 3/3] Fetching metadata for ${e.length} data silos`));let p=_chunkLBDIZJ23cjs._b.call(void 0, e,l);t.start(e.length,0);let n=0;await _chunkLBDIZJ23cjs.a.call(void 0, p,async s=>{try{let{dataSilos:{nodes:o}}=await _chunkLBDIZJ23cjs.gc.call(void 0, u,_chunkLBDIZJ23cjs.l,{first:l,filterBy:{ids:s}});a.push(...o),n+=s.length,t.update(n)}catch(o){throw _chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error fetching data silos for IDs ${s.join(", ")}`)),o}}),t.stop();let d=new Date().getTime()-c;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully pulled in ${a.length} data silos in ${d/1e3} seconds!`)),a}async function Y(u,{dataSiloIds:e=[],includeGuessedCategories:l,includeAttributes:a,parentCategories:c=[],subCategories:t=[],pageSize:p=1e3}={}){let n=await q(u,{dataSiloIds:e,includeGuessedCategories:l,includeAttributes:a,parentCategories:c,subCategories:t,pageSize:p}),m=_chunkLBDIZJ23cjs.fc.call(void 0, n.map(r=>r.dataPointId)),d=await F(u,{dataPointIds:m}),s=_chunkLBDIZJ23cjs.bc.call(void 0, d,"id"),o=_chunkLBDIZJ23cjs.fc.call(void 0, n.map(r=>r.dataSiloId)),y=await Q(u,{dataSiloIds:o}),D=_chunkLBDIZJ23cjs.bc.call(void 0, y,"id");return n.map(r=>({...r,dataPoint:s[r.dataPointId],dataSilo:D[r.dataSiloId]}))}async function nt(u,{dataSiloIds:e=[],status:l,subCategories:a=[],includeEncryptedSnippets:c,pageSize:t=100}={}){let p=[],n=new Date().getTime(),m=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),d={...a.length>0?{subCategoryIds:a}:{},...l?{status:l}:{},...e.length>0?{dataSilos:e}:{}},{unstructuredSubDataPointRecommendations:{totalCount:s}}=await _chunkLBDIZJ23cjs.gc.call(void 0, u,_chunkLBDIZJ23cjs.j,{filterBy:d});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("[Step 1/3] Pulling in all subdatapoints")),m.start(s,0);let o=0,y=!1,D,r=0;do try{let{unstructuredSubDataPointRecommendations:{nodes:g}}=await _chunkLBDIZJ23cjs.gc.call(void 0, u,_graphqlrequest.gql`
|
|
45
|
+
query TranscendCliUnstructuredSubDataPointRecommendationCsvExport(
|
|
46
|
+
$filterBy: UnstructuredSubDataPointRecommendationsFilterInput
|
|
47
|
+
$first: Int!
|
|
48
|
+
$offset: Int!
|
|
49
|
+
) {
|
|
50
|
+
unstructuredSubDataPointRecommendations(
|
|
51
|
+
filterBy: $filterBy
|
|
52
|
+
first: $first
|
|
53
|
+
offset: $offset
|
|
54
|
+
useMaster: false
|
|
55
|
+
) {
|
|
56
|
+
nodes {
|
|
57
|
+
id
|
|
58
|
+
dataSiloId
|
|
59
|
+
scannedObjectPathId
|
|
60
|
+
scannedObjectId
|
|
61
|
+
${c?"name":""}
|
|
62
|
+
${c?"contextSnippet":""}
|
|
63
|
+
dataSubCategory {
|
|
64
|
+
name
|
|
65
|
+
category
|
|
66
|
+
}
|
|
67
|
+
status
|
|
68
|
+
confidence
|
|
69
|
+
classificationMethod
|
|
70
|
+
classifierVersion
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`,{first:t,offset:r,filterBy:{...d}});D=_optionalChain([g, 'access', _4 => _4[g.length-1], 'optionalAccess', _5 => _5.id]),p.push(...g),y=g.length===t,o+=g.length,r+=g.length,m.update(o)}catch(g){throw _chunkZUNVPK23cjs.a.error(_colors2.default.red(`An error fetching subdatapoints for cursor ${D} and offset ${r}`)),g}while(y);m.stop();let R=new Date().getTime()-n,C=_chunkLBDIZJ23cjs.cc.call(void 0, p,"name");return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully pulled in ${C.length} subdatapoints in ${R/1e3} seconds!`)),C}exports.a = Y; exports.b = nt;
|
|
75
|
+
//# sourceMappingURL=chunk-MPJABCSW.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-MPJABCSW.cjs","../src/lib/data-inventory/pullAllDatapoints.ts","../src/lib/data-inventory/pullUnstructuredSubDataPointRecommendations.ts"],"names":["pullSubDatapoints","client","dataSiloIds","includeGuessedCategories","includeAttributes","parentCategories","subCategories","pageSize","subDataPoints","t0","progressBar","cliProgress","filterBy","SubDataPointDataSubCategoryGuessStatus","totalCount","makeGraphQLRequest","SUB_DATA_POINTS_COUNT","logger","colors","total","shouldContinue","cursor","offset","nodes","gql","err"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-MPJABCSW.cjs","sourcesContent":[null,"/* eslint-disable max-lines */\nimport { keyBy, uniq, chunk, sortBy } from 'lodash-es';\nimport {\n type DataCategoryType,\n SubDataPointDataSubCategoryGuessStatus,\n} from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport { gql } from 'graphql-request';\nimport colors from 'colors';\nimport type { GraphQLClient } from 'graphql-request';\nimport {\n DATAPOINT_EXPORT,\n DATA_SILO_EXPORT,\n type DataSiloAttributeValue,\n SUB_DATA_POINTS_COUNT,\n makeGraphQLRequest,\n} from '../graphql';\nimport { logger } from '../../logger';\nimport type { DataCategoryInput, ProcessingPurposeInput } from '../../codecs';\nimport { mapSeries } from '../bluebird-replace';\n\nexport interface DataSiloCsvPreview {\n /** ID of dataSilo */\n id: string;\n /** Name of dataSilo */\n title: string;\n}\n\nexport interface DataPointCsvPreview {\n /** ID of dataPoint */\n id: string;\n /** The path to this data point */\n path: string[];\n /** Description */\n description: {\n /** Default message */\n defaultMessage: string;\n };\n /** Name */\n name: string;\n}\n\nexport interface SubDataPointCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Name (or key) of the subdatapoint */\n name: string;\n /** The description */\n description?: string;\n /** Personal data category */\n categories: DataCategoryInput[];\n /** Data point ID */\n dataPointId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** The processing purpose for this sub datapoint */\n purposes: ProcessingPurposeInput[];\n /** Attribute attached to subdatapoint */\n attributeValues?: DataSiloAttributeValue[];\n /** Data category guesses that are output by the classifier */\n pendingCategoryGuesses?: {\n /** Data category being guessed */\n category: DataCategoryInput;\n /** Status of guess */\n status: SubDataPointDataSubCategoryGuessStatus;\n /** classifier version that produced the guess */\n classifierVersion: number;\n }[];\n}\n\nexport interface DatapointFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Whether to include guessed categories, defaults to only approved categories */\n includeGuessedCategories?: boolean;\n /** Whether or not to include attributes */\n includeAttributes?: boolean;\n /** Parent categories to filter down for */\n parentCategories?: DataCategoryType[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n}\n\n/**\n * Pull subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The subdatapoints\n */\nasync function pullSubDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<SubDataPointCsvPreview[]> {\n const subDataPoints: SubDataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n // Filters\n const filterBy = {\n ...(parentCategories.length > 0 ? { category: parentCategories } : {}),\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n // if parentCategories or subCategories and not includeGuessedCategories\n ...(parentCategories.length + subCategories.length > 0 &&\n !includeGuessedCategories\n ? // then only show data points with approved data categories\n { status: SubDataPointDataSubCategoryGuessStatus.Approved }\n : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n subDataPoints: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** Count */\n totalCount: number;\n };\n }>(client, SUB_DATA_POINTS_COUNT, {\n filterBy,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n subDataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n subDataPoints: {\n /** List of matches */\n nodes: SubDataPointCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliSubDataPointCsvExport(\n $filterBy: SubDataPointFiltersInput\n $first: Int!\n $offset: Int!\n ) {\n subDataPoints(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n name\n description\n dataPointId\n dataSiloId\n purposes {\n name\n purpose\n }\n categories {\n name\n category\n }\n ${\n includeGuessedCategories\n ? `pendingCategoryGuesses {\n category {\n name\n category\n }\n status\n classifierVersion\n }`\n : ''\n }\n ${\n includeAttributes\n ? `attributeValues {\n attributeKey {\n name\n }\n name\n }`\n : ''\n }\n }\n }\n }\n `,\n {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n // TODO: https://transcend.height.app/T-40484 - add cursor support\n // ...(cursor ? { cursor: { id: cursor } } : {}),\n },\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n subDataPoints.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`,\n ),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(subDataPoints, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return sorted;\n}\n\n/**\n * Pull datapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints\n */\nasync function pullDatapoints(\n client: GraphQLClient,\n {\n dataPointIds = [],\n pageSize = 100,\n }: {\n /** IDs of data points to filter down */\n dataPointIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataPointCsvPreview[]> {\n const dataPoints: DataPointCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n logger.info(\n colors.magenta(\n `[Step 2/3] Fetching metadata for ${dataPointIds.length} datapoints`,\n ),\n );\n\n // Group by 100\n const dataPointsGrouped = chunk(dataPointIds, pageSize);\n\n progressBar.start(dataPointIds.length, 0);\n let total = 0;\n await mapSeries(dataPointsGrouped, async (dataPointIdsGroup) => {\n try {\n const {\n dataPoints: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataPoints: {\n /** List of matches */\n nodes: DataPointCsvPreview[];\n };\n }>(client, DATAPOINT_EXPORT, {\n first: pageSize,\n filterBy: {\n ids: dataPointIdsGroup,\n },\n });\n\n dataPoints.push(...nodes);\n total += dataPointIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for IDs ${dataPointIdsGroup.join(\n ', ',\n )}`,\n ),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataPoints.length} dataPoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return dataPoints;\n}\n\n/**\n * Pull data silo information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The data silos\n */\nasync function pullDataSilos(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n pageSize = 100,\n }: {\n /** IDs of data silos to filter down */\n dataSiloIds: string[];\n /** Page size to pull in */\n pageSize?: number;\n },\n): Promise<DataSiloCsvPreview[]> {\n const dataSilos: DataSiloCsvPreview[] = [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n logger.info(\n colors.magenta(\n `[Step 3/3] Fetching metadata for ${dataSiloIds.length} data silos`,\n ),\n );\n\n // Group by 100\n const dataSilosGrouped = chunk(dataSiloIds, pageSize);\n\n progressBar.start(dataSiloIds.length, 0);\n let total = 0;\n await mapSeries(dataSilosGrouped, async (dataSiloIdsGroup) => {\n try {\n const {\n dataSilos: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n dataSilos: {\n /** List of matches */\n nodes: DataSiloCsvPreview[];\n };\n }>(client, DATA_SILO_EXPORT, {\n first: pageSize,\n filterBy: {\n ids: dataSiloIdsGroup,\n },\n });\n\n dataSilos.push(...nodes);\n total += dataSiloIdsGroup.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching data silos for IDs ${dataSiloIdsGroup.join(', ')}`,\n ),\n );\n throw err;\n }\n });\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n logger.info(\n colors.green(\n `Successfully pulled in ${dataSilos.length} data silos in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return dataSilos;\n}\n\n/**\n * Pull all datapoints from the data inventory.\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @returns The datapoints and data silos\n */\nexport async function pullAllDatapoints(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n includeGuessedCategories,\n includeAttributes,\n parentCategories = [],\n subCategories = [],\n pageSize = 1000,\n }: DatapointFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<\n (SubDataPointCsvPreview & {\n /** Data point information */\n dataPoint: DataPointCsvPreview;\n /** Data silo information */\n dataSilo: DataSiloCsvPreview;\n })[]\n> {\n // Subdatapoint information\n const subDatapoints = await pullSubDatapoints(client, {\n dataSiloIds,\n includeGuessedCategories,\n includeAttributes,\n parentCategories,\n subCategories,\n pageSize,\n });\n\n // The datapoint ids to grab\n const dataPointIds = uniq(subDatapoints.map((point) => point.dataPointId));\n const dataPoints = await pullDatapoints(client, {\n dataPointIds,\n });\n const dataPointById = keyBy(dataPoints, 'id');\n\n // The data silo IDs to grab\n const allDataSiloIds = uniq(subDatapoints.map((point) => point.dataSiloId));\n const dataSilos = await pullDataSilos(client, {\n dataSiloIds: allDataSiloIds,\n });\n const dataSiloById = keyBy(dataSilos, 'id');\n\n return subDatapoints.map((subDataPoint) => ({\n ...subDataPoint,\n dataPoint: dataPointById[subDataPoint.dataPointId],\n dataSilo: dataSiloById[subDataPoint.dataSiloId],\n }));\n}\n/* eslint-enable max-lines */\n","import type { UnstructuredSubDataPointRecommendationStatus } from '@transcend-io/privacy-types';\nimport cliProgress from 'cli-progress';\nimport colors from 'colors';\nimport { gql, type GraphQLClient } from 'graphql-request';\nimport { sortBy } from 'lodash-es';\nimport type { DataCategoryInput } from '../../codecs';\nimport { ENTRY_COUNT, makeGraphQLRequest } from '../graphql';\nimport { logger } from '../../logger';\n\ninterface UnstructuredSubDataPointRecommendationCsvPreview {\n /** ID of subDatapoint */\n id: string;\n /** Entry or Named Entity recognized by the classifier */\n name: string;\n /** Context snippet including entry */\n contextSnippet: string;\n /** Scanned object ID */\n scannedObjectId: string;\n /** Scanned object path ID */\n scannedObjectPathId: string;\n /** The data silo ID */\n dataSiloId: string;\n /** Personal data category */\n dataSubCategory: DataCategoryInput;\n /** Classification Status */\n status: UnstructuredSubDataPointRecommendationStatus;\n /** Confidence */\n confidence: number;\n /** Classification method */\n classificationMethod: string;\n /** Classifier version */\n classifierVersion: string;\n}\n\ninterface EntryFilterOptions {\n /** IDs of data silos to filter down */\n dataSiloIds?: string[];\n /** Parent categories to filter down for */\n status?: UnstructuredSubDataPointRecommendationStatus[];\n /** Sub categories to filter down for */\n subCategories?: string[]; // TODO: https://transcend.height.app/T-40482 - do by name not ID\n /** Include entry and snippet */\n includeEncryptedSnippets?: boolean;\n /** Include encryptedSamplesS3Key */\n includeEncryptedSamplesS3Key?: boolean;\n}\n/**\n * Pull unstructured subdatapoint information\n *\n * @param client - Client to use for the request\n * @param options - Options\n * @param options.dataSiloIds - IDs of data silos to filter down\n * @param options.status - Parent categories to filter down for\n * @param options.subCategories - Sub categories to filter down for\n * @param options.includeEncryptedSnippets - Include entry and snippet\n * @param options.includeEncryptedSamplesS3Key - Include encryptedSamplesS3Key\n * @param options.pageSize - Page size to pull in\n * @returns A promise that resolves to an array of unstructured subdatapoint recommendations\n */\nexport async function pullUnstructuredSubDataPointRecommendations(\n client: GraphQLClient,\n {\n dataSiloIds = [],\n status,\n subCategories = [],\n includeEncryptedSnippets,\n pageSize = 100,\n }: EntryFilterOptions & {\n /** Page size to pull in */\n pageSize?: number;\n } = {},\n): Promise<UnstructuredSubDataPointRecommendationCsvPreview[]> {\n const unstructuredSubDataPointRecommendations: UnstructuredSubDataPointRecommendationCsvPreview[] =\n [];\n\n // Time duration\n const t0 = new Date().getTime();\n\n // create a new progress bar instance and use shades_classic theme\n const progressBar = new cliProgress.SingleBar(\n {},\n cliProgress.Presets.shades_classic,\n );\n\n // Filters\n const filterBy = {\n ...(subCategories.length > 0 ? { subCategoryIds: subCategories } : {}),\n ...(status ? { status } : {}),\n ...(dataSiloIds.length > 0 ? { dataSilos: dataSiloIds } : {}),\n };\n\n // Build a GraphQL client\n const {\n unstructuredSubDataPointRecommendations: { totalCount },\n } = await makeGraphQLRequest<{\n /** Query response */\n unstructuredSubDataPointRecommendations: {\n /** Count */\n totalCount: number;\n };\n }>(client, ENTRY_COUNT, {\n filterBy,\n });\n\n logger.info(colors.magenta('[Step 1/3] Pulling in all subdatapoints'));\n\n progressBar.start(totalCount, 0);\n let total = 0;\n let shouldContinue = false;\n let cursor: string | undefined;\n let offset = 0;\n do {\n try {\n const {\n unstructuredSubDataPointRecommendations: { nodes },\n } = await makeGraphQLRequest<{\n /** Query response */\n unstructuredSubDataPointRecommendations: {\n /** List of matches */\n nodes: UnstructuredSubDataPointRecommendationCsvPreview[];\n };\n }>(\n client,\n gql`\n query TranscendCliUnstructuredSubDataPointRecommendationCsvExport(\n $filterBy: UnstructuredSubDataPointRecommendationsFilterInput\n $first: Int!\n $offset: Int!\n ) {\n unstructuredSubDataPointRecommendations(\n filterBy: $filterBy\n first: $first\n offset: $offset\n useMaster: false\n ) {\n nodes {\n id\n dataSiloId\n scannedObjectPathId\n scannedObjectId\n ${includeEncryptedSnippets ? 'name' : ''}\n ${includeEncryptedSnippets ? 'contextSnippet' : ''}\n dataSubCategory {\n name\n category\n }\n status\n confidence\n classificationMethod\n classifierVersion\n }\n }\n }\n `,\n {\n first: pageSize,\n offset,\n filterBy: {\n ...filterBy,\n },\n },\n );\n\n cursor = nodes[nodes.length - 1]?.id as string;\n unstructuredSubDataPointRecommendations.push(...nodes);\n shouldContinue = nodes.length === pageSize;\n total += nodes.length;\n offset += nodes.length;\n progressBar.update(total);\n } catch (err) {\n logger.error(\n colors.red(\n `An error fetching subdatapoints for cursor ${cursor} and offset ${offset}`,\n ),\n );\n throw err;\n }\n } while (shouldContinue);\n\n progressBar.stop();\n const t1 = new Date().getTime();\n const totalTime = t1 - t0;\n\n const sorted = sortBy(unstructuredSubDataPointRecommendations, 'name');\n\n logger.info(\n colors.green(\n `Successfully pulled in ${sorted.length} subdatapoints in ${\n totalTime / 1000\n } seconds!`,\n ),\n );\n return sorted;\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkUEGX6GZ2cjs = require('./chunk-UEGX6GZ2.cjs');var _chunkLBDIZJ23cjs = require('./chunk-LBDIZJ23.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkEG4L6YAJcjs = require('./chunk-EG4L6YAJ.cjs');var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);async function H({email:r,password:a,scopes:f,apiKeyTitle:t,parentOrganizationId:o,deleteExistingApiKey:l=!0,createNewApiKey:x=!0,transcendUrl:k=_chunkEG4L6YAJcjs.e}){let s=await _chunkLBDIZJ23cjs.we.call(void 0, k,{});_chunkZUNVPK23cjs.a.info(_colors2.default.magenta("Logging in using email and password."));let{roles:d,loginCookie:P}=await _chunkLBDIZJ23cjs.Ne.call(void 0, s,{email:r,password:a});_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully logged in and found ${d.length} role${d.length===1?"":"s"}!`));let K=o?d.filter(e=>e.organization.id===o||e.organization.parentOrganizationId===o):d;s.setHeaders({Cookie:P});let m=[],c=[];return _chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Generating API keys with title: ${t}, scopes: ${f.join(",")}.`)),await _chunkLBDIZJ23cjs.a.call(void 0, K,async e=>{try{await _chunkLBDIZJ23cjs.Oe.call(void 0, s,{roleId:e.id,email:r}),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Checking if API key already exists in organization "${e.organization.name}" with title: "${t}".`));let[g]=await _chunkLBDIZJ23cjs.Hc.call(void 0, s,[t]);if(g&&l)_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`Deleting existing API key in "${e.organization.name}" with title: "${t}".`)),await _chunkLBDIZJ23cjs.Re.call(void 0, s,g.id),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully deleted API key in "${e.organization.name}" with title: "${t}".`));else if(g)throw new Error(`API key already exists with title: "${t}"`);if(x){_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Creating API key in "${e.organization.name}" with title: "${t}".`));let{apiKey:N}=await _chunkLBDIZJ23cjs.Qe.call(void 0, s,{title:t,scopes:f});m.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:N}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully created API key in "${e.organization.name}" with title: "${t}".`))}else m.push({organizationName:e.organization.name,organizationId:e.organization.id,apiKey:""})}catch(g){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to create API key in organization "${e.organization.name}"! - ${g.message}`)),c.push({organizationName:e.organization.name,organizationId:e.organization.id,error:g.message})}}),_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully created ${m.length} API key${m.length===1?"":"s"}`)),c.length>0&&_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Failed to create ${c.length} API key${c.length===1?"":"s"}!`)),{errors:c,apiKeys:m}}var _typeutils = require('@transcend-io/type-utils');var _iots = require('io-ts'); var I = _interopRequireWildcard(_iots);var _fs = require('fs');function T(r){return r||(_chunkZUNVPK23cjs.a.error(_colors2.default.red("A Transcend API key must be provided. You can specify using --auth=$TRANSCEND_API_KEY")),process.exit(1)),_fs.existsSync.call(void 0, r)?_typeutils.decodeCodec.call(void 0, I.array(_chunkUEGX6GZ2cjs.fa),_fs.readFileSync.call(void 0, r,"utf-8")):r}function Z(r,a,f=!1){if(!_fs.existsSync.call(void 0, r))return[];let t=_fs.readdirSync.call(void 0, r).filter(o=>a?a.filter(l=>o.endsWith(l)).length:!0).filter(o=>o.indexOf(".")>0);return f?t.map(o=>o.replace(/\.[^/.]+$/,"")):t}var _path = require('path');function te(r){return _fs.readdirSync.call(void 0, r).filter(a=>_fs.statSync.call(void 0, _path.join.call(void 0, r,a)).isDirectory())}exports.a = H; exports.b = T; exports.c = Z; exports.d = te;
|
|
2
|
+
//# sourceMappingURL=chunk-R5N2S5UU.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-R5N2S5UU.cjs","../src/lib/api-keys/generateCrossAccountApiKeys.ts"],"names":["generateCrossAccountApiKeys","email","password","scopes","apiKeyTitle","parentOrganizationId","deleteExistingApiKey","createNewApiKey","transcendUrl","DEFAULT_TRANSCEND_API","client","buildTranscendGraphQLClientGeneric","logger","colors","roles","loginCookie","loginUser","filteredRoles","role","results","errors","mapSeries","assumeRole","apiKeyWithTitle","fetchAllApiKeys","deleteApiKey","apiKey","createApiKey","err"],"mappings":"AAAA,mfAAyC,wDAAyF,wDAAyC,wDAAyC,gFCUjM,MAoBnB,SAAsBA,CAAAA,CAA4B,CAChD,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CACA,oBAAA,CAAAC,CAAAA,CAAuB,CAAA,CAAA,CACvB,eAAA,CAAAC,CAAAA,CAAkB,CAAA,CAAA,CAClB,YAAA,CAAAC,CAAAA,CAAeC,mBACjB,CAAA,CAsBG,CAED,IAAMC,CAAAA,CAAS,MAAMC,kCAAAA,CAAmCH,CAAc,CAAC,CAAC,CAAA,CAGxEI,mBAAAA,CAAO,IAAA,CAAKC,gBAAAA,CAAO,OAAA,CAAQ,sCAAsC,CAAC,CAAA,CAClE,GAAM,CAAE,KAAA,CAAAC,CAAAA,CAAO,WAAA,CAAAC,CAAY,CAAA,CAAI,MAAMC,kCAAAA,CAAUN,CAAQ,CAAE,KAAA,CAAAT,CAAAA,CAAO,QAAA,CAAAC,CAAS,CAAC,CAAA,CAC1EU,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,iCAAA,EAAoCC,CAAAA,CAAM,MAAM,CAAA,KAAA,EAC9CA,CAAAA,CAAM,MAAA,GAAW,CAAA,CAAI,EAAA,CAAK,GAC5B,CAAA,CAAA,CACF,CACF,CAAA,CAGA,IAAMG,CAAAA,CAAgBZ,CAAAA,CAClBS,CAAAA,CAAM,MAAA,CACHI,CAAAA,EACCA,CAAAA,CAAK,YAAA,CAAa,EAAA,GAAOb,CAAAA,EACzBa,CAAAA,CAAK,YAAA,CAAa,oBAAA,GAAyBb,CAC/C,CAAA,CACAS,CAAAA,CAGJJ,CAAAA,CAAO,UAAA,CAAW,CAChB,MAAA,CAAQK,CACV,CAAC,CAAA,CAGD,IAAMI,CAAAA,CAA0B,CAAC,CAAA,CAC3BC,CAAAA,CAAgC,CAAC,CAAA,CAGvC,OAAAR,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,gCAAA,EAAmCT,CAAW,CAAA,UAAA,EAAaD,CAAAA,CAAO,IAAA,CAChE,GACF,CAAC,CAAA,CAAA,CACH,CACF,CAAA,CAGA,MAAMkB,iCAAAA,CAAUJ,CAAe,MAAOC,CAAAA,EAAS,CAC7C,GAAI,CAEF,MAAMI,kCAAAA,CAAWZ,CAAQ,CAAE,MAAA,CAAQQ,CAAAA,CAAK,EAAA,CAAI,KAAA,CAAAjB,CAAM,CAAC,CAAA,CAGnDW,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,oDAAA,EAAuDK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,eAAA,EAAkBd,CAAW,CAAA,EAAA,CAC5G,CACF,CAAA,CAGA,GAAM,CAACmB,CAAe,CAAA,CAAI,MAAMC,kCAAAA,CAAgBd,CAAQ,CAACN,CAAW,CAAC,CAAA,CACrE,EAAA,CAAImB,CAAAA,EAAmBjB,CAAAA,CACrBM,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,MAAA,CACL,CAAA,8BAAA,EAAiCK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,eAAA,EAAkBd,CAAW,CAAA,EAAA,CACtF,CACF,CAAA,CACA,MAAMqB,kCAAAA,CAAaf,CAAQa,CAAAA,CAAgB,EAAE,CAAA,CAC7CX,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,iCAAA,EAAoCK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,eAAA,EAAkBd,CAAW,CAAA,EAAA,CACzF,CACF,CAAA,CAAA,KAAA,EAAA,CACSmB,CAAAA,CAET,MAAM,IAAI,KAAA,CAAM,CAAA,oCAAA,EAAuCnB,CAAW,CAAA,CAAA,CAAG,CAAA,CAIvE,EAAA,CAAIG,CAAAA,CAAiB,CACnBK,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,OAAA,CACL,CAAA,qBAAA,EAAwBK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,eAAA,EAAkBd,CAAW,CAAA,EAAA,CAC7E,CACF,CAAA,CACA,GAAM,CAAE,MAAA,CAAAsB,CAAO,CAAA,CAAI,MAAMC,kCAAAA,CAAajB,CAAQ,CAC5C,KAAA,CAAON,CAAAA,CACP,MAAA,CAAAD,CACF,CAAC,CAAA,CACDgB,CAAAA,CAAQ,IAAA,CAAK,CACX,gBAAA,CAAkBD,CAAAA,CAAK,YAAA,CAAa,IAAA,CACpC,cAAA,CAAgBA,CAAAA,CAAK,YAAA,CAAa,EAAA,CAClC,MAAA,CAAAQ,CACF,CAAC,CAAA,CACDd,mBAAAA,CAAO,IAAA,CACLC,gBAAAA,CAAO,KAAA,CACL,CAAA,iCAAA,EAAoCK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,eAAA,EAAkBd,CAAW,CAAA,EAAA,CACzF,CACF,CACF,CAAA,KAEEe,CAAAA,CAAQ,IAAA,CAAK,CACX,gBAAA,CAAkBD,CAAAA,CAAK,YAAA,CAAa,IAAA,CACpC,cAAA,CAAgBA,CAAAA,CAAK,YAAA,CAAa,EAAA,CAClC,MAAA,CAAQ,EACV,CAAC,CAEL,CAAA,KAAA,CAASU,CAAAA,CAAK,CACZhB,mBAAAA,CAAO,KAAA,CACLC,gBAAAA,CAAO,GAAA,CACL,CAAA,0CAAA,EAA6CK,CAAAA,CAAK,YAAA,CAAa,IAAI,CAAA,KAAA,EAAQU,CAAAA,CAAI,OAAO,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/chunk-R5N2S5UU.cjs","sourcesContent":[null,"import { mapSeries } from '../bluebird-replace';\nimport {\n buildTranscendGraphQLClientGeneric,\n loginUser,\n createApiKey,\n fetchAllApiKeys,\n deleteApiKey,\n assumeRole,\n} from '../graphql';\nimport { ScopeName } from '@transcend-io/privacy-types';\nimport colors from 'colors';\nimport { StoredApiKey } from '../../codecs';\nimport { logger } from '../../logger';\nimport { DEFAULT_TRANSCEND_API } from '../../constants';\n\nexport interface ApiKeyGenerateError {\n /** Name of instance */\n organizationName: string;\n /** Error */\n error: string;\n /** Organization ID API key is for */\n organizationId: string;\n}\n\n/**\n * Generate API keys across multiple transcend accounts\n *\n * @param options - Options\n * @returns Number of API keys created\n */\nexport async function generateCrossAccountApiKeys({\n email,\n password,\n scopes,\n apiKeyTitle,\n parentOrganizationId,\n deleteExistingApiKey = true,\n createNewApiKey = true,\n transcendUrl = DEFAULT_TRANSCEND_API,\n}: {\n /** Email address of user generating API keys */\n email: string;\n /** Password of user generating API keys */\n password: string;\n /** Filter for organizations that match this parent organization ID */\n parentOrganizationId?: string;\n /** Title of the API create to create */\n apiKeyTitle: string;\n /** Title of the API create to create */\n scopes: ScopeName[];\n /** API URL for Transcend backend */\n transcendUrl?: string;\n /** When true delete existing API keys with that title, if set to false an API key exists with that title, an error is thrown */\n deleteExistingApiKey?: boolean;\n /** When true, generate new API keys, otherwise only will delete past API keys */\n createNewApiKey?: boolean;\n}): Promise<{\n /** Successfully generated */\n apiKeys: StoredApiKey[];\n /** Error results */\n errors: ApiKeyGenerateError[];\n}> {\n // Create GraphQL client\n const client = await buildTranscendGraphQLClientGeneric(transcendUrl, {});\n\n // Login the user\n logger.info(colors.magenta('Logging in using email and password.'));\n const { roles, loginCookie } = await loginUser(client, { email, password });\n logger.info(\n colors.green(\n `Successfully logged in and found ${roles.length} role${\n roles.length === 1 ? '' : 's'\n }!`,\n ),\n );\n\n // Filter down by parentOrganizationId\n const filteredRoles = parentOrganizationId\n ? roles.filter(\n (role) =>\n role.organization.id === parentOrganizationId ||\n role.organization.parentOrganizationId === parentOrganizationId,\n )\n : roles;\n\n // Save cookie to call route subsequent times\n client.setHeaders({\n Cookie: loginCookie,\n });\n\n // Save the resulting API keys\n const results: StoredApiKey[] = [];\n const errors: ApiKeyGenerateError[] = [];\n\n // Generate API keys\n logger.info(\n colors.magenta(\n `Generating API keys with title: ${apiKeyTitle}, scopes: ${scopes.join(\n ',',\n )}.`,\n ),\n );\n\n // Map over each role\n await mapSeries(filteredRoles, async (role) => {\n try {\n // Log into the other instance\n await assumeRole(client, { roleId: role.id, email });\n\n // Grab API keys with that title\n logger.info(\n colors.magenta(\n `Checking if API key already exists in organization \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n\n // Delete existing API key\n const [apiKeyWithTitle] = await fetchAllApiKeys(client, [apiKeyTitle]);\n if (apiKeyWithTitle && deleteExistingApiKey) {\n logger.info(\n colors.yellow(\n `Deleting existing API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n await deleteApiKey(client, apiKeyWithTitle.id);\n logger.info(\n colors.green(\n `Successfully deleted API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else if (apiKeyWithTitle) {\n // throw error if one exists but not configured to delete\n throw new Error(`API key already exists with title: \"${apiKeyTitle}\"`);\n }\n\n // Create the API key\n if (createNewApiKey) {\n logger.info(\n colors.magenta(\n `Creating API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n const { apiKey } = await createApiKey(client, {\n title: apiKeyTitle,\n scopes,\n });\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey,\n });\n logger.info(\n colors.green(\n `Successfully created API key in \"${role.organization.name}\" with title: \"${apiKeyTitle}\".`,\n ),\n );\n } else {\n // Delete only\n results.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n apiKey: '',\n });\n }\n } catch (err) {\n logger.error(\n colors.red(\n `Failed to create API key in organization \"${role.organization.name}\"! - ${err.message}`,\n ),\n );\n errors.push({\n organizationName: role.organization.name,\n organizationId: role.organization.id,\n error: err.message,\n });\n }\n });\n logger.info(\n colors.green(\n `Successfully created ${results.length} API key${\n results.length === 1 ? '' : 's'\n }`,\n ),\n );\n\n if (errors.length > 0) {\n logger.error(\n colors.red(\n `Failed to create ${errors.length} API key${\n errors.length === 1 ? '' : 's'\n }!`,\n ),\n );\n }\n\n return { errors, apiKeys: results };\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkCHTWXNEAcjs = require('./chunk-CHTWXNEA.cjs');var _chunkLBDIZJ23cjs = require('./chunk-LBDIZJ23.cjs');var _chunkZUNVPK23cjs = require('./chunk-ZUNVPK23.cjs');var _chunkEG4L6YAJcjs = require('./chunk-EG4L6YAJ.cjs');var _iots = require('io-ts'); var e = _interopRequireWildcard(_iots); var S = _interopRequireWildcard(_iots);var _typeutils = require('@transcend-io/type-utils');var Z=e.type({identifier:e.string,type:e.string,coreIdentifier:e.string,dataSiloId:e.string,requestId:e.string,nonce:e.string,requestCreatedAt:e.string,daysUntilOverdue:e.number,attributes:e.array(e.type({key:e.string,values:e.array(e.string)}))});async function B(r,{dataSiloId:s,limit:c=100,offset:n=0,requestType:a}){try{let i=await r.get(`v1/data-silo/${s}/pending-requests/${a}`,{searchParams:{offset:n,limit:c}}).json(),{items:f}=_typeutils.decodeCodec.call(void 0, e.type({items:e.array(Z)}),i);return f}catch(i){throw new Error(`Received an error from server: ${_optionalChain([i, 'optionalAccess', _2 => _2.response, 'optionalAccess', _3 => _3.body])||_optionalChain([i, 'optionalAccess', _4 => _4.message])}`)}}var j=S.type({nonce:S.string,identifier:S.string});async function W(r,{nonce:s,identifier:c}){try{return await r.put("v1/data-silo",{headers:{"x-transcend-nonce":s},json:{profiles:[{profileId:c}]}}),!0}catch(n){if(_optionalChain([n, 'access', _5 => _5.response, 'optionalAccess', _6 => _6.statusCode])===409)return!1;throw new Error(`Received an error from server: ${_optionalChain([n, 'optionalAccess', _7 => _7.response, 'optionalAccess', _8 => _8.body])||_optionalChain([n, 'optionalAccess', _9 => _9.message])}`)}}var _colors = require('colors'); var _colors2 = _interopRequireDefault(_colors);var _cliprogress = require('cli-progress'); var _cliprogress2 = _interopRequireDefault(_cliprogress);async function ue({file:r,dataSiloId:s,auth:c,sombraAuth:n,concurrency:a=100,transcendUrl:i=_chunkEG4L6YAJcjs.e,sleepSeconds:f=10}){let y=await _chunkLBDIZJ23cjs.ye.call(void 0, i,c,n);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Reading "${r}" from disk`));let o=_chunkCHTWXNEAcjs.q.call(void 0, r,j);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Notifying Transcend for data silo "${s}" marking "${o.length}" identifiers as completed.`));let C=new Date().getTime(),w=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),d=0,u=0,l=0;w.start(o.length,0);let m=_chunkLBDIZJ23cjs._b.call(void 0, o,a),I=m.length;await _chunkLBDIZJ23cjs.a.call(void 0, m,async($,P)=>{_chunkZUNVPK23cjs.a.info(_colors2.default.blue(`Processing chunk ${P+1}/${I} (${_chunkLBDIZJ23cjs._b.length} items)`)),await _chunkLBDIZJ23cjs.b.call(void 0, $,async h=>{try{await W(y,h)?d+=1:u+=1}catch(b){_chunkZUNVPK23cjs.a.error(_colors2.default.red(`Error notifying Transcend for identifier "${h.identifier}" - ${_optionalChain([b, 'optionalAccess', _10 => _10.message])}`)),l+=1}w.update(d+u)}),f>0&&P<I-1&&(_chunkZUNVPK23cjs.a.info(_colors2.default.yellow(`Sleeping for ${f}s before next chunk...`)),await new Promise(h=>{setTimeout(h,f*1e3)}))}),w.stop();let x=new Date().getTime()-C;if(_chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend for ${d} identifiers in "${x/1e3}" seconds!`)),u&&_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`There were ${u} identifiers that were not in a state to be updated.They likely have already been resolved.`)),l)throw _chunkZUNVPK23cjs.a.error(_colors2.default.red(`There were ${l} identifiers that failed to be updated. Please review the logs for more information.`)),new Error("Failed to update all identifiers");return o.length}var _privacytypes = require('@transcend-io/privacy-types');async function Te({requestIds:r,dataSiloId:s,auth:c,concurrency:n=100,status:a=_privacytypes.RequestDataSiloStatus.Resolved,transcendUrl:i=_chunkEG4L6YAJcjs.e}){let f=_chunkLBDIZJ23cjs.xe.call(void 0, i,c),y=new Date().getTime(),o=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic);_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Notifying Transcend for data silo "${s}" marking "${r.length}" requests as completed.`));let C=0;o.start(r.length,0),await _chunkLBDIZJ23cjs.b.call(void 0, r,async u=>{let l=await _chunkLBDIZJ23cjs.Le.call(void 0, f,{requestId:u,dataSiloId:s});try{await _chunkLBDIZJ23cjs.gc.call(void 0, f,_chunkLBDIZJ23cjs.wa,{requestDataSiloId:l.id,status:a})}catch(m){if(!m.message.includes("Client error: Request must be active:"))throw m}C+=1,o.update(C)},{concurrency:n}),o.stop();let d=new Date().getTime()-y;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully notified Transcend in "${d/1e3}" seconds!`)),r.length}async function ke({dataSiloId:r,auth:s,sombraAuth:c,actions:n,apiPageSize:a=100,savePageSize:i=1e3,onSave:f,transcendUrl:y=_chunkEG4L6YAJcjs.e,skipRequestCount:o=!1}){if(i%a!==0)throw new Error(`savePageSize must be a multiple of apiPageSize. savePageSize: ${i}, apiPageSize: ${a}`);let C=await _chunkLBDIZJ23cjs.ye.call(void 0, y,s,c),w=_chunkLBDIZJ23cjs.xe.call(void 0, y,s),d=0;o||(d=await _chunkLBDIZJ23cjs.De.call(void 0, w,{dataSiloId:r})),_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulling ${o?"all":d} outstanding request identifiers for data silo: "${r}" for requests of types "${n.join('", "')}"`));let u=new Date().getTime(),l=new _cliprogress2.default.SingleBar({},_cliprogress2.default.Presets.shades_classic),m=new Set,I=[],g=[];o||l.start(d,0),await _chunkLBDIZJ23cjs.a.call(void 0, n,async $=>{let P=0,h=!0;for(;h;){let b=await B(C,{dataSiloId:r,limit:a,offset:P,requestType:$}),_=b.map(A=>(m.add(A.requestId),{...A,action:$})),M=_.map(({attributes:A,...V})=>({...V,...A.reduce((X,G)=>Object.assign(X,{[G.key]:G.values.join(",")}),{})}));I.push(..._),g.push(...M),g.length>=i&&(await f(g),g=[]),h=b.length===a,P+=a,o?_chunkZUNVPK23cjs.a.info(_colors2.default.magenta(`Pulled ${b.length} outstanding identifiers for ${m.size} requests`)):l.update(m.size)}}),g.length>0&&await f(g),o||l.stop();let x=new Date().getTime()-u;return _chunkZUNVPK23cjs.a.info(_colors2.default.green(`Successfully pulled ${I.length} outstanding identifiers from ${m.size} requests in "${x/1e3}" seconds!`)),{identifiers:I}}exports.a = Z; exports.b = B; exports.c = j; exports.d = W; exports.e = ue; exports.f = Te; exports.g = ke;
|
|
2
|
+
//# sourceMappingURL=chunk-RW5GSSAA.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-RW5GSSAA.cjs","../src/lib/cron/pullCronPageOfIdentifiers.ts"],"names":["CronIdentifier","pullCronPageOfIdentifiers","sombra","dataSiloId","limit","offset","requestType","response"],"mappings":"AAAA,u/BAAwC,wDAAwG,wDAAyC,wDAAyC,6GCA/M,qDACS,IAIfA,CAAAA,CAAmB,CAAA,CAAA,IAAA,CAAK,CAEnC,UAAA,CAAc,CAAA,CAAA,MAAA,CAEd,IAAA,CAAQ,CAAA,CAAA,MAAA,CAER,cAAA,CAAkB,CAAA,CAAA,MAAA,CAElB,UAAA,CAAc,CAAA,CAAA,MAAA,CAEd,SAAA,CAAa,CAAA,CAAA,MAAA,CAEb,KAAA,CAAS,CAAA,CAAA,MAAA,CAET,gBAAA,CAAoB,CAAA,CAAA,MAAA,CAEpB,gBAAA,CAAoB,CAAA,CAAA,MAAA,CAEpB,UAAA,CAAc,CAAA,CAAA,KAAA,CACV,CAAA,CAAA,IAAA,CAAK,CACL,GAAA,CAAO,CAAA,CAAA,MAAA,CACP,MAAA,CAAU,CAAA,CAAA,KAAA,CAAQ,CAAA,CAAA,MAAM,CAC1B,CAAC,CACH,CACF,CAAC,CAAA,CAaD,MAAA,SAAsBC,CAAAA,CACpBC,CAAAA,CACA,CACE,UAAA,CAAAC,CAAAA,CACA,KAAA,CAAAC,CAAAA,CAAQ,GAAA,CACR,MAAA,CAAAC,CAAAA,CAAS,CAAA,CACT,WAAA,CAAAC,CACF,CAAA,CAU2B,CAC3B,GAAI,CAEF,IAAMC,CAAAA,CAAW,MAAML,CAAAA,CACpB,GAAA,CAAI,CAAA,aAAA,EAAgBC,CAAU,CAAA,kBAAA,EAAqBG,CAAW,CAAA,CAAA","file":"/home/runner/work/cli/cli/dist/chunk-RW5GSSAA.cjs","sourcesContent":[null,"import * as t from 'io-ts';\nimport { decodeCodec } from '@transcend-io/type-utils';\nimport { RequestAction } from '@transcend-io/privacy-types';\nimport type { Got } from 'got';\n\nexport const CronIdentifier = t.type({\n /** The identifier value */\n identifier: t.string,\n /** The type of identifier */\n type: t.string,\n /** The core identifier of the request */\n coreIdentifier: t.string,\n /** The ID of the underlying data silo */\n dataSiloId: t.string,\n /** The ID of the underlying request */\n requestId: t.string,\n /** The request nonce */\n nonce: t.string,\n /** The time the request was created */\n requestCreatedAt: t.string,\n /** The number of days until the request is overdue */\n daysUntilOverdue: t.number,\n /** Request attributes */\n attributes: t.array(\n t.type({\n key: t.string,\n values: t.array(t.string),\n }),\n ),\n});\n\n/** Type override */\nexport type CronIdentifier = t.TypeOf<typeof CronIdentifier>;\n\n/**\n * Pull a offset of identifiers for a cron job\n *\n * @see https://docs.transcend.io/docs/api-reference/GET/v1/data-silo/(id)/pending-requests/(type)\n * @param sombra - Sombra instance configured to make requests\n * @param options - Additional options\n * @returns Successfully submitted request\n */\nexport async function pullCronPageOfIdentifiers(\n sombra: Got,\n {\n dataSiloId,\n limit = 100,\n offset = 0,\n requestType,\n }: {\n /** Data Silo ID */\n dataSiloId: string;\n /** Type of request */\n requestType: RequestAction;\n /** Number of identifiers to pull in */\n limit?: number;\n /** Page to pull in */\n offset?: number;\n },\n): Promise<CronIdentifier[]> {\n try {\n // Make the GraphQL request\n const response = await sombra\n .get(`v1/data-silo/${dataSiloId}/pending-requests/${requestType}`, {\n searchParams: {\n offset,\n limit,\n },\n })\n .json();\n\n const { items } = decodeCodec(\n t.type({\n items: t.array(CronIdentifier),\n }),\n response,\n );\n return items;\n } catch (err) {\n throw new Error(\n `Received an error from server: ${err?.response?.body || err?.message}`,\n );\n }\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkCHTWXNEAcjs = require('./chunk-CHTWXNEA.cjs');var _inquirer = require('inquirer'); var _inquirer2 = _interopRequireDefault(_inquirer);var _inquirerautocompleteprompt = require('inquirer-autocomplete-prompt'); var _inquirerautocompleteprompt2 = _interopRequireDefault(_inquirerautocompleteprompt);async function c({message:e}){let{response:r}=await _inquirer2.default.prompt([{name:"response",message:e,type:"confirm"}]);return r}async function l({message:e}){let{response:r}=await _inquirer2.default.prompt([{name:"response",message:e,type:"text",validate:t=>t.trim().length>0}]);return r}async function y({defaultValue:e,values:r,message:t}){_inquirer2.default.registerPrompt("autocomplete",_inquirerautocompleteprompt2.default);let{response:p}=await _inquirer2.default.prompt([{name:"response",message:t,type:"autocomplete",default:e,source:(a,n)=>n?r.filter(s=>typeof s=="string"&&_chunkCHTWXNEAcjs.k.call(void 0, n,s)):r}]);return p}exports.a = c; exports.b = l; exports.c = y;
|
|
2
|
+
//# sourceMappingURL=chunk-RZWMOCW3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-RZWMOCW3.cjs","../src/lib/helpers/inquirer.ts"],"names":["inquirerConfirmBoolean","message","response","inquirer","inquirerConfirmText","x","inquirerAutoComplete","defaultValue","values","autoCompletePrompt","answersSoFar","input","fuzzySearch"],"mappings":"AAAA,iOAAwC,wFCAnB,kKACU,MAU/B,SAAsBA,CAAAA,CAAuB,CAC3C,OAAA,CAAAC,CACF,CAAA,CAGqB,CACnB,GAAM,CAAE,QAAA,CAAAC,CAAS,CAAA,CAAI,MAAMC,kBAAAA,CAAS,MAAA,CAGjC,CACD,CACE,IAAA,CAAM,UAAA,CACN,OAAA,CAAAF,CAAAA,CACA,IAAA,CAAM,SACR,CACF,CAAC,CAAA,CACD,OAAOC,CACT,CAQA,MAAA,SAAsBE,CAAAA,CAAoB,CACxC,OAAA,CAAAH,CACF,CAAA,CAGoB,CAClB,GAAM,CAAE,QAAA,CAAAC,CAAS,CAAA,CAAI,MAAMC,kBAAAA,CAAS,MAAA,CAGjC,CACD,CACE,IAAA,CAAM,UAAA,CACN,OAAA,CAAAF,CAAAA,CACA,IAAA,CAAM,MAAA,CACN,QAAA,CAAWI,CAAAA,EAAMA,CAAAA,CAAE,IAAA,CAAK,CAAA,CAAE,MAAA,CAAS,CACrC,CACF,CAAC,CAAA,CACD,OAAOH,CACT,CAQA,MAAA,SAAsBI,CAAAA,CAAqB,CACzC,YAAA,CAAAC,CAAAA,CACA,MAAA,CAAAC,CAAAA,CACA,OAAA,CAAAP,CACF,CAAA,CAOoB,CAClBE,kBAAAA,CAAS,cAAA,CAAe,cAAA,CAAgBM,oCAAkB,CAAA,CAC1D,GAAM,CAAE,QAAA,CAAAP,CAAS,CAAA,CAAI,MAAMC,kBAAAA,CAAS,MAAA,CAGjC,CACD,CACE,IAAA,CAAM,UAAA,CACN,OAAA,CAAAF,CAAAA,CACA,IAAA,CAAM,cAAA,CACN,OAAA,CAASM,CAAAA,CACT,MAAA,CAAQ,CAACG,CAAAA,CAA2BC,CAAAA,CAAAA,EACjCA,CAAAA,CAEGH,CAAAA,CAAO,MAAA,CACJH,CAAAA,EAAM,OAAOA,CAAAA,EAAM,QAAA,EAAYO,iCAAAA,CAAYD,CAAON,CAAC,CACtD,CAAA,CAHAG,CAIR,CACF,CAAC,CAAA,CACD,OAAON,CACT,CAAA,4CAAA","file":"/home/runner/work/cli/cli/dist/chunk-RZWMOCW3.cjs","sourcesContent":[null,"import inquirer from 'inquirer';\nimport autoCompletePrompt from 'inquirer-autocomplete-prompt';\nimport { fuzzySearch } from '../requests';\nimport { ObjByString } from '@transcend-io/type-utils';\n\n/**\n * Inquirer confirm text\n *\n * @param options - Options\n * @returns The response\n */\nexport async function inquirerConfirmBoolean({\n message,\n}: {\n /** Message */\n message: string;\n}): Promise<boolean> {\n const { response } = await inquirer.prompt<{\n /** confirmation */\n response: boolean;\n }>([\n {\n name: 'response',\n message,\n type: 'confirm',\n },\n ]);\n return response;\n}\n\n/**\n * Inquirer confirm text\n *\n * @param options - Options\n * @returns The response\n */\nexport async function inquirerConfirmText({\n message,\n}: {\n /** Message */\n message: string;\n}): Promise<string> {\n const { response } = await inquirer.prompt<{\n /** confirmation */\n response: string;\n }>([\n {\n name: 'response',\n message,\n type: 'text',\n validate: (x) => x.trim().length > 0,\n },\n ]);\n return response;\n}\n\n/**\n * Inquirer auto complete\n *\n * @param options - Options\n * @returns The response\n */\nexport async function inquirerAutoComplete({\n defaultValue,\n values,\n message,\n}: {\n /** Default value */\n defaultValue?: string;\n /** Message */\n message: string;\n /** Values to select */\n values: string[];\n}): Promise<string> {\n inquirer.registerPrompt('autocomplete', autoCompletePrompt);\n const { response } = await inquirer.prompt<{\n /** confirmation */\n response: string;\n }>([\n {\n name: 'response',\n message,\n type: 'autocomplete',\n default: defaultValue,\n source: (answersSoFar: ObjByString, input: string) =>\n !input\n ? values\n : values.filter(\n (x) => typeof x === 'string' && fuzzySearch(input, x),\n ),\n },\n ]);\n return response;\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkBY7W4UQFcjs = require('./chunk-BY7W4UQF.cjs');var _iots = require('io-ts'); var e = _interopRequireWildcard(_iots); var r = _interopRequireWildcard(_iots);var _typeutils = require('@transcend-io/type-utils');var d=({TRouteName:t})=>e.type({routeName:t,enabledPolicies:e.array(_typeutils.valuesOf.call(void 0, _chunkBY7W4UQFcjs.e))});var l=({TEnabledRoutes:t})=>r.type({enabledRoutes:t});exports.a = d; exports.b = l;
|
|
2
|
+
//# sourceMappingURL=chunk-SAEKBZGF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-SAEKBZGF.cjs","../src/lib/helpers/buildEnabledRouteType.ts","../src/lib/helpers/buildAIIntegrationType.ts"],"names":["buildEnabledRouteType","TRouteName","valuesOf","buildAIIntegrationType","TEnabledRoutes"],"mappings":"AAAA,mZAAwC,6GCArB,qDAEM,IASZA,CAAAA,CAAwB,CAAoB,CACvD,UAAA,CAAAC,CACF,CAAA,CAAA,EAII,CAAA,CAAA,IAAA,CAAK,CACL,SAAA,CAAWA,CAAAA,CACX,eAAA,CAAmB,CAAA,CAAA,KAAA,CAAMC,iCAAAA,mBAA6B,CAAC,CACzD,CAAC,CAAA,CCpBH,IASaC,CAAAA,CAAyB,CAGpC,CACA,cAAA,CAAAC,CACF,CAAA,CAAA,EAII,CAAA,CAAA,IAAA,CAAK,CACL,aAAA,CAAeA,CACjB,CAAC,CAAA,CAAA,6BAAA","file":"/home/runner/work/cli/cli/dist/chunk-SAEKBZGF.cjs","sourcesContent":[null,"import * as t from 'io-ts';\nimport { EnabledRouteC } from '../../codecs';\nimport { valuesOf } from '@transcend-io/type-utils';\nimport { PathfinderPolicyName } from '../../enums';\n\n/**\n * Builds a custom io-ts type that represents a route allowed by the proxy\n *\n * @param TRouteName - the string with the name of the allowed route\n * @returns custom io-ts AllowedRoute type\n */\nexport const buildEnabledRouteType = <T extends t.Mixed>({\n TRouteName,\n}: {\n /** the type of the routeName property */\n TRouteName: T;\n}): EnabledRouteC<T> =>\n t.type({\n routeName: TRouteName,\n enabledPolicies: t.array(valuesOf(PathfinderPolicyName)),\n });\n","import * as t from 'io-ts';\nimport { AIIntegrationC, EnabledRouteC } from '../../codecs';\n\n/**\n * Helper to build a custom io-ts type representing an AIIntegration\n *\n * @param TEnabledRoutes - the type of the enabledRoutes for the AIIntegration type\n * @returns an AIIntegration type\n */\nexport const buildAIIntegrationType = <\n T extends t.Mixed,\n P extends t.ArrayC<EnabledRouteC<T>>,\n>({\n TEnabledRoutes,\n}: {\n /** the type of the enabledRoutes property */\n TEnabledRoutes: P;\n}): AIIntegrationC<T> =>\n t.type({\n enabledRoutes: TEnabledRoutes,\n });\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);var _os = require('os'); var _os2 = _interopRequireDefault(_os);var _path = require('path'); var _path2 = _interopRequireDefault(_path);function p(o){return{process:o,os:_os2.default,fs:_fs2.default,path:_path2.default}}exports.a = p;
|
|
2
|
+
//# sourceMappingURL=chunk-T462ONFX.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/context.ts"],"names":["buildContext","process","os","fs","path"],"mappings":"AAAA,yOAAe,gEACA,wEACE,SAkBDA,CAAAA,CAAaC,CAAAA,CAAuC,CAClE,MAAO,CACL,OAAA,CAAAA,CAAAA,CACA,EAAA,CAAAC,YAAAA,CACA,EAAA,CAAAC,YAAAA,CACA,IAAA,CAAAC,cACF,CACF,CAAA,cAAA","file":"/home/runner/work/cli/cli/dist/chunk-T462ONFX.cjs","sourcesContent":["import fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport type { StricliAutoCompleteContext } from '@stricli/auto-complete';\nimport type { CommandContext } from '@stricli/core';\n\nexport interface LocalContext\n extends CommandContext,\n StricliAutoCompleteContext {\n /** The Node.js process object */\n readonly process: NodeJS.Process;\n // ...\n}\n\n/**\n * Builds the context for the CLI.\n *\n * @param process - The Node.js process object.\n * @returns The context for the CLI.\n */\nexport function buildContext(process: NodeJS.Process): LocalContext {\n return {\n process,\n os,\n fs,\n path,\n };\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});function o(s){let e=s.split(",").filter(r=>!!r),t={};return e.forEach(r=>{let[i,n]=r.split(":");if(!i||!n)throw new Error(`Invalid variable: ${r}. Expected format: key:value`);t[i]=n}),t}exports.a = o;
|
|
2
|
+
//# sourceMappingURL=chunk-TD7ADMVO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/helpers/parseVariablesFromString.ts"],"names":["parseVariablesFromString","variables","splitVars","x","vars","variable","k","v"],"mappings":"AAMO,kFAASA,CAAAA,CAAyBC,CAAAA,CAEvC,CAEA,IAAMC,CAAAA,CAAYD,CAAAA,CAAU,KAAA,CAAM,GAAG,CAAA,CAAE,MAAA,CAAQE,CAAAA,EAAM,CAAC,CAACA,CAAC,CAAA,CAClDC,CAAAA,CAAkC,CAAC,CAAA,CACzC,OAAAF,CAAAA,CAAU,OAAA,CAASG,CAAAA,EAAa,CAC9B,GAAM,CAACC,CAAAA,CAAGC,CAAC,CAAA,CAAIF,CAAAA,CAAS,KAAA,CAAM,GAAG,CAAA,CACjC,EAAA,CAAI,CAACC,CAAAA,EAAK,CAACC,CAAAA,CACT,MAAM,IAAI,KAAA,CACR,CAAA,kBAAA,EAAqBF,CAAQ,CAAA,4BAAA,CAC/B,CAAA,CAEFD,CAAAA,CAAKE,CAAC,CAAA,CAAIC,CACZ,CAAC,CAAA,CACMH,CACT,CAAA,cAAA","file":"/home/runner/work/cli/cli/dist/chunk-TD7ADMVO.cjs","sourcesContent":["/**\n * Parse variables from string\n *\n * @param variables - Variables as string\n * @returns Variables as object\n */\nexport function parseVariablesFromString(variables: string): {\n [k in string]: string;\n} {\n // Parse out the variables\n const splitVars = variables.split(',').filter((x) => !!x);\n const vars: { [k in string]: string } = {};\n splitVars.forEach((variable) => {\n const [k, v] = variable.split(':');\n if (!k || !v) {\n throw new Error(\n `Invalid variable: ${variable}. Expected format: key:value`,\n );\n }\n vars[k] = v;\n });\n return vars;\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLBDIZJ23cjs = require('./chunk-LBDIZJ23.cjs');function f(p,{adTechPurposes:m=["SaleOfInfo"],serviceToTitle:s,serviceToSupportedIntegration:r}){let e=[],i=[],n={};p.forEach(t=>{let{service:a,attributes:c=[]}=t;if(!a||a==="internalService")return;let u=c.find(o=>o.key==="Found on Domain");u&&(n[a]||(n[a]=[]),n[a].push(...u.values.map(o=>o.replace("https://","").replace("http://",""))),n[a]=[...new Set(n[a])]),_chunkLBDIZJ23cjs.ec.call(void 0, t.trackingPurposes,m).length>0?(i.push(a),e.includes(a)&&(e=e.filter(o=>o!==a))):i.includes(a)||e.push(a)});let h=[...new Set(i)].map(t=>({title:s[t],...r[t]?{integrationName:t}:{integrationName:"promptAPerson","outer-type":t},attributes:[{key:"Tech Type",values:["Ad Tech"]},{key:"Found On Domain",values:n[t]||[]}]}));return{siteTechDataSilos:[...new Set(e)].map(t=>({title:s[t],...r[t]?{integrationName:t}:{integrationName:"promptAPerson",outerType:t},attributes:[{key:"Tech Type",values:["Site Tech"]},{key:"Found On Domain",values:n[t]||[]}]})),adTechDataSilos:h}}exports.a = f;
|
|
2
|
+
//# sourceMappingURL=chunk-UBUNHRCG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/cli/cli/dist/chunk-UBUNHRCG.cjs","../src/lib/consent-manager/dataFlowsToDataSilos.ts"],"names":["dataFlowsToDataSilos","inputs","adTechPurposes","serviceToTitle","serviceToSupportedIntegration","siteTechIntegrations","adTechIntegrations","serviceToFoundOnDomain","flow","service","attributes","foundOnDomain","attr","v","union_default","s","adTechDataSilos"],"mappings":"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","file":"/home/runner/work/cli/cli/dist/chunk-UBUNHRCG.cjs","sourcesContent":[null,"import { DataFlowInput, DataSiloInput } from '../../codecs';\nimport { union } from 'lodash-es';\nimport { IndexedCatalogs } from '../graphql';\n\n/**\n * Convert data flow configurations into a set of data silo configurations\n *\n * @param inputs - Data flow input to convert to data silos\n * @param options - Additional options\n * @returns Business entity configuration input\n */\nexport function dataFlowsToDataSilos(\n inputs: DataFlowInput[],\n {\n adTechPurposes = ['SaleOfInfo'],\n serviceToTitle,\n serviceToSupportedIntegration,\n }: IndexedCatalogs & {\n /** List of purposes that are considered \"Ad Tech\" */\n adTechPurposes?: string[];\n },\n): {\n /** List of data silo configurations for site-tech services */\n siteTechDataSilos: DataSiloInput[];\n /** List of data silo configurations for ad-tech services */\n adTechDataSilos: DataSiloInput[];\n} {\n // List of site tech integrations\n let siteTechIntegrations: string[] = [];\n\n // List of ad tech integrations\n const adTechIntegrations: string[] = [];\n\n // Mapping from service name to list of\n const serviceToFoundOnDomain: { [k in string]: string[] } = {};\n\n // iterate over each flow\n inputs.forEach((flow) => {\n // process data flows with services\n const { service, attributes = [] } = flow;\n if (!service || service === 'internalService') {\n return;\n }\n\n // create mapping to found on domain\n const foundOnDomain = attributes.find(\n (attr) => attr.key === 'Found on Domain',\n );\n\n // Create a list of all domains where the data flow was found\n if (foundOnDomain) {\n if (!serviceToFoundOnDomain[service]) {\n serviceToFoundOnDomain[service] = [];\n }\n serviceToFoundOnDomain[service]!.push(\n ...foundOnDomain.values.map((v) =>\n v.replace('https://', '').replace('http://', ''),\n ),\n );\n serviceToFoundOnDomain[service] = [\n ...new Set(serviceToFoundOnDomain[service]),\n ];\n }\n\n // Keep track of ad tech\n if (union(flow.trackingPurposes, adTechPurposes).length > 0) {\n // add service to ad tech list\n adTechIntegrations.push(service);\n\n // remove from site tech list\n if (siteTechIntegrations.includes(service)) {\n siteTechIntegrations = siteTechIntegrations.filter(\n (s) => s !== service,\n );\n }\n } else if (!adTechIntegrations.includes(service)) {\n // add to site tech list\n siteTechIntegrations.push(service);\n }\n });\n\n // create the list of ad tech integrations\n const adTechDataSilos = [...new Set(adTechIntegrations)].map((service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', 'outer-type': service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Ad Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }));\n\n // create the list of site tech integrations\n const siteTechDataSilos = [...new Set(siteTechIntegrations)].map(\n (service) => ({\n title: serviceToTitle[service],\n ...(serviceToSupportedIntegration[service]\n ? { integrationName: service }\n : { integrationName: 'promptAPerson', outerType: service }),\n attributes: [\n {\n key: 'Tech Type',\n values: ['Site Tech'],\n },\n {\n key: 'Found On Domain',\n values: serviceToFoundOnDomain[service] || [],\n },\n ],\n }),\n );\n\n return {\n siteTechDataSilos,\n adTechDataSilos,\n };\n}\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkSAEKBZGFcjs = require('./chunk-SAEKBZGF.cjs');var _chunkBY7W4UQFcjs = require('./chunk-BY7W4UQF.cjs');var _iots = require('io-ts'); var t = _interopRequireWildcard(_iots);var _typeutils = require('@transcend-io/type-utils');var _privacytypes = require('@transcend-io/privacy-types');var _airgapjstypes = require('@transcend-io/airgap.js-types');var _internationalization = require('@transcend-io/internationalization');var It=t.type({title:t.string}),O= exports.b =t.intersection([t.type({name:t.string,value:t.string}),t.partial({isSecret:t.boolean})]),ft= exports.c =t.type({title:t.string}),xt= exports.d =t.intersection([t.type({name:t.string,description:t.string}),t.partial({"sso-department":t.string,"sso-group":t.string,"sso-title":t.string,users:t.array(t.string),scopes:t.array(_typeutils.valuesOf.call(void 0, _privacytypes.ScopeName))})]),bt= exports.e =t.intersection([t.type({title:t.string,"output-identifiers":t.array(t.string)}),t.partial({description:t.string,url:t.string,type:_typeutils.valuesOf.call(void 0, _privacytypes.EnricherType),"input-identifier":t.string,testRegex:t.string,lookerQueryTitle:t.string,expirationDuration:t.number,transitionRequestStatus:_typeutils.valuesOf.call(void 0, _privacytypes.PreflightRequestStatus),phoneNumbers:t.array(t.string),regionList:t.array(_typeutils.valuesOf.call(void 0, {..._privacytypes.IsoCountryCode,..._privacytypes.IsoCountrySubdivisionCode})),"data-subjects":t.array(t.string),headers:t.array(O),"privacy-actions":t.array(_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction))})]),Tt= exports.f =t.type({purpose:_typeutils.valuesOf.call(void 0, _privacytypes.ProcessingPurpose),name:t.string}),c= exports.g =t.intersection([t.type({category:_typeutils.valuesOf.call(void 0, _privacytypes.DataCategoryType)}),t.partial({name:t.string})]),Pt= exports.h =t.intersection([t.type({category:c,status:_typeutils.valuesOf.call(void 0, _privacytypes.SubDataPointDataSubCategoryGuessStatus),confidence:t.number}),t.partial({classifierVersion:t.number})]),Te= exports.i =t.intersection([t.type({category:c,status:_typeutils.valuesOf.call(void 0, _privacytypes.UnstructuredSubDataPointRecommendationStatus),confidence:t.number}),t.partial({classifierVersion:t.number})]),At= exports.j =t.intersection([t.type({name:t.string}),t.partial({description:t.string,color:t.string})]),Ot= exports.k =t.intersection([t.type({name:t.string,type:_typeutils.valuesOf.call(void 0, _privacytypes.AttributeKeyType)}),t.partial({description:t.string,resources:t.array(_typeutils.valuesOf.call(void 0, _privacytypes.AttributeSupportedResourceType)),values:t.array(At)})]),r= exports.l =t.type({key:t.string,values:t.array(t.string)}),Ct= exports.m =t.intersection([t.type({name:t.string,instructions:t.string,agentId:t.string,codeInterpreterEnabled:t.boolean,retrievalEnabled:t.boolean,"large-language-model":t.type({name:t.string,client:_typeutils.valuesOf.call(void 0, _privacytypes.LargeLanguageModelClient)})}),t.partial({description:t.string,prompt:t.string,owners:t.array(t.string),teams:t.array(t.string),"agent-functions":t.array(t.string),"agent-files":t.array(t.string)})]),vt= exports.n =t.type({name:t.string,description:t.string,parameters:t.string}),kt= exports.o =t.intersection([t.type({name:t.string,fileId:t.string,size:t.number,purpose:_typeutils.valuesOf.call(void 0, _privacytypes.PromptFilePurpose)}),t.partial({description:t.string})]),wt= exports.p =t.intersection([t.type({title:t.string}),t.partial({description:t.string,dataProcessingAgreementLink:t.string,contactName:t.string,contactPhone:t.string,address:t.string,headquarterCountry:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountryCode),headquarterSubDivision:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountrySubdivisionCode),websiteUrl:t.string,businessEntity:t.string,owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),Rt= exports.q =t.intersection([t.type({name:t.string,category:_typeutils.valuesOf.call(void 0, _privacytypes.DataCategoryType)}),t.partial({description:t.string,regex:t.string,owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),St= exports.r =t.intersection([t.type({name:t.string,purpose:_typeutils.valuesOf.call(void 0, _privacytypes.ProcessingPurpose)}),t.partial({description:t.string,owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),ht= exports.s =t.type({title:t.string,content:t.string}),Dt= exports.t =t.type({title:t.string,content:t.string}),Et= exports.u =t.type({title:t.string,description:t.string,prompts:t.array(t.string)}),Nt= exports.v =t.intersection([t.type({key:t.string}),t.partial({title:t.string,description:t.union([t.string,t.null]),purposes:t.array(Tt),categories:t.array(c),"guessed-categories":t.array(Pt),"access-request-visibility-enabled":t.boolean,"erasure-request-redaction-enabled":t.boolean,attributes:t.array(r)})]),Mt= exports.w =t.intersection([t.type({key:t.string}),t.partial({path:t.array(t.string),title:t.string,description:t.string,"data-collection-tag":t.string,"privacy-action-queries":t.partial(_typeutils.applyEnum.call(void 0, _privacytypes.RequestActionObjectResolver,()=>t.string)),"privacy-actions":t.array(_typeutils.valuesOf.call(void 0, _privacytypes.RequestActionObjectResolver)),fields:t.array(Nt),owners:t.array(t.string),teams:t.array(t.string)})]),Lt= exports.x =t.partial({"notify-email-address":t.string,"send-frequency":t.number,"send-type":_typeutils.valuesOf.call(void 0, _privacytypes.PromptAVendorEmailSendType),"include-identifiers-attachment":t.boolean,"completion-link-type":_typeutils.valuesOf.call(void 0, _privacytypes.PromptAVendorEmailCompletionLinkType),"manual-work-retry-frequency":t.string}),Ft= exports.y =t.intersection([t.type({title:t.string}),t.partial({description:t.string,address:t.string,headquarterCountry:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountryCode),headquarterSubDivision:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountrySubdivisionCode),dataProtectionOfficerName:t.string,dataProtectionOfficerEmail:t.string,attributes:t.array(r),owners:t.array(t.string),teams:t.array(t.string)})]),Pe= exports.z =t.intersection([t.type({name:t.string,codePackageType:_typeutils.valuesOf.call(void 0, _privacytypes.CodePackageType)}),t.partial({description:t.string,repositoryUrl:t.string,catalogIntegrationName:t.string,documentationLinks:t.array(t.string),ownerEmails:t.array(t.string),teamNames:t.array(t.string)})]),qt= exports.A =t.intersection([t.type({name:t.string}),t.partial({version:t.string,isDevDependency:t.boolean})]),Ae= exports.B =t.intersection([t.type({name:t.string,type:_typeutils.valuesOf.call(void 0, _privacytypes.CodePackageType),relativePath:t.string,repositoryName:t.string}),t.partial({description:t.string,softwareDevelopmentKits:t.array(qt),teamNames:t.array(t.string),ownerEmails:t.array(t.string)})]),Oe= exports.C =t.intersection([t.type({name:t.string,url:t.string}),t.partial({description:t.string,teamNames:t.array(t.string),ownerEmails:t.array(t.string)})]),Vt= exports.D =t.intersection([t.type({type:t.string}),t.partial({active:t.boolean,title:t.string,adminDashboardDefaultSilentMode:t.boolean,actions:t.array(_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction))})]),Kt= exports.E =t.intersection([t.type({type:_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction)}),t.partial({skipSecondaryIfNoFiles:t.boolean,skipDownloadableStep:t.boolean,requiresReview:t.boolean,waitingPeriod:t.number,regionDetectionMethod:_typeutils.valuesOf.call(void 0, _privacytypes.RegionDetectionMethod),regionList:t.array(_typeutils.valuesOf.call(void 0, {..._privacytypes.IsoCountryCode,..._privacytypes.IsoCountrySubdivisionCode})),regionBlockList:t.array(_typeutils.valuesOf.call(void 0, {..._privacytypes.IsoCountryCode,..._privacytypes.IsoCountrySubdivisionCode}))})]),jt= exports.F =t.intersection([t.type({name:t.string,type:t.string}),t.partial({regex:t.string,selectOptions:t.array(t.string),privacyCenterVisibility:t.array(_typeutils.valuesOf.call(void 0, _privacytypes.RequestAction)),dataSubjects:t.array(t.string),isRequiredInForm:t.boolean,placeholder:t.string,displayTitle:t.string,displayDescription:t.string,displayOrder:t.number})]),Bt= exports.G =t.intersection([t.type({value:t.string,type:_typeutils.valuesOf.call(void 0, _privacytypes.DataFlowScope)}),t.partial({description:t.string,trackingPurposes:t.array(t.string),service:t.string,status:_typeutils.valuesOf.call(void 0, _privacytypes.ConsentTrackerStatus),owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),Gt= exports.H =t.intersection([t.type({name:t.string}),t.partial({isRegex:t.boolean,description:t.string,trackingPurposes:t.array(t.string),service:t.string,status:_typeutils.valuesOf.call(void 0, _privacytypes.ConsentTrackerStatus),owners:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),Ut= exports.I =t.intersection([t.type({name:t.string}),t.partial({displayName:t.string,regions:t.array(t.partial({countrySubDivision:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountrySubdivisionCode),country:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountryCode)})),onConsentExpiry:_typeutils.valuesOf.call(void 0, _airgapjstypes.OnConsentExpiry),consentExpiry:t.number,operator:_typeutils.valuesOf.call(void 0, _privacytypes.RegionsOperator),displayPriority:t.number,viewState:_typeutils.valuesOf.call(void 0, _airgapjstypes.InitialViewState),purposes:t.array(t.type({trackingType:t.string})),optedOutPurposes:t.array(t.type({trackingType:t.string})),browserLanguages:t.array(_typeutils.valuesOf.call(void 0, _airgapjstypes.BrowserLanguage)),browserTimeZones:t.array(_typeutils.valuesOf.call(void 0, _privacytypes.BrowserTimeZone))})]),Qt= exports.J =t.intersection([t.type({name:t.string}),t.partial({partition:t.string})]),zt= exports.K =t.partial({version:t.string,bundleUrls:t.record(_typeutils.valuesOf.call(void 0, _privacytypes.ConsentBundleType),t.string),domains:t.array(t.string),partition:t.string,consentPrecedence:_typeutils.valuesOf.call(void 0, _privacytypes.ConsentPrecedenceOption),unknownRequestPolicy:_typeutils.valuesOf.call(void 0, _privacytypes.UnknownRequestPolicy),unknownCookiePolicy:_typeutils.valuesOf.call(void 0, _privacytypes.UnknownRequestPolicy),syncEndpoint:t.string,telemetryPartitioning:_typeutils.valuesOf.call(void 0, _privacytypes.TelemetryPartitionStrategy),signedIabAgreement:_typeutils.valuesOf.call(void 0, _privacytypes.SignedIabAgreementOption),uspapi:_typeutils.valuesOf.call(void 0, _privacytypes.UspapiOption),experiences:t.array(Ut),theme:t.partial({primaryColor:t.string,fontColor:t.string,privacyPolicy:t.string,prompt:t.number}),syncGroups:t.string}),Ht= exports.L =t.partial({isDisabled:t.boolean,showPrivacyRequestButton:t.boolean,showDataPractices:t.boolean,showPolicies:t.boolean,showTrackingTechnologies:t.boolean,showCookies:t.boolean,showDataFlows:t.boolean,showConsentManager:t.boolean,showManageYourPrivacy:t.boolean,showMarketingPreferences:t.boolean,locales:t.array(_typeutils.valuesOf.call(void 0, _internationalization.LanguageKey)),defaultLocale:_typeutils.valuesOf.call(void 0, _internationalization.LanguageKey),preferBrowserDefaultLocale:t.boolean,supportEmail:t.string,replyToEmail:t.string,useNoReplyEmailAddress:t.boolean,useCustomEmailDomain:t.boolean,transformAccessReportJsonToCsv:t.boolean,theme:t.partial({colors:t.partial(_typeutils.applyEnum.call(void 0, _privacytypes.ConfigurableColorPaletteColor,()=>t.string)),componentStyles:_privacytypes.PrivacyCenterComponentStyles,textStyles:_privacytypes.PrivacyCenterTextStyles})}),Wt= exports.M =t.intersection([t.type({title:t.string}),t.partial({effectiveOn:t.string,disableEffectiveOn:t.boolean,content:t.string,disabledLocales:t.array(_typeutils.valuesOf.call(void 0, _internationalization.LanguageKey))})]),Zt= exports.N =t.intersection([t.type({id:t.string}),t.partial({targetReactIntlId:t.string,defaultMessage:t.string,translations:t.partial(_typeutils.applyEnum.call(void 0, _internationalization.LanguageKey,()=>t.string))})]),Jt= exports.O =t.intersection([t.type({title:t.string,integrationName:t.string}),t.partial({"outer-type":t.string,description:t.string,url:t.string,"api-key-title":t.string,headers:t.array(O),"data-subjects":t.array(t.string),"identity-keys":t.array(t.string),"deletion-dependencies":t.array(t.string),owners:t.array(t.string),teams:t.array(t.string),disabled:t.boolean,datapoints:t.array(Mt),"email-settings":Lt,country:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountryCode),countrySubDivision:_typeutils.valuesOf.call(void 0, _privacytypes.IsoCountrySubdivisionCode),attributes:t.array(r),businessEntityTitles:t.array(t.string)})]),Yt= exports.P =t.intersection([t.type({title:t.string,productLine:_typeutils.valuesOf.call(void 0, _privacytypes.TranscendProduct)}),t.partial({description:t.string,hidden:t.boolean})]),Xt= exports.Q =t.intersection([t.type({title:t.string,type:_typeutils.valuesOf.call(void 0, _privacytypes.ActionItemCode),collections:t.array(t.string)}),t.partial({priority:_typeutils.valuesOf.call(void 0, _privacytypes.ActionItemPriorityOverride),customerExperienceActionItemId:t.string,dueDate:t.string,resolved:t.boolean,notes:t.string,link:t.string,users:t.array(t.string),teams:t.array(t.string),attributes:t.array(r)})]),C= exports.R =t.intersection([t.type({"depends-on-question-reference-id":t.string,"comparison-operator":_typeutils.valuesOf.call(void 0, _privacytypes.ComparisonOperator)}),t.partial({"comparison-operands":t.array(t.string)})]),_t= exports.S =t.recursion("AssessmentNestedRuleInput",w=>t.intersection([t.type({"logic-operator":_typeutils.valuesOf.call(void 0, _privacytypes.LogicOperator)}),t.partial({rules:t.array(C),"nested-rules":t.array(w)})])),$t= exports.T =t.intersection([t.type({action:_typeutils.valuesOf.call(void 0, _privacytypes.AssessmentsDisplayLogicAction)}),t.partial({rule:C,"nested-rule":_t})]),Ce= exports.U =t.partial({"risk-level":t.string,"risk-matrix-column":t.string,"risk-matrix-row":t.string}),te= exports.V =t.intersection([t.type({"comparison-operands":t.array(t.string),"comparison-operator":_typeutils.valuesOf.call(void 0, _privacytypes.ComparisonOperator)}),t.partial({"risk-level":t.string,"risk-matrix-column":t.string,"risk-matrix-row":t.string})]),ee= exports.W =t.type({value:t.string}),re= exports.X =t.intersection([t.type({title:t.string,type:_typeutils.valuesOf.call(void 0, _privacytypes.AssessmentQuestionType)}),t.partial({"sub-type":_typeutils.valuesOf.call(void 0, _privacytypes.AssessmentQuestionSubType),placeholder:t.string,description:t.string,"is-required":t.boolean,"reference-id":t.string,"display-logic":$t,"risk-logic":t.array(te),"risk-categories":t.array(t.string),"risk-framework":t.string,"answer-options":t.array(ee),"selected-answers":t.array(t.string),"allowed-mime-types":t.array(t.string),"allow-select-other":t.boolean,"sync-model":_typeutils.valuesOf.call(void 0, _privacytypes.AssessmentSyncModel),"sync-column":_typeutils.valuesOf.call(void 0, _privacytypes.AssessmentSyncColumn),"attribute-key":t.string,"require-risk-evaluation":t.boolean,"require-risk-matrix-evaluation":t.boolean})]),v= exports.Y =t.intersection([t.type({title:t.string,questions:t.array(re)}),t.partial({assignees:t.array(t.string),"external-assignees":t.array(t.string),status:t.string,"is-reviewed":t.boolean})]),k= exports.Z =t.type({type:_typeutils.valuesOf.call(void 0, _privacytypes.RetentionScheduleType),"duration-days":t.number,operand:_typeutils.valuesOf.call(void 0, _privacytypes.RetentionScheduleOperation)}),ne= exports._ =t.intersection([t.type({title:t.string}),t.partial({sections:t.array(v),description:t.string,status:_typeutils.valuesOf.call(void 0, _privacytypes.AssessmentFormTemplateStatus),source:_typeutils.valuesOf.call(void 0, _privacytypes.AssessmentFormTemplateSource),creator:t.string,locked:t.boolean,"parent-id":t.string,archived:t.boolean,"created-at":t.string,"attribute-keys":t.array(t.string),"retention-schedule":k,templates:t.array(t.string)})]),f= exports.$ =t.type({title:t.string,type:_typeutils.valuesOf.call(void 0, _privacytypes.AttributeSupportedResourceType)}),se= exports.aa =t.intersection([t.type({title:t.string,group:t.string}),t.partial({sections:t.array(v),creator:t.string,description:t.string,status:_typeutils.valuesOf.call(void 0, _privacytypes.AssessmentFormStatus),assignees:t.array(t.string),"external-assignees":t.array(t.string),reviewers:t.array(t.string),locked:t.boolean,archived:t.boolean,external:t.boolean,"title-is-internal":t.boolean,"due-date":t.string,"created-at":t.string,"assigned-at":t.string,"submitted-at":t.string,"approved-at":t.string,"rejected-at":t.string,resources:t.array(f),rows:t.array(f),"retention-schedule":k,attributes:t.array(r)})]),oe= exports.ba =t.type({title:t.string,slug:t.string}),ie= exports.ca =t.intersection([t.type({type:_typeutils.valuesOf.call(void 0, _privacytypes.PreferenceTopicType),title:t.string,description:t.string}),t.partial({"default-configuration":t.string,"show-in-privacy-center":t.boolean,options:t.array(oe)})]),ae= exports.da =t.intersection([t.type({trackingType:t.string,title:t.string,name:t.string}),t.partial({description:t.string,"is-active":t.boolean,configurable:t.boolean,"display-order":t.number,"show-in-privacy-center":t.boolean,"show-in-consent-manager":t.boolean,"preference-topics":t.array(ie),"auth-level":_typeutils.valuesOf.call(void 0, _privacytypes.PreferenceStoreAuthLevel),"opt-out-signals":t.array(_typeutils.valuesOf.call(void 0, _airgapjstypes.UserPrivacySignalEnum)),"default-consent":_typeutils.valuesOf.call(void 0, _privacytypes.DefaultConsentOption)})]),ve= exports.ea =t.partial({"action-items":t.array(Xt),"action-item-collections":t.array(Yt),"api-keys":t.array(ft),teams:t.array(xt),templates:t.array(It),enrichers:t.array(bt),attributes:t.array(Ot),"business-entities":t.array(Ft),vendors:t.array(wt),"data-categories":t.array(Rt),"processing-purposes":t.array(St),"data-subjects":t.array(Vt),actions:t.array(Kt),identifiers:t.array(jt),"data-silos":t.array(Jt),"data-flows":t.array(Bt),cookies:t.array(Gt),"consent-manager":zt,prompts:t.array(ht),"prompt-partials":t.array(Dt),"prompt-groups":t.array(Et),agents:t.array(Ct),"agent-functions":t.array(vt),"agent-files":t.array(kt),"privacy-center":Ht,policies:t.array(Wt),messages:t.array(Zt),partitions:t.array(Qt),"assessment-templates":t.array(ne),assessments:t.array(se),purposes:t.array(ae)}),ke= exports.fa =t.type({organizationName:t.string,apiKey:t.string,organizationId:t.string}),we= exports.ga =t.intersection([t.type({"Connections Made To":t.string,Type:_typeutils.valuesOf.call(void 0, _privacytypes.DataFlowScope),Purpose:t.string}),t.partial({Service:t.string,Notes:t.string,Owners:t.string,Teams:t.string,Status:_typeutils.valuesOf.call(void 0, _privacytypes.ConsentTrackerStatus)}),t.record(t.string,t.string)]),Re= exports.ha =t.intersection([t.type({Name:t.string,Purpose:t.string}),t.partial({Service:t.string,Notes:t.string,Owners:t.string,Teams:t.string,Status:_typeutils.valuesOf.call(void 0, _privacytypes.ConsentTrackerStatus)}),t.record(t.string,t.string)]),Se= exports.ia =t.type({title:t.string,description:t.string,cookies:t.array(t.type({name:t.string,trackingPurposes:t.array(t.string)})),dataFlows:t.array(t.type({value:t.string,type:_typeutils.valuesOf.call(void 0, _privacytypes.DataFlowScope),trackingPurposes:t.array(t.string)}))}),he= exports.ja =_typeutils.valuesOf.call(void 0, _chunkBY7W4UQFcjs.e),pe= exports.ka =_chunkSAEKBZGFcjs.a.call(void 0, {TRouteName:_typeutils.valuesOf.call(void 0, _chunkBY7W4UQFcjs.f)}),De=_typeutils.valuesOf.call(void 0, _chunkBY7W4UQFcjs.f),ye= exports.la =t.array(pe),ue= exports.ma =_chunkSAEKBZGFcjs.b.call(void 0, {TEnabledRoutes:ye}),Ee= exports.na =t.partial({enabledIntegrations:t.partial({openAI:ue})}),Ne= exports.oa =t.partial({promptRunName:t.string,promptId:t.string,promptTitle:t.string,promptGroupId:t.string,promptGroupTitle:t.string,runByEmployeeEmail:t.string,applicationId:t.string,applicationName:t.string,codePackageName:t.string,repositoryName:t.string,applicationUserCoreIdentifier:t.string,applicationUserName:t.string,slackMessageTs:t.string,slackTeamId:t.string,slackChannelId:t.string,slackChannelName:t.string}),ce=t.intersection([t.type({title:t.string}),t.partial({value:t.string})]),ge=t.type({columns:t.array(ce)}),Me= exports.pa =t.partial({rows:t.array(ge),json:t.string});exports.a = It; exports.b = O; exports.c = ft; exports.d = xt; exports.e = bt; exports.f = Tt; exports.g = c; exports.h = Pt; exports.i = Te; exports.j = At; exports.k = Ot; exports.l = r; exports.m = Ct; exports.n = vt; exports.o = kt; exports.p = wt; exports.q = Rt; exports.r = St; exports.s = ht; exports.t = Dt; exports.u = Et; exports.v = Nt; exports.w = Mt; exports.x = Lt; exports.y = Ft; exports.z = Pe; exports.A = qt; exports.B = Ae; exports.C = Oe; exports.D = Vt; exports.E = Kt; exports.F = jt; exports.G = Bt; exports.H = Gt; exports.I = Ut; exports.J = Qt; exports.K = zt; exports.L = Ht; exports.M = Wt; exports.N = Zt; exports.O = Jt; exports.P = Yt; exports.Q = Xt; exports.R = C; exports.S = _t; exports.T = $t; exports.U = Ce; exports.V = te; exports.W = ee; exports.X = re; exports.Y = v; exports.Z = k; exports._ = ne; exports.$ = f; exports.aa = se; exports.ba = oe; exports.ca = ie; exports.da = ae; exports.ea = ve; exports.fa = ke; exports.ga = we; exports.ha = Re; exports.ia = Se; exports.ja = he; exports.ka = pe; exports.la = ye; exports.ma = ue; exports.na = Ee; exports.oa = Ne; exports.pa = Me;
|
|
2
|
+
//# sourceMappingURL=chunk-UEGX6GZ2.cjs.map
|