@glissandoo/lib 1.1.9 → 1.1.10

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.
@@ -1,7 +1,7 @@
1
1
  import { DocumentReference, DocumentSnapshot } from '@google-cloud/firestore';
2
2
  import { LanguagesTypes } from '../../lang';
3
3
  import Model from '../Model';
4
- import { CommunicationData, CommunicationThumbnailType, CommunicationType } from './types';
4
+ import { CommunicationData, CommunicationType } from './types';
5
5
  export default class Communication extends Model<CommunicationData> {
6
6
  protected lang: LanguagesTypes;
7
7
  constructor(doc: DocumentSnapshot, lang?: LanguagesTypes);
@@ -11,7 +11,7 @@ export default class Communication extends Model<CommunicationData> {
11
11
  get promoterInfo(): import("../Group/types").GroupTinyData;
12
12
  get owner(): DocumentReference;
13
13
  get ownerInfo(): import("../User/types").UserTinyData | import("../Group/types").GroupTinyData;
14
- get allowAnswer(): boolean;
14
+ get blockAnswers(): boolean;
15
15
  get templateId(): string | null;
16
16
  get recipients(): string[];
17
17
  get recipientsInfo(): Record<string, import("./types").CommunicationRecipientData>;
@@ -29,18 +29,6 @@ export default class Communication extends Model<CommunicationData> {
29
29
  get isActive(): boolean;
30
30
  get plainText(): string;
31
31
  get createdAt(): FirebaseFirestore.Timestamp;
32
- get createdToNow(): string;
33
- get thumbnailType(): CommunicationThumbnailType | null;
34
- get isThumbnailAvatar(): boolean;
35
- get isThumbnailImage(): boolean;
36
- get thumbnailURL(): string | null;
37
- get avatar(): (import("../User/types").UserTinyData & {
38
- id: string;
39
- }) | null;
40
- get thumbnail(): {
41
- url: string;
42
- alt: string;
43
- };
44
32
  get editedAt(): FirebaseFirestore.Timestamp | null;
45
33
  /** @deprecated use reactions */
46
34
  get totalClaps(): number;
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const date_fns_1 = require("date-fns");
7
6
  const lodash_1 = require("lodash");
8
7
  const utils_1 = require("../../helpers/utils");
9
8
  const lang_1 = require("../../lang");
@@ -35,8 +34,8 @@ class Communication extends Model_1.default {
35
34
  get ownerInfo() {
36
35
  return this.data.ownerInfo;
37
36
  }
38
- get allowAnswer() {
39
- return this.data.allowAnswers || false;
37
+ get blockAnswers() {
38
+ return this.data.blockAnswers || false;
40
39
  }
41
40
  get templateId() {
42
41
  return this.data.templateId || null;
@@ -83,47 +82,6 @@ class Communication extends Model_1.default {
83
82
  get createdAt() {
84
83
  return this.data.createdAt;
85
84
  }
86
- get createdToNow() {
87
- const dateLang = lang_1.getDateLang(this.lang);
88
- // @ÑAPA
89
- const text = date_fns_1.formatDistanceToNow(this.createdAt.toDate(), { locale: dateLang.locale })
90
- .replace('alrededor de', 'hace')
91
- .replace('arredor de', 'fa');
92
- return text;
93
- }
94
- get thumbnailType() {
95
- return this.data.thumbnailType || null;
96
- }
97
- get isThumbnailAvatar() {
98
- return this.thumbnailType === types_1.CommunicationThumbnailType.Avatar;
99
- }
100
- get isThumbnailImage() {
101
- return this.thumbnailType === types_1.CommunicationThumbnailType.Image;
102
- }
103
- get thumbnailURL() {
104
- return this.data.thumbnailURL || null;
105
- }
106
- get avatar() {
107
- return this.data.avatar || null;
108
- }
109
- get thumbnail() {
110
- if (this.isThumbnailAvatar && this.avatar) {
111
- return {
112
- url: this.avatar.photoURL,
113
- alt: this.avatar.displayName,
114
- };
115
- }
116
- if (this.isThumbnailImage && this.thumbnailURL) {
117
- return {
118
- url: this.thumbnailURL,
119
- alt: '',
120
- };
121
- }
122
- return {
123
- url: this.promoterInfo.photoURL,
124
- alt: this.promoterInfo.displayName,
125
- };
126
- }
127
85
  get editedAt() {
128
86
  return this.data.editedAt || null;
129
87
  }
@@ -6,10 +6,6 @@ export declare enum CommunicationType {
6
6
  Private = "user",
7
7
  Public = "group"
8
8
  }
9
- export declare enum CommunicationThumbnailType {
10
- Avatar = "avatar",
11
- Image = "image"
12
- }
13
9
  export declare enum CommunicationReactions {
14
10
  OK = "\uD83D\uDC4D",
15
11
  Claps = "\uD83D\uDC4F",
@@ -50,23 +46,18 @@ export interface CommunicationRecipientData {
50
46
  export interface CommunicationData {
51
47
  title: string;
52
48
  message: Node[];
53
- promoter: DocumentReference;
54
- promoterInfo: GroupTinyData;
55
49
  type: CommunicationType;
56
- owner: DocumentReference;
50
+ readonly promoter: DocumentReference;
51
+ promoterInfo: GroupTinyData;
52
+ readonly owner: DocumentReference;
57
53
  ownerInfo: GroupTinyData | UserTinyData;
58
- allowAnswers: boolean;
54
+ blockAnswers: boolean;
59
55
  attachmentsPath: string[];
60
56
  imagesPath: string[];
61
57
  templateId: string | null;
62
58
  recipients: string[];
63
59
  recipientsInfo: Record<string, CommunicationRecipientData>;
64
- thumbnailType: CommunicationThumbnailType | null;
65
- thumbnailURL: string | null;
66
60
  commentsCount: number;
67
- avatar: (UserTinyData & {
68
- id: string;
69
- }) | null;
70
61
  deletedAt: Timestamp | null;
71
62
  editedAt: Timestamp | null;
72
63
  readonly server: boolean;
@@ -1,16 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CommunicationReactions = exports.CommunicationThumbnailType = exports.CommunicationType = void 0;
3
+ exports.CommunicationReactions = exports.CommunicationType = void 0;
4
4
  var CommunicationType;
5
5
  (function (CommunicationType) {
6
6
  CommunicationType["Private"] = "user";
7
7
  CommunicationType["Public"] = "group";
8
8
  })(CommunicationType = exports.CommunicationType || (exports.CommunicationType = {}));
9
- var CommunicationThumbnailType;
10
- (function (CommunicationThumbnailType) {
11
- CommunicationThumbnailType["Avatar"] = "avatar";
12
- CommunicationThumbnailType["Image"] = "image";
13
- })(CommunicationThumbnailType = exports.CommunicationThumbnailType || (exports.CommunicationThumbnailType = {}));
14
9
  var CommunicationReactions;
15
10
  (function (CommunicationReactions) {
16
11
  CommunicationReactions["OK"] = "\uD83D\uDC4D";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",