solid-ui 2.4.27-80358ddf → 2.4.27-85020be3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +6 -1
  2. package/dist/670.solid-ui.min.js +1 -0
  3. package/dist/805.solid-ui.min.js +3 -0
  4. package/dist/805.solid-ui.min.js.LICENSE.txt +58 -0
  5. package/dist/805.solid-ui.min.js.map +1 -0
  6. package/dist/_2b19.solid-ui.js +14 -0
  7. package/dist/_2b19.solid-ui.js.map +1 -0
  8. package/dist/index.html +1 -9
  9. package/dist/{main.js → solid-ui.js} +7668 -15049
  10. package/dist/solid-ui.js.map +1 -0
  11. package/dist/solid-ui.min.js +3 -0
  12. package/dist/solid-ui.min.js.LICENSE.txt +54 -0
  13. package/dist/solid-ui.min.js.map +1 -0
  14. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +12134 -0
  15. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -0
  16. package/lib/chat/chatLogic.js +70 -26
  17. package/lib/chat/chatLogic.js.map +1 -1
  18. package/lib/chat/keys.d.ts +13 -0
  19. package/lib/chat/keys.d.ts.map +1 -0
  20. package/lib/chat/keys.js +233 -0
  21. package/lib/chat/keys.js.map +1 -0
  22. package/lib/chat/message.js +35 -1
  23. package/lib/chat/message.js.map +1 -1
  24. package/lib/chat/signature.d.ts +25 -0
  25. package/lib/chat/signature.d.ts.map +1 -0
  26. package/lib/chat/signature.js +113 -0
  27. package/lib/chat/signature.js.map +1 -0
  28. package/lib/header/index.d.ts.map +1 -1
  29. package/lib/header/index.js +13 -5
  30. package/lib/header/index.js.map +1 -1
  31. package/lib/login/login.d.ts.map +1 -1
  32. package/lib/login/login.js +28 -26
  33. package/lib/login/login.js.map +1 -1
  34. package/lib/style.js +30 -27
  35. package/lib/style.js.map +1 -1
  36. package/lib/utils/keyHelpers/accessData.d.ts +10 -0
  37. package/lib/utils/keyHelpers/accessData.d.ts.map +1 -0
  38. package/lib/utils/keyHelpers/accessData.js +226 -0
  39. package/lib/utils/keyHelpers/accessData.js.map +1 -0
  40. package/lib/utils/keyHelpers/acl.d.ts +20 -0
  41. package/lib/utils/keyHelpers/acl.d.ts.map +1 -0
  42. package/lib/utils/keyHelpers/acl.js +93 -0
  43. package/lib/utils/keyHelpers/acl.js.map +1 -0
  44. package/lib/versionInfo.js +5 -5
  45. package/lib/versionInfo.js.map +1 -1
  46. package/lib/widgets/forms.js +8 -4
  47. package/lib/widgets/forms.js.map +1 -1
  48. package/package.json +13 -8
  49. package/dist/main.js.map +0 -1
