@snugdesk/core 0.2.3 → 0.2.5

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/index.d.ts CHANGED
@@ -166,6 +166,33 @@ declare class AppSyncHelperService {
166
166
  static ɵprov: i0.ɵɵInjectableDeclaration<AppSyncHelperService>;
167
167
  }
168
168
 
169
+ interface OpenSearchResponse {
170
+ hits?: {
171
+ total?: number | {
172
+ value?: number;
173
+ };
174
+ hits?: OpenSearchHit[];
175
+ };
176
+ }
177
+ interface OpenSearchHit {
178
+ id?: unknown;
179
+ _id?: unknown;
180
+ _source?: Record<string, unknown>;
181
+ fields?: Record<string, unknown>;
182
+ }
183
+ declare class OpenSearchHelperService {
184
+ private httpClient;
185
+ private readonly jsonHeaders;
186
+ constructor(httpClient: HttpClient);
187
+ private buildOpenSearchProxyEndpoint;
188
+ searchIndex(index: string, body: unknown): Promise<OpenSearchResponse>;
189
+ parseSearchResults(response: OpenSearchResponse | null | undefined): Array<Record<string, unknown>>;
190
+ parseTotalCount(response: OpenSearchResponse | null | undefined): number;
191
+ private mapHitToSource;
192
+ static ɵfac: i0.ɵɵFactoryDeclaration<OpenSearchHelperService, never>;
193
+ static ɵprov: i0.ɵɵInjectableDeclaration<OpenSearchHelperService>;
194
+ }
195
+
169
196
  interface S3Credentials {
170
197
  accessKeyId: string;
171
198
  secretAccessKey: string;
@@ -298,20 +325,6 @@ type List<T> = {
298
325
  interface SubscriptionResponse<T> {
299
326
  value: GraphQLResult<T>;
300
327
  }
301
- type Country = {
302
- code: string;
303
- nameEn: string;
304
- nameLocal?: string | null;
305
- currency?: CountryCurrency | null;
306
- officialLanguage?: Language | null;
307
- callingCode?: string | null;
308
- region?: string | null;
309
- flag?: string | null;
310
- };
311
- type CountryCurrency = {
312
- code: string;
313
- nameEn: string;
314
- };
315
328
  type Language = {
316
329
  code: string;
317
330
  nameEn: string;
@@ -582,18 +595,7 @@ declare class InteractionEndpointService {
582
595
  static ɵprov: i0.ɵɵInjectableDeclaration<InteractionEndpointService>;
583
596
  }
584
597
 
585
- type Team = {
586
- id: string;
587
- tenantId: string;
588
- name: string;
589
- description?: string | null;
590
- image?: S3Object | null;
591
- ticketFields?: Array<string | null> | null;
592
- createdAt: number;
593
- updatedAt: number;
594
- deletedAt?: number | null;
595
- };
596
-
598
+ declare const FIELDS_USER = "\n id\n externalId\n tenantId\n email\n name\n image {\n key\n bucket\n location\n }\n phoneNumber {\n countryCode\n dialCode\n e164Number\n internationalNumber\n nationalNumber\n number\n }\n preferences {\n timezoneName\n language {\n code\n nameEn\n nameLocal\n }\n }\n notificationSettings {\n allowPush\n allowEmail\n allowSMS\n allowWhatsApp\n }\n type\n activatedAt\n blockedAt\n createdAt\n updatedAt\n deletedAt\n";
597
599
  type UserPreferences = {
598
600
  timezoneName?: string | null;
599
601
  language?: Language | null;
@@ -731,6 +733,40 @@ declare class UserSessionService {
731
733
  static ɵprov: i0.ɵɵInjectableDeclaration<UserSessionService>;
732
734
  }
733
735
 
736
+ type Team = {
737
+ id: string;
738
+ tenantId: string;
739
+ name: string;
740
+ description?: string | null;
741
+ image?: S3Object | null;
742
+ ticketFields?: Array<string | null> | null;
743
+ createdAt: number;
744
+ updatedAt: number;
745
+ deletedAt?: number | null;
746
+ };
747
+ type TeamMember = {
748
+ id: string;
749
+ teamId: string;
750
+ team?: Team | null;
751
+ userId: string;
752
+ isManager: boolean;
753
+ createdAt: number;
754
+ updatedAt: number;
755
+ deletedAt?: number | null;
756
+ };
757
+ type ModelTeamMemberFilterInput = {
758
+ id?: ModelIDInput | null;
759
+ teamId?: ModelIDInput | null;
760
+ userId?: ModelIDInput | null;
761
+ isManager?: ModelBooleanInput | null;
762
+ createdAt?: ModelIntInput | null;
763
+ updatedAt?: ModelIntInput | null;
764
+ deletedAt?: ModelIntInput | null;
765
+ and?: Array<ModelTeamMemberFilterInput | null> | null;
766
+ or?: Array<ModelTeamMemberFilterInput | null> | null;
767
+ not?: ModelTeamMemberFilterInput | null;
768
+ };
769
+
734
770
  declare enum InteractionChannel {
735
771
  EMAIL = "EMAIL",
736
772
  PHONE = "PHONE",
@@ -762,10 +798,13 @@ declare enum InteractionStatus {
762
798
  }
763
799
  declare enum InteractionProvider {
764
800
  AVAYA_IPO = "AVAYA_IPO",
765
- TELNYX = "TELNYX",
766
- WHATSAPP = "WHATSAPP",
801
+ FACEBOOK = "FACEBOOK",
802
+ INSTAGRAM = "INSTAGRAM",
803
+ OZONETEL = "OZONETEL",
804
+ SNUGDESK = "SNUGDESK",
767
805
  TELEGRAM = "TELEGRAM",
768
- SNUGDESK = "SNUGDESK"
806
+ TELNYX = "TELNYX",
807
+ WHATSAPP = "WHATSAPP"
769
808
  }
770
809
  type InteractionRouteConfiguration = {
771
810
  teamId?: string | null;
@@ -1337,6 +1376,15 @@ declare class EntityConversationService {
1337
1376
  static ɵprov: i0.ɵɵInjectableDeclaration<EntityConversationService>;
1338
1377
  }
1339
1378
 
1379
+ declare class TeamService {
1380
+ private readonly appSyncService;
1381
+ constructor(appSyncService: AppSyncHelperService);
1382
+ GetTeam(id: string): Promise<Team>;
1383
+ ListTeamMembershipsByUserId(userId: string, createdAt?: ModelIntKeyConditionInput, sortDirection?: ModelSortDirection, filter?: ModelTeamMemberFilterInput, limit?: number, nextToken?: string): Promise<List<TeamMember>>;
1384
+ static ɵfac: i0.ɵɵFactoryDeclaration<TeamService, never>;
1385
+ static ɵprov: i0.ɵɵInjectableDeclaration<TeamService>;
1386
+ }
1387
+
1340
1388
  declare class CustomValidators {
1341
1389
  #private;
1342
1390
  /**
@@ -1366,5 +1414,5 @@ declare class CleanDeep {
1366
1414
  static clean(obj: any): typeof obj;
1367
1415
  }
1368
1416
 
1369
- export { AMPLIFY_CONFIG, AppSyncHelperService, CleanDeep, CustomPipesModule, CustomValidators, DomainNamePipe, EntityConversationService, EntityService, ErrorComponent, FIELDS_ENTITY_CONVERSATION, FIELDS_ENTITY_CONVERSATION_EXPANDED, FIELDS_INTERACTION_WIDGET, FooterComponent, FormatEpochTimestampPipe, InteractionChannel, InteractionContext, InteractionDirection, InteractionEndpointService, InteractionProvider, InteractionRouteLogic, InteractionService, InteractionStatus, InteractionWidgetService, LoaderComponent, ModelAttributeTypes, ModelSortDirection, S3HelperService, SafeHtmlPipe, SearchInnerFieldPipe, SearchPipe, SingularizePipe, SnugdeskAuthenticationService, SnugdeskCoreModule, SnugdeskIPRegistryService, TenantService, UserService, UserSessionService, UserStatus, UserType, provideAmplifyConfig };
1370
- export type { AmplifyConfig, Country, CountryCurrency, CreateEntityConversationInput, CreateEntityInput, CreateInteractionAttendeeInput, CreateInteractionInput, CreateInteractionMessageAttachmentInput, CreateInteractionMessageInput, Entity, EntityContactPreferences, EntityConversation, EntityPreferences, Interaction, InteractionAttendee, InteractionEndpoint, InteractionEndpointPriceDetails, InteractionEndpointRegulatoryComplianceDocument, InteractionHost, InteractionInvitee, InteractionMessage, InteractionMessageAttachment, InteractionRouteConfiguration, InteractionRouteConfigurationInput, InteractionWidget, Language, List, ModelBooleanInput, ModelEntityConditionInput, ModelEntityConversationConditionInput, ModelEntityConversationFilterInput, ModelEntityFilterInput, ModelIDInput, ModelIDKeyConditionInput, ModelIntInput, ModelIntKeyConditionInput, ModelInteractionAttendeeConditionInput, ModelInteractionAttendeeFilterInput, ModelInteractionChannelInput, ModelInteractionConditionInput, ModelInteractionContextInput, ModelInteractionDirectionInput, ModelInteractionInviteeFilterInput, ModelInteractionMessageAttachmentConditionInput, ModelInteractionMessageAttachmentFilterInput, ModelInteractionMessageConditionInput, ModelInteractionMessageFilterInput, ModelInteractionProviderInput, ModelInteractionStatusInput, ModelInteractionWidgetConditionInput, ModelInteractionWidgetFilterInput, ModelSizeInput, ModelStringInput, ModelStringKeyConditionInput, ModelUserSessionConditionInput, ModelUserSessionFilterInput, ModelUserStatusInput, PhoneNumber, S3Config, S3Credentials, S3Object, SubscriptionResponse, Team, Tenant, TenantPreferences, TenantSecurity, UpdateEntityConversationInput, UpdateEntityInput, UpdateInteractionInput, UpdateUserSessionInput, User, UserNotificationSettings, UserPreferences, UserSession };
1417
+ export { AMPLIFY_CONFIG, AppSyncHelperService, CleanDeep, CustomPipesModule, CustomValidators, DomainNamePipe, EntityConversationService, EntityService, ErrorComponent, FIELDS_ENTITY_CONVERSATION, FIELDS_ENTITY_CONVERSATION_EXPANDED, FIELDS_INTERACTION_WIDGET, FIELDS_USER, FooterComponent, FormatEpochTimestampPipe, InteractionChannel, InteractionContext, InteractionDirection, InteractionEndpointService, InteractionProvider, InteractionRouteLogic, InteractionService, InteractionStatus, InteractionWidgetService, LoaderComponent, OpenSearchHelperService, S3HelperService, SafeHtmlPipe, SearchInnerFieldPipe, SearchPipe, SingularizePipe, SnugdeskAuthenticationService, SnugdeskCoreModule, SnugdeskIPRegistryService, TeamService, TenantService, UserService, UserSessionService, UserStatus, UserType, provideAmplifyConfig };
1418
+ export type { AmplifyConfig, CreateEntityConversationInput, CreateEntityInput, CreateInteractionAttendeeInput, CreateInteractionInput, CreateInteractionMessageAttachmentInput, CreateInteractionMessageInput, Entity, EntityContactPreferences, EntityConversation, EntityPreferences, Interaction, InteractionAttendee, InteractionEndpoint, InteractionEndpointPriceDetails, InteractionEndpointRegulatoryComplianceDocument, InteractionHost, InteractionInvitee, InteractionMessage, InteractionMessageAttachment, InteractionRouteConfiguration, InteractionRouteConfigurationInput, InteractionWidget, ModelEntityConditionInput, ModelEntityConversationConditionInput, ModelEntityConversationFilterInput, ModelEntityFilterInput, ModelInteractionAttendeeConditionInput, ModelInteractionAttendeeFilterInput, ModelInteractionChannelInput, ModelInteractionConditionInput, ModelInteractionContextInput, ModelInteractionDirectionInput, ModelInteractionInviteeFilterInput, ModelInteractionMessageAttachmentConditionInput, ModelInteractionMessageAttachmentFilterInput, ModelInteractionMessageConditionInput, ModelInteractionMessageFilterInput, ModelInteractionProviderInput, ModelInteractionStatusInput, ModelInteractionWidgetConditionInput, ModelInteractionWidgetFilterInput, ModelUserSessionConditionInput, ModelUserSessionFilterInput, ModelUserStatusInput, OpenSearchHit, OpenSearchResponse, S3Config, S3Credentials, Tenant, TenantPreferences, TenantSecurity, UpdateEntityConversationInput, UpdateEntityInput, UpdateInteractionInput, UpdateUserSessionInput, User, UserNotificationSettings, UserPreferences, UserSession };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snugdesk/core",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Core utility and session management library required for all Snugdesk widgets. Handles authentication, configuration, and shared services.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=19.0.0",
@@ -28,6 +28,10 @@
28
28
  ".": {
29
29
  "types": "./index.d.ts",
30
30
  "default": "./fesm2022/snugdesk-core.mjs"
31
+ },
32
+ "./src/lib/models/dynamodb": {
33
+ "types": "./src/lib/models/dynamodb/index.d.ts",
34
+ "default": "./fesm2022/snugdesk-core-src-lib-models-dynamodb.mjs"
31
35
  }
32
36
  }
33
37
  }
@@ -0,0 +1,176 @@
1
+ import { GraphQLResult } from '@aws-amplify/api-graphql';
2
+
3
+ declare enum ModelAttributeTypes {
4
+ binary = "binary",
5
+ binarySet = "binarySet",
6
+ bool = "bool",
7
+ list = "list",
8
+ map = "map",
9
+ number = "number",
10
+ numberSet = "numberSet",
11
+ string = "string",
12
+ stringSet = "stringSet",
13
+ _null = "_null"
14
+ }
15
+ declare enum ModelSortDirection {
16
+ ASC = "ASC",
17
+ DESC = "DESC"
18
+ }
19
+ type ModelSizeInput = {
20
+ ne?: number | null;
21
+ eq?: number | null;
22
+ le?: number | null;
23
+ lt?: number | null;
24
+ ge?: number | null;
25
+ gt?: number | null;
26
+ between?: Array<number | null> | null;
27
+ };
28
+ type ModelBooleanInput = {
29
+ ne?: boolean | null;
30
+ eq?: boolean | null;
31
+ attributeExists?: boolean | null;
32
+ attributeType?: ModelAttributeTypes | null;
33
+ };
34
+ type ModelIDInput = {
35
+ ne?: string | null;
36
+ eq?: string | null;
37
+ le?: string | null;
38
+ lt?: string | null;
39
+ ge?: string | null;
40
+ gt?: string | null;
41
+ contains?: string | null;
42
+ notContains?: string | null;
43
+ between?: Array<string | null> | null;
44
+ beginsWith?: string | null;
45
+ attributeExists?: boolean | null;
46
+ attributeType?: ModelAttributeTypes | null;
47
+ size?: ModelSizeInput | null;
48
+ };
49
+ type ModelIntInput = {
50
+ ne?: number | null;
51
+ eq?: number | null;
52
+ le?: number | null;
53
+ lt?: number | null;
54
+ ge?: number | null;
55
+ gt?: number | null;
56
+ between?: Array<number | null> | null;
57
+ attributeExists?: boolean | null;
58
+ attributeType?: ModelAttributeTypes | null;
59
+ };
60
+ type ModelStringInput = {
61
+ ne?: string | null;
62
+ eq?: string | null;
63
+ le?: string | null;
64
+ lt?: string | null;
65
+ ge?: string | null;
66
+ gt?: string | null;
67
+ contains?: string | null;
68
+ notContains?: string | null;
69
+ between?: Array<string | null> | null;
70
+ beginsWith?: string | null;
71
+ attributeExists?: boolean | null;
72
+ attributeType?: ModelAttributeTypes | null;
73
+ size?: ModelSizeInput | null;
74
+ };
75
+ type ModelIDKeyConditionInput = {
76
+ eq?: string | null;
77
+ le?: string | null;
78
+ lt?: string | null;
79
+ ge?: string | null;
80
+ gt?: string | null;
81
+ between?: Array<string | null> | null;
82
+ beginsWith?: string | null;
83
+ };
84
+ type ModelIntKeyConditionInput = {
85
+ eq?: number | null;
86
+ le?: number | null;
87
+ lt?: number | null;
88
+ ge?: number | null;
89
+ gt?: number | null;
90
+ between?: Array<number | null> | null;
91
+ };
92
+ type ModelStringKeyConditionInput = {
93
+ eq?: string | null;
94
+ le?: string | null;
95
+ lt?: string | null;
96
+ ge?: string | null;
97
+ gt?: string | null;
98
+ between?: Array<string | null> | null;
99
+ beginsWith?: string | null;
100
+ };
101
+ type List<T> = {
102
+ items: Array<T | null>;
103
+ nextToken?: string | null;
104
+ };
105
+ interface SubscriptionResponse<T> {
106
+ value: GraphQLResult<T>;
107
+ }
108
+ type Country = {
109
+ code: string;
110
+ nameEn: string;
111
+ nameLocal?: string | null;
112
+ currency?: CountryCurrency | null;
113
+ officialLanguage?: Language | null;
114
+ callingCode?: string | null;
115
+ region?: string | null;
116
+ flag?: string | null;
117
+ };
118
+ type CountryCurrency = {
119
+ code: string;
120
+ nameEn: string;
121
+ };
122
+ type Language = {
123
+ code: string;
124
+ nameEn: string;
125
+ nameLocal?: string | null;
126
+ };
127
+ type PhoneNumber = {
128
+ countryCode?: string | null;
129
+ dialCode?: string | null;
130
+ e164Number?: string | null;
131
+ internationalNumber?: string | null;
132
+ nationalNumber?: string | null;
133
+ number?: string | null;
134
+ };
135
+ type S3Object = {
136
+ key: string;
137
+ bucket: string;
138
+ location: string;
139
+ };
140
+
141
+ type Team = {
142
+ id: string;
143
+ tenantId: string;
144
+ name: string;
145
+ description?: string | null;
146
+ image?: S3Object | null;
147
+ ticketFields?: Array<string | null> | null;
148
+ createdAt: number;
149
+ updatedAt: number;
150
+ deletedAt?: number | null;
151
+ };
152
+ type TeamMember = {
153
+ id: string;
154
+ teamId: string;
155
+ team?: Team | null;
156
+ userId: string;
157
+ isManager: boolean;
158
+ createdAt: number;
159
+ updatedAt: number;
160
+ deletedAt?: number | null;
161
+ };
162
+ type ModelTeamMemberFilterInput = {
163
+ id?: ModelIDInput | null;
164
+ teamId?: ModelIDInput | null;
165
+ userId?: ModelIDInput | null;
166
+ isManager?: ModelBooleanInput | null;
167
+ createdAt?: ModelIntInput | null;
168
+ updatedAt?: ModelIntInput | null;
169
+ deletedAt?: ModelIntInput | null;
170
+ and?: Array<ModelTeamMemberFilterInput | null> | null;
171
+ or?: Array<ModelTeamMemberFilterInput | null> | null;
172
+ not?: ModelTeamMemberFilterInput | null;
173
+ };
174
+
175
+ export { ModelAttributeTypes, ModelSortDirection };
176
+ export type { Country, CountryCurrency, Language, List, ModelBooleanInput, ModelIDInput, ModelIDKeyConditionInput, ModelIntInput, ModelIntKeyConditionInput, ModelSizeInput, ModelStringInput, ModelStringKeyConditionInput, ModelTeamMemberFilterInput, PhoneNumber, S3Object, SubscriptionResponse, Team, TeamMember };