@vocollege/app 0.0.149 → 0.0.151

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/dist/global.d.ts CHANGED
@@ -1,39 +1,39 @@
1
- export declare type AuthStorageConfigType = {
1
+ export type AuthStorageConfigType = {
2
2
  STATE: string;
3
3
  VERIFIER: string;
4
4
  REFRESH_TOKEN: string;
5
5
  ACCESS_TOKEN: string;
6
6
  TOKEN_TYPE: string;
7
7
  };
8
- export declare type AuthConfigType = {
8
+ export type AuthConfigType = {
9
9
  BASE_URL: string;
10
10
  CLIENT_ID?: string;
11
11
  LOGIN?: string;
12
12
  ENDPOINT?: string;
13
13
  STORAGE?: AuthStorageConfigType;
14
14
  };
15
- export declare type ApiConfigType = {
15
+ export type ApiConfigType = {
16
16
  BASE_URL: string;
17
17
  ENDPOINT?: string;
18
18
  GRAPHQL?: string;
19
19
  };
20
- export declare type AppConfigType = {
20
+ export type AppConfigType = {
21
21
  BASE_URL: string;
22
22
  AUTH?: string;
23
23
  HOME?: string;
24
24
  LOGIN?: string;
25
25
  };
26
- export declare type VoAppType = {
26
+ export type VoAppType = {
27
27
  configure: Function;
28
28
  config?: Function;
29
29
  auth: any;
30
30
  api: any;
31
31
  };
32
- export declare type VoTokenType = {
32
+ export type VoTokenType = {
33
33
  access_token: string;
34
34
  refresh_token: string;
35
35
  };
36
36
  export interface GeneralObject {
37
37
  [key: string]: any;
38
38
  }
39
- export declare type TypeNullObject = null | GeneralObject;
39
+ export type TypeNullObject = null | GeneralObject;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -24,8 +24,11 @@
24
24
  "electronicReference": "Elektronisk referens",
25
25
  "professionalTitle": "Yrkestitel",
26
26
  "notifyUser": "Notifiera användaren om att kontot har skapats",
27
+ "notifications": "Notiser",
27
28
  "gdpr": "Jag samtycker till att VO-College lagrar mina personuppgifter",
28
- "gdprIsRequired": "Du behöver godkänna att vi hanterar dina personuppgifter"
29
+ "gdprIsRequired": "Du behöver godkänna att vi hanterar dina personuppgifter",
30
+ "sendResetEmail": "Återställ lösenord",
31
+ "confirmResetEmail": "Är du säker på att du vill skicka ett lösenordåterställnings-mail till användaren med id ::uid igen?"
29
32
  },
30
33
  "messages": {
31
34
  "userCreated": "Användaren har skapats.",
@@ -33,14 +36,26 @@
33
36
  "accountUpdated": "Kontot har uppdaterats",
34
37
  "userDeleted": "Användaren har raderats",
35
38
  "statusHelper": "Detta avgör om en användare syns utåt, exempelvis i köer.",
36
- "readMoreDataPolicy": "Läs mer i vår dataskyddspolicy"
39
+ "readMoreDataPolicy": "Läs mer i vår dataskyddspolicy",
40
+ "resetEmailSent": "Länk till lösenordsåterställning ska skickas till användaren"
37
41
  },
38
42
  "settings": [
39
43
  {
40
44
  "name": "excludeFromAutomaticDeletion",
41
45
  "label": "Uteslut denna användare från automatisk radering"
42
46
  }
43
- ]
47
+ ],
48
+ "options": {
49
+ "disableAllNotifications": "Stäng av alla notiser",
50
+ "onlyValedictorianNotifications": "Få endast notiser från validander",
51
+ "notificationSelection": "Val av notiser",
52
+ "notificationDisableDailyMail": "Avstå från dagliga mailutskick"
53
+ },
54
+ "notifications": {
55
+ "all": "Ta emot alla notiser",
56
+ "candidate": "Få endast notiser från validander",
57
+ "none": "Stäng av alla notiser"
58
+ }
44
59
  },
45
60
  "acl": {
46
61
  "label": "ACL",
@@ -28,7 +28,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
28
28
  function verb(n) { return function (v) { return step([n, v]); }; }
29
29
  function step(op) {
30
30
  if (f) throw new TypeError("Generator is already executing.");
31
- while (_) try {
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
32
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
33
  if (y = 0, t) op = [op[0] & 2, t.value];
34
34
  switch (op[0]) {
@@ -69,10 +69,10 @@ var Vapor = /** @class */ (function () {
69
69
  /**
70
70
  * Store a file in S3 and return its UUID, key, and other information.
71
71
  */
72
- Vapor.prototype.store = function (file, options) {
73
- if (options === void 0) { options = {}; }
74
- return __awaiter(this, void 0, void 0, function () {
72
+ Vapor.prototype.store = function (file_1) {
73
+ return __awaiter(this, arguments, void 0, function (file, options) {
75
74
  var response, instance, headers, cancelToken;
75
+ if (options === void 0) { options = {}; }
76
76
  return __generator(this, function (_a) {
77
77
  switch (_a.label) {
78
78
  case 0: return [4 /*yield*/, axios_1.default.post(
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -6,7 +6,7 @@ declare class VoApi extends VoBase {
6
6
  init(params?: GeneralObject): void;
7
7
  get getGraphqlUrl(): string;
8
8
  get getGraphqlSubscriptionUrl(): string;
9
- getUser(): Promise<import("axios").AxiosResponse<any>>;
9
+ getUser(): Promise<import("axios").AxiosResponse<any, any>>;
10
10
  logout(): Promise<boolean>;
11
11
  }
12
12
  declare const _default: VoApi;
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -1,3 +1,4 @@
1
1
  export declare const CREATE_USER: import("@apollo/client").DocumentNode;
2
2
  export declare const UPDATE_USER: import("@apollo/client").DocumentNode;
3
3
  export declare const DELETE_USER: import("@apollo/client").DocumentNode;
4
+ export declare const SEND_RESET_EMAIL_TO_USER: import("@apollo/client").DocumentNode;
@@ -4,9 +4,10 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
4
4
  return cooked;
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DELETE_USER = exports.UPDATE_USER = exports.CREATE_USER = void 0;
7
+ exports.SEND_RESET_EMAIL_TO_USER = exports.DELETE_USER = exports.UPDATE_USER = exports.CREATE_USER = void 0;
8
8
  var client_1 = require("@apollo/client");
9
9
  exports.CREATE_USER = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n mutation CreateUser($input: UpdateUserInput!) {\n createUser(input: $input) {\n id\n name\n email\n firstname\n lastname\n }\n }\n"], ["\n mutation CreateUser($input: UpdateUserInput!) {\n createUser(input: $input) {\n id\n name\n email\n firstname\n lastname\n }\n }\n"])));
10
- exports.UPDATE_USER = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {\n updateUser(id: $id, input: $input) {\n id\n name\n email\n firstname\n lastname\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n updated_at\n created_at\n groups {\n id\n title\n type\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n apps\n settings\n }\n }\n"], ["\n mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {\n updateUser(id: $id, input: $input) {\n id\n name\n email\n firstname\n lastname\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n updated_at\n created_at\n groups {\n id\n title\n type\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n apps\n settings\n }\n }\n"])));
10
+ exports.UPDATE_USER = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {\n updateUser(id: $id, input: $input) {\n id\n name\n email\n firstname\n lastname\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n updated_at\n created_at\n groups {\n id\n title\n type\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n apps\n settings\n validig {\n options {\n id\n name\n type\n value\n }\n }\n }\n }\n"], ["\n mutation UpdateUser($id: ID!, $input: UpdateUserInput!) {\n updateUser(id: $id, input: $input) {\n id\n name\n email\n firstname\n lastname\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n updated_at\n created_at\n groups {\n id\n title\n type\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n apps\n settings\n validig {\n options {\n id\n name\n type\n value\n }\n }\n }\n }\n"])));
11
11
  exports.DELETE_USER = (0, client_1.gql)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n mutation DeleteUser($id: ID!) {\n deleteUser(id: $id) {\n id\n }\n }\n"], ["\n mutation DeleteUser($id: ID!) {\n deleteUser(id: $id) {\n id\n }\n }\n"])));
12
- var templateObject_1, templateObject_2, templateObject_3;
12
+ exports.SEND_RESET_EMAIL_TO_USER = (0, client_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\nmutation SendResetEmailToUser($id: ID!) {\n sendResetEmailToUser(id: $id) {\n id\n }\n }\n"], ["\nmutation SendResetEmailToUser($id: ID!) {\n sendResetEmailToUser(id: $id) {\n id\n }\n }\n"])));
13
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -6,9 +6,9 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.GET_ACCOUNT = exports.GET_USERS_SIMPLIFIED = exports.GET_USERS = exports.GET_USER = exports.GET_USERS_FIELDS = void 0;
8
8
  var client_1 = require("@apollo/client");
9
- exports.GET_USERS_FIELDS = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fragment UsersFields on User {\n id\n name\n email\n active\n status\n updated_at\n created_at\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n name\n title\n }\n validig {\n id\n }\n }\n"], ["\n fragment UsersFields on User {\n id\n name\n email\n active\n status\n updated_at\n created_at\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n name\n title\n }\n validig {\n id\n }\n }\n"])));
10
- exports.GET_USER = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query User($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n gdpr\n description\n updated_at\n created_at\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n title\n type\n }\n validig {\n id\n }\n apps\n settings\n }\n }\n"], ["\n query User($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n gdpr\n description\n updated_at\n created_at\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n title\n type\n }\n validig {\n id\n }\n apps\n settings\n }\n }\n"])));
9
+ exports.GET_USERS_FIELDS = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n fragment UsersFields on User {\n id\n name\n email\n active\n status\n updated_at\n created_at\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n name\n title\n }\n validig {\n id\n options {\n id\n name\n type\n value\n }\n }\n }\n"], ["\n fragment UsersFields on User {\n id\n name\n email\n active\n status\n updated_at\n created_at\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n name\n title\n }\n validig {\n id\n options {\n id\n name\n type\n value\n }\n }\n }\n"])));
10
+ exports.GET_USER = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query User($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n gdpr\n description\n updated_at\n created_at\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n title\n type\n }\n validig {\n id\n options {\n id\n name\n type\n value\n }\n }\n apps\n settings\n \n }\n }\n"], ["\n query User($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n gdpr\n description\n updated_at\n created_at\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n roles {\n id\n label\n type\n }\n groupRoles {\n id\n label\n type\n }\n groups {\n id\n title\n type\n }\n validig {\n id\n options {\n id\n name\n type\n value\n }\n }\n apps\n settings\n \n }\n }\n"])));
11
11
  exports.GET_USERS = (0, client_1.gql)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n # query Users($page: Int!, $search: String) {\n # users(page: $page, search: $search) {\n # paginatorInfo {\n # total\n # currentPage\n # hasMorePages\n # }\n # data {\n # name\n # email\n # }\n # }\n # }\n\n query Users(\n $search: String\n $page: Int\n $limit: Int\n $orderBy: [GetUsersOrderByClause]\n $filters: [GetUsersFilter]\n ) {\n allGroups(categories: [\"region\", \"local\"]) {\n id\n title\n }\n roles {\n id\n name\n label\n }\n users(\n search: $search\n page: $page\n limit: $limit\n orderBy: $orderBy\n filters: $filters\n ) {\n paginatorInfo {\n total\n currentPage\n hasMorePages\n }\n data {\n ...UsersFields\n }\n }\n }\n ", "\n"], ["\n # query Users($page: Int!, $search: String) {\n # users(page: $page, search: $search) {\n # paginatorInfo {\n # total\n # currentPage\n # hasMorePages\n # }\n # data {\n # name\n # email\n # }\n # }\n # }\n\n query Users(\n $search: String\n $page: Int\n $limit: Int\n $orderBy: [GetUsersOrderByClause]\n $filters: [GetUsersFilter]\n ) {\n allGroups(categories: [\"region\", \"local\"]) {\n id\n title\n }\n roles {\n id\n name\n label\n }\n users(\n search: $search\n page: $page\n limit: $limit\n orderBy: $orderBy\n filters: $filters\n ) {\n paginatorInfo {\n total\n currentPage\n hasMorePages\n }\n data {\n ...UsersFields\n }\n }\n }\n ", "\n"])), exports.GET_USERS_FIELDS);
12
12
  exports.GET_USERS_SIMPLIFIED = (0, client_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n query UsersSimplified(\n $search: String\n $page: Int\n $limit: Int\n $orderBy: [GetUsersOrderByClause]\n $filters: [GetUsersFilter]\n ) {\n users(\n search: $search\n page: $page\n limit: $limit\n orderBy: $orderBy\n filters: $filters\n ) {\n paginatorInfo {\n total\n currentPage\n hasMorePages\n }\n data {\n ...UsersFields\n }\n }\n }\n ", "\n"], ["\n query UsersSimplified(\n $search: String\n $page: Int\n $limit: Int\n $orderBy: [GetUsersOrderByClause]\n $filters: [GetUsersFilter]\n ) {\n users(\n search: $search\n page: $page\n limit: $limit\n orderBy: $orderBy\n filters: $filters\n ) {\n paginatorInfo {\n total\n currentPage\n hasMorePages\n }\n data {\n ...UsersFields\n }\n }\n }\n ", "\n"])), exports.GET_USERS_FIELDS);
13
- exports.GET_ACCOUNT = (0, client_1.gql)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query Account($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n description\n workplace\n gdpr\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n }\n userSettings {\n publicDefaultPortfolio {\n id\n name\n disk\n }\n }\n }\n"], ["\n query Account($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n description\n workplace\n gdpr\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n }\n userSettings {\n publicDefaultPortfolio {\n id\n name\n disk\n }\n }\n }\n"])));
13
+ exports.GET_ACCOUNT = (0, client_1.gql)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n query Account($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n description\n workplace\n gdpr\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n validig {\n options {\n name\n type\n value\n }\n }\n }\n userSettings {\n publicDefaultPortfolio {\n id\n name\n disk\n }\n }\n }\n"], ["\n query Account($id: ID!) {\n user(id: $id) {\n id\n name\n email\n firstname\n lastname\n active\n personal_number\n address1\n address2\n postalcode\n town\n country\n phone1\n profession\n status\n description\n workplace\n gdpr\n images {\n id\n title\n filename\n filesize\n filetype\n url\n }\n validig {\n options {\n name\n type\n value\n }\n }\n }\n userSettings {\n publicDefaultPortfolio {\n id\n name\n disk\n }\n }\n }\n"])));
14
14
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -19,6 +19,7 @@ declare class VoAuth extends VoBase {
19
19
  check(forceRedirect?: boolean, forceLoad?: boolean): Promise<any>;
20
20
  loadUser(force?: boolean): Promise<any>;
21
21
  get currentUser(): any;
22
+ get isOnlyValidigCandidate(): any;
22
23
  getToken(): VoTokenType | void;
23
24
  initAuth(): {
24
25
  state: string;
@@ -52,7 +52,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
52
52
  function verb(n) { return function (v) { return step([n, v]); }; }
53
53
  function step(op) {
54
54
  if (f) throw new TypeError("Generator is already executing.");
55
- while (_) try {
55
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
56
56
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
57
57
  if (y = 0, t) op = [op[0] & 2, t.value];
58
58
  switch (op[0]) {
@@ -369,6 +369,17 @@ var VoAuth = /** @class */ (function (_super) {
369
369
  enumerable: false,
370
370
  configurable: true
371
371
  });
372
+ Object.defineProperty(VoAuth.prototype, "isOnlyValidigCandidate", {
373
+ get: function () {
374
+ var _a, _b, _c, _d;
375
+ if ((_a = this.user) === null || _a === void 0 ? void 0 : _a.validig) {
376
+ return ((_c = (_b = this.user) === null || _b === void 0 ? void 0 : _b.roles) === null || _c === void 0 ? void 0 : _c.length) == 1 && ((_d = this.user) === null || _d === void 0 ? void 0 : _d.roles.find(function (r) { return r.name === "candidate"; }));
377
+ }
378
+ return false;
379
+ },
380
+ enumerable: false,
381
+ configurable: true
382
+ });
372
383
  VoAuth.prototype.getToken = function () {
373
384
  try {
374
385
  var refreshTokenKey = VoConfig_1.default.get.AUTH_STORAGE_REFRESH_TOKEN || "";
@@ -1,4 +1,4 @@
1
- declare type VoConfigType = {
1
+ type VoConfigType = {
2
2
  [key: string]: any;
3
3
  };
4
4
  declare class VoConfig {
@@ -3,7 +3,7 @@ declare class VoDocs extends VoBase {
3
3
  graphqlClient: any;
4
4
  init(): void;
5
5
  get getGraphqlUrl(): string;
6
- getTemporaryFileUrl(id: string, publicDownload?: boolean): Promise<import("axios").AxiosResponse<any>>;
6
+ getTemporaryFileUrl(id: string, publicDownload?: boolean): Promise<import("axios").AxiosResponse<any, any>>;
7
7
  }
8
8
  declare const _default: VoDocs;
9
9
  export default _default;
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -77,10 +77,10 @@ var VoDocs = /** @class */ (function (_super) {
77
77
  enumerable: false,
78
78
  configurable: true
79
79
  });
80
- VoDocs.prototype.getTemporaryFileUrl = function (id, publicDownload) {
81
- if (publicDownload === void 0) { publicDownload = false; }
82
- return __awaiter(this, void 0, void 0, function () {
80
+ VoDocs.prototype.getTemporaryFileUrl = function (id_1) {
81
+ return __awaiter(this, arguments, void 0, function (id, publicDownload) {
83
82
  var currentGroup, endpoint, url;
83
+ if (publicDownload === void 0) { publicDownload = false; }
84
84
  return __generator(this, function (_a) {
85
85
  try {
86
86
  currentGroup = VoGroups_1.default.getCurrent(true);
@@ -7,7 +7,7 @@ export declare const localStorage: {
7
7
  get: (key: string) => string | false | null;
8
8
  remove: (key: string) => true | undefined;
9
9
  };
10
- declare type encodeQueryDataType = {
10
+ type encodeQueryDataType = {
11
11
  [key: string]: any;
12
12
  };
13
13
  export declare const encodeQueryData: (data: encodeQueryDataType) => string;
@@ -20,7 +20,7 @@ export declare const regexPatterns: {
20
20
  personalNumber: RegExp;
21
21
  orgnr: RegExp;
22
22
  };
23
- declare type errorObjectType = {
23
+ type errorObjectType = {
24
24
  message: string;
25
25
  fields?: {
26
26
  [key: string]: any;
@@ -33,8 +33,8 @@ export declare const wrapPromise: (promise: any) => {
33
33
  read: () => any;
34
34
  };
35
35
  export declare const downloadFile: (url: string) => void;
36
- export declare const orderByPosition: (a: any, b: any) => 1 | -1 | 0;
37
- export declare const orderByField: (a: any, b: any, field: string) => 1 | -1 | 0;
36
+ export declare const orderByPosition: (a: any, b: any) => 0 | 1 | -1;
37
+ export declare const orderByField: (a: any, b: any, field: string) => 0 | 1 | -1;
38
38
  export declare const shortenText: (str: string, limit?: number, stripHtml?: boolean, addEllipsis?: boolean) => string;
39
39
  export declare const getImageContact: (item: any, width?: number, height?: number) => string;
40
40
  export declare const getImage: (item: any, width: number, height: number, field?: string) => string;
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -121,7 +121,7 @@ exports.regexPatterns = {
121
121
  username: /(^[a-z]{3,})([\.]|[\_]|[\-]|[a-z]|[0-9]?)+$/,
122
122
  email: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
123
123
  stringNonDigit: /^[^0-9]+$/,
124
- password: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/,
124
+ password: /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/, // At least 8 characters, 1 uppercase, 1 lowercase and 1 digit.
125
125
  cleanName: /(^[a-z]{1,})(\w|-?)+$/,
126
126
  personalNumber: /^(\d{8})[-]\d{4}$/,
127
127
  orgnr: /^(\d{6})[-]\d{4}$/,
@@ -1,4 +1,4 @@
1
- declare type RoutesType = {
1
+ type RoutesType = {
2
2
  [key: string]: any;
3
3
  };
4
4
  declare class VoRouter {
@@ -6,7 +6,7 @@ declare const localStorage: {
6
6
  get: (key: string) => string | false | null;
7
7
  remove: (key: string) => true | undefined;
8
8
  };
9
- declare type encodeQueryDataType = {
9
+ type encodeQueryDataType = {
10
10
  [key: string]: any;
11
11
  };
12
12
  declare const encodeQueryData: (data: encodeQueryDataType) => string;
@@ -16,7 +16,7 @@ declare const regexPatterns: {
16
16
  stringNonDigit: RegExp;
17
17
  password: RegExp;
18
18
  };
19
- declare type errorObjectType = {
19
+ type errorObjectType = {
20
20
  message: string;
21
21
  fields?: {
22
22
  [key: string]: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocollege/app",
3
- "version": "0.0.149",
3
+ "version": "0.0.151",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -24,8 +24,11 @@
24
24
  "electronicReference": "Elektronisk referens",
25
25
  "professionalTitle": "Yrkestitel",
26
26
  "notifyUser": "Notifiera användaren om att kontot har skapats",
27
+ "notifications": "Notiser",
27
28
  "gdpr": "Jag samtycker till att VO-College lagrar mina personuppgifter",
28
- "gdprIsRequired": "Du behöver godkänna att vi hanterar dina personuppgifter"
29
+ "gdprIsRequired": "Du behöver godkänna att vi hanterar dina personuppgifter",
30
+ "sendResetEmail": "Återställ lösenord",
31
+ "confirmResetEmail": "Är du säker på att du vill skicka ett lösenordåterställnings-mail till användaren med id ::uid igen?"
29
32
  },
30
33
  "messages": {
31
34
  "userCreated": "Användaren har skapats.",
@@ -33,14 +36,26 @@
33
36
  "accountUpdated": "Kontot har uppdaterats",
34
37
  "userDeleted": "Användaren har raderats",
35
38
  "statusHelper": "Detta avgör om en användare syns utåt, exempelvis i köer.",
36
- "readMoreDataPolicy": "Läs mer i vår dataskyddspolicy"
39
+ "readMoreDataPolicy": "Läs mer i vår dataskyddspolicy",
40
+ "resetEmailSent": "Länk till lösenordsåterställning ska skickas till användaren"
37
41
  },
38
42
  "settings": [
39
43
  {
40
44
  "name": "excludeFromAutomaticDeletion",
41
45
  "label": "Uteslut denna användare från automatisk radering"
42
46
  }
43
- ]
47
+ ],
48
+ "options": {
49
+ "disableAllNotifications": "Stäng av alla notiser",
50
+ "onlyValedictorianNotifications": "Få endast notiser från validander",
51
+ "notificationSelection": "Val av notiser",
52
+ "notificationDisableDailyMail": "Avstå från dagliga mailutskick"
53
+ },
54
+ "notifications": {
55
+ "all": "Ta emot alla notiser",
56
+ "candidate": "Få endast notiser från validander",
57
+ "none": "Stäng av alla notiser"
58
+ }
44
59
  },
45
60
  "acl": {
46
61
  "label": "ACL",
@@ -47,6 +47,14 @@ export const UPDATE_USER = gql`
47
47
  }
48
48
  apps
49
49
  settings
50
+ validig {
51
+ options {
52
+ id
53
+ name
54
+ type
55
+ value
56
+ }
57
+ }
50
58
  }
51
59
  }
52
60
  `;
@@ -58,3 +66,11 @@ export const DELETE_USER = gql`
58
66
  }
59
67
  }
60
68
  `;
69
+
70
+ export const SEND_RESET_EMAIL_TO_USER = gql`
71
+ mutation SendResetEmailToUser($id: ID!) {
72
+ sendResetEmailToUser(id: $id) {
73
+ id
74
+ }
75
+ }
76
+ `;
@@ -26,6 +26,12 @@ export const GET_USERS_FIELDS = gql`
26
26
  }
27
27
  validig {
28
28
  id
29
+ options {
30
+ id
31
+ name
32
+ type
33
+ value
34
+ }
29
35
  }
30
36
  }
31
37
  `;
@@ -77,9 +83,16 @@ export const GET_USER = gql`
77
83
  }
78
84
  validig {
79
85
  id
86
+ options {
87
+ id
88
+ name
89
+ type
90
+ value
91
+ }
80
92
  }
81
93
  apps
82
94
  settings
95
+
83
96
  }
84
97
  }
85
98
  `;
@@ -192,6 +205,13 @@ export const GET_ACCOUNT = gql`
192
205
  filetype
193
206
  url
194
207
  }
208
+ validig {
209
+ options {
210
+ name
211
+ type
212
+ value
213
+ }
214
+ }
195
215
  }
196
216
  userSettings {
197
217
  publicDefaultPortfolio {
@@ -234,6 +234,12 @@ class VoAuth extends VoBase {
234
234
  get currentUser() {
235
235
  return this.user;
236
236
  }
237
+ get isOnlyValidigCandidate() {
238
+ if (this.user?.validig) {
239
+ return this.user?.roles?.length == 1 && this.user?.roles.find((r: any) => r.name ==="candidate");
240
+ }
241
+ return false;
242
+ }
237
243
 
238
244
  getToken(): VoTokenType | void {
239
245
  try {