@snugdesk/core 0.2.23 → 0.2.25

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.
@@ -1176,6 +1176,21 @@ var InteractionRouteLogic;
1176
1176
  InteractionRouteLogic["PARALLEL"] = "PARALLEL";
1177
1177
  })(InteractionRouteLogic || (InteractionRouteLogic = {}));
1178
1178
 
1179
+ var TenantComplianceDocumentStatus;
1180
+ (function (TenantComplianceDocumentStatus) {
1181
+ TenantComplianceDocumentStatus["ACTIVE"] = "ACTIVE";
1182
+ TenantComplianceDocumentStatus["EXPIRED"] = "EXPIRED";
1183
+ TenantComplianceDocumentStatus["REVOKED"] = "REVOKED";
1184
+ TenantComplianceDocumentStatus["PENDING_VERIFICATION"] = "PENDING_VERIFICATION";
1185
+ })(TenantComplianceDocumentStatus || (TenantComplianceDocumentStatus = {}));
1186
+ var TenantComplianceDocumentType;
1187
+ (function (TenantComplianceDocumentType) {
1188
+ TenantComplianceDocumentType["PAN_CARD"] = "PAN_CARD";
1189
+ TenantComplianceDocumentType["GST_CERTIFICATE"] = "GST_CERTIFICATE";
1190
+ TenantComplianceDocumentType["TDS_REGISTRATION"] = "TDS_REGISTRATION";
1191
+ TenantComplianceDocumentType["GOVT_CERTIFICATE"] = "GOVT_CERTIFICATE";
1192
+ TenantComplianceDocumentType["OTHER"] = "OTHER";
1193
+ })(TenantComplianceDocumentType || (TenantComplianceDocumentType = {}));
1179
1194
  var TenantSSOConfigurationProtocol;
1180
1195
  (function (TenantSSOConfigurationProtocol) {
1181
1196
  TenantSSOConfigurationProtocol["SAML"] = "SAML";
@@ -3125,6 +3140,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
3125
3140
  }]
3126
3141
  }], ctorParameters: () => [{ type: AppSyncHelperService }] });
3127
3142
 
3143
+ const FIELDS_LANGUAGE = `
3144
+ code
3145
+ nameEn
3146
+ nameLocal
3147
+ `;
3148
+ const FIELDS_COUNTRY = `
3149
+ code
3150
+ nameEn
3151
+ nameLocal
3152
+ currency {
3153
+ code
3154
+ nameEn
3155
+ }
3156
+ officialLanguage {
3157
+ ${FIELDS_LANGUAGE}
3158
+ }
3159
+ callingCode
3160
+ region
3161
+ flag
3162
+ `;
3163
+ const FIELDS_PHONE_NUMBER = `
3164
+ countryCode
3165
+ dialCode
3166
+ e164Number
3167
+ internationalNumber
3168
+ nationalNumber
3169
+ number
3170
+ `;
3171
+ class CommonService {
3172
+ httpClient;
3173
+ countriesData;
3174
+ languagesData;
3175
+ // private static readonly COUNTRY_ENDPOINT = `https://assets.snugdesk.com/metadata/countries.json`;
3176
+ static COUNTRY_ENDPOINT = `https://snugdesk-assets.s3.amazonaws.com/metadata/countries.json`;
3177
+ // private static readonly LANGUAGE_ENDPOINT = `https://assets.snugdesk.com/metadata/languages.json`;
3178
+ static LANGUAGE_ENDPOINT = `https://snugdesk-assets.s3.amazonaws.com/metadata/languages.json`;
3179
+ constructor(httpClient) {
3180
+ this.httpClient = httpClient;
3181
+ }
3182
+ async getAllCountries() {
3183
+ if (!this.countriesData) {
3184
+ this.countriesData = await lastValueFrom(this.httpClient.get(CommonService.COUNTRY_ENDPOINT));
3185
+ }
3186
+ return this.countriesData;
3187
+ }
3188
+ async getCountryFromCallingCode(countryCallingCode) {
3189
+ const countries = await this.getAllCountries();
3190
+ return countries.find((country) => country.callingCode === countryCallingCode);
3191
+ }
3192
+ async getCountryFromCountryCode(countryCode) {
3193
+ const countries = await this.getAllCountries();
3194
+ return countries.find((country) => country.code === countryCode);
3195
+ }
3196
+ async getAllLanguages() {
3197
+ if (!this.languagesData) {
3198
+ this.languagesData = await lastValueFrom(this.httpClient.get(CommonService.LANGUAGE_ENDPOINT));
3199
+ }
3200
+ return this.languagesData;
3201
+ }
3202
+ async getLanguageFromLanguageCode(languageCode) {
3203
+ const languages = await this.getAllLanguages();
3204
+ return languages?.find((language) => language.code === languageCode);
3205
+ }
3206
+ 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 });
3207
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CommonService, providedIn: 'root' });
3208
+ }
3209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: CommonService, decorators: [{
3210
+ type: Injectable,
3211
+ args: [{
3212
+ providedIn: 'root',
3213
+ }]
3214
+ }], ctorParameters: () => [{ type: i1$2.HttpClient }] });
3215
+
3128
3216
  const FIELDS_TENANT = `
3129
3217
  id
3130
3218
  externalId
@@ -3132,8 +3220,6 @@ const FIELDS_TENANT = `
3132
3220
  organizationName
