@mindful-web/marko-web-identity-x 1.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/.eslintignore +1 -0
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/api/fragment-types.json +1 -0
- package/api/fragments/active-user.js +108 -0
- package/api/mutations/add-external-user-id.js +24 -0
- package/api/mutations/create-app-user.js +11 -0
- package/api/mutations/delete-app-user-for-current-application.js +7 -0
- package/api/mutations/impersonate-app-user.js +12 -0
- package/api/mutations/logout-app-user.js +11 -0
- package/api/mutations/send-change-email-link.js +7 -0
- package/api/mutations/send-login-link.js +7 -0
- package/api/mutations/set-custom-attributes.js +15 -0
- package/api/queries/check-content-access.js +19 -0
- package/api/queries/get-active-context.js +45 -0
- package/api/queries/load-user-by-external-id.js +14 -0
- package/api/queries/load-user-by-id.js +11 -0
- package/api/queries/load-user.js +11 -0
- package/browser/.eslintrc.js +11 -0
- package/browser/access.vue +377 -0
- package/browser/authenticate.vue +278 -0
- package/browser/change-email-confirm.vue +120 -0
- package/browser/change-email-init.vue +179 -0
- package/browser/comments/create.vue +107 -0
- package/browser/comments/post.vue +151 -0
- package/browser/comments/stream.vue +319 -0
- package/browser/custom-column.vue +314 -0
- package/browser/dayjs.js +6 -0
- package/browser/download-related.vue +120 -0
- package/browser/download.vue +380 -0
- package/browser/errors/authentication.js +7 -0
- package/browser/errors/feature.js +7 -0
- package/browser/errors/form.js +7 -0
- package/browser/errors/logout.js +7 -0
- package/browser/form/address-block.vue +131 -0
- package/browser/form/common/checkbox-group.vue +140 -0
- package/browser/form/common/form-group.vue +24 -0
- package/browser/form/common/form-label.vue +17 -0
- package/browser/form/consent.vue +121 -0
- package/browser/form/fields/address-extra.vue +68 -0
- package/browser/form/fields/city.vue +68 -0
- package/browser/form/fields/comment-body.vue +63 -0
- package/browser/form/fields/country.vue +94 -0
- package/browser/form/fields/custom-boolean.vue +58 -0
- package/browser/form/fields/custom-select-group.vue +25 -0
- package/browser/form/fields/custom-select-multiple.vue +97 -0
- package/browser/form/fields/custom-select-write-in-inline.vue +39 -0
- package/browser/form/fields/custom-select-write-in.vue +66 -0
- package/browser/form/fields/custom-select.vue +191 -0
- package/browser/form/fields/custom-text.vue +62 -0
- package/browser/form/fields/display-name.vue +64 -0
- package/browser/form/fields/email.vue +62 -0
- package/browser/form/fields/family-name.vue +68 -0
- package/browser/form/fields/given-name.vue +68 -0
- package/browser/form/fields/organization-title.vue +68 -0
- package/browser/form/fields/organization.vue +68 -0
- package/browser/form/fields/phone-number.vue +68 -0
- package/browser/form/fields/postal-code.vue +68 -0
- package/browser/form/fields/receive-email.vue +58 -0
- package/browser/form/fields/region.vue +106 -0
- package/browser/form/fields/regional-policy.vue +59 -0
- package/browser/form/fields/street.vue +68 -0
- package/browser/graphql/create-client.js +65 -0
- package/browser/graphql/parse.js +1 -0
- package/browser/graphql/queries/download-related-content.js +38 -0
- package/browser/index.js +110 -0
- package/browser/login-fields.vue +214 -0
- package/browser/login.vue +331 -0
- package/browser/logout.vue +68 -0
- package/browser/mixins/global-auto-signup-event-emitter.js +18 -0
- package/browser/mixins/global-event-emitter.js +28 -0
- package/browser/profile.vue +688 -0
- package/browser/service.js +32 -0
- package/browser/utils/clean-path.js +1 -0
- package/browser/utils/cookies-enabled.js +10 -0
- package/browser/utils/get-as-array.js +6 -0
- package/browser/utils/get-referring-page.js +7 -0
- package/browser/utils/get.js +8 -0
- package/browser/utils/post.js +10 -0
- package/browser/utils/redirect.js +7 -0
- package/browser/utils/region-country-codes.js +1 -0
- package/components/access.marko +24 -0
- package/components/access.marko.js +61 -0
- package/components/comment-stream.marko +31 -0
- package/components/comment-stream.marko.js +71 -0
- package/components/context.marko +15 -0
- package/components/context.marko.js +52 -0
- package/components/form-access.marko +60 -0
- package/components/form-access.marko.js +111 -0
- package/components/form-authenticate.marko +32 -0
- package/components/form-authenticate.marko.js +73 -0
- package/components/form-change-email.marko +27 -0
- package/components/form-change-email.marko.js +68 -0
- package/components/form-login.marko +32 -0
- package/components/form-login.marko.js +72 -0
- package/components/form-logout.marko +7 -0
- package/components/form-logout.marko.js +36 -0
- package/components/form-profile.marko +38 -0
- package/components/form-profile.marko.js +78 -0
- package/components/form-register.marko +2 -0
- package/components/form-register.marko.js +32 -0
- package/components/identify.marko +17 -0
- package/components/identify.marko.js +59 -0
- package/components/marko.json +90 -0
- package/components/non-auth-identify.marko +15 -0
- package/components/non-auth-identify.marko.js +53 -0
- package/config.js +161 -0
- package/hooks.js +20 -0
- package/index.js +30 -0
- package/marko.json +6 -0
- package/middleware/content-access-state.js +31 -0
- package/middleware/content-download-state.js +27 -0
- package/middleware.js +32 -0
- package/package.json +40 -0
- package/routes/access.js +29 -0
- package/routes/authenticate.js +58 -0
- package/routes/change-email-confirm.js +60 -0
- package/routes/change-email-init.js +16 -0
- package/routes/comment-count.js +19 -0
- package/routes/comments.js +43 -0
- package/routes/countries.js +19 -0
- package/routes/create-comment.js +25 -0
- package/routes/download.js +29 -0
- package/routes/flag-comment.js +21 -0
- package/routes/index.js +40 -0
- package/routes/login-fields.js +35 -0
- package/routes/login.js +95 -0
- package/routes/logout.js +19 -0
- package/routes/profile.js +183 -0
- package/routes/regions.js +22 -0
- package/service.js +483 -0
- package/utils/call-hooks-for.js +28 -0
- package/utils/context-cookie.js +30 -0
- package/utils/create-client.js +48 -0
- package/utils/create-identity-builder.js +33 -0
- package/utils/get-as-array.js +6 -0
- package/utils/json-error-handler.js +41 -0
- package/utils/token-cookie.js +30 -0
package/.eslintignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*.marko.js
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Parameter1 LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# Mindful Web Marko Wrapper for IdentityX
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
1. Include `@mindful-web/marko-web-identity-x` as a project/website dependency.
|
|
6
|
+
|
|
7
|
+
2. Include IdentityX tenant configuration within your site
|
|
8
|
+
```js
|
|
9
|
+
// your-site/config/identity-x.js
|
|
10
|
+
const IdentityX = require('@mindful-web/marko-web-identity-x/config');
|
|
11
|
+
|
|
12
|
+
const config = new IdentityX({
|
|
13
|
+
appId: '<MY-APPLICATION-ID>',
|
|
14
|
+
});
|
|
15
|
+
module.exports = config;
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
3. Create an IdentityX router to load the IdentityX middleware.
|
|
19
|
+
```js
|
|
20
|
+
// your-site/server/routes/identity-x.js
|
|
21
|
+
const IdentityX = require('@mindful-web/marko-web-identity-x');
|
|
22
|
+
const config = require('../../config/identity-x');
|
|
23
|
+
const authenticate = require('../templates/user/authenticate');
|
|
24
|
+
const login = require('../templates/user/login');
|
|
25
|
+
const logout = require('../templates/user/logout');
|
|
26
|
+
const register = require('../templates/user/register');
|
|
27
|
+
const profile = require('../templates/user/profile');
|
|
28
|
+
|
|
29
|
+
module.exports = (app) => {
|
|
30
|
+
IdentityX(app, config);
|
|
31
|
+
|
|
32
|
+
app.get(config.getEndpointFor('authenticate'), (req, res) => {
|
|
33
|
+
res.marko(authenticate);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
app.get(config.getEndpointFor('login'), (req, res) => {
|
|
37
|
+
res.marko(login);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
app.get(config.getEndpointFor('logout'), (req, res) => {
|
|
41
|
+
res.marko(logout);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
app.get(config.getEndpointFor('register'), (req, res) => {
|
|
45
|
+
res.marko(register);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
app.get(config.getEndpointFor('profile'), (req, res) => {
|
|
49
|
+
res.marko(profile);
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
4. Include the IdentityX router **before all other routes!**
|
|
55
|
+
```js
|
|
56
|
+
// your-site/server/routes/index.js
|
|
57
|
+
const IdentityX = require('./identity-x');
|
|
58
|
+
|
|
59
|
+
module.exports = (app) => {
|
|
60
|
+
IdentityX(app);
|
|
61
|
+
// ...
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
5. Create `login`, `logout`, `authenticate`, `register` and `profile` templates. These templates must include the relevant `<marko-web-identity-x-form-...>` component.
|
|
66
|
+
```marko
|
|
67
|
+
<marko-web-default-page-layout>
|
|
68
|
+
<@page>
|
|
69
|
+
<marko-web-identity-x-form-authenticate />
|
|
70
|
+
</@page>
|
|
71
|
+
</marko-web-default-page-layout>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
5. Include the Browser plugin.
|
|
75
|
+
```js
|
|
76
|
+
// your-site/browser/index.js
|
|
77
|
+
import IdentityX from '@mindful-web/marko-web-identity-x/browser';
|
|
78
|
+
|
|
79
|
+
IdentityX(Browser);
|
|
80
|
+
// ...
|
|
81
|
+
|
|
82
|
+
export default Browser;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Usage
|
|
86
|
+
|
|
87
|
+
Include the `<marko-web-identity-x-form-authenticate>` component in the template where users land after authenticating (/user/authenticate).
|
|
88
|
+
|
|
89
|
+
Include the `<marko-web-identity-x-form-login>` component to display the login form.
|
|
90
|
+
|
|
91
|
+
Include the `<marko-web-identity-x-form-register>` component to display the register form.
|
|
92
|
+
|
|
93
|
+
Include the `<marko-web-identity-x-form-logout>` component to display the logout form.
|
|
94
|
+
|
|
95
|
+
Include the `<marko-web-identity-x-form-profile>` component to display the user profile form.
|
|
96
|
+
|
|
97
|
+
Include the `<marko-web-identity-x-context>` component where you'd like access to IdentityX context.
|
|
98
|
+
```marko
|
|
99
|
+
<!-- your-site/server/templates/some-page.marko -->
|
|
100
|
+
<marko-web-identity-x-context|{ user, hasUser }|>
|
|
101
|
+
<if(hasUser)>
|
|
102
|
+
<h1>Hello ${user.givenName}!</h1>
|
|
103
|
+
</if>
|
|
104
|
+
</marko-web-identity-x-context>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Include the `<marko-web-identity-x-access>` component where you'd like to ensure access levels are met:
|
|
108
|
+
```marko
|
|
109
|
+
<!-- your-site/server/templates/content/index.marko -->
|
|
110
|
+
$ const { isRequired, accessLevels } = getAsObject(content, 'userRegistration');
|
|
111
|
+
<marko-web-identity-x-access|context|
|
|
112
|
+
enabled=isRequired
|
|
113
|
+
required-access-level-ids=accessLevels
|
|
114
|
+
>
|
|
115
|
+
$ const {
|
|
116
|
+
canAccess,
|
|
117
|
+
isLoggedIn,
|
|
118
|
+
requiresAccessLevel,
|
|
119
|
+
hasRequiredAccessLevel,
|
|
120
|
+
messages,
|
|
121
|
+
} = context;
|
|
122
|
+
<if(!canAccess)>
|
|
123
|
+
<if(isLoggedIn && !hasRequiredAccessLevel)>
|
|
124
|
+
$!{messages.loggedInNoAccess}
|
|
125
|
+
</if>
|
|
126
|
+
<else-if(!isLoggedIn && requiresAccessLevel)>
|
|
127
|
+
$!{messages.loggedOutNoAccess}
|
|
128
|
+
</else-if>
|
|
129
|
+
<else-if(!isLoggedIn)>
|
|
130
|
+
<h5>You must be logged-in to access this content.</h5>
|
|
131
|
+
<cms-browser-component name="IdentitySignInForm" />
|
|
132
|
+
</else-if>
|
|
133
|
+
</if>
|
|
134
|
+
<else>
|
|
135
|
+
<p>This is secret content only some can see!</p>
|
|
136
|
+
</else>
|
|
137
|
+
</marko-web-identity-x-access>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Customization
|
|
141
|
+
|
|
142
|
+
You can change the default IdentityX Vue components by passing them to the component loader in your site's browser config:
|
|
143
|
+
```diff
|
|
144
|
+
import IdentityX from '@mindful-web/marko-web-identity-x/browser';
|
|
145
|
+
+ import MyLoginComponent from './my-login-component.vue';
|
|
146
|
+
|
|
147
|
+
-IdentityX(Browser);
|
|
148
|
+
+IdentityX(Browser, {
|
|
149
|
+
+ CustomLoginComponent: MyLoginComponent,
|
|
150
|
+
+});
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Vue Event emission
|
|
154
|
+
|
|
155
|
+
This package emits the following events via the EventBus/global Vue root. Each payload will be an
|
|
156
|
+
object and will include a `label` field tied to the `eventLabel` prop of the emitting component.
|
|
157
|
+
Each payload _may_ include additional data, as relevant.
|
|
158
|
+
|
|
159
|
+
All components support passing an object of `additionalEventData`, which when present will append
|
|
160
|
+
data both to the submission (for backend hook handling) and to the emitted event payload.
|
|
161
|
+
### Submission events
|
|
162
|
+
|
|
163
|
+
| Event name | Event payload | Details |
|
|
164
|
+
| - | - | - |
|
|
165
|
+
| `identity-x-login-link-sent` | `{ label, ...additionalEventData }` | Fires when a user submits their email to start the login handshake.
|
|
166
|
+
| `identity-x-authenticated` | `{ label, ...additionalEventData, mustReVerifyProfile, isProfileComplete, requiresCustomFieldAnswers }` | Fires when a user has completed the login handshake and is now fully authenticated.
|
|
167
|
+
| `identity-x-logout` | `{ label, ...additionalEventData }` | Fires when a user has logged out successfully.
|
|
168
|
+
| `identity-x-profile-updated` | `{ label, ...additionalEventData }` | Fires when a user has submitted an update to their profile/fields.
|
|
169
|
+
| `identity-x-comment-post-submitted` | `{ label, ...additionalEventData }` | Fires when a user posts a comment to a comment stream
|
|
170
|
+
| `identity-x-comment-report-submitted` | `{ label, ...additionalEventData, id }` | Fires when a user reports a comment on a comment stream
|
|
171
|
+
| `identity-x-comment-stream-login-link-sent` | `{ label, ...additionalEventData }` | Fires when a user starts login from a comment stream
|
|
172
|
+
|
|
173
|
+
### View events
|
|
174
|
+
|
|
175
|
+
Each component will emit an event when the component is displayed.
|
|
176
|
+
|
|
177
|
+
| Event name | Event payload | Details |
|
|
178
|
+
| - | - | - |
|
|
179
|
+
| `identity-x-authenticate-displayed` | `{ label, ...additionalEventData }`
|
|
180
|
+
| `identity-x-login-displayed` | `{ label, ...additionalEventData }`
|
|
181
|
+
| `identity-x-logout-displayed` | `{ label, ...additionalEventData }`
|
|
182
|
+
| `identity-x-profile-displayed` | `{ label, ...additionalEventData }`
|
|
183
|
+
| `identity-x-comment-stream-displayed` | `{ label, ...additionalEventData }`
|
|
184
|
+
| `identity-x-comment-stream-loaded` | `{ label, ...additionalEventData }`
|
|
185
|
+
| `identity-x-comment-stream-loaded-more` | `{ label, ...additionalEventData }`
|
|
186
|
+
|
|
187
|
+
### Error events
|
|
188
|
+
|
|
189
|
+
Each component will emit an event when an error is encountered and include the error message as the
|
|
190
|
+
`message` attribute of the emitted payload.
|
|
191
|
+
|
|
192
|
+
| Event name | Event payload |
|
|
193
|
+
| - | - |
|
|
194
|
+
| `identity-x-authenticate-errored` | `{ label, message: '...', ...additionalEventData }`
|
|
195
|
+
| `identity-x-login-errored` | `{ label, message: '...', ...additionalEventData }`
|
|
196
|
+
| `identity-x-logout-errored` | `{ label, message: '...', ...additionalEventData }`
|
|
197
|
+
| `identity-x-profile-errored` | `{ label, message: '...', ...additionalEventData }`
|
|
198
|
+
| `identity-x-comment-post-errored` | `{ label, message: '...', ...additionalEventData }`
|
|
199
|
+
| `identity-x-comment-report-errored` | `{ label, message: '...', ...additionalEventData }`
|
|
200
|
+
| `identity-x-comment-stream-errored` | `{ label, message: '...', ...additionalEventData }`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"__schema":{"types":[{"kind":"INTERFACE","name":"FieldInterface","possibleTypes":[{"name":"SelectField"},{"name":"BooleanField"}]}]}}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
|
|
3
|
+
module.exports = gql`
|
|
4
|
+
|
|
5
|
+
fragment ActiveUserFragment on AppUser {
|
|
6
|
+
id
|
|
7
|
+
email
|
|
8
|
+
verified
|
|
9
|
+
verifiedCount
|
|
10
|
+
givenName
|
|
11
|
+
familyName
|
|
12
|
+
displayName
|
|
13
|
+
organization
|
|
14
|
+
organizationTitle
|
|
15
|
+
lastLoggedIn
|
|
16
|
+
countryCode
|
|
17
|
+
regionCode
|
|
18
|
+
postalCode
|
|
19
|
+
city
|
|
20
|
+
street
|
|
21
|
+
addressExtra
|
|
22
|
+
mobileNumber
|
|
23
|
+
phoneNumber
|
|
24
|
+
receiveEmail
|
|
25
|
+
mustReVerifyProfile
|
|
26
|
+
externalIds {
|
|
27
|
+
id
|
|
28
|
+
identifier { value type }
|
|
29
|
+
namespace { provider tenant type }
|
|
30
|
+
}
|
|
31
|
+
regionalConsentAnswers { id given date }
|
|
32
|
+
customAttributes
|
|
33
|
+
customBooleanFieldAnswers(input: {
|
|
34
|
+
onlyActive: true
|
|
35
|
+
sort: { field: createdAt, order: asc }
|
|
36
|
+
}) {
|
|
37
|
+
id
|
|
38
|
+
hasAnswered
|
|
39
|
+
answer
|
|
40
|
+
value
|
|
41
|
+
field {
|
|
42
|
+
id
|
|
43
|
+
label
|
|
44
|
+
active
|
|
45
|
+
required
|
|
46
|
+
externalId {
|
|
47
|
+
id
|
|
48
|
+
namespace { provider tenant type }
|
|
49
|
+
identifier { value type }
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
customSelectFieldAnswers(input: {
|
|
54
|
+
onlyActive: true
|
|
55
|
+
sort: { field: createdAt, order: asc }
|
|
56
|
+
}) {
|
|
57
|
+
id
|
|
58
|
+
hasAnswered
|
|
59
|
+
answers { id label externalIdentifier writeInValue }
|
|
60
|
+
field {
|
|
61
|
+
id
|
|
62
|
+
label
|
|
63
|
+
active
|
|
64
|
+
multiple
|
|
65
|
+
required
|
|
66
|
+
externalId {
|
|
67
|
+
id
|
|
68
|
+
namespace { provider tenant type }
|
|
69
|
+
identifier { value type }
|
|
70
|
+
}
|
|
71
|
+
options: choices {
|
|
72
|
+
id
|
|
73
|
+
label
|
|
74
|
+
... on SelectFieldOption {
|
|
75
|
+
canWriteIn
|
|
76
|
+
}
|
|
77
|
+
... on SelectFieldOptionGroup {
|
|
78
|
+
options {
|
|
79
|
+
id
|
|
80
|
+
label
|
|
81
|
+
canWriteIn
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
customTextFieldAnswers(input: {
|
|
88
|
+
onlyActive: true
|
|
89
|
+
sort: { field: createdAt, order: asc }
|
|
90
|
+
}) {
|
|
91
|
+
id
|
|
92
|
+
hasAnswered
|
|
93
|
+
value
|
|
94
|
+
field {
|
|
95
|
+
id
|
|
96
|
+
label
|
|
97
|
+
active
|
|
98
|
+
required
|
|
99
|
+
externalId {
|
|
100
|
+
id
|
|
101
|
+
namespace { provider tenant type }
|
|
102
|
+
identifier { value type }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
|
|
3
|
+
module.exports = gql`
|
|
4
|
+
|
|
5
|
+
mutation AddExternalUserId($input: SetAppUserExternalIdMutationInput!) {
|
|
6
|
+
addAppUserExternalId(input: $input) {
|
|
7
|
+
id
|
|
8
|
+
email
|
|
9
|
+
externalIds {
|
|
10
|
+
id
|
|
11
|
+
identifier {
|
|
12
|
+
value
|
|
13
|
+
type
|
|
14
|
+
}
|
|
15
|
+
namespace {
|
|
16
|
+
provider
|
|
17
|
+
tenant
|
|
18
|
+
type
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
const userFragment = require('../fragments/active-user');
|
|
3
|
+
|
|
4
|
+
module.exports = gql`
|
|
5
|
+
mutation LoginCreateAppUser($email: String!) {
|
|
6
|
+
createAppUser(input: { email: $email }) {
|
|
7
|
+
...ActiveUserFragment
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
${userFragment}
|
|
11
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
const userFragment = require('../fragments/active-user');
|
|
3
|
+
|
|
4
|
+
module.exports = gql`
|
|
5
|
+
mutation LogoutAppUser($input: LogoutAppUserWithDataMutationInput!) {
|
|
6
|
+
logoutAppUserWithData(input: $input) {
|
|
7
|
+
...ActiveUserFragment
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
${userFragment}
|
|
11
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
const userFragment = require('../fragments/active-user');
|
|
3
|
+
|
|
4
|
+
module.exports = gql`
|
|
5
|
+
mutation UpdateOwnAppUserCustomAttributes($input: UpdateOwnAppUserCustomAttributesMutationInput!) {
|
|
6
|
+
updateOwnAppUserCustomAttributes(input: $input) {
|
|
7
|
+
id
|
|
8
|
+
customAttributes
|
|
9
|
+
...ActiveUserFragment
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
${userFragment}
|
|
14
|
+
|
|
15
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
|
|
3
|
+
module.exports = gql`
|
|
4
|
+
|
|
5
|
+
query CheckContentAccess($input: CheckContentAccessQueryInput!) {
|
|
6
|
+
checkContentAccess(input: $input) {
|
|
7
|
+
canAccess
|
|
8
|
+
isLoggedIn
|
|
9
|
+
hasRequiredAccessLevel
|
|
10
|
+
requiresAccessLevel
|
|
11
|
+
requiredAccessLevels {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
}
|
|
15
|
+
messages
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
`;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
const userFragment = require('../fragments/active-user');
|
|
3
|
+
|
|
4
|
+
module.exports = gql`
|
|
5
|
+
|
|
6
|
+
query GetActiveAppContext {
|
|
7
|
+
activeAppContext {
|
|
8
|
+
application {
|
|
9
|
+
id
|
|
10
|
+
name
|
|
11
|
+
organization {
|
|
12
|
+
id
|
|
13
|
+
name
|
|
14
|
+
consentPolicy
|
|
15
|
+
emailConsentRequest
|
|
16
|
+
regionalConsentPolicies(input: { status: enabled }) {
|
|
17
|
+
id
|
|
18
|
+
message
|
|
19
|
+
countries {
|
|
20
|
+
id
|
|
21
|
+
}
|
|
22
|
+
required
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
user {
|
|
27
|
+
...ActiveUserFragment
|
|
28
|
+
}
|
|
29
|
+
mergedTeams {
|
|
30
|
+
id
|
|
31
|
+
name
|
|
32
|
+
photoURL
|
|
33
|
+
}
|
|
34
|
+
mergedAccessLevels {
|
|
35
|
+
id
|
|
36
|
+
name
|
|
37
|
+
}
|
|
38
|
+
hasTeams
|
|
39
|
+
hasUser
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${userFragment}
|
|
44
|
+
|
|
45
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
const userFragment = require('../fragments/active-user');
|
|
3
|
+
|
|
4
|
+
module.exports = gql`
|
|
5
|
+
query LoadUserByExternalId(
|
|
6
|
+
$identifier: AppUserExternalIdentifierInput!,
|
|
7
|
+
$namespace: AppUserExternalNamespaceInput!
|
|
8
|
+
) {
|
|
9
|
+
appUserByExternalId(input: { identifier: $identifier, namespace: $namespace }) {
|
|
10
|
+
...ActiveUserFragment
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
${userFragment}
|
|
14
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const gql = require('graphql-tag');
|
|
2
|
+
const userFragment = require('../fragments/active-user');
|
|
3
|
+
|
|
4
|
+
module.exports = gql`
|
|
5
|
+
query LoadUserByEmail($email: String!) {
|
|
6
|
+
appUser(input: { email: $email }) {
|
|
7
|
+
...ActiveUserFragment
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
${userFragment}
|
|
11
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const root = require('../../../eslintrc.browser');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
...root,
|
|
5
|
+
rules: {
|
|
6
|
+
...root.rules,
|
|
7
|
+
'vue/no-v-html': 'off',
|
|
8
|
+
// @todo this should NOT stay on, only added because some form fields were handled wrong
|
|
9
|
+
'vue/no-mutating-props': 'off',
|
|
10
|
+
},
|
|
11
|
+
};
|