@diia-inhouse/analytics 1.61.0
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/LICENCE.md +287 -0
- package/README.md +93 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/actionResult.js +30 -0
- package/dist/interfaces/actionResult.js.map +1 -0
- package/dist/interfaces/actionType.js +27 -0
- package/dist/interfaces/actionType.js.map +1 -0
- package/dist/interfaces/analytics.js +3 -0
- package/dist/interfaces/analytics.js.map +1 -0
- package/dist/interfaces/categories.js +13 -0
- package/dist/interfaces/categories.js.map +1 -0
- package/dist/interfaces/data.js +3 -0
- package/dist/interfaces/data.js.map +1 -0
- package/dist/interfaces/device.js +3 -0
- package/dist/interfaces/device.js.map +1 -0
- package/dist/interfaces/index.js +25 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/nextGenAnalytics.js +3 -0
- package/dist/interfaces/nextGenAnalytics.js.map +1 -0
- package/dist/interfaces/rating.js +350 -0
- package/dist/interfaces/rating.js.map +1 -0
- package/dist/mocks/analytics.js +77 -0
- package/dist/mocks/analytics.js.map +1 -0
- package/dist/mocks/index.js +18 -0
- package/dist/mocks/index.js.map +1 -0
- package/dist/services/analytics.js +146 -0
- package/dist/services/analytics.js.map +1 -0
- package/dist/services/index.js +18 -0
- package/dist/services/index.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interfaces/actionResult.d.ts +25 -0
- package/dist/types/interfaces/actionType.d.ts +22 -0
- package/dist/types/interfaces/analytics.d.ts +37 -0
- package/dist/types/interfaces/categories.d.ts +8 -0
- package/dist/types/interfaces/data.d.ts +25 -0
- package/dist/types/interfaces/device.d.ts +8 -0
- package/dist/types/interfaces/index.d.ts +8 -0
- package/dist/types/interfaces/nextGenAnalytics.d.ts +15 -0
- package/dist/types/interfaces/rating.d.ts +452 -0
- package/dist/types/mocks/analytics.d.ts +2 -0
- package/dist/types/mocks/index.d.ts +1 -0
- package/dist/types/services/analytics.d.ts +19 -0
- package/dist/types/services/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/rating.d.ts +8 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/rating.js +151 -0
- package/dist/utils/rating.js.map +1 -0
- package/package.json +94 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare enum AnalyticsActionResult {
|
|
2
|
+
Error = "error",
|
|
3
|
+
Success = "success",
|
|
4
|
+
NotFound = "notFound",
|
|
5
|
+
NoPhoto = "noPhoto",
|
|
6
|
+
NeedVerification = "needVerification",
|
|
7
|
+
Confirming = "confirming",
|
|
8
|
+
NotConfirmed = "notConfirmed",
|
|
9
|
+
Declined = "declined",
|
|
10
|
+
Inactive = "inactive",
|
|
11
|
+
UnavailableLegalReasons = "unavailableLegalReasons",
|
|
12
|
+
Booked = "booked",
|
|
13
|
+
NotBooked = "notBooked",
|
|
14
|
+
Allowed = "allowed",
|
|
15
|
+
NotAllowed = "notAllowed",
|
|
16
|
+
Prepared = "prepared",
|
|
17
|
+
NotPrepared = "notPrepared",
|
|
18
|
+
Delivered = "delivered",
|
|
19
|
+
NotDelivered = "notDelivered",
|
|
20
|
+
Available = "available",
|
|
21
|
+
NotAvailable = "notAvailable",
|
|
22
|
+
NewUser = "newUser",
|
|
23
|
+
Yes = "yes",
|
|
24
|
+
No = "no"
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum AnalyticsActionType {
|
|
2
|
+
AddBranch = "addBranch",
|
|
3
|
+
UpdateBranch = "updateBranch",
|
|
4
|
+
RemoveBranch = "removeBranch",
|
|
5
|
+
AddOffer = "addOffer",
|
|
6
|
+
RemoveOffer = "removeOffer",
|
|
7
|
+
Booking = "booking",
|
|
8
|
+
Permission = "permission",
|
|
9
|
+
Preparation = "preparation",
|
|
10
|
+
Delivery = "delivery",
|
|
11
|
+
Push = "push",
|
|
12
|
+
AddAppVersion = "addAppVersion",
|
|
13
|
+
RemoveAppVersion = "removeAppVersion",
|
|
14
|
+
AppStatus = "appStatus",
|
|
15
|
+
Attestation = "attestation",
|
|
16
|
+
Validation = "validation",
|
|
17
|
+
Check = "check",
|
|
18
|
+
GetGroups = "getGroups",
|
|
19
|
+
IsGroupAvailable = "IsGroupAvailable",
|
|
20
|
+
SignUp = "signUp",
|
|
21
|
+
SignOut = "signOut"
|
|
22
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import { AnalyticsActionResult } from './actionResult';
|
|
3
|
+
import { AnalyticsActionType } from './actionType';
|
|
4
|
+
import { AnalyticsCategory } from './categories';
|
|
5
|
+
import { AcquirerAnalyticsData, NotificationAnalyticsData, UserAnalyticsData } from './data';
|
|
6
|
+
import { AnalyticsDevice } from './device';
|
|
7
|
+
interface BaseAnalytics {
|
|
8
|
+
date: string;
|
|
9
|
+
category: AnalyticsCategory;
|
|
10
|
+
action: {
|
|
11
|
+
type: AnalyticsActionType;
|
|
12
|
+
result: AnalyticsActionResult;
|
|
13
|
+
};
|
|
14
|
+
appVersion?: string;
|
|
15
|
+
device?: AnalyticsDevice;
|
|
16
|
+
}
|
|
17
|
+
export interface AcquirerAnalytics extends BaseAnalytics {
|
|
18
|
+
acquirer?: ObjectId;
|
|
19
|
+
identifier?: string;
|
|
20
|
+
data?: AcquirerAnalyticsData;
|
|
21
|
+
}
|
|
22
|
+
export interface NotificationAnalytics extends BaseAnalytics {
|
|
23
|
+
data?: NotificationAnalyticsData;
|
|
24
|
+
}
|
|
25
|
+
export interface UserAnalytics extends BaseAnalytics {
|
|
26
|
+
identifier: string;
|
|
27
|
+
data?: UserAnalyticsData;
|
|
28
|
+
}
|
|
29
|
+
export interface AuthAnalytics extends BaseAnalytics {
|
|
30
|
+
identifier: string;
|
|
31
|
+
data?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
export type Analytics = AcquirerAnalytics | NotificationAnalytics | UserAnalytics | AuthAnalytics;
|
|
34
|
+
export interface AnalyticsLog {
|
|
35
|
+
analytics: Analytics;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface AcquirerAnalyticsPackageItem {
|
|
2
|
+
scope: string;
|
|
3
|
+
document: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AcquirerAnalyticsData {
|
|
6
|
+
branch?: string;
|
|
7
|
+
branchScopes?: Record<string, unknown>;
|
|
8
|
+
offer?: string;
|
|
9
|
+
scopeType?: string;
|
|
10
|
+
offerScopes?: Record<string, unknown>;
|
|
11
|
+
request?: string;
|
|
12
|
+
scopeList?: Record<string, unknown>;
|
|
13
|
+
scopes?: Record<string, unknown> | unknown[];
|
|
14
|
+
reason?: string;
|
|
15
|
+
package?: AcquirerAnalyticsPackageItem[];
|
|
16
|
+
offerRequestType?: string;
|
|
17
|
+
deliveryTypes?: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface UserAnalyticsData {
|
|
20
|
+
lastActivityDate: string;
|
|
21
|
+
lastDocumentUpdate: string;
|
|
22
|
+
}
|
|
23
|
+
export interface NotificationAnalyticsData {
|
|
24
|
+
reason: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ObjectId } from 'bson';
|
|
2
|
+
import { AnalyticsDevice } from './device';
|
|
3
|
+
export interface NextGenAnalytics {
|
|
4
|
+
date: string;
|
|
5
|
+
category: string;
|
|
6
|
+
action: {
|
|
7
|
+
type: string;
|
|
8
|
+
result: string;
|
|
9
|
+
};
|
|
10
|
+
identifier?: string;
|
|
11
|
+
acquirer?: ObjectId;
|
|
12
|
+
appVersion?: string;
|
|
13
|
+
device?: AnalyticsDevice;
|
|
14
|
+
data?: Record<string, unknown>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import { NotificationTemplateParams } from '@diia-inhouse/types';
|
|
2
|
+
export declare enum RatingCategory {
|
|
3
|
+
PublicService = "public-service",
|
|
4
|
+
Document = "document",
|
|
5
|
+
DiiaId = "diia-id"
|
|
6
|
+
}
|
|
7
|
+
export declare enum DiiaIdServiceCode {
|
|
8
|
+
Authorization = "authorization",
|
|
9
|
+
Signing = "signing"
|
|
10
|
+
}
|
|
11
|
+
export declare enum RatingType {
|
|
12
|
+
UserInitiative = "userInitiative",
|
|
13
|
+
ByRequest = "byRequest"
|
|
14
|
+
}
|
|
15
|
+
export declare enum RatingAvailabilityProcessCode {
|
|
16
|
+
RatingAlreadySaved = 47101002,
|
|
17
|
+
RatingMissingTaxpayerCard = 47101003
|
|
18
|
+
}
|
|
19
|
+
export declare enum RatingChipCommon {
|
|
20
|
+
RegistryUnavailable = "registryUnavailable",
|
|
21
|
+
IncorrectData = "incorrectData",
|
|
22
|
+
MoreOneTry = "moreOneTry",
|
|
23
|
+
Other = "other",
|
|
24
|
+
LongServiceSearch = "longServiceSearch",
|
|
25
|
+
LongApplicationProcessing = "longApplicationProcessing",
|
|
26
|
+
NotComprehensibleText = "notComprehensibleText",
|
|
27
|
+
ComprehensibleText = "comprehensibleText",
|
|
28
|
+
EnoughHints = "enoughHints",
|
|
29
|
+
NotEnoughHints = "notEnoughHints",
|
|
30
|
+
Design = "design",
|
|
31
|
+
BadDesign = "badDesign",
|
|
32
|
+
EasyFast = "easyFast",
|
|
33
|
+
WasWaitingForService = "wasWaitingForService",
|
|
34
|
+
PostOfficeInteraction = "postOfficeInteraction",
|
|
35
|
+
UsefulService = "usefulService",
|
|
36
|
+
SeveralPaymentAttempts = "severalPaymentAttempts",
|
|
37
|
+
SigningError = "signingError",
|
|
38
|
+
LicenseWasNotDisplayed = "licenseWasNotDisplayed",
|
|
39
|
+
LicensePlateSelection = "licensePlateSelection",
|
|
40
|
+
LongRegistration = "longRegistration",
|
|
41
|
+
AddressError = "addressError",
|
|
42
|
+
DigitalDocument = "digitalDocument",
|
|
43
|
+
DemocracyInSmartphone = "democracyInSmartphone",
|
|
44
|
+
UntimelyCert = "UntimelyCert",
|
|
45
|
+
GotError = "gotError",
|
|
46
|
+
GeolocationNotConfirmed = "geolocationNotConfirmed",
|
|
47
|
+
StreetMissing = "streetMissing",
|
|
48
|
+
GotRefuse = "gotRefuse",
|
|
49
|
+
AutomaticService = "automaticService",
|
|
50
|
+
NeededHelp = "neededHelp",
|
|
51
|
+
MissingData = "missingData",
|
|
52
|
+
EmploymentCenterInteraction = "employmentCenterInteraction",
|
|
53
|
+
NoNotification = "noNotification",
|
|
54
|
+
PaymentFee = "paymentFee",
|
|
55
|
+
PaymentOptions = "paymentOptions",
|
|
56
|
+
PaymentProcessing = "paymentProcessing",
|
|
57
|
+
PaymentIssues = "paymentIssues",
|
|
58
|
+
Delivery = "delivery",
|
|
59
|
+
FastPayment = "fastPayment",
|
|
60
|
+
InconvenientPlayer = "inconvenientPlayer",
|
|
61
|
+
SlowLoading = "slowLoading",
|
|
62
|
+
NotEnoughRadioWaves = "notEnoughRadioWaves",
|
|
63
|
+
NotEnoughChannels = "notEnoughChannels",
|
|
64
|
+
NotTheFirstTimePayment = "notTheFirstTimePayment",
|
|
65
|
+
Convenient = "convenient",
|
|
66
|
+
Inconvenient = "inconvenient",
|
|
67
|
+
IntuitiveInterface = "intuitiveInterface",
|
|
68
|
+
NoTariffing = "noTariffing",
|
|
69
|
+
NoTVProgram = "noTVProgram",
|
|
70
|
+
PushNotReceived = "pushNotReceived",
|
|
71
|
+
VehicleLicenseIsStillActive = "vehicleLicenseIsStillActive",
|
|
72
|
+
Mobility = "mobility",
|
|
73
|
+
BadConditions = "badConditions",
|
|
74
|
+
LostPayment = "lostPayment",
|
|
75
|
+
FrequentUse = "frequentUse",
|
|
76
|
+
InteractionWithServiceCenter = "interactionWithServiceCenter",
|
|
77
|
+
BadInteractionWithServiceCenter = "badInteractionWithServiceCenter",
|
|
78
|
+
DownloadSolutionFile = "downloadSolutionFile",
|
|
79
|
+
AddMeetingCalendar = "addMeetingCalendar",
|
|
80
|
+
NoFineCame = "noFineCame",
|
|
81
|
+
TakesALongToLoad = "takesALongToLoad",
|
|
82
|
+
IrrelevantInformation = "irrelevantInformation",
|
|
83
|
+
AlwayRelevantInformation = "alwayRelevantInformation",
|
|
84
|
+
NotUnderstandingWhatNext = "notUnderstandingWhatNext",
|
|
85
|
+
WrongfulRefusal = "wrongfulRefusal",
|
|
86
|
+
UploadingPhoto = "uploadingPhoto",
|
|
87
|
+
LimitedSelectionCities = "limitedSelectionCities",
|
|
88
|
+
BadPartnersInteraction = "badPartnersInteraction",
|
|
89
|
+
ContributionVictory = "contributionVictory",
|
|
90
|
+
PartnersInteraction = "partnersInteraction"
|
|
91
|
+
}
|
|
92
|
+
export type RatingServiceCode = DiiaIdServiceCode | string;
|
|
93
|
+
/** @deprecated */
|
|
94
|
+
export declare enum RatingChip {
|
|
95
|
+
NeedesHelp = "needesHelp" /** @deprecated use NeededHelp instead */,
|
|
96
|
+
RegistryUnavailable = "registryUnavailable",
|
|
97
|
+
OutdatedData = "outdatedData" /** @deprecated use IncorrectData instead */,
|
|
98
|
+
IncorrectData = "incorrectData",
|
|
99
|
+
MoreOneTry = "moreOneTry",
|
|
100
|
+
Other = "other",
|
|
101
|
+
LongServiceSearch = "longServiceSearch",
|
|
102
|
+
LongProcessing = "longProcessing" /** @deprecated use LongApplicationProcessing instead */,
|
|
103
|
+
LongApplicationProcessing = "longApplicationProcessing",
|
|
104
|
+
NotComprehensibleText = "notComprehensibleText",
|
|
105
|
+
ComprehensibleText = "comprehensibleText",
|
|
106
|
+
EnoughHints = "enoughHints",
|
|
107
|
+
NotEnoughHints = "notEnoughHints",
|
|
108
|
+
Design = "design",
|
|
109
|
+
BadDesign = "badDesign",
|
|
110
|
+
EasyFast = "easyFast",
|
|
111
|
+
WasWaitingForService = "wasWaitingForService",
|
|
112
|
+
PostOfficeInteraction = "postOfficeInteraction",
|
|
113
|
+
UsefulService = "usefulService",
|
|
114
|
+
SeveralPaymentAttempts = "severalPaymentAttempts",
|
|
115
|
+
SigningError = "signingError",
|
|
116
|
+
LicenseWasNotDisplayed = "licenseWasNotDisplayed",
|
|
117
|
+
AddressError = "addressError",
|
|
118
|
+
DigitalDocument = "digitalDocument",
|
|
119
|
+
UntimelyCert = "UntimelyCert",
|
|
120
|
+
NotTheFirstTime = "notTheFirstTime",
|
|
121
|
+
GotError = "gotError",
|
|
122
|
+
GeolocationNotConfirmed = "geolocationNotConfirmed",
|
|
123
|
+
StreetMissing = "streetMissing",
|
|
124
|
+
GotRefuse = "gotRefuse",
|
|
125
|
+
AutomaticService = "automaticService",
|
|
126
|
+
InteractionWithCommission = "interactionWithCommission",
|
|
127
|
+
WrongfulRefusal = "wrongfulRefusal",
|
|
128
|
+
RefusalDueToRepairsMade = "RefusalDueToRepairsMade",
|
|
129
|
+
NeededHelp = "neededHelp",
|
|
130
|
+
MissingData = "missingData",
|
|
131
|
+
EmploymentCenterInteraction = "employmentCenterInteraction",
|
|
132
|
+
NoNotification = "noNotification",
|
|
133
|
+
PaymentFee = "paymentFee",
|
|
134
|
+
PaymentOptions = "paymentOptions",
|
|
135
|
+
FastPayment = "fastPayment",
|
|
136
|
+
InconvenientPlayer = "inconvenientPlayer",
|
|
137
|
+
SlowLoading = "slowLoading",
|
|
138
|
+
NotEnoughRadioWaves = "notEnoughRadioWaves",
|
|
139
|
+
NotEnoughChannels = "notEnoughChannels",
|
|
140
|
+
Convenient = "convenient",
|
|
141
|
+
Inconvenient = "inconvenient",
|
|
142
|
+
IntuitiveInterface = "intuitiveInterface",
|
|
143
|
+
NoTariffing = "noTariffing",
|
|
144
|
+
NoTVProgram = "noTVProgram",
|
|
145
|
+
PushNotReceived = "pushNotReceived",
|
|
146
|
+
VehicleLicenseIsStillActive = "vehicleLicenseIsStillActive",
|
|
147
|
+
AllInSmartphone = "allInSmartphone" /** @deprecated use Mobility instead */,
|
|
148
|
+
ComplexServices = "complexServices" /** @deprecated use Mobility instead */,
|
|
149
|
+
Mobility = "mobility",
|
|
150
|
+
BadConditions = "badConditions",
|
|
151
|
+
LostPayment = "lostPayment",
|
|
152
|
+
FrequentUse = "frequentUse",
|
|
153
|
+
NotAcceptDocument = "notAcceptDocument",
|
|
154
|
+
UsePlastic = "usePlastic",
|
|
155
|
+
NotUsePlastic = "notUsePlastic",
|
|
156
|
+
DocumentNotDisplayedSometimes = "documentNotDisplayedSometimes",
|
|
157
|
+
GoogleServices = "googleServices",
|
|
158
|
+
ForwardingFromApplication = "forwardingFromApplication",
|
|
159
|
+
NotFindColleagues = "notFindColleagues",
|
|
160
|
+
MissingUnit = "missingUnit",
|
|
161
|
+
ProblemsApproval = "problemsApproval",
|
|
162
|
+
QrCodeError = "qrCodeError",
|
|
163
|
+
ApplicationSubmission = "applicationSubmission",
|
|
164
|
+
BadBankInteraction = "badBankInteraction",
|
|
165
|
+
NoLiquidatedBank = "noLiquidatedBank",
|
|
166
|
+
AccountOpeningProblems = "accountOpeningProblems",
|
|
167
|
+
BankInteraction = "bankInteraction",
|
|
168
|
+
SetUpNotifications = "setUpNotifications",
|
|
169
|
+
AddPostOffices = "addPostOffices",
|
|
170
|
+
ImproveDelivery = "improveDelivery",
|
|
171
|
+
AwardOffline = "awardOffline",
|
|
172
|
+
EverythingYouDo = "everythingYouDo",
|
|
173
|
+
ConvenientDelivery = "convenientDelivery",
|
|
174
|
+
DeleteFunction = "deleteFunction",
|
|
175
|
+
OnlineOfflineVersions = "onlineOfflineVersions"
|
|
176
|
+
}
|
|
177
|
+
export declare enum RatingScore {
|
|
178
|
+
Awful = "1",
|
|
179
|
+
Bad = "2",
|
|
180
|
+
Ok = "3",
|
|
181
|
+
Good = "4",
|
|
182
|
+
Excellent = "5"
|
|
183
|
+
}
|
|
184
|
+
export declare enum CustomRatingFormCode {
|
|
185
|
+
PenaltiesPaid = "penaltiesPaid",
|
|
186
|
+
PenaltiesPaidOutside = "penaltiesPaidOutside",
|
|
187
|
+
CancelProperUser = "cancelProperUser",
|
|
188
|
+
PollClosed = "pollClosed",
|
|
189
|
+
DebtsIn = "debtsIn",
|
|
190
|
+
DebtsOut = "debtsOut",
|
|
191
|
+
ResidenceRegistrationApplicant = "residenceRegistrationApplicant",
|
|
192
|
+
ResidenceRegistrationOwner = "residenceRegistrationOwner",
|
|
193
|
+
ResidenceRegistrationParent = "residenceRegistrationParent",
|
|
194
|
+
DepositGuaranteePaymentsDoneRefuse = "depositGuaranteePaymentsDoneRefuse",
|
|
195
|
+
ReplacementDriverLicenseWithPlastic = "replacementDriverLicenseWithPlastic" /** @deprecated use ReplacementDriverLicenseWithPlasticPickup instead */,
|
|
196
|
+
ReplacementDriverLicenseWithPlasticPickup = "replacementDriverLicenseWithPlasticPickup",
|
|
197
|
+
ReplacementDriverLicenseWithPlasticPost = "replacementDriverLicenseWithPlasticPost",
|
|
198
|
+
ReplacementDriverLicenseDigitalOnly = "replacementDriverLicenseDigitalOnly",
|
|
199
|
+
DamagedPropertyDecision = "damagedPropertyDecision",
|
|
200
|
+
DestroyedPropertyDecision = "destroyedPropertyDecision",
|
|
201
|
+
DamagedPropertyRepairMessage = "damagedPropertyRepairMessage",
|
|
202
|
+
CourtPenaltiesPaid = "courtPenaltiesPaid",
|
|
203
|
+
MortgageDone = "mortgageDone",
|
|
204
|
+
TargetFeedbackShelters = "targetFeedbackShelters",
|
|
205
|
+
TargetFeedbackInvincibility = "targetFeedbackInvincibility",
|
|
206
|
+
MilitaryBondsDoneRefuse = "militaryBondsDoneRefuse"
|
|
207
|
+
}
|
|
208
|
+
export type ScreenCode = StaticScreenCode | string;
|
|
209
|
+
export declare enum StaticScreenCode {
|
|
210
|
+
Document = "document",
|
|
211
|
+
Start = "start",
|
|
212
|
+
Home = "home",
|
|
213
|
+
Status = "status",
|
|
214
|
+
ChildrenCertificatesSelection = "childrenCertificatesSelection",
|
|
215
|
+
ReasonSelection = "reasonSelection",
|
|
216
|
+
CertTypeSelection = "certTypeSelection",
|
|
217
|
+
RequesterData = "requesterData",
|
|
218
|
+
BirthPlace = "birthPlace",
|
|
219
|
+
Nationality = "nationality",
|
|
220
|
+
RegistrationPlace = "registrationPlace",
|
|
221
|
+
RegistrationPlaceSelection = "registrationPlaceSelection",
|
|
222
|
+
Contacts = "contacts",
|
|
223
|
+
Application = "application",
|
|
224
|
+
VehicleSelection = "vehicleSelection",
|
|
225
|
+
VehiclePrice = "vehiclePrice",
|
|
226
|
+
LicensePlateType = "licensePlateType",
|
|
227
|
+
GenLicensePlate = "genLicensePlate",
|
|
228
|
+
LicensePlates = "licensePlates",
|
|
229
|
+
VehicleLicenseType = "vehicleLicenseType",
|
|
230
|
+
ExpirationDateSelection = "expirationDateSelection",
|
|
231
|
+
Sharing = "sharing",
|
|
232
|
+
SharingCancelProperUser = "sharingCancelProperUser",
|
|
233
|
+
ConfirmationRequest = "confirmationRequest",
|
|
234
|
+
ProperUsers = "properUsers",
|
|
235
|
+
ProperUser = "properUser",
|
|
236
|
+
StartCancelProperUser = "startCancelProperUser",
|
|
237
|
+
StatusCancelProperUser = "statusCancelProperUser",
|
|
238
|
+
ApplicationCancelProperUser = "applicationCancelProperUser",
|
|
239
|
+
LedSelection = "ledSelection",
|
|
240
|
+
LedExchange = "ledExchange",
|
|
241
|
+
PostOfficeSelection = "postOfficeSelection",
|
|
242
|
+
DocumentTypeSelection = "documentTypeSelection",
|
|
243
|
+
ResidenceCert = "residenceCert",
|
|
244
|
+
CurrentResidencePlaceSelection = "currentResidencePlaceSelection",
|
|
245
|
+
CurrentResidencePlaceConfirmation = "currentResidencePlaceConfirmation",
|
|
246
|
+
BankAccountSelection = "bankAccountSelection",
|
|
247
|
+
AssistanceTypes = "assistanceTypes",
|
|
248
|
+
Payment = "payment",
|
|
249
|
+
AllCertificatesDoneOk5 = "allCertificatesDoneOk5",
|
|
250
|
+
AllCertificatesDoneOk7 = "allCertificatesDoneOk7",
|
|
251
|
+
ConfirmJobLoss = "confirmJobLoss",
|
|
252
|
+
EmploymentCenterRegistration = "employmentCenterRegistration",
|
|
253
|
+
AddPassportData = "addPassportData",
|
|
254
|
+
ConfirmationAwaiting = "confirmationAwaiting",
|
|
255
|
+
PropertyTypes = "propertyTypes",
|
|
256
|
+
ObjectApplications = "objectApplications",
|
|
257
|
+
ObjectMessages = "objectMessages",
|
|
258
|
+
ApplicationStatus = "applicationStatus",
|
|
259
|
+
MessageStatus = "messageStatus",
|
|
260
|
+
ApplicationMessages = "applicationMessages",
|
|
261
|
+
Onboarding = "onboarding",
|
|
262
|
+
RepairsQuestions = "repairsQuestions",
|
|
263
|
+
BenefitsQuestions = "benefitsQuestions",
|
|
264
|
+
CardAwaiting = "cardAwaiting",
|
|
265
|
+
LinkDrrp = "linkDrrp",
|
|
266
|
+
DiiaRadio = "diiaRadio",
|
|
267
|
+
DiiaRadioPlaying = "diiaRadioPlaying",
|
|
268
|
+
DiiaRadioPaused = "diiaRadioPaused",
|
|
269
|
+
DiiaTVPlaying = "diiaTVPlaying",
|
|
270
|
+
TvChannelSelection = "tvChannelSelection",
|
|
271
|
+
DamageMessages = "damageMessages",
|
|
272
|
+
DamagedPropertyRecovery = "damagedPropertyRecovery",
|
|
273
|
+
ChooseDrrpObject = "chooseDrrpObject",
|
|
274
|
+
AddManualObject = "addManualObject",
|
|
275
|
+
AddManualObjectAddress = "addManualObjectAddress",
|
|
276
|
+
DamageAssessment = "damageAssessment",
|
|
277
|
+
DamagesFixing = "damagesFixing",
|
|
278
|
+
NewAdultRegistration = "newAdultRegistration",
|
|
279
|
+
NewChildRegistration = "newChildRegistration",
|
|
280
|
+
Adult = "adult",
|
|
281
|
+
AddBirthCertificate = "addBirthCertificate",
|
|
282
|
+
AddBirthCertificateOwnersChild = "addBirthCertificateOwnersChild",
|
|
283
|
+
ApproveOwnerData = "approveOwnerData",
|
|
284
|
+
LiquidatedBanks = "liquidatedBanks",
|
|
285
|
+
CurrentAdultRegistration = "currentAdultRegistration",
|
|
286
|
+
CurrentChildRegistration = "currentChildRegistration",
|
|
287
|
+
ContactsOwner = "contactsOwner",
|
|
288
|
+
PenaltiesPaidOutside = "penaltiesPaidOutside",
|
|
289
|
+
Penalties = "penalties",
|
|
290
|
+
CriminalRecordCertificate = "criminalRecordCertificate",
|
|
291
|
+
ReplacementDriverLicense = "replacementDriverLicense",
|
|
292
|
+
QuizArchive = "quizArchive",
|
|
293
|
+
QuizDetailsActive = "quizDetailsActive",
|
|
294
|
+
QuizDetailsClose = "quizDetailsClose",
|
|
295
|
+
OfficialsPoll = "officialsPoll",
|
|
296
|
+
OfficialsWorkspace = "officialsWorkspace",
|
|
297
|
+
OfficialsBadges = "officialsBadges",
|
|
298
|
+
OfficialsSearchColleagues = "officialsSearchColleagues",
|
|
299
|
+
BenefitsConfirmation = "benefitsConfirmation",
|
|
300
|
+
OwnersConfirmation = "ownersConfirmation",
|
|
301
|
+
CourtCasesDetails = "courtCasesDetails",
|
|
302
|
+
CourtCasesDecisions = "courtCasesDecisions",
|
|
303
|
+
CourtCasesDecisionsDetails = "courtCasesDecisionsDetails",
|
|
304
|
+
CourtCasesHearings = "courtCasesHearings",
|
|
305
|
+
CourtCasesHearingsDetails = "courtCasesHearingsDetails",
|
|
306
|
+
AllApplications = "allApplications",
|
|
307
|
+
DownloadList = "downloadList",
|
|
308
|
+
Map = "map",
|
|
309
|
+
MaritalStatus = "maritalStatus",
|
|
310
|
+
ChildrenNumber = "childrenNumber",
|
|
311
|
+
Income = "income",
|
|
312
|
+
MortgageApartment = "mortgageApartment",
|
|
313
|
+
AddressMortgageApartment = "addressMortgageApartment",
|
|
314
|
+
MortgageBanks = "mortgageBanks",
|
|
315
|
+
SelectionRepairStage = "selectionRepairStage",
|
|
316
|
+
MediaUpload = "mediaUpload",
|
|
317
|
+
StartBookingFunds = "startBookingFunds",
|
|
318
|
+
SelectionBookingCertificate = "selectionBookingCertificate",
|
|
319
|
+
MapPointDetails = "mapPointDetails",
|
|
320
|
+
TargetFeedbackInvincibility = "targetFeedbackInvincibility",
|
|
321
|
+
TargetFeedbackShelters = "targetFeedbackShelters",
|
|
322
|
+
Specialities = "specialities",
|
|
323
|
+
AvailableBonds = "availableBonds",
|
|
324
|
+
AvailableBondsPartners = "availableBondsPartners",
|
|
325
|
+
AvailableBondsPartnersCart = "availableBondsPartnersCart",
|
|
326
|
+
CompensationType = "compensationType",
|
|
327
|
+
RepeatedDeliveryApplication = "repeatedDeliveryApplication",
|
|
328
|
+
RepeatedDeliveryContacts = "repeatedDeliveryContacts",
|
|
329
|
+
RepeatedDeliveryMethodsOfObtaining = "repeatedDeliveryMethodsOfObtaining",
|
|
330
|
+
DepartmentSelection = "departmentSelection",
|
|
331
|
+
DeliveryAddressDefinition = "deliveryAddressDefinition",
|
|
332
|
+
ConstructingStartMessage = "constructingStartMessage",
|
|
333
|
+
ConstructingCompletionMessage = "constructingCompletionMessage"
|
|
334
|
+
}
|
|
335
|
+
export type RatingFormCode = RatingServiceCode | CustomRatingFormCode;
|
|
336
|
+
export interface RatingForm<T = string> {
|
|
337
|
+
formCode?: RatingFormCode;
|
|
338
|
+
resourceId?: string;
|
|
339
|
+
title: string;
|
|
340
|
+
rating: {
|
|
341
|
+
label: string;
|
|
342
|
+
items: RatingItem<T>[];
|
|
343
|
+
};
|
|
344
|
+
comment: {
|
|
345
|
+
label: string;
|
|
346
|
+
hint: string;
|
|
347
|
+
};
|
|
348
|
+
mainButton: string;
|
|
349
|
+
}
|
|
350
|
+
export interface RatingItem<T = string> {
|
|
351
|
+
rate: RatingScore;
|
|
352
|
+
emoji: string;
|
|
353
|
+
chip: {
|
|
354
|
+
label: string;
|
|
355
|
+
description: string;
|
|
356
|
+
chips: RatingChipMeta<T>[];
|
|
357
|
+
};
|
|
358
|
+
chipBlocks?: ChipBlock<T>[];
|
|
359
|
+
}
|
|
360
|
+
export interface ChipBlock<T> {
|
|
361
|
+
label: string;
|
|
362
|
+
description?: string[];
|
|
363
|
+
chips: RatingChipMeta<T>[];
|
|
364
|
+
}
|
|
365
|
+
export interface RatingChipMeta<T = string> {
|
|
366
|
+
code: T;
|
|
367
|
+
name: string;
|
|
368
|
+
}
|
|
369
|
+
export interface GetRatingFormParams {
|
|
370
|
+
userIdentifier: string;
|
|
371
|
+
category: RatingCategory;
|
|
372
|
+
serviceCode: RatingServiceCode;
|
|
373
|
+
statusDate: Date;
|
|
374
|
+
resourceId?: string;
|
|
375
|
+
ratingFormCode?: RatingFormCode;
|
|
376
|
+
screenCode?: ScreenCode;
|
|
377
|
+
hasRatingSubmitThreshold?: boolean;
|
|
378
|
+
daysAfterLastRatingSubmitThreshold?: number;
|
|
379
|
+
intervalDelay?: number;
|
|
380
|
+
intervalDuration?: number;
|
|
381
|
+
}
|
|
382
|
+
export interface GetRatingFormResponse {
|
|
383
|
+
ratingForm?: RatingForm;
|
|
384
|
+
ratingStartsAtUnixTime: number;
|
|
385
|
+
}
|
|
386
|
+
export interface RateServiceEventPayload {
|
|
387
|
+
userIdentifier: string;
|
|
388
|
+
category: RatingCategory;
|
|
389
|
+
serviceCode: RatingServiceCode;
|
|
390
|
+
ratingFormCode?: RatingFormCode;
|
|
391
|
+
resourceId?: string;
|
|
392
|
+
notificationParams?: NotificationTemplateParams;
|
|
393
|
+
delay?: number;
|
|
394
|
+
}
|
|
395
|
+
export interface ChipsRateGroup<T> {
|
|
396
|
+
rate: RatingScore[];
|
|
397
|
+
chips: T[];
|
|
398
|
+
}
|
|
399
|
+
export interface ChipsBlockRateGroup<T> {
|
|
400
|
+
rate: RatingScore[];
|
|
401
|
+
chipBlocks: ChipBlock<T>[];
|
|
402
|
+
}
|
|
403
|
+
export interface TextParams {
|
|
404
|
+
title?: string;
|
|
405
|
+
ratingLabel?: string;
|
|
406
|
+
chipLabels?: Partial<Record<RatingScore, string>>;
|
|
407
|
+
chipDescription?: string;
|
|
408
|
+
commentLabel?: string;
|
|
409
|
+
commentHint?: string;
|
|
410
|
+
mainButton?: string;
|
|
411
|
+
}
|
|
412
|
+
export interface ChipParams<T extends string> {
|
|
413
|
+
chipsRateGroups?: ChipsRateGroup<T>[];
|
|
414
|
+
chipValueMap?: Partial<Record<T, string>>;
|
|
415
|
+
chipBlockRateGroups?: ChipsBlockRateGroup<T>[];
|
|
416
|
+
}
|
|
417
|
+
export interface GetUserInitiativeRatingFormRequest {
|
|
418
|
+
screenCode?: ScreenCode;
|
|
419
|
+
resourceId?: string;
|
|
420
|
+
}
|
|
421
|
+
export interface GetUserInitiativeRatingFormResponse {
|
|
422
|
+
ratingForm?: RatingForm;
|
|
423
|
+
processCode?: RatingAvailabilityProcessCode;
|
|
424
|
+
}
|
|
425
|
+
export interface IsUserInitiativeRatingAvailableRequest {
|
|
426
|
+
userIdentifier: string;
|
|
427
|
+
category: RatingCategory;
|
|
428
|
+
serviceCode: RatingServiceCode;
|
|
429
|
+
screenCode?: ScreenCode;
|
|
430
|
+
resourceId?: string;
|
|
431
|
+
checkTaxpayerCard?: boolean;
|
|
432
|
+
ignoreScreenCodes?: ScreenCode[];
|
|
433
|
+
}
|
|
434
|
+
export interface IsByRequestRatingAvailableRequest {
|
|
435
|
+
userIdentifier: string;
|
|
436
|
+
category: RatingCategory;
|
|
437
|
+
serviceCode: RatingServiceCode;
|
|
438
|
+
statusDate: Date;
|
|
439
|
+
resourceId?: string;
|
|
440
|
+
ratingFormCode?: RatingFormCode;
|
|
441
|
+
screenCode?: ScreenCode;
|
|
442
|
+
hasRatingSubmitThreshold?: boolean;
|
|
443
|
+
daysAfterLastRatingSubmitThreshold?: number;
|
|
444
|
+
intervalDelay?: number;
|
|
445
|
+
intervalDuration?: number;
|
|
446
|
+
}
|
|
447
|
+
export interface RatingService<T, K extends Partial<RateServiceEventPayload> = Partial<RateServiceEventPayload>> {
|
|
448
|
+
sendRatingPush(model: T, userIdentifier: string, params?: K): Promise<void>;
|
|
449
|
+
getRatingForm(model: T, userIdentifier: string, params?: K): Promise<RatingForm | undefined>;
|
|
450
|
+
getUserInitiativeRatingForm?(userIdentifier: string, serviceCode: RatingServiceCode): Promise<GetUserInitiativeRatingFormResponse>;
|
|
451
|
+
getUserInitiativeRatingFormByResourceId?(userIdentifier: string, serviceCode: RatingServiceCode, resourceId: string): Promise<GetUserInitiativeRatingFormResponse>;
|
|
452
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './analytics';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
3
|
+
import { ObjectId } from 'bson';
|
|
4
|
+
import { ActHeaders, AlsData, Logger } from '@diia-inhouse/types';
|
|
5
|
+
import { AcquirerAnalyticsData, AnalyticsActionResult, AnalyticsActionType, AnalyticsCategory, NotificationAnalyticsData, UserAnalyticsData } from '../interfaces';
|
|
6
|
+
export declare class AnalyticsService {
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private readonly asyncLocalStorage;
|
|
9
|
+
constructor(logger: Logger, asyncLocalStorage: AsyncLocalStorage<AlsData>);
|
|
10
|
+
acquirerLog(category: AnalyticsCategory, acquirerId: ObjectId, actionType: AnalyticsActionType, actionResult: AnalyticsActionResult, headers: ActHeaders | undefined, data?: AcquirerAnalyticsData): void;
|
|
11
|
+
userAcquirerLog(category: AnalyticsCategory, userIdentifier: string, acquirerId: ObjectId | undefined, actionType: AnalyticsActionType, actionResult: AnalyticsActionResult, headers: ActHeaders | undefined, data?: AcquirerAnalyticsData): void;
|
|
12
|
+
notificationLog(actionType: AnalyticsActionType, actionResult: AnalyticsActionResult, headers: ActHeaders, data?: NotificationAnalyticsData): void;
|
|
13
|
+
userLog(actionType: AnalyticsActionType, actionResult: AnalyticsActionResult, userIdentifier: string, headers: ActHeaders, data?: UserAnalyticsData): void;
|
|
14
|
+
authLog(actionType: AnalyticsActionType, actionResult: AnalyticsActionResult, userIdentifier: string, headers: ActHeaders, data?: Record<string, unknown>): void;
|
|
15
|
+
log(category: string, actionType: string, actionResult: string, data?: Record<string, unknown>): void;
|
|
16
|
+
private getDate;
|
|
17
|
+
private getDevice;
|
|
18
|
+
private logAnalytics;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './analytics';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './rating';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChipParams, RatingCategory, RatingForm, RatingFormCode, TextParams } from '../interfaces';
|
|
2
|
+
export declare class RatingUtils {
|
|
3
|
+
private readonly chipCodeToValueDefaultMap;
|
|
4
|
+
private readonly chipLabelMap;
|
|
5
|
+
private readonly ratingLabelMap;
|
|
6
|
+
private readonly commentLabelMap;
|
|
7
|
+
getRatingForm<T extends string>(formCode: RatingFormCode, category: RatingCategory, chipParams: ChipParams<T>, textParams?: TextParams, resourceId?: string): RatingForm;
|
|
8
|
+
}
|