diff --git a/GDPR-README.md b/GDPR-README.md new file mode 100644 index 0000000000000000000000000000000000000000..5bd48edcb07ea654204a0ed376ccaab2b42a8b4c --- /dev/null +++ b/GDPR-README.md @@ -0,0 +1,130 @@ +Snippets defined for GDPR classification: + +```json +{ + "gdprCommonProperty": { + "prefix": "gdprcommon", + "body": [ + "// __GDPR__COMMON__ \"common.${1:propertyName}\" : { \"endPoint\": \"${2|none,SqmUserId,SqmMachineId|}\", \"classification\": \"${3|SystemMetaData,CustomerContent,EndUserPseudonymizedInformation|}\", \"purpose\": \"${4|FeatureInsight,PerformanceAndHealth,BusinessInsight,SecurityAndAuditing|}\" }\n" + ], + "description": "GDPR - declare a common property" + }, + "gdprProperty": { + "prefix": "gdprproperty", + "body": [ + "\"${1:propertyName}\": { \"endPoint\": \"${3|none,SqmUserId,SqmMachineId|}\", \"classification\": \"${4|SystemMetaData,CustomerContent,EndUserPseudonymizedInformation,PublicPersonalData,PublicNonPersonalData|}\", \"purpose\": \"${5|FeatureInsight,PerformanceAndHealth,BusinessInsight,SecurityAndAuditing|}\" }$2$0" + ], + "description": "GDPR - declare a property" + }, + "gdprInclude": { + "prefix": "gdprinclude", + "body": [ + "\"\\${include}\": [", + " \"\\${${1:FragmentName}}\"$0", + "]" + ], + "description": "GDPR - include fragments" + }, + "gdprIncludeFragment": { + "prefix": "gdprincludefragment", + "body": [ + "\"\\${${1:FragmentName}}\"$0" + ], + "description": "GDPR - include a fragment" + }, + "gdprEvent": { + "prefix": "gdprevent", + "body": [ + "/* __GDPR__", + " \"${1:eventName}\" : {", + " \"${2:propertyName}\" : { \"endPoint\": \"${4|none,SqmUserId,SqmMachineId|}\", \"classification\": \"${5|SystemMetaData,CustomerContent,EndUserPseudonymizedInformation|}\", \"purpose\": \"${6|FeatureInsight,PerformanceAndHealth,BusinessInsight,SecurityAndAuditing|}\" }$3$0", + " }", + " */\n" + ], + "description": "GDPR - declare an event" + }, + "gdprFragment": { + "prefix": "gdprinclude", + "body": [ + "/* __GDPR__FRAGMENT__", + " \"${1:fragmentName}\" : {", + " \"${2:propertyName}\" : { \"endPoint\": \"${4|none,SqmUserId,SqmMachineId|}\", \"classification\": \"${5|SystemMetaData,CustomerContent,EndUserPseudonymizedInformation|}\", \"purpose\": \"${6|FeatureInsight,PerformanceAndHealth,BusinessInsight,SecurityAndAuditing|}\" }$3$0", + " }", + " */\n" + ], + "description": "GDPR - declare a fragment" + } +} +``` + + +Keybindings defined for GDPR snippets: + +```json +[ + { + "key": "ctrl+9", + "command": "editor.action.insertSnippet", + "when": "editorTextFocus", + "args": { + "langId": "typescript", + "name": "gdprCommonProperty" + } + }, + { + "key": "ctrl+8 ctrl+8", + "command": "editor.action.insertSnippet", + "when": "editorTextFocus", + "args": { + "langId": "typescript", + "name": "gdprFragment" + } + }, + { + "key": "ctrl+0 ctrl+8", + "command": "editor.action.insertSnippet", + "when": "editorTextFocus", + "args": { + "langId": "typescript", + "name": "gdprInclude" + } + }, + { + "key": "ctrl+0 ctrl+7", + "command": "editor.action.insertSnippet", + "when": "editorTextFocus", + "args": { + "langId": "typescript", + "name": "gdprIncludeFragment" + } + }, + { + "key": "ctrl+0 ctrl+0", + "command": "editor.action.insertSnippet", + "when": "editorTextFocus", + "args": { + "langId": "typescript", + "name": "gdprEvent" + } + }, + { + "key": "ctrl+0 ctrl+9", + "command": "editor.action.insertSnippet", + "when": "editorTextFocus", + "args": { + "langId": "typescript", + "name": "gdprProperty" + } + }, + { + "key": "ctrl+8 ctrl+9", + "command": "editor.action.insertSnippet", + "when": "editorTextFocus", + "args": { + "langId": "typescript", + "name": "gdprProperty" + } + } +] + +``` \ No newline at end of file diff --git a/scripts/gdpr.sh b/scripts/gdpr.sh new file mode 100644 index 0000000000000000000000000000000000000000..d6235822abbf8a37b9dae2ae85c37355589eceeb --- /dev/null +++ b/scripts/gdpr.sh @@ -0,0 +1,3 @@ +rg --no-line-number --regexp "//\s__GDPR__COMMON__(.*)\s*\$" --no-filename --no-heading + +