package/lib/style.js CHANGED
@@ -86,15 +86,15 @@ var style = {
86
86
  linkDivStyle: 'width:2em; padding:0.5em; height: 4em;',
87
87
  // ACL
88
88
  aclControlBoxContainer: 'margin: 1em',
89
- aclControlBoxHeader: 'fontSize: 120%, margin: 0 0 1rem',
90
- aclControlBoxStatus: 'display: none, margin: 1rem 0',
89
+ aclControlBoxHeader: 'font-size: 120%; margin: 0 0 1rem',
90
+ aclControlBoxStatus: 'display: none; margin: 1rem 0',
91
91
  aclControlBoxStatusRevealed: 'display: block',
92
92
  aclGroupContent: 'maxWidth: 650',
93
- accessGroupList: 'display: grid, gridTemplateColumns: 1fr, margin: 1em, width: 100%',
94
- accessGroupListItem: 'display: grid, gridTemplateColumns: 100px auto 30%',
93
+ accessGroupList: 'display: grid; grid-template-columns: 1fr; margin: 1em; width: 100%',
94
+ accessGroupListItem: 'display: grid; grid-template-columns: 100px auto 30%',
95
95
  defaultsController: 'display: flex',
96
- defaultsControllerNotice: 'color: #888, flexGrow: 1, fontSize: 80%',
97
- bigButton: 'backgroundColor: white, border: 0.1em solid #888, borderRadius: 0.3em, maxWidth: 50%, paddingBottom: 1em, paddingTop: 1em',
96
+ defaultsControllerNotice: 'color: #888; flexGrow: 1; fontSize: 80%',
97
+ bigButton: 'background-color: white; border: 0.1em solid #888; border-radius: 0.3em; max-width: 50%; padding-bottom: 1em; padding-top: 1em',
98
98
  group: 'color: #888',
99
99
  group1: 'color: green',
100
100
  group2: 'color: #cc0',
@@ -102,36 +102,39 @@ var style = {
102
102
  group5: 'color: red',
103
103
  group9: 'color: blue',
104
104
  group13: 'color: purple',
105
- trustedAppAddApplicationsTable: 'backgroundColor: #eee',
105
+ trustedAppAddApplicationsTable: 'background-color: #eee',
106
106
  trustedAppCancelButton: 'float: right',
107
- trustedAppControllerI: 'borderColor: orange, borderRadius: 1em, borderWidth: 0.1em',
107
+ trustedAppControllerI: 'border-color: orange; borderRadius: 1em; borderWidth: 0.1em',
108
108
  temporaryStatusInit: 'background: green',
109
- temporaryStatusEnd: 'background: transparent, transition: background 5s linear',
109
+ temporaryStatusEnd: 'background: transparent; transition: background 5s linear',
110
110
  // header
111
- headerUserMenuLink: 'background: none, border: 0, color: black, cursor: pointer, display: block, fontFamily: Arial, fontSize: 1em, textAlign: left, padding: 1em, width: 100%, textDecoration: none',
112
- headerUserMenuLinkHover: 'backgroundColor: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',
113
- headerUserMenuTrigger: 'background: none, border: 0, cursor: pointer, width: 60px, height: 60px',
114
- headerUserMenuTriggerImg: 'borderRadius: 50%, height: 56px, width: 56px, width: 28px !important',
115
- headerUserMenuButton: 'background: none, border: 0, color: black, cursor: pointer, display: block, fontFamily: Arial, fontSize: 1em, textAlign: left, padding: 1em, width: 100%',
116
- headerUserMenuButtonHover: 'backgroundColor: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',
117
- headerUserMenuList: 'listStyle: none, margin: 0, padding: 0',
118
- headerUserMenuNavigationMenu: 'background: white, border: solid 1px #000000, borderRight: 0,position: absolute, right: 0, top: 60px, width: 200px, z-index: 1',
119
- headerUserMenuListItem: 'borderBottom: solid 1px #000000',
120
- headerUserMenuPhoto: 'borderRadius: 50%, backgroundPosition: center, backgroundRepeat: no-repeat,backgroundSize: cover,height: 50px, width: 50px',
121
- headerBanner: 'boxShadow: 0px 1px 4px #000000, display: flex, justifyContent: space-between,padding: 0 1.5em, marginBottom: 4px',
111
+ headerUserMenuLink: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none',
112
+ headerUserMenuLinkHover: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',
113
+ headerUserMenuTrigger: 'background: none; border: 0; cursor: pointer; width: 60px; height: 60px',
114
+ headerUserMenuTriggerImg: 'border-radius: 50%; height: 56px; width: 28px !important',
115
+ headerUserMenuButton: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%',
116
+ headerUserMenuButtonHover: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',
117
+ headerUserMenuList: 'list-style: none; margin: 0; padding: 0',
118
+ headerUserMenuListDisplay: 'list-style: none; margin: 0; padding: 0; display:true',
119
+ headerUserMenuNavigationMenu: 'background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: true',
120
+ headerUserMenuNavigationMenuNotDisplayed: 'background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: none',
121
+ headerUserMenuListItem: 'border-bottom: solid 1px #000000',
122
+ headerUserMenuPhoto: 'border-radius: 50%; background-position: center; background-repeat: no-repeat; background-size: cover; height: 50px; width: 50px',
123
+ headerBanner: 'box-shadow: 0px 1px 4px #000000; display: flex; justify-content: space-between; padding: 0 1.5em; margin-bottom: 4px',
122
124
  headerBannerLink: 'display: block',
123
125
  headerBannerRightMenu: 'display: flex',
124
- headerBannerLogin: 'marginLeft: auto',
125
- headerBannerLoginInput: 'margin: 0.75em 0 0.75em 0.5em !important, padding: 0.5em !important',
126
- headerBannerUserMenu: 'borderLeft: solid 1px #000000, marginLeft: auto',
127
- headerBannerHelpMenu: 'borderLeft: solid 1px #000000, marginLeft: auto',
128
- headerBannerIcon: 'backgroundSize: 65px 60px, height: 60px !important, width: 65px !important',
126
+ headerBannerLogin: 'margin-left: auto',
127
+ allChildrenVisible: 'display:true',
128
+ headerBannerLoginInput: 'margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important',
129
+ headerBannerUserMenu: 'border-left: solid 1px #000000; margin-left: auto',
130
+ headerBannerHelpMenu: 'border-left: solid 1px #000000; margin.left: auto',
131
+ headerBannerIcon: 'background-size: 65px 60px !important; height: 60px !important; width: 65px !important',
129
132
  // may just be 65px round($icon-size * 352 / 322);
130
133
 
131
134
  // footer
132
- footer: 'borderTop: solid 1px $divider-color, fontSize: 0.9em, padding: 0.5em 1.5em',
135
+ footer: 'border-top: solid 1px $divider-color; font-size: 0.9em; padding: 0.5em 1.5em',
133
136
  // buttons
134
- primaryButton: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',
137
+ primaryButton: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',
135
138
  primaryButtonHover: 'background-color: #9f7dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',
136
139
  primaryButtonNoBorder: 'background-color: #ffffff; color: #7c4dff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',
137
140
  primaryButtonNoBorderHover: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',
package/lib/style.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","names":["formBorderColor","lowProfileLinkColor","formFieldNameBoxWidth","style","checkboxStyle","checkboxInputStyle","fieldLabelStyle","formSelectSTyle","textInputStyle","textInputStyleUneditable","textInputSize","buttonStyle","commentStyle","iconStyle","smallButtonStyle","classIconStyle","confirmPopupStyle","tabBorderRadius","messageBodyStyle","pendingeditModifier","highlightColor","personaBarStyle","searchInputStyle","autocompleteRowStyle","signInButtonStyle","heading1Style","heading2Style","heading3Style","heading4Style","formHeadingColor","formHeadingStyle","formTextInput","formGroupStyle","concat","formFieldLabelStyle","formFieldNameBoxStyle","textInputBackgroundColor","textInputBackgroundColorUneditable","textInputColor","textInputColorPending","multilineTextInputStyle","renderAsDivStyle","imageDivStyle","linkDivStyle","aclControlBoxContainer","aclControlBoxHeader","aclControlBoxStatus","aclControlBoxStatusRevealed","aclGroupContent","accessGroupList","accessGroupListItem","defaultsController","defaultsControllerNotice","bigButton","group","group1","group2","group3","group5","group9","group13","trustedAppAddApplicationsTable","trustedAppCancelButton","trustedAppControllerI","temporaryStatusInit","temporaryStatusEnd","headerUserMenuLink","headerUserMenuLinkHover","headerUserMenuTrigger","headerUserMenuTriggerImg","headerUserMenuButton","headerUserMenuButtonHover","headerUserMenuList","headerUserMenuNavigationMenu","headerUserMenuListItem","headerUserMenuPhoto","headerBanner","headerBannerLink","headerBannerRightMenu","headerBannerLogin","headerBannerLoginInput","headerBannerUserMenu","headerBannerHelpMenu","headerBannerIcon","footer","primaryButton","primaryButtonHover","primaryButtonNoBorder","primaryButtonNoBorderHover","secondaryButton","secondaryButtonHover","secondaryButtonNoBorder","secondaryButtonNoBorderHover","exports","setStyle","ele","styleName","module"],"sources":["../src/style.js"],"sourcesContent":["// Common readable consistent stylesheet\n// to avoid using style sheets which are document-global\n// and make programmable style toggling with selection, drag over, etc easier\n\n// These must all end with semicolon so they can be appended to.\n\nconst formBorderColor = '#888888' // Mid-grey\nconst lowProfileLinkColor = '#3B5998' // Grey-blue, e.g., for field labels linking to ontology\nconst formFieldNameBoxWidth = '8em' // The fixed amount to get form fields to line up\n// The latter we put in when switching awy from using tables. Getting allignment between\n// fields in different groups though is hard problem.\n\nexport const style = { // styleModule\n\n checkboxStyle: 'color: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',\n checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em',\n\n fieldLabelStyle: 'color: #3B5998; text-decoration: none;',\n formSelectSTyle:\n 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputStyle:\n 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputStyleUneditable: // Color difference only\n 'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputSize: 20, // Default text input size in characters roughly\n buttonStyle:\n 'background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;', // 'background-color: #eef;\n commentStyle: 'padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;',\n iconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;',\n smallButtonStyle: 'margin: 0.2em; width: 1em; height:1em;',\n classIconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;', // combine with buttonStyle\n confirmPopupStyle: 'padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;',\n tabBorderRadius: '0.2em',\n messageBodyStyle:\n 'white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; border-radius:0.2em; padding: .3em 0.5em; margin: 0.1em;',\n pendingeditModifier: 'color: #bbb;',\n highlightColor: '#7C4DFF', // Solid lavendar https://design.inrupt.com/atomic-core/?cat=Core\n\n // Contacts\n personaBarStyle: 'width: 100%; height: 4em; background-color: #eee; vertical-align: middle;',\n searchInputStyle: 'border: 0.1em solid #444; border-radius: 0.2em; width: 100%; font-size: 100%; padding: 0.1em 0.6em; margin 0.2em;',\n autocompleteRowStyle: 'border: 0.2em solid straw;',\n\n // Login buttons\n signInButtonStyle: 'padding: 1em; border-radius:0.2em; font-size: 100%;', // was 0.5em radius\n\n // Forms\n heading1Style: 'font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;', // originally was brown; now grey\n heading2Style: 'font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;', // originally was brown; now grey\n heading3Style: 'font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;', // For example, in large forms or before a small form\n heading4Style: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // Lowest level used by default in small things\n\n formBorderColor, // originally was brown; now grey\n formHeadingColor: '#888888', // originally was brown; now grey\n formHeadingStyle: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // originally was brown; now grey\n formTextInput: 'font-size: 100%; margin: 0.1em; padding: 0.1em;', // originally used this\n formGroupStyle: [`padding-left: 0em; border: 0.0em solid ${formBorderColor}; border-radius: 0.2em;`, // weight 0\n `padding-left: 2em; border: 0.05em solid ${formBorderColor}; border-radius: 0.2em;`,\n `padding-left: 2em; border: 0.1em solid ${formBorderColor}; border-radius: 0.2em;`,\n `padding-left: 2em; border: 0.2em solid ${formBorderColor}; border-radius: 0.2em;` // @@ pink\n ],\n\n formFieldLabelStyle: `'color: ${lowProfileLinkColor}; text-decoration: none;'`,\n formFieldNameBoxWidth,\n formFieldNameBoxStyle: `padding: 0.3em; vertical-align: middle; width:${formFieldNameBoxWidth};`,\n textInputBackgroundColor: '#eef',\n textInputBackgroundColorUneditable: '#fff',\n textInputColor: '#000',\n textInputColorPending: '#888',\n multilineTextInputStyle: 'font-size:100%; white-space: pre-wrap; background-color: #eef;' +\n ' border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;',\n\n // Buttons\n renderAsDivStyle: 'display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;',\n imageDivStyle: 'width:2.5em; padding:0.5em; height: 2.5em;',\n linkDivStyle: 'width:2em; padding:0.5em; height: 4em;',\n\n // ACL\n aclControlBoxContainer: 'margin: 1em',\n aclControlBoxHeader: 'fontSize: 120%, margin: 0 0 1rem',\n aclControlBoxStatus: 'display: none, margin: 1rem 0',\n aclControlBoxStatusRevealed: 'display: block',\n aclGroupContent: 'maxWidth: 650',\n accessGroupList: 'display: grid, gridTemplateColumns: 1fr, margin: 1em, width: 100%',\n accessGroupListItem: 'display: grid, gridTemplateColumns: 100px auto 30%',\n defaultsController: 'display: flex',\n defaultsControllerNotice: 'color: #888, flexGrow: 1, fontSize: 80%',\n bigButton: 'backgroundColor: white, border: 0.1em solid #888, borderRadius: 0.3em, maxWidth: 50%, paddingBottom: 1em, paddingTop: 1em',\n group: 'color: #888',\n group1: 'color: green',\n group2: 'color: #cc0',\n group3: 'color: orange',\n group5: 'color: red',\n group9: 'color: blue',\n group13: 'color: purple',\n\n trustedAppAddApplicationsTable: 'backgroundColor: #eee',\n trustedAppCancelButton: 'float: right',\n trustedAppControllerI: 'borderColor: orange, borderRadius: 1em, borderWidth: 0.1em',\n temporaryStatusInit: 'background: green',\n temporaryStatusEnd: 'background: transparent, transition: background 5s linear',\n\n // header\n headerUserMenuLink: 'background: none, border: 0, color: black, cursor: pointer, display: block, fontFamily: Arial, fontSize: 1em, textAlign: left, padding: 1em, width: 100%, textDecoration: none',\n headerUserMenuLinkHover: 'backgroundColor: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',\n\n headerUserMenuTrigger: 'background: none, border: 0, cursor: pointer, width: 60px, height: 60px',\n headerUserMenuTriggerImg: 'borderRadius: 50%, height: 56px, width: 56px, width: 28px !important',\n headerUserMenuButton: 'background: none, border: 0, color: black, cursor: pointer, display: block, fontFamily: Arial, fontSize: 1em, textAlign: left, padding: 1em, width: 100%',\n headerUserMenuButtonHover: 'backgroundColor: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',\n headerUserMenuList: 'listStyle: none, margin: 0, padding: 0',\n headerUserMenuNavigationMenu: 'background: white, border: solid 1px #000000, borderRight: 0,position: absolute, right: 0, top: 60px, width: 200px, z-index: 1',\n headerUserMenuListItem: 'borderBottom: solid 1px #000000',\n headerUserMenuPhoto: 'borderRadius: 50%, backgroundPosition: center, backgroundRepeat: no-repeat,backgroundSize: cover,height: 50px, width: 50px',\n headerBanner: 'boxShadow: 0px 1px 4px #000000, display: flex, justifyContent: space-between,padding: 0 1.5em, marginBottom: 4px',\n headerBannerLink: 'display: block',\n headerBannerRightMenu: 'display: flex',\n headerBannerLogin: 'marginLeft: auto',\n headerBannerLoginInput: 'margin: 0.75em 0 0.75em 0.5em !important, padding: 0.5em !important',\n headerBannerUserMenu: 'borderLeft: solid 1px #000000, marginLeft: auto',\n headerBannerHelpMenu: 'borderLeft: solid 1px #000000, marginLeft: auto',\n headerBannerIcon: 'backgroundSize: 65px 60px, height: 60px !important, width: 65px !important', // may just be 65px round($icon-size * 352 / 322);\n\n // footer\n footer: 'borderTop: solid 1px $divider-color, fontSize: 0.9em, padding: 0.5em 1.5em',\n\n // buttons\n primaryButton: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n primaryButtonHover: 'background-color: #9f7dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n primaryButtonNoBorder: 'background-color: #ffffff; color: #7c4dff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n primaryButtonNoBorderHover: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n secondaryButton: 'background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n secondaryButtonHover: 'background-color: #37cde6; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n secondaryButtonNoBorder: 'background-color: #ffffff; color: #01c9ea; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n secondaryButtonNoBorderHover: 'background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out'\n\n}\n\nstyle.setStyle = function setStyle (ele, styleName) {\n ele.style = style[styleName]\n}\n\nmodule.exports = style // @@ No way to do this in ESM\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEA;;AAEA,IAAMA,eAAe,GAAG,SAAS,EAAC;AAClC,IAAMC,mBAAmB,GAAG,SAAS,EAAC;AACtC,IAAMC,qBAAqB,GAAG,KAAK,EAAC;AACpC;AACA;;AAEO,IAAMC,KAAK,GAAG;EAAE;;EAErBC,aAAa,EAAE,6EAA6E;EAC5FC,kBAAkB,EAAE,0GAA0G;EAE9HC,eAAe,EAAE,wCAAwC;EACzDC,eAAe,EACb,yHAAyH;EAC3HC,cAAc,EACZ,yHAAyH;EAC3HC,wBAAwB;EAAE;EACxB,2HAA2H;EAC7HC,aAAa,EAAE,EAAE;EAAE;EACnBC,WAAW,EACP,2HAA2H;EAAE;EACjIC,YAAY,EAAE,wEAAwE;EACtFC,SAAS,EAAE,6DAA6D;EACxEC,gBAAgB,EAAE,wCAAwC;EAC1DC,cAAc,EAAE,kIAAkI;EAAE;EACpJC,iBAAiB,EAAE,0HAA0H;EAC7IC,eAAe,EAAE,OAAO;EACxBC,gBAAgB,EACd,wIAAwI;EAC1IC,mBAAmB,EAAE,cAAc;EACnCC,cAAc,EAAE,SAAS;EAAE;;EAE3B;EACAC,eAAe,EAAE,2EAA2E;EAC5FC,gBAAgB,EAAE,mHAAmH;EACrIC,oBAAoB,EAAE,4BAA4B;EAElD;EACAC,iBAAiB,EAAE,qDAAqD;EAAE;;EAE1E;EACAC,aAAa,EAAE,yFAAyF;EAAE;EAC1GC,aAAa,EAAE,0FAA0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AAO,GAAG1F,KAAK,EAAC"}
1
+ {"version":3,"file":"style.js","names":["formBorderColor","lowProfileLinkColor","formFieldNameBoxWidth","style","checkboxStyle","checkboxInputStyle","fieldLabelStyle","formSelectSTyle","textInputStyle","textInputStyleUneditable","textInputSize","buttonStyle","commentStyle","iconStyle","smallButtonStyle","classIconStyle","confirmPopupStyle","tabBorderRadius","messageBodyStyle","pendingeditModifier","highlightColor","personaBarStyle","searchInputStyle","autocompleteRowStyle","signInButtonStyle","heading1Style","heading2Style","heading3Style","heading4Style","formHeadingColor","formHeadingStyle","formTextInput","formGroupStyle","concat","formFieldLabelStyle","formFieldNameBoxStyle","textInputBackgroundColor","textInputBackgroundColorUneditable","textInputColor","textInputColorPending","multilineTextInputStyle","renderAsDivStyle","imageDivStyle","linkDivStyle","aclControlBoxContainer","aclControlBoxHeader","aclControlBoxStatus","aclControlBoxStatusRevealed","aclGroupContent","accessGroupList","accessGroupListItem","defaultsController","defaultsControllerNotice","bigButton","group","group1","group2","group3","group5","group9","group13","trustedAppAddApplicationsTable","trustedAppCancelButton","trustedAppControllerI","temporaryStatusInit","temporaryStatusEnd","headerUserMenuLink","headerUserMenuLinkHover","headerUserMenuTrigger","headerUserMenuTriggerImg","headerUserMenuButton","headerUserMenuButtonHover","headerUserMenuList","headerUserMenuListDisplay","headerUserMenuNavigationMenu","headerUserMenuNavigationMenuNotDisplayed","headerUserMenuListItem","headerUserMenuPhoto","headerBanner","headerBannerLink","headerBannerRightMenu","headerBannerLogin","allChildrenVisible","headerBannerLoginInput","headerBannerUserMenu","headerBannerHelpMenu","headerBannerIcon","footer","primaryButton","primaryButtonHover","primaryButtonNoBorder","primaryButtonNoBorderHover","secondaryButton","secondaryButtonHover","secondaryButtonNoBorder","secondaryButtonNoBorderHover","exports","setStyle","ele","styleName","module"],"sources":["../src/style.js"],"sourcesContent":["// Common readable consistent stylesheet\n// to avoid using style sheets which are document-global\n// and make programmable style toggling with selection, drag over, etc easier\n\n// These must all end with semicolon so they can be appended to.\n\nconst formBorderColor = '#888888' // Mid-grey\nconst lowProfileLinkColor = '#3B5998' // Grey-blue, e.g., for field labels linking to ontology\nconst formFieldNameBoxWidth = '8em' // The fixed amount to get form fields to line up\n// The latter we put in when switching awy from using tables. Getting allignment between\n// fields in different groups though is hard problem.\n\nexport const style = { // styleModule\n\n checkboxStyle: 'color: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',\n checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em',\n\n fieldLabelStyle: 'color: #3B5998; text-decoration: none;',\n formSelectSTyle:\n 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputStyle:\n 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputStyleUneditable: // Color difference only\n 'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputSize: 20, // Default text input size in characters roughly\n buttonStyle:\n 'background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;', // 'background-color: #eef;\n commentStyle: 'padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;',\n iconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;',\n smallButtonStyle: 'margin: 0.2em; width: 1em; height:1em;',\n classIconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;', // combine with buttonStyle\n confirmPopupStyle: 'padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;',\n tabBorderRadius: '0.2em',\n messageBodyStyle:\n 'white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; border-radius:0.2em; padding: .3em 0.5em; margin: 0.1em;',\n pendingeditModifier: 'color: #bbb;',\n highlightColor: '#7C4DFF', // Solid lavendar https://design.inrupt.com/atomic-core/?cat=Core\n\n // Contacts\n personaBarStyle: 'width: 100%; height: 4em; background-color: #eee; vertical-align: middle;',\n searchInputStyle: 'border: 0.1em solid #444; border-radius: 0.2em; width: 100%; font-size: 100%; padding: 0.1em 0.6em; margin 0.2em;',\n autocompleteRowStyle: 'border: 0.2em solid straw;',\n\n // Login buttons\n signInButtonStyle: 'padding: 1em; border-radius:0.2em; font-size: 100%;', // was 0.5em radius\n\n // Forms\n heading1Style: 'font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;', // originally was brown; now grey\n heading2Style: 'font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;', // originally was brown; now grey\n heading3Style: 'font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;', // For example, in large forms or before a small form\n heading4Style: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // Lowest level used by default in small things\n\n formBorderColor, // originally was brown; now grey\n formHeadingColor: '#888888', // originally was brown; now grey\n formHeadingStyle: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // originally was brown; now grey\n formTextInput: 'font-size: 100%; margin: 0.1em; padding: 0.1em;', // originally used this\n formGroupStyle: [`padding-left: 0em; border: 0.0em solid ${formBorderColor}; border-radius: 0.2em;`, // weight 0\n `padding-left: 2em; border: 0.05em solid ${formBorderColor}; border-radius: 0.2em;`,\n `padding-left: 2em; border: 0.1em solid ${formBorderColor}; border-radius: 0.2em;`,\n `padding-left: 2em; border: 0.2em solid ${formBorderColor}; border-radius: 0.2em;` // @@ pink\n ],\n\n formFieldLabelStyle: `'color: ${lowProfileLinkColor}; text-decoration: none;'`,\n formFieldNameBoxWidth,\n formFieldNameBoxStyle: `padding: 0.3em; vertical-align: middle; width:${formFieldNameBoxWidth};`,\n textInputBackgroundColor: '#eef',\n textInputBackgroundColorUneditable: '#fff',\n textInputColor: '#000',\n textInputColorPending: '#888',\n multilineTextInputStyle: 'font-size:100%; white-space: pre-wrap; background-color: #eef;' +\n ' border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;',\n\n // Buttons\n renderAsDivStyle: 'display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;',\n imageDivStyle: 'width:2.5em; padding:0.5em; height: 2.5em;',\n linkDivStyle: 'width:2em; padding:0.5em; height: 4em;',\n\n // ACL\n aclControlBoxContainer: 'margin: 1em',\n aclControlBoxHeader: 'font-size: 120%; margin: 0 0 1rem',\n aclControlBoxStatus: 'display: none; margin: 1rem 0',\n aclControlBoxStatusRevealed: 'display: block',\n aclGroupContent: 'maxWidth: 650',\n accessGroupList: 'display: grid; grid-template-columns: 1fr; margin: 1em; width: 100%',\n accessGroupListItem: 'display: grid; grid-template-columns: 100px auto 30%',\n defaultsController: 'display: flex',\n defaultsControllerNotice: 'color: #888; flexGrow: 1; fontSize: 80%',\n bigButton: 'background-color: white; border: 0.1em solid #888; border-radius: 0.3em; max-width: 50%; padding-bottom: 1em; padding-top: 1em',\n group: 'color: #888',\n group1: 'color: green',\n group2: 'color: #cc0',\n group3: 'color: orange',\n group5: 'color: red',\n group9: 'color: blue',\n group13: 'color: purple',\n\n trustedAppAddApplicationsTable: 'background-color: #eee',\n trustedAppCancelButton: 'float: right',\n trustedAppControllerI: 'border-color: orange; borderRadius: 1em; borderWidth: 0.1em',\n temporaryStatusInit: 'background: green',\n temporaryStatusEnd: 'background: transparent; transition: background 5s linear',\n\n // header\n headerUserMenuLink: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none',\n headerUserMenuLinkHover: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',\n headerUserMenuTrigger: 'background: none; border: 0; cursor: pointer; width: 60px; height: 60px',\n headerUserMenuTriggerImg: 'border-radius: 50%; height: 56px; width: 28px !important',\n headerUserMenuButton: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%',\n headerUserMenuButtonHover: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',\n headerUserMenuList: 'list-style: none; margin: 0; padding: 0',\n headerUserMenuListDisplay: 'list-style: none; margin: 0; padding: 0; display:true',\n headerUserMenuNavigationMenu: 'background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: true',\n headerUserMenuNavigationMenuNotDisplayed: 'background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: none',\n headerUserMenuListItem: 'border-bottom: solid 1px #000000',\n headerUserMenuPhoto: 'border-radius: 50%; background-position: center; background-repeat: no-repeat; background-size: cover; height: 50px; width: 50px',\n headerBanner: 'box-shadow: 0px 1px 4px #000000; display: flex; justify-content: space-between; padding: 0 1.5em; margin-bottom: 4px',\n headerBannerLink: 'display: block',\n headerBannerRightMenu: 'display: flex',\n headerBannerLogin: 'margin-left: auto',\n allChildrenVisible: 'display:true',\n headerBannerLoginInput: 'margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important',\n headerBannerUserMenu: 'border-left: solid 1px #000000; margin-left: auto',\n headerBannerHelpMenu: 'border-left: solid 1px #000000; margin.left: auto',\n headerBannerIcon: 'background-size: 65px 60px !important; height: 60px !important; width: 65px !important', // may just be 65px round($icon-size * 352 / 322);\n\n // footer\n footer: 'border-top: solid 1px $divider-color; font-size: 0.9em; padding: 0.5em 1.5em',\n\n // buttons\n primaryButton: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n primaryButtonHover: 'background-color: #9f7dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n primaryButtonNoBorder: 'background-color: #ffffff; color: #7c4dff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n primaryButtonNoBorderHover: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n secondaryButton: 'background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n secondaryButtonHover: 'background-color: #37cde6; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n secondaryButtonNoBorder: 'background-color: #ffffff; color: #01c9ea; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n secondaryButtonNoBorderHover: 'background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out'\n\n}\n\nstyle.setStyle = function setStyle (ele, styleName) {\n ele.style = style[styleName]\n}\n\nmodule.exports = style // @@ No way to do this in ESM\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEA;;AAEA,IAAMA,eAAe,GAAG,SAAS,EAAC;AAClC,IAAMC,mBAAmB,GAAG,SAAS,EAAC;AACtC,IAAMC,qBAAqB,GAAG,KAAK,EAAC;AACpC;AACA;;AAEO,IAAMC,KAAK,GAAG;EAAE;;EAErBC,aAAa,EAAE,6EAA6E;EAC5FC,kBAAkB,EAAE,0GAA0G;EAE9HC,eAAe,EAAE,wCAAwC;EACzDC,eAAe,EACb,yHAAyH;EAC3HC,cAAc,EACZ,yHAAyH;EAC3HC,wBAAwB;EAAE;EACxB,2HAA2H;EAC7HC,aAAa,EAAE,EAAE;EAAE;EACnBC,WAAW,EACP,2HAA2H;EAAE;EACjIC,YAAY,EAAE,wEAAwE;EACtFC,SAAS,EAAE,6DAA6D;EACxEC,gBAAgB,EAAE,wCAAwC;EAC1DC,cAAc,EAAE,kIAAkI;EAAE;EACpJC,iBAAiB,EAAE,0HAA0H;EAC7IC,eAAe,EAAE,OAAO;EACxBC,gBAAgB,EACd,wIAAwI;EAC1IC,mBAAmB,EAAE,cAAc;EACnCC,cAAc,EAAE,SAAS;EAAE;;EAE3B;EACAC,eAAe,EAAE,2EAA2E;EAC5FC,gBAAgB,EAAE,mHAAmH;EACrIC,oBAAoB,EAAE,4BAA4B;EAElD;EACAC,iBAAiB,EAAE,qDAAqD;EAAE;;EAE1E;EACAC,aAAa,EAAE,yFAAyF;EAAE;EAC1GC,aAAa,EAAE,0FAA0F;EAAE;EAC3GC,aAAa,EAAE,0FAA0F;EAAE;EAC3GC,a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,CAAC;AAC9B,CAAC;AAEDC,MAAM,CAACJ,OAAO,GAAG7F,KAAK,EAAC"}
@@ -0,0 +1,10 @@
1
+ import { NamedNode } from 'rdflib';
2
+ export declare const getPodRoot: (webId: NamedNode) => Promise<string | undefined>;
3
+ export declare const pubKeyUrl: (webId: NamedNode) => Promise<string>;
4
+ export declare function getExistingPublicKey(webId: NamedNode, publicKeyUrl: string): Promise<string | undefined>;
5
+ export declare const privKeyUrl: (webId: NamedNode) => Promise<string>;
6
+ export declare function getExistingPrivateKey(webId: NamedNode, privateKeyUrl: string): Promise<string | undefined>;
7
+ type KeyType = 'PublicKey' | 'PrivateKey';
8
+ export declare function getKeyIfExists(webId: NamedNode, keyUrl: string, keyType: KeyType): Promise<string | undefined>;
9
+ export {};
10
+ //# sourceMappingURL=accessData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessData.d.ts","sourceRoot":"","sources":["../../../src/utils/keyHelpers/accessData.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,eAAO,MAAM,UAAU,UAAiB,SAAS,gCAsBhD,CAAA;AAED,eAAO,MAAM,SAAS,UAAiB,SAAS,oBAI/C,CAAA;AAED,wBAAsB,oBAAoB,CAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAGjF;AAED,eAAO,MAAM,UAAU,UAAiB,SAAS,oBAIhD,CAAA;AAED,wBAAsB,qBAAqB,CAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,+BAGnF;AAED,KAAK,OAAO,GAAG,WAAW,GAAG,YAAY,CAAA;AAEzC,wBAAsB,cAAc,CAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,+BAyBvF"}
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getExistingPrivateKey = getExistingPrivateKey;
9
+ exports.getExistingPublicKey = getExistingPublicKey;
10
+ exports.getKeyIfExists = getKeyIfExists;
11
+ exports.pubKeyUrl = exports.privKeyUrl = exports.getPodRoot = void 0;
12
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
14
+ var debug = _interopRequireWildcard(require("../../debug"));
15
+ var _signature = require("../../chat/signature");
16
+ var _solidLogic = require("solid-logic");
17
+ var ns = _interopRequireWildcard(require("../../ns"));
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
+ var getPodRoot = /*#__PURE__*/function () {
21
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(webId) {
22
+ var _podRoot;
23
+ var webIdURL, storages, podRoot, path, _res$headers$get, res;
24
+ return _regenerator["default"].wrap(function _callee$(_context) {
25
+ while (1) switch (_context.prev = _context.next) {
26
+ case 0:
27
+ webIdURL = new URL(webId.uri); // find storages in webId document
28
+ _context.next = 3;
29
+ return _solidLogic.store.fetcher.load(webId.uri);
30
+ case 3:
31
+ storages = _solidLogic.store.each(webId, ns.space('storage'), null, webId.doc());
32
+ if (storages !== null && storages !== void 0 && storages.length) {
33
+ _context.next = 19;
34
+ break;
35
+ }
36
+ // find storage recursively in webId URL
37
+ path = webIdURL.pathname;
38
+ case 6:
39
+ if (!path.length) {
40
+ _context.next = 17;
41
+ break;
42
+ }
43
+ path = path.substring(0, path.lastIndexOf('/'));
44
+ podRoot = _solidLogic.store.sym(webIdURL.origin + path + '/');
45
+ _context.next = 11;
46
+ return _solidLogic.store.fetcher.webOperation('HEAD', podRoot.uri);
47
+ case 11:
48
+ res = _context.sent;
49
+ if (!((_res$headers$get = res.headers.get('link')) !== null && _res$headers$get !== void 0 && _res$headers$get.includes(ns.space('Storage').value))) {
50
+ _context.next = 14;
51
+ break;
52
+ }
53
+ return _context.abrupt("break", 17);
54
+ case 14:
55
+ if (!path) debug.warn("Current user storage not found for\n".concat(webId));
56
+ _context.next = 6;
57
+ break;
58
+ case 17:
59
+ _context.next = 21;
60
+ break;
61
+ case 19:
62
+ // give preference to storage in webId root
63
+ podRoot = storages.find(function (storage) {
64
+ return webIdURL.origin === new URL(storage.value).origin;
65
+ });
66
+ if (!podRoot) podRoot = storages[0];
67
+ case 21:
68
+ return _context.abrupt("return", (_podRoot = podRoot) === null || _podRoot === void 0 ? void 0 : _podRoot.value);
69
+ case 22:
70
+ case "end":
71
+ return _context.stop();
72
+ }
73
+ }, _callee);
74
+ }));
75
+ return function getPodRoot(_x) {
76
+ return _ref.apply(this, arguments);
77
+ };
78
+ }();
79
+ exports.getPodRoot = getPodRoot;
80
+ var pubKeyUrl = /*#__PURE__*/function () {
81
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(webId) {
82
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
83
+ while (1) switch (_context2.prev = _context2.next) {
84
+ case 0:
85
+ _context2.prev = 0;
86
+ _context2.next = 3;
87
+ return getPodRoot(webId);
88
+ case 3:
89
+ _context2.t0 = _context2.sent;
90
+ return _context2.abrupt("return", _context2.t0 + 'profile/keys/publicKey.ttl');
91
+ case 7:
92
+ _context2.prev = 7;
93
+ _context2.t1 = _context2["catch"](0);
94
+ throw new Error(_context2.t1);
95
+ case 10:
96
+ case "end":
97
+ return _context2.stop();
98
+ }
99
+ }, _callee2, null, [[0, 7]]);
100
+ }));
101
+ return function pubKeyUrl(_x2) {
102
+ return _ref2.apply(this, arguments);
103
+ };
104
+ }();
105
+ exports.pubKeyUrl = pubKeyUrl;
106
+ function getExistingPublicKey(_x3, _x4) {
107
+ return _getExistingPublicKey.apply(this, arguments);
108
+ }
109
+ function _getExistingPublicKey() {
110
+ _getExistingPublicKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(webId, publicKeyUrl) {
111
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
112
+ while (1) switch (_context4.prev = _context4.next) {
113
+ case 0:
114
+ _context4.next = 2;
115
+ return getKeyIfExists(webId, publicKeyUrl, 'PublicKey');
116
+ case 2:
117
+ return _context4.abrupt("return", _context4.sent);
118
+ case 3:
119
+ case "end":
120
+ return _context4.stop();
121
+ }
122
+ }, _callee4);
123
+ }));
124
+ return _getExistingPublicKey.apply(this, arguments);
125
+ }
126
+ var privKeyUrl = /*#__PURE__*/function () {
127
+ var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(webId) {
128
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
129
+ while (1) switch (_context3.prev = _context3.next) {
130
+ case 0:
131
+ _context3.prev = 0;
132
+ _context3.next = 3;
133
+ return getPodRoot(webId);
134
+ case 3:
135
+ _context3.t0 = _context3.sent;
136
+ return _context3.abrupt("return", _context3.t0 + 'profile/keys/privateKey.ttl');
137
+ case 7:
138
+ _context3.prev = 7;
139
+ _context3.t1 = _context3["catch"](0);
140
+ throw new Error(_context3.t1);
141
+ case 10:
142
+ case "end":
143
+ return _context3.stop();
144
+ }
145
+ }, _callee3, null, [[0, 7]]);
146
+ }));
147
+ return function privKeyUrl(_x5) {
148
+ return _ref3.apply(this, arguments);
149
+ };
150
+ }();
151
+ exports.privKeyUrl = privKeyUrl;
152
+ function getExistingPrivateKey(_x6, _x7) {
153
+ return _getExistingPrivateKey.apply(this, arguments);
154
+ }
155
+ function _getExistingPrivateKey() {
156
+ _getExistingPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(webId, privateKeyUrl) {
157
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
158
+ while (1) switch (_context5.prev = _context5.next) {
159
+ case 0:
160
+ _context5.next = 2;
161
+ return getKeyIfExists(webId, privateKeyUrl, 'PrivateKey');
162
+ case 2:
163
+ return _context5.abrupt("return", _context5.sent);
164
+ case 3:
165
+ case "end":
166
+ return _context5.stop();
167
+ }
168
+ }, _callee5);
169
+ }));
170
+ return _getExistingPrivateKey.apply(this, arguments);
171
+ }
172
+ function getKeyIfExists(_x8, _x9, _x10) {
173
+ return _getKeyIfExists.apply(this, arguments);
174
+ }
175
+ function _getKeyIfExists() {
176
+ _getKeyIfExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(webId, keyUrl, keyType) {
177
+ var key, _err$response, data, contentType, response;
178
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
179
+ while (1) switch (_context6.prev = _context6.next) {
180
+ case 0:
181
+ _context6.prev = 0;
182
+ _context6.next = 3;
183
+ return _solidLogic.store.fetcher.load(keyUrl);
184
+ case 3:
185
+ key = _solidLogic.store.any(webId, _solidLogic.store.sym(_signature.CERT + keyType));
186
+ return _context6.abrupt("return", key === null || key === void 0 ? void 0 : key.value);
187
+ case 7:
188
+ _context6.prev = 7;
189
+ _context6.t0 = _context6["catch"](0);
190
+ if (!((_context6.t0 === null || _context6.t0 === void 0 ? void 0 : (_err$response = _context6.t0.response) === null || _err$response === void 0 ? void 0 : _err$response.status) === 404)) {
191
+ _context6.next = 24;
192
+ break;
193
+ }
194
+ _context6.prev = 10;
195
+ // create resource
196
+ data = '';
197
+ contentType = 'text/turtle';
198
+ _context6.next = 15;
199
+ return _solidLogic.store.fetcher.webOperation('PUT', keyUrl, {
200
+ data: data,
201
+ contentType: contentType
202
+ });
203
+ case 15:
204
+ response = _context6.sent;
205
+ _context6.next = 22;
206
+ break;
207
+ case 18:
208
+ _context6.prev = 18;
209
+ _context6.t1 = _context6["catch"](10);
210
+ debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + _context6.t1);
211
+ throw _context6.t1;
212
+ case 22:
213
+ delete _solidLogic.store.fetcher.requested[keyUrl]; // delete cached 404 error
214
+ return _context6.abrupt("return", undefined);
215
+ case 24:
216
+ debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + _context6.t0);
217
+ throw _context6.t0;
218
+ case 26:
219
+ case "end":
220
+ return _context6.stop();
221
+ }
222
+ }, _callee6, null, [[0, 7], [10, 18]]);
223
+ }));
224
+ return _getKeyIfExists.apply(this, arguments);
225
+ }
226
+ //# sourceMappingURL=accessData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessData.js","names":["debug","_interopRequireWildcard","require","_signature","_solidLogic","ns","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getPodRoot","_ref","_asyncToGenerator2","_regenerator","mark","_callee","webId","_podRoot","webIdURL","storages","podRoot","path","_res$headers$get","res","wrap","_callee$","_context","prev","next","URL","uri","store","fetcher","load","each","space","doc","length","pathname","substring","lastIndexOf","sym","origin","webOperation","sent","headers","includes","value","abrupt","warn","concat","find","storage","stop","_x","apply","arguments","exports","pubKeyUrl","_ref2","_callee2","_callee2$","_context2","t0","t1","Error","_x2","getExistingPublicKey","_x3","_x4","_getExistingPublicKey","_callee4","publicKeyUrl","_callee4$","_context4","getKeyIfExists","privKeyUrl","_ref3","_callee3","_callee3$","_context3","_x5","getExistingPrivateKey","_x6","_x7","_getExistingPrivateKey","_callee5","privateKeyUrl","_callee5$","_context5","_x8","_x9","_x10","_getKeyIfExists","_callee6","keyUrl","keyType","_err$response","data","contentType","response","_callee6$","_context6","any","CERT","status","log","requested","undefined"],"sources":["../../../src/utils/keyHelpers/accessData.ts"],"sourcesContent":["import * as debug from '../../debug'\nimport { CERT } from '../../chat/signature'\nimport { store } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { NamedNode } from 'rdflib'\n\nexport const getPodRoot = async (webId: NamedNode) => {\n const webIdURL = new URL(webId.uri)\n // find storages in webId document\n await store.fetcher.load(webId.uri)\n const storages = store.each(webId, ns.space('storage'), null, webId.doc())\n var podRoot: NamedNode | undefined\n if (!storages?.length) {\n // find storage recursively in webId URL\n let path = webIdURL.pathname\n while (path.length) {\n path = path.substring(0, path.lastIndexOf('/'))\n podRoot = store.sym(webIdURL.origin + path + '/')\n const res = await store.fetcher.webOperation('HEAD', podRoot.uri)\n if (res.headers.get('link')?.includes(ns.space('Storage').value)) break\n if (!path) debug.warn(`Current user storage not found for\\n${webId}`)\n }\n } else {\n // give preference to storage in webId root\n podRoot = storages.find((storage) => webIdURL.origin === new URL(storage.value).origin) as NamedNode\n if (!podRoot) podRoot = storages[0] as NamedNode\n }\n return podRoot?.value\n}\n\nexport const pubKeyUrl = async (webId: NamedNode) => {\n try {\n return await getPodRoot(webId) + 'profile/keys/publicKey.ttl'\n } catch (err) { throw new Error(err) }\n}\n\nexport async function getExistingPublicKey (webId: NamedNode, publicKeyUrl: string) {\n // find publickey\n return await getKeyIfExists(webId, publicKeyUrl, 'PublicKey')\n}\n\nexport const privKeyUrl = async (webId: NamedNode) => {\n try {\n return await getPodRoot(webId) + 'profile/keys/privateKey.ttl'\n } catch (err) { throw new Error(err) }\n}\n\nexport async function getExistingPrivateKey (webId: NamedNode, privateKeyUrl: string) {\n // find privateKey\n return await getKeyIfExists(webId, privateKeyUrl, 'PrivateKey')\n}\n\ntype KeyType = 'PublicKey' | 'PrivateKey'\n\nexport async function getKeyIfExists (webId: NamedNode, keyUrl: string, keyType: KeyType) {\n try {\n await store.fetcher.load(keyUrl)\n const key = store.any(webId, store.sym(CERT + keyType))\n return key?.value // as NamedNode\n } catch (err) {\n if (err?.response?.status === 404) { // If PATCH on some server do not all create intermediate containers\n try {\n // create resource\n const data = ''\n const contentType = 'text/turtle'\n const response = await store.fetcher.webOperation('PUT', keyUrl, {\n data,\n contentType\n })\n } catch (err) {\n debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n throw err\n }\n delete store.fetcher.requested[keyUrl] // delete cached 404 error\n return undefined\n }\n debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n throw err\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA8B,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,G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QAAA;UAAA0E,SAAA,CAAA3E,IAAA;UAAA2E,SAAA,CAAAtC,EAAA,GAAAsC,SAAA;UAKdxH,KAAK,CAAC4H,GAAG,CAAC,gCAAgC,GAAGX,MAAM,GAAG,IAAI,GAAAO,SAAA,CAAAtC,EAAM,CAAC;UAAA,MAAAsC,SAAA,CAAAtC,EAAA;QAAA;UAGnE,OAAOjC,iBAAK,CAACC,OAAO,CAAC2E,SAAS,CAACZ,MAAM,CAAC,EAAC;UAAA,OAAAO,SAAA,CAAAtD,MAAA,WAChC4D,SAAS;QAAA;UAElB9H,KAAK,CAAC4H,GAAG,CAAC,gCAAgC,GAAGX,MAAM,GAAG,IAAI,GAAAO,SAAA,CAAAvC,EAAM,CAAC;UAAA,MAAAuC,SAAA,CAAAvC,EAAA;QAAA;QAAA;UAAA,OAAAuC,SAAA,CAAAjD,IAAA;MAAA;IAAA,GAAAyC,QAAA;EAAA,CAGpE;EAAA,OAAAD,eAAA,CAAAtC,KAAA,OAAAC,SAAA;AAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * set ACL
3
+ * @param keyDoc
4
+ * @param aclBody
5
+ */
6
+ export declare function setAcl(keyDoc: string, aclBody: string): Promise<void>;
7
+ /**
8
+ * key container ACL
9
+ * @param me
10
+ * @returns aclBody
11
+ */
12
+ export declare const keyContainerAclBody: (me: string) => string;
13
+ /**
14
+ * Read only ACL
15
+ * @param keyDoc
16
+ * @param me
17
+ * @returns aclBody
18
+ */
19
+ export declare const keyAclBody: (keyDoc: any, me: any) => string;
20
+ //# sourceMappingURL=acl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acl.d.ts","sourceRoot":"","sources":["../../../src/utils/keyHelpers/acl.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAsB,MAAM,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAsB5D;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,OAAQ,MAAM,WAe7C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kCAatB,CAAA"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.keyContainerAclBody = exports.keyAclBody = void 0;
9
+ exports.setAcl = setAcl;
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
+ var debug = _interopRequireWildcard(require("../../debug"));
13
+ var _solidLogic = require("solid-logic");
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ /**
17
+ * set ACL
18
+ * @param keyDoc
19
+ * @param aclBody
20
+ */
21
+ function setAcl(_x, _x2) {
22
+ return _setAcl.apply(this, arguments);
23
+ }
24
+ /**
25
+ * key container ACL
26
+ * @param me
27
+ * @returns aclBody
28
+ */
29
+ function _setAcl() {
30
+ _setAcl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(keyDoc, aclBody) {
31
+ var keyAclDoc, _err$response;
32
+ return _regenerator["default"].wrap(function _callee$(_context) {
33
+ while (1) switch (_context.prev = _context.next) {
34
+ case 0:
35
+ _context.next = 2;
36
+ return _solidLogic.store.fetcher.load(keyDoc);
37
+ case 2:
38
+ // FIXME: check the Why value on this quad:
39
+ debug.log(_solidLogic.store.statementsMatching(_solidLogic.store.sym(keyDoc), _solidLogic.store.sym('http://www.iana.org/assignments/link-relations/acl')));
40
+ keyAclDoc = _solidLogic.store.any(_solidLogic.store.sym(keyDoc), _solidLogic.store.sym('http://www.iana.org/assignments/link-relations/acl'));
41
+ if (keyAclDoc) {
42
+ _context.next = 6;
43
+ break;
44
+ }
45
+ throw new Error('Key ACL doc not found!');
46
+ case 6:
47
+ _context.prev = 6;
48
+ _context.next = 9;
49
+ return _solidLogic.store.fetcher.webOperation('PUT', keyAclDoc.value, {
50
+ data: aclBody,
51
+ contentType: 'text/turtle'
52
+ });
53
+ case 9:
54
+ _context.next = 16;
55
+ break;
56
+ case 11:
57
+ _context.prev = 11;
58
+ _context.t0 = _context["catch"](6);
59
+ if (!((_context.t0 === null || _context.t0 === void 0 ? void 0 : (_err$response = _context.t0.response) === null || _err$response === void 0 ? void 0 : _err$response.status) !== 404)) {
60
+ _context.next = 15;
61
+ break;
62
+ }
63
+ throw new Error(_context.t0);
64
+ case 15:
65
+ debug.log('delete ' + keyAclDoc.value + ' ' + _context.t0.response.status); // should test 404 and 2xx
66
+ case 16:
67
+ case "end":
68
+ return _context.stop();
69
+ }
70
+ }, _callee, null, [[6, 11]]);
71
+ }));
72
+ return _setAcl.apply(this, arguments);
73
+ }
74
+ var keyContainerAclBody = function keyContainerAclBody(me) {
75
+ var aclBody = "\n@prefix : <#>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <".concat(me, ">;\n acl:mode acl:Read, acl:Write.\n");
76
+ return aclBody;
77
+ };
78
+
79
+ /**
80
+ * Read only ACL
81
+ * @param keyDoc
82
+ * @param me
83
+ * @returns aclBody
84
+ */
85
+ exports.keyContainerAclBody = keyContainerAclBody;
86
+ var keyAclBody = function keyAclBody(keyDoc, me) {
87
+ var keyAgent = 'acl:agentClass foaf:Agent'; // publicKey
88
+ if (me !== null && me !== void 0 && me.length) keyAgent = "acl:agent <".concat(me, ">"); // privateKey
89
+ var aclBody = "\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#Read>\n a acl:Authorization;\n ".concat(keyAgent, ";\n acl:accessTo <").concat(keyDoc.split('/').pop(), ">;\n acl:mode acl:Read.\n");
90
+ return aclBody;
91
+ };
92
+ exports.keyAclBody = keyAclBody;
93
+ //# sourceMappingURL=acl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acl.js","names":["debug","_interopRequireWildcard","require","_solidLogic","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","setAcl","_x","_x2","_setAcl","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","keyDoc","aclBody","keyAclDoc","_err$response","wrap","_callee$","_context","prev","next","store","fetcher","load","log","statementsMatching","sym","any","Error","webOperation","value","data","contentType","t0","response","status","stop","keyContainerAclBody","me","concat","exports","keyAclBody","keyAgent","length","split","pop"],"sources":["../../../src/utils/keyHelpers/acl.ts"],"sourcesContent":["import * as debug from '../../debug'\nimport { store } from 'solid-logic'\n\n/**\n * set ACL\n * @param keyDoc\n * @param aclBody\n */\nexport async function setAcl (keyDoc: string, aclBody: string) {\n // Some servers don't present a Link http response header\n // if the container doesn't exist yet, refetch the resource\n\n await store.fetcher.load(keyDoc)\n\n // FIXME: check the Why value on this quad:\n debug.log(store.statementsMatching(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl')))\n const keyAclDoc = store.any(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl'))\n if (!keyAclDoc) {\n throw new Error('Key ACL doc not found!')\n }\n\n try {\n await store.fetcher.webOperation('PUT', keyAclDoc.value, {\n data: aclBody,\n contentType: 'text/turtle'\n })\n } catch (err) {\n if (err?.response?.status !== 404) { throw new Error(err) }\n debug.log('delete ' + keyAclDoc.value + ' ' + err.response.status) // should test 404 and 2xx\n }\n}\n\n/**\n * key container ACL\n * @param me\n * @returns aclBody\n */\nexport const keyContainerAclBody = (me: string) => {\n const aclBody = `\n@prefix : <#>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <${me}>;\n acl:mode acl:Read, acl:Write.\n`\n return aclBody\n}\n\n/**\n * Read only ACL\n * @param keyDoc\n * @param me\n * @returns aclBody\n */\nexport const keyAclBody = (keyDoc, me) => {\n let keyAgent = 'acl:agentClass foaf:Agent' // publicKey\n if (me?.length) keyAgent = `acl:agent <${me}>` // privateKey\n const aclBody = `\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#Read>\n a acl:Authorization;\n ${keyAgent};\n acl:accessTo <${keyDoc.split('/').pop()}>;\n acl:mode acl:Read.\n`\n return aclBody\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAmC,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iB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AAAE,IAAA;YAAA;UAAA;UAAA,MAAU,IAAIQ,KAAK,CAAAV,QAAA,CAAAe,EAAA,CAAK;QAAA;UACzDzD,KAAK,CAACgD,GAAG,CAAC,SAAS,GAAGV,SAAS,CAACgB,KAAK,GAAG,GAAG,GAAGZ,QAAA,CAAAe,EAAA,CAAIC,QAAQ,CAACC,MAAM,CAAC,EAAC;QAAA;QAAA;UAAA,OAAAjB,QAAA,CAAAkB,IAAA;MAAA;IAAA,GAAAzB,OAAA;EAAA,CAEtE;EAAA,OAAAN,OAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAOM,IAAM8B,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,EAAU,EAAK;EACjD,IAAMzB,OAAO,+OAAA0B,MAAA,CAUED,EAAE,4CAElB;EACC,OAAOzB,OAAO;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA2B,OAAA,CAAAH,mBAAA,GAAAA,mBAAA;AAMO,IAAMI,UAAU,GAAG,SAAbA,UAAUA,CAAI7B,MAAM,EAAE0B,EAAE,EAAK;EACxC,IAAII,QAAQ,GAAG,2BAA2B,EAAC;EAC3C,IAAIJ,EAAE,aAAFA,EAAE,eAAFA,EAAE,CAAEK,MAAM,EAAED,QAAQ,iBAAAH,MAAA,CAAiBD,EAAE,MAAG,EAAC;EAC/C,IAAMzB,OAAO,4IAAA0B,MAAA,CAKTG,QAAQ,2BAAAH,MAAA,CACM3B,MAAM,CAACgC,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE,iCAE1C;EACC,OAAOhC,OAAO;AAChB,CAAC;AAAA2B,OAAA,CAAAC,UAAA,GAAAA,UAAA"}
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.versionInfo = void 0;
7
7
  var versionInfo = {
8
- buildTime: '2023-03-27T19:39:58Z',
9
- commit: '80358ddf87cf952a93491b7966eba27ddf4762ba',
8
+ buildTime: '2023-05-17T23:36:40Z',
9
+ commit: '85020be3e8bc3efbb001f01ed574ec3955ba6e80',
10
10
  npmInfo: {
11
11
  'solid-ui': '2.4.27',
12
12
  npm: '8.19.4',
13
- node: '16.19.1',
14
- v8: '9.4.146.26-node.24',
13
+ node: '16.20.0',
14
+ v8: '9.4.146.26-node.26',
15
15
  uv: '1.43.0',
16
16
  zlib: '1.2.11',
17
17
  brotli: '1.0.9',
18
- ares: '1.18.1',
18
+ ares: '1.19.0',
19
19
  modules: '93',
20
20
  nghttp2: '1.47.0',
21
21
  napi: '8',
@@ -1 +1 @@
1
- {"version":3,"file":"versionInfo.js","names":["versionInfo","buildTime","commit","npmInfo","npm","node","v8","uv","zlib","brotli","ares","modules","nghttp2","napi","llhttp","openssl","cldr","icu","tz","unicode","ngtcp2","nghttp3","exports"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export const versionInfo = {\n buildTime: '2023-03-27T19:39:58Z',\n commit: '80358ddf87cf952a93491b7966eba27ddf4762ba',\n npmInfo:\n{\n 'solid-ui': '2.4.27',\n npm: '8.19.4',\n node: '16.19.1',\n v8: '9.4.146.26-node.24',\n uv: '1.43.0',\n zlib: '1.2.11',\n brotli: '1.0.9',\n ares: '1.18.1',\n modules: '93',\n nghttp2: '1.47.0',\n napi: '8',\n llhttp: '6.0.10',\n openssl: '1.1.1t+quic',\n cldr: '41.0',\n icu: '71.1',\n tz: '2022f',\n unicode: '14.0',\n ngtcp2: '0.8.1',\n nghttp3: '0.7.0'\n}\n}\n"],"mappings":";;;;;;AAAO,IAAMA,WAAW,GAAG;EACzBC,SAAS,EAAE,sBAAsB;EACjCC,MAAM,EAAE,0CAA0C;EAClDC,OAAO,EACT;IACE,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAE,SAAS;IACfC,EAAE,EAAE,oBAAoB;IACxBC,EAAE,EAAE,QAAQ;IACZC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,OAAO;IACfC,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAE,IAAI;IACbC,OAAO,EAAE,QAAQ;IACjBC,IAAI,EAAE,GAAG;IACTC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE,aAAa;IACtBC,IAAI,EAAE,MAAM;IACZC,GAAG,EAAE,MAAM;IACXC,EAAE,EAAE,OAAO;IACXC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE;EACX;AACA,CAAC;AAAAC,OAAA,CAAAtB,WAAA,GAAAA,WAAA"}
1
+ {"version":3,"file":"versionInfo.js","names":["versionInfo","buildTime","commit","npmInfo","npm","node","v8","uv","zlib","brotli","ares","modules","nghttp2","napi","llhttp","openssl","cldr","icu","tz","unicode","ngtcp2","nghttp3","exports"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export const versionInfo = {\n buildTime: '2023-05-17T23:36:40Z',\n commit: '85020be3e8bc3efbb001f01ed574ec3955ba6e80',\n npmInfo:\n{\n 'solid-ui': '2.4.27',\n npm: '8.19.4',\n node: '16.20.0',\n v8: '9.4.146.26-node.26',\n uv: '1.43.0',\n zlib: '1.2.11',\n brotli: '1.0.9',\n ares: '1.19.0',\n modules: '93',\n nghttp2: '1.47.0',\n napi: '8',\n llhttp: '6.0.10',\n openssl: '1.1.1t+quic',\n cldr: '41.0',\n icu: '71.1',\n tz: '2022f',\n unicode: '14.0',\n ngtcp2: '0.8.1',\n nghttp3: '0.7.0'\n}\n}\n"],"mappings":";;;;;;AAAO,IAAMA,WAAW,GAAG;EACzBC,SAAS,EAAE,sBAAsB;EACjCC,MAAM,EAAE,0CAA0C;EAClDC,OAAO,EACT;IACE,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE,QAAQ;IACbC,IAAI,EAAE,SAAS;IACfC,EAAE,EAAE,oBAAoB;IACxBC,EAAE,EAAE,QAAQ;IACZC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,OAAO;IACfC,IAAI,EAAE,QAAQ;IACdC,OAAO,EAAE,IAAI;IACbC,OAAO,EAAE,QAAQ;IACjBC,IAAI,EAAE,GAAG;IACTC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE,aAAa;IACtBC,IAAI,EAAE,MAAM;IACZC,GAAG,EAAE,MAAM;IACXC,EAAE,EAAE,OAAO;IACXC,OAAO,EAAE,MAAM;IACfC,MAAM,EAAE,OAAO;IACfC,OAAO,EAAE;EACX;AACA,CAAC;AAAAC,OAAA,CAAAtB,WAAA,GAAAA,WAAA"}