@snugdesk/core 0.2.27 → 0.2.29
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/fesm2022/snugdesk-core.mjs +122 -74
- package/fesm2022/snugdesk-core.mjs.map +1 -1
- package/index.d.ts +84 -61
- package/package.json +1 -1
|
@@ -1212,6 +1212,79 @@ var UserType;
|
|
|
1212
1212
|
UserType["ADMINISTRATOR"] = "ADMINISTRATOR";
|
|
1213
1213
|
})(UserType || (UserType = {}));
|
|
1214
1214
|
|
|
1215
|
+
const FIELDS_LANGUAGE = `
|
|
1216
|
+
code
|
|
1217
|
+
nameEn
|
|
1218
|
+
nameLocal
|
|
1219
|
+
`;
|
|
1220
|
+
const FIELDS_COUNTRY = `
|
|
1221
|
+
code
|
|
1222
|
+
nameEn
|
|
1223
|
+
nameLocal
|
|
1224
|
+
currency {
|
|
1225
|
+
code
|
|
1226
|
+
nameEn
|
|
1227
|
+
}
|
|
1228
|
+
officialLanguage {
|
|
1229
|
+
${FIELDS_LANGUAGE}
|
|
1230
|
+
}
|
|
1231
|
+
callingCode
|
|
1232
|
+
region
|
|
1233
|
+
flag
|
|
1234
|
+
`;
|
|
1235
|
+
const FIELDS_PHONE_NUMBER = `
|
|
1236
|
+
countryCode
|
|
1237
|
+
dialCode
|
|
1238
|
+
e164Number
|
|
1239
|
+
internationalNumber
|
|
1240
|
+
nationalNumber
|
|
1241
|
+
number
|
|
1242
|
+
`;
|
|
1243
|
+
class CommonService {
|
|
1244
|
+
httpClient;
|
|
1245
|
+
countriesData;
|
|
1246
|
+
languagesData;
|
|
1247
|
+
// private static readonly COUNTRY_ENDPOINT = `https://assets.snugdesk.com/metadata/countries.json`;
|
|
1248
|
+
static COUNTRY_ENDPOINT = `https://snugdesk-assets.s3.amazonaws.com/metadata/countries.json`;
|
|
1249
|
+
// private static readonly LANGUAGE_ENDPOINT = `https://assets.snugdesk.com/metadata/languages.json`;
|
|
1250
|
+
static LANGUAGE_ENDPOINT = `https://snugdesk-assets.s3.amazonaws.com/metadata/languages.json`;
|
|
1251
|
+
constructor(httpClient) {
|
|
1252
|
+
this.httpClient = httpClient;
|
|
1253
|
+
}
|
|
1254
|
+
async getAllCountries() {
|
|
1255
|
+
if (!this.countriesData) {
|
|
1256
|
+
this.countriesData = await lastValueFrom(this.httpClient.get(CommonService.COUNTRY_ENDPOINT));
|
|
1257
|
+
}
|
|
1258
|
+
return this.countriesData;
|
|
1259
|
+
}
|
|
1260
|
+
async getCountryFromCallingCode(countryCallingCode) {
|
|
1261
|
+
const countries = await this.getAllCountries();
|
|
1262
|
+
return countries.find((country) => country.callingCode === countryCallingCode);
|
|
1263
|
+
}
|
|
1264
|
+
async getCountryFromCountryCode(countryCode) {
|
|
1265
|
+
const countries = await this.getAllCountries();
|
|
1266
|
+
return countries.find((country) => country.code === countryCode);
|
|
1267
|
+
}
|
|
1268
|
+
async getAllLanguages() {
|
|
1269
|
+
if (!this.languagesData) {
|
|
1270
|
+
this.languagesData = await lastValueFrom(this.httpClient.get(CommonService.LANGUAGE_ENDPOINT));
|
|
1271
|
+
}
|
|
1272
|
+
return this.languagesData;
|
|
1273
|
+
}
|
|
1274
|
+
async getLanguageFromLanguageCode(languageCode) {
|
|
1275
|
+
const languages = await this.getAllLanguages();
|
|
1276
|
+
return languages?.find((language) => language.code === languageCode);
|
|
1277
|
+
}
|
|
1278
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CommonService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1279
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CommonService, providedIn: 'root' });
|
|
1280
|
+
}
|
|
1281
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CommonService, decorators: [{
|
|
1282
|
+
type: Injectable,
|
|
1283
|
+
args: [{
|
|
1284
|
+
providedIn: 'root',
|
|
1285
|
+
}]
|
|
1286
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }] });
|
|
1287
|
+
|
|
1215
1288
|
const FIELDS_ENTITY_TYPE = `
|
|
1216
1289
|
id
|
|
1217
1290
|
externalId
|
|
@@ -1219,6 +1292,8 @@ const FIELDS_ENTITY_TYPE = `
|
|
|
1219
1292
|
name
|
|
1220
1293
|
description
|
|
1221
1294
|
image {
|
|
1295
|
+
key
|
|
1296
|
+
bucket
|
|
1222
1297
|
location
|
|
1223
1298
|
}
|
|
1224
1299
|
createdAt
|
|
@@ -1236,6 +1311,8 @@ const FIELDS_ENTITY = `
|
|
|
1236
1311
|
parentId
|
|
1237
1312
|
name
|
|
1238
1313
|
image {
|
|
1314
|
+
key
|
|
1315
|
+
bucket
|
|
1239
1316
|
location
|
|
1240
1317
|
}
|
|
1241
1318
|
email
|
|
@@ -1287,6 +1364,8 @@ const FIELDS_ENTITY_EXPANDED = `
|
|
|
1287
1364
|
entityTypeId
|
|
1288
1365
|
name
|
|
1289
1366
|
image {
|
|
1367
|
+
key
|
|
1368
|
+
bucket
|
|
1290
1369
|
location
|
|
1291
1370
|
}
|
|
1292
1371
|
isOrganization
|
|
@@ -1307,6 +1386,8 @@ const FIELDS_ENTITY_EXPANDED = `
|
|
|
1307
1386
|
}
|
|
1308
1387
|
name
|
|
1309
1388
|
image {
|
|
1389
|
+
key
|
|
1390
|
+
bucket
|
|
1310
1391
|
location
|
|
1311
1392
|
}
|
|
1312
1393
|
isOrganization
|
|
@@ -1350,6 +1431,8 @@ const FIELDS_ENTITY_MINIMAL = `
|
|
|
1350
1431
|
metadata
|
|
1351
1432
|
name
|
|
1352
1433
|
image {
|
|
1434
|
+
key
|
|
1435
|
+
bucket
|
|
1353
1436
|
location
|
|
1354
1437
|
}
|
|
1355
1438
|
email
|
|
@@ -1568,6 +1651,18 @@ class EntityService {
|
|
|
1568
1651
|
const response = await this.appSyncService.query(statement, gqlAPIServiceArguments);
|
|
1569
1652
|
return response.data.listEntityTypesByTenantId;
|
|
1570
1653
|
}
|
|
1654
|
+
OnEntityByIdListener(id) {
|
|
1655
|
+
const statement = `subscription OnEntityById($id: ID!) {
|
|
1656
|
+
OnEntityById(id: $id) {
|
|
1657
|
+
${FIELDS_ENTITY_EXPANDED}
|
|
1658
|
+
}
|
|
1659
|
+
}`;
|
|
1660
|
+
const gqlAPIServiceArguments = {
|
|
1661
|
+
id,
|
|
1662
|
+
};
|
|
1663
|
+
return this.appSyncService.subscribe(statement, gqlAPIServiceArguments);
|
|
1664
|
+
/* as Observable<SubscriptionResponse<Pick<__SubscriptionContainer, "OnEntityById">>>; */
|
|
1665
|
+
}
|
|
1571
1666
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: EntityService, deps: [{ token: AppSyncHelperService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1572
1667
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: EntityService, providedIn: 'root' });
|
|
1573
1668
|
}
|
|
@@ -1874,79 +1969,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
1874
1969
|
}]
|
|
1875
1970
|
}], ctorParameters: () => [{ type: AppSyncHelperService }] });
|
|
1876
1971
|
|
|
1877
|
-
const FIELDS_LANGUAGE = `
|
|
1878
|
-
code
|
|
1879
|
-
nameEn
|
|
1880
|
-
nameLocal
|
|
1881
|
-
`;
|
|
1882
|
-
const FIELDS_COUNTRY = `
|
|
1883
|
-
code
|
|
1884
|
-
nameEn
|
|
1885
|
-
nameLocal
|
|
1886
|
-
currency {
|
|
1887
|
-
code
|
|
1888
|
-
nameEn
|
|
1889
|
-
}
|
|
1890
|
-
officialLanguage {
|
|
1891
|
-
${FIELDS_LANGUAGE}
|
|
1892
|
-
}
|
|
1893
|
-
callingCode
|
|
1894
|
-
region
|
|
1895
|
-
flag
|
|
1896
|
-
`;
|
|
1897
|
-
const FIELDS_PHONE_NUMBER = `
|
|
1898
|
-
countryCode
|
|
1899
|
-
dialCode
|
|
1900
|
-
e164Number
|
|
1901
|
-
internationalNumber
|
|
1902
|
-
nationalNumber
|
|
1903
|
-
number
|
|
1904
|
-
`;
|
|
1905
|
-
class CommonService {
|
|
1906
|
-
httpClient;
|
|
1907
|
-
countriesData;
|
|
1908
|
-
languagesData;
|
|
1909
|
-
// private static readonly COUNTRY_ENDPOINT = `https://assets.snugdesk.com/metadata/countries.json`;
|
|
1910
|
-
static COUNTRY_ENDPOINT = `https://snugdesk-assets.s3.amazonaws.com/metadata/countries.json`;
|
|
1911
|
-
// private static readonly LANGUAGE_ENDPOINT = `https://assets.snugdesk.com/metadata/languages.json`;
|
|
1912
|
-
static LANGUAGE_ENDPOINT = `https://snugdesk-assets.s3.amazonaws.com/metadata/languages.json`;
|
|
1913
|
-
constructor(httpClient) {
|
|
1914
|
-
this.httpClient = httpClient;
|
|
1915
|
-
}
|
|
1916
|
-
async getAllCountries() {
|
|
1917
|
-
if (!this.countriesData) {
|
|
1918
|
-
this.countriesData = await lastValueFrom(this.httpClient.get(CommonService.COUNTRY_ENDPOINT));
|
|
1919
|
-
}
|
|
1920
|
-
return this.countriesData;
|
|
1921
|
-
}
|
|
1922
|
-
async getCountryFromCallingCode(countryCallingCode) {
|
|
1923
|
-
const countries = await this.getAllCountries();
|
|
1924
|
-
return countries.find((country) => country.callingCode === countryCallingCode);
|
|
1925
|
-
}
|
|
1926
|
-
async getCountryFromCountryCode(countryCode) {
|
|
1927
|
-
const countries = await this.getAllCountries();
|
|
1928
|
-
return countries.find((country) => country.code === countryCode);
|
|
1929
|
-
}
|
|
1930
|
-
async getAllLanguages() {
|
|
1931
|
-
if (!this.languagesData) {
|
|
1932
|
-
this.languagesData = await lastValueFrom(this.httpClient.get(CommonService.LANGUAGE_ENDPOINT));
|
|
1933
|
-
}
|
|
1934
|
-
return this.languagesData;
|
|
1935
|
-
}
|
|
1936
|
-
async getLanguageFromLanguageCode(languageCode) {
|
|
1937
|
-
const languages = await this.getAllLanguages();
|
|
1938
|
-
return languages?.find((language) => language.code === languageCode);
|
|
1939
|
-
}
|
|
1940
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CommonService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1941
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CommonService, providedIn: 'root' });
|
|
1942
|
-
}
|
|
1943
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CommonService, decorators: [{
|
|
1944
|
-
type: Injectable,
|
|
1945
|
-
args: [{
|
|
1946
|
-
providedIn: 'root',
|
|
1947
|
-
}]
|
|
1948
|
-
}], ctorParameters: () => [{ type: i1$2.HttpClient }] });
|
|
1949
|
-
|
|
1950
1972
|
const FIELDS_USER = `
|
|
1951
1973
|
id
|
|
1952
1974
|
externalId
|
|
@@ -1954,6 +1976,8 @@ const FIELDS_USER = `
|
|
|
1954
1976
|
email
|
|
1955
1977
|
name
|
|
1956
1978
|
image {
|
|
1979
|
+
key
|
|
1980
|
+
bucket
|
|
1957
1981
|
location
|
|
1958
1982
|
}
|
|
1959
1983
|
phoneNumber {
|
|
@@ -2151,6 +2175,8 @@ const FIELDS_TEAM = `
|
|
|
2151
2175
|
name
|
|
2152
2176
|
description
|
|
2153
2177
|
image {
|
|
2178
|
+
key
|
|
2179
|
+
bucket
|
|
2154
2180
|
location
|
|
2155
2181
|
}
|
|
2156
2182
|
ticketFields
|
|
@@ -2292,9 +2318,13 @@ const FIELDS_INTERACTION_MINIMAL = `
|
|
|
2292
2318
|
notes
|
|
2293
2319
|
summary
|
|
2294
2320
|
transcription {
|
|
2321
|
+
key
|
|
2322
|
+
bucket
|
|
2295
2323
|
location
|
|
2296
2324
|
}
|
|
2297
2325
|
recording {
|
|
2326
|
+
key
|
|
2327
|
+
bucket
|
|
2298
2328
|
location
|
|
2299
2329
|
}
|
|
2300
2330
|
routeConfiguration {
|
|
@@ -2341,9 +2371,13 @@ const FIELDS_INTERACTION = `
|
|
|
2341
2371
|
notes
|
|
2342
2372
|
summary
|
|
2343
2373
|
transcription {
|
|
2374
|
+
key
|
|
2375
|
+
bucket
|
|
2344
2376
|
location
|
|
2345
2377
|
}
|
|
2346
2378
|
recording {
|
|
2379
|
+
key
|
|
2380
|
+
bucket
|
|
2347
2381
|
location
|
|
2348
2382
|
}
|
|
2349
2383
|
routeConfiguration {
|
|
@@ -2422,9 +2456,13 @@ const FIELDS_INTERACTION_EXPANDED = `
|
|
|
2422
2456
|
notes
|
|
2423
2457
|
summary
|
|
2424
2458
|
transcription {
|
|
2459
|
+
key
|
|
2460
|
+
bucket
|
|
2425
2461
|
location
|
|
2426
2462
|
}
|
|
2427
2463
|
recording {
|
|
2464
|
+
key
|
|
2465
|
+
bucket
|
|
2428
2466
|
location
|
|
2429
2467
|
}
|
|
2430
2468
|
routeConfiguration {
|
|
@@ -2520,6 +2558,8 @@ const FIELDS_INTERACTION_MESSAGE_ATTACHMENT = `
|
|
|
2520
2558
|
size
|
|
2521
2559
|
type
|
|
2522
2560
|
file {
|
|
2561
|
+
key
|
|
2562
|
+
bucket
|
|
2523
2563
|
location
|
|
2524
2564
|
}
|
|
2525
2565
|
createdAt
|
|
@@ -3365,6 +3405,8 @@ const FIELDS_TENANT = `
|
|
|
3365
3405
|
organizationName
|
|
3366
3406
|
websiteURL
|
|
3367
3407
|
image {
|
|
3408
|
+
key
|
|
3409
|
+
bucket
|
|
3368
3410
|
location
|
|
3369
3411
|
}
|
|
3370
3412
|
preferences {
|
|
@@ -3396,6 +3438,8 @@ const FIELDS_TENANT_MINIMAL = `
|
|
|
3396
3438
|
organizationName
|
|
3397
3439
|
websiteURL
|
|
3398
3440
|
image {
|
|
3441
|
+
key
|
|
3442
|
+
bucket
|
|
3399
3443
|
location
|
|
3400
3444
|
}
|
|
3401
3445
|
preferences {
|
|
@@ -3420,6 +3464,8 @@ const FIELDS_TENANT_EXPANDED = `
|
|
|
3420
3464
|
organizationName
|
|
3421
3465
|
websiteURL
|
|
3422
3466
|
image {
|
|
3467
|
+
key
|
|
3468
|
+
bucket
|
|
3423
3469
|
location
|
|
3424
3470
|
}
|
|
3425
3471
|
billingInformation {
|
|
@@ -3491,6 +3537,8 @@ const FIELDS_TENANT_COMPLIANCE_DOCUMENT = `
|
|
|
3491
3537
|
status
|
|
3492
3538
|
notes
|
|
3493
3539
|
file {
|
|
3540
|
+
key
|
|
3541
|
+
bucket
|
|
3494
3542
|
location
|
|
3495
3543
|
}
|
|
3496
3544
|
createdAt
|
|
@@ -4265,5 +4313,5 @@ class CustomValidators {
|
|
|
4265
4313
|
* Generated bundle index. Do not edit.
|
|
4266
4314
|
*/
|
|
4267
4315
|
|
|
4268
|
-
export { AMPLIFY_CONFIG, AppSyncHelperService, CleanDeep, CustomPipesModule, CustomValidators, DomainNamePipe, EncryptedStorageService, EntityConversationService, EntityService, ErrorComponent, FIELDS_ENTITY, FIELDS_ENTITY_CONVERSATION, FIELDS_ENTITY_CONVERSATION_EXPANDED, FIELDS_ENTITY_CONVERSATION_MINIMAL, FIELDS_ENTITY_EXPANDED, FIELDS_ENTITY_MINIMAL, FIELDS_ENTITY_TYPE, FIELDS_INTERACTION, FIELDS_INTERACTION_ATTENDEE, FIELDS_INTERACTION_ATTENDEE_EXPANDED, FIELDS_INTERACTION_ENDPOINT, FIELDS_INTERACTION_ENDPOINT_MINIMAL, FIELDS_INTERACTION_EXPANDED, FIELDS_INTERACTION_HOST, FIELDS_INTERACTION_INVITEE, FIELDS_INTERACTION_MESSAGE, FIELDS_INTERACTION_MESSAGE_ATTACHMENT, FIELDS_INTERACTION_MESSAGE_EXPANDED, FIELDS_INTERACTION_MINIMAL, FIELDS_INTERACTION_WIDGET, FIELDS_INTERACTION_WIDGET_USER_SETTING, FIELDS_TEAM, FIELDS_TEAM_MEMBER, FIELDS_TENANT, FIELDS_TENANT_COMPLIANCE_DOCUMENT, FIELDS_TENANT_EXPANDED, FIELDS_TENANT_MINIMAL, FIELDS_TICKET, FIELDS_TICKET_PRIORITY, FIELDS_TICKET_STATUS, FIELDS_TICKET_TYPE, FIELDS_USER, FIELDS_USER_SESSION, FooterComponent, FormatEpochTimestampPipe, InteractionChannel, InteractionContext, InteractionDirection, InteractionEndpointService, InteractionProvider, InteractionRouteLogic, InteractionService, InteractionStatus, InteractionWidgetService, LoaderComponent, ModelAttributeTypes, ModelSortDirection, OpenSearchHelperService, ProcessingStatus, S3HelperService, SafeHtmlPipe, SearchInnerFieldPipe, SearchPipe, SingularizePipe, SnugdeskAuthenticationService, SnugdeskCoreModule, SnugdeskIPRegistryService, StorageType, TeamService, TenantComplianceDocumentStatus, TenantComplianceDocumentType, TenantSSOConfigurationProtocol, TenantService, TicketService, UserService, UserSessionService, UserStatus, UserType, provideAmplifyConfig };
|
|
4316
|
+
export { AMPLIFY_CONFIG, AppSyncHelperService, CleanDeep, CommonService, CustomPipesModule, CustomValidators, DomainNamePipe, EncryptedStorageService, EntityConversationService, EntityService, ErrorComponent, FIELDS_COUNTRY, FIELDS_ENTITY, FIELDS_ENTITY_CONVERSATION, FIELDS_ENTITY_CONVERSATION_EXPANDED, FIELDS_ENTITY_CONVERSATION_MINIMAL, FIELDS_ENTITY_EXPANDED, FIELDS_ENTITY_MINIMAL, FIELDS_ENTITY_TYPE, FIELDS_INTERACTION, FIELDS_INTERACTION_ATTENDEE, FIELDS_INTERACTION_ATTENDEE_EXPANDED, FIELDS_INTERACTION_ENDPOINT, FIELDS_INTERACTION_ENDPOINT_MINIMAL, FIELDS_INTERACTION_EXPANDED, FIELDS_INTERACTION_HOST, FIELDS_INTERACTION_INVITEE, FIELDS_INTERACTION_MESSAGE, FIELDS_INTERACTION_MESSAGE_ATTACHMENT, FIELDS_INTERACTION_MESSAGE_EXPANDED, FIELDS_INTERACTION_MINIMAL, FIELDS_INTERACTION_WIDGET, FIELDS_INTERACTION_WIDGET_USER_SETTING, FIELDS_LANGUAGE, FIELDS_PHONE_NUMBER, FIELDS_TEAM, FIELDS_TEAM_MEMBER, FIELDS_TENANT, FIELDS_TENANT_COMPLIANCE_DOCUMENT, FIELDS_TENANT_EXPANDED, FIELDS_TENANT_MINIMAL, FIELDS_TICKET, FIELDS_TICKET_PRIORITY, FIELDS_TICKET_STATUS, FIELDS_TICKET_TYPE, FIELDS_USER, FIELDS_USER_SESSION, FooterComponent, FormatEpochTimestampPipe, InteractionChannel, InteractionContext, InteractionDirection, InteractionEndpointService, InteractionProvider, InteractionRouteLogic, InteractionService, InteractionStatus, InteractionWidgetService, LoaderComponent, ModelAttributeTypes, ModelSortDirection, OpenSearchHelperService, ProcessingStatus, S3HelperService, SafeHtmlPipe, SearchInnerFieldPipe, SearchPipe, SingularizePipe, SnugdeskAuthenticationService, SnugdeskCoreModule, SnugdeskIPRegistryService, StorageType, TeamService, TenantComplianceDocumentStatus, TenantComplianceDocumentType, TenantSSOConfigurationProtocol, TenantService, TicketService, UserService, UserSessionService, UserStatus, UserType, provideAmplifyConfig };
|
|
4269
4317
|
//# sourceMappingURL=snugdesk-core.mjs.map
|