3133
3221
  websiteURL
3134
3222
  image {
3135
- key
3136
- bucket
3137
3223
  location
3138
3224
  }
3139
3225
  preferences {
@@ -3157,6 +3243,122 @@ const FIELDS_TENANT = `
3157
3243
  createdAt
3158
3244
  updatedAt
3159
3245
  deletedAt
3246
+ updatedByUserId
3247
+ updatedByUserSessionId
3248
+ `;
3249
+ const FIELDS_TENANT_MINIMAL = `
3250
+ id
3251
+ externalId
3252
+ tenantDomain
3253
+ organizationName
3254
+ websiteURL
3255
+ image {
3256
+ location
3257
+ }
3258
+ preferences {
3259
+ timezoneName
3260
+ language {
3261
+ code
3262
+ nameEn
3263
+ nameLocal
3264
+ }
3265
+ allowUserToChangePreferences
3266
+ }
3267
+ activatedAt
3268
+ blockedAt
3269
+ createdAt
3270
+ updatedAt
3271
+ deletedAt
3272
+ updatedByUserId
3273
+ updatedByUserSessionId
3274
+ `;
3275
+ const FIELDS_TENANT_EXPANDED = `
3276
+ id
3277
+ externalId
3278
+ tenantDomain
3279
+ organizationName
3280
+ websiteURL
3281
+ image {
3282
+ location
3283
+ }
3284
+ billingInformation {
3285
+ companyName
3286
+ address
3287
+ state
3288
+ city
3289
+ postalCode
3290
+ country {
3291
+ ${FIELDS_COUNTRY}
3292
+ }
3293
+ companyIdentificationNumber
3294
+ taxIdentificationNumber
3295
+ }
3296
+ contactInformation {
3297
+ name
3298
+ email
3299
+ phoneNumber {
3300
+ ${FIELDS_PHONE_NUMBER}
3301
+ }
3302
+ address
3303
+ state
3304
+ city
3305
+ postalCode
3306
+ country {
3307
+ ${FIELDS_COUNTRY}
3308
+ }
3309
+ }
3310
+ preferences {
3311
+ timezoneName
3312
+ language {
3313
+ code
3314
+ nameEn
3315
+ nameLocal
3316
+ }
3317
+ allowUserToChangePreferences
3318
+ }
3319
+ ssoConfiguration {
3320
+ provider
3321
+ protocol
3322
+ displayName
3323
+ configuration
3324
+ isEnabled
3325
+ isDefaultLoginMode
3326
+ }
3327
+ security {
3328
+ domainValidationTokenExpiry
3329
+ userValidationTokenExpiry
3330
+ secretTokenExpiry
3331
+ sessionTokenExpiry
3332
+ sessionIdleTimeout
3333
+ }
3334
+ activatedAt
3335
+ blockedAt
3336
+ createdAt
3337
+ updatedAt
3338
+ deletedAt
3339
+ updatedByUserId
3340
+ updatedByUserSessionId
3341
+ `;
3342
+ const FIELDS_TENANT_COMPLIANCE_DOCUMENT = `
3343
+ id
3344
+ tenantId
3345
+ documentName
3346
+ documentType
3347
+ documentNumber
3348
+ legalEntityName
3349
+ issuedBy
3350
+ issueDate
3351
+ expiryDate
3352
+ status
3353
+ notes
3354
+ file {
3355
+ location
3356
+ }
3357
+ createdAt
3358
+ updatedAt
3359
+ deletedAt
3360
+ updatedByUserId
3361
+ updatedByUserSessionId
3160
3362
  `;
3161
3363
  class TenantService {
3162
3364
  appSyncService;
@@ -3173,6 +3375,105 @@ class TenantService {
3173
3375
  const response = await this.appSyncService.query(statement, gqlAPIServiceArguments);
3174
3376
  return response.data?.getTenant;
3175
3377
  }
3378
+ async GetTenantExpanded(id) {
3379
+ const statement = `query GetTenant($id: ID!) {
3380
+ getTenant(id: $id) {
3381
+ ${FIELDS_TENANT_EXPANDED}
3382
+ }
3383
+ }`;
3384
+ const gqlAPIServiceArguments = { id };
3385
+ const response = await this.appSyncService.query(statement, gqlAPIServiceArguments);
3386
+ return response.data?.getTenant;
3387
+ }
3388
+ async CreateTenant(input, condition) {
3389
+ const statement = `mutation CreateTenant($input: CreateTenantInput!, $condition: ModelTenantConditionInput) {
3390
+ createTenant(input: $input, condition: $condition) {
3391
+ ${FIELDS_TENANT_MINIMAL}
3392
+ }
3393
+ }`;
3394
+ const gqlAPIServiceArguments = { input };
3395
+ if (condition) {
3396
+ gqlAPIServiceArguments.condition = condition;
3397
+ }
3398
+ const response = await this.appSyncService.query(statement, gqlAPIServiceArguments);
3399
+ return response.data.createTenant;
3400
+ }
3401
+ async UpdateTenant(input, condition) {
3402
+ const statement = `mutation UpdateTenant($input: UpdateTenantInput!, $condition: ModelTenantConditionInput) {
3403
+ updateTenant(input: $input, condition: $condition) {
3404
+ ${FIELDS_TENANT_MINIMAL}
3405
+ }
3406
+ }`;
3407
+ const gqlAPIServiceArguments = { input };
3408
+ if (condition) {
3409
+ gqlAPIServiceArguments.condition = condition;
3410
+ }
3411
+ const response = await this.appSyncService.query(statement, gqlAPIServiceArguments);
3412
+ return response.data.updateTenant;
3413
+ }
3414
+ async CreateTenantComplianceDocument(input, condition) {
3415
+ const statement = `mutation CreateTenantComplianceDocument($input: CreateTenantComplianceDocumentInput!, $condition: ModelTenantComplianceDocumentConditionInput) {
3416
+ createTenantComplianceDocument(input: $input, condition: $condition) {
3417
+ ${FIELDS_TENANT_COMPLIANCE_DOCUMENT}
3418
+ }
3419
+ }`;
3420
+ const gqlAPIServiceArguments = { input };
3421
+ if (condition) {
3422
+ gqlAPIServiceArguments.condition = condition;
3423
+ }
3424
+ const response = await this.appSyncService.query(statement, gqlAPIServiceArguments);
3425
+ return response.data.createTenantComplianceDocument;
3426
+ }
3427
+ async UpdateTenantComplianceDocument(input, condition) {
3428
+ const statement = `mutation UpdateTenantComplianceDocument($input: UpdateTenantComplianceDocumentInput!, $condition: ModelTenantComplianceDocumentConditionInput) {
3429
+ updateTenantComplianceDocument(input: $input, condition: $condition) {
3430
+ ${FIELDS_TENANT_COMPLIANCE_DOCUMENT}
3431
+ }
3432
+ }`;
3433
+ const gqlAPIServiceArguments = { input };
3434
+ if (condition) {
3435
+ gqlAPIServiceArguments.condition = condition;
3436
+ }
3437
+ const response = await this.appSyncService.query(statement, gqlAPIServiceArguments);
3438
+ return response.data.updateTenantComplianceDocument;
3439
+ }
3440
+ async ListTenantComplianceDocumentsByTenantId(tenantId, updatedAt, sortDirection, filter, limit, nextToken) {
3441
+ const statement = `query ListTenantComplianceDocumentsByTenantId($tenantId: ID!, $updatedAt: ModelIntKeyConditionInput, $sortDirection: ModelSortDirection, $filter: ModelTenantComplianceDocumentFilterInput, $limit: Int, $nextToken: String) {
3442
+ listTenantComplianceDocumentsByTenantId(
3443
+ tenantId: $tenantId
3444
+ updatedAt: $updatedAt
3445
+ sortDirection: $sortDirection
3446
+ filter: $filter
3447
+ limit: $limit
3448
+ nextToken: $nextToken
3449
+ ) {
3450
+ items {
3451
+ ${FIELDS_TENANT_COMPLIANCE_DOCUMENT}
3452
+ }
3453
+ nextToken
3454
+ }
3455
+ }`;
3456
+ const gqlAPIServiceArguments = {
3457
+ tenantId,
3458
+ };
3459
+ if (updatedAt) {
3460
+ gqlAPIServiceArguments.updatedAt = updatedAt;
3461
+ }
3462
+ if (sortDirection) {
3463
+ gqlAPIServiceArguments.sortDirection = sortDirection;
3464
+ }
3465
+ if (filter) {
3466
+ gqlAPIServiceArguments.filter = filter;
3467
+ }
3468
+ if (limit) {
3469
+ gqlAPIServiceArguments.limit = limit;
3470
+ }
3471
+ if (nextToken) {
3472
+ gqlAPIServiceArguments.nextToken = nextToken;
3473
+ }
3474
+ const response = await this.appSyncService.query(statement, gqlAPIServiceArguments);
3475
+ return response.data.listTenantComplianceDocumentsByTenantId;
3476
+ }
3176
3477
  OnTenantByIdListener(id) {
3177
3478
  const statement = `subscription OnTenantById($id: ID!) {
3178
3479
  OnTenantById(id: $id) {
@@ -3825,5 +4126,5 @@ class CustomValidators {
3825
4126
  * Generated bundle index. Do not edit.
3826
4127
  */
3827
4128
 
3828
- 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_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, TenantSSOConfigurationProtocol, TenantService, TicketService, UserService, UserSessionService, UserStatus, UserType, provideAmplifyConfig };
4129
+ 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 };
3829
4130
  //# sourceMappingURL=snugdesk-core.mjs.map