@giosg/types 6.5.0 → 7.0.1
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/CHANGELOG.md +38 -5
- package/lib/GiosgTCApi.d.ts +113 -0
- package/lib/GiosgTCApi.d.ts.map +1 -0
- package/lib/GiosgTCApi.js +17 -0
- package/lib/apps.js +0 -1
- package/lib/assets.js +0 -1
- package/lib/brands.js +0 -1
- package/lib/call.js +0 -1
- package/lib/canned_answers.js +0 -1
- package/lib/chat.js +0 -1
- package/lib/cjs/GiosgTCApi.d.ts +118 -0
- package/lib/cjs/GiosgTCApi.d.ts.map +1 -0
- package/lib/cjs/GiosgTCApi.js +25 -0
- package/lib/cjs/actions.d.ts +72 -0
- package/lib/cjs/actions.d.ts.map +1 -0
- package/lib/cjs/actions.js +63 -0
- package/lib/cjs/apps.d.ts +99 -0
- package/lib/cjs/apps.d.ts.map +1 -0
- package/lib/cjs/apps.js +2 -0
- package/lib/cjs/assets.d.ts +144 -0
- package/lib/cjs/assets.d.ts.map +1 -0
- package/lib/cjs/assets.js +2 -0
- package/lib/cjs/brands.d.ts +41 -0
- package/lib/cjs/brands.d.ts.map +1 -0
- package/lib/cjs/brands.js +2 -0
- package/lib/cjs/call.d.ts +41 -0
- package/lib/cjs/call.d.ts.map +1 -0
- package/lib/cjs/call.js +2 -0
- package/lib/cjs/canned_answers.d.ts +26 -0
- package/lib/cjs/canned_answers.d.ts.map +1 -0
- package/lib/cjs/canned_answers.js +2 -0
- package/lib/cjs/chat.d.ts +1071 -0
- package/lib/cjs/chat.d.ts.map +1 -0
- package/lib/cjs/chat.js +2 -0
- package/lib/cjs/common.d.ts +7 -0
- package/lib/cjs/common.d.ts.map +1 -0
- package/lib/cjs/common.js +628 -0
- package/lib/cjs/conditions.d.ts +98 -0
- package/lib/cjs/conditions.d.ts.map +1 -0
- package/lib/cjs/conditions.js +80 -0
- package/lib/cjs/customer.d.ts +519 -0
- package/lib/cjs/customer.d.ts.map +1 -0
- package/lib/cjs/customer.js +2 -0
- package/lib/cjs/customership.d.ts +79 -0
- package/lib/cjs/customership.d.ts.map +1 -0
- package/lib/cjs/customership.js +2 -0
- package/lib/cjs/email.d.ts +47 -0
- package/lib/cjs/email.d.ts.map +1 -0
- package/lib/cjs/email.js +2 -0
- package/lib/cjs/experiments.d.ts +168 -0
- package/lib/cjs/experiments.d.ts.map +1 -0
- package/lib/cjs/experiments.js +2 -0
- package/lib/cjs/goals.d.ts +126 -0
- package/lib/cjs/goals.d.ts.map +1 -0
- package/lib/cjs/goals.js +2 -0
- package/lib/cjs/index.d.ts +36 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +32 -0
- package/lib/cjs/leadforms.d.ts +30 -0
- package/lib/cjs/leadforms.d.ts.map +1 -0
- package/lib/cjs/leadforms.js +2 -0
- package/lib/cjs/linkpreview.d.ts +16 -0
- package/lib/cjs/linkpreview.d.ts.map +1 -0
- package/lib/cjs/linkpreview.js +2 -0
- package/lib/cjs/oath.d.ts +75 -0
- package/lib/cjs/oath.d.ts.map +1 -0
- package/lib/cjs/oath.js +25 -0
- package/lib/cjs/partnerships.d.ts +54 -0
- package/lib/cjs/partnerships.d.ts.map +1 -0
- package/lib/cjs/partnerships.js +2 -0
- package/lib/cjs/permissions.d.ts +26 -0
- package/lib/cjs/permissions.d.ts.map +1 -0
- package/lib/cjs/permissions.js +2 -0
- package/lib/cjs/public.d.ts +418 -0
- package/lib/cjs/public.d.ts.map +1 -0
- package/lib/cjs/public.js +12 -0
- package/lib/cjs/rooms.d.ts +205 -0
- package/lib/cjs/rooms.d.ts.map +1 -0
- package/lib/cjs/rooms.js +2 -0
- package/lib/cjs/routers.d.ts +76 -0
- package/lib/cjs/routers.d.ts.map +1 -0
- package/lib/cjs/routers.js +2 -0
- package/lib/cjs/rules.d.ts +229 -0
- package/lib/cjs/rules.d.ts.map +1 -0
- package/lib/cjs/rules.js +2 -0
- package/lib/cjs/sharing.d.ts +111 -0
- package/lib/cjs/sharing.d.ts.map +1 -0
- package/lib/cjs/sharing.js +2 -0
- package/lib/cjs/shoppingcarts.d.ts +33 -0
- package/lib/cjs/shoppingcarts.d.ts.map +1 -0
- package/lib/cjs/shoppingcarts.js +2 -0
- package/lib/cjs/system.d.ts +21 -0
- package/lib/cjs/system.d.ts.map +1 -0
- package/lib/cjs/system.js +2 -0
- package/lib/cjs/target.d.ts +105 -0
- package/lib/cjs/target.d.ts.map +1 -0
- package/lib/cjs/target.js +2 -0
- package/lib/cjs/teams.d.ts +78 -0
- package/lib/cjs/teams.d.ts.map +1 -0
- package/lib/cjs/teams.js +2 -0
- package/lib/cjs/types.d.ts +226 -0
- package/lib/cjs/types.d.ts.map +1 -0
- package/lib/cjs/types.js +29 -0
- package/lib/cjs/uploads.d.ts +55 -0
- package/lib/cjs/uploads.d.ts.map +1 -0
- package/lib/cjs/uploads.js +2 -0
- package/lib/cjs/userclients.d.ts +79 -0
- package/lib/cjs/userclients.d.ts.map +1 -0
- package/lib/cjs/userclients.js +2 -0
- package/lib/cjs/variables.d.ts +41 -0
- package/lib/cjs/variables.d.ts.map +1 -0
- package/lib/cjs/variables.js +2 -0
- package/lib/cjs/visitor.d.ts +210 -0
- package/lib/cjs/visitor.d.ts.map +1 -0
- package/lib/cjs/visitor.js +2 -0
- package/lib/cjs/webhooks.d.ts +61 -0
- package/lib/cjs/webhooks.d.ts.map +1 -0
- package/lib/cjs/webhooks.js +2 -0
- package/lib/customer.js +0 -1
- package/lib/customership.js +0 -1
- package/lib/email.js +0 -1
- package/lib/experiments.js +0 -1
- package/lib/goals.js +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/leadforms.js +0 -1
- package/lib/linkpreview.js +0 -1
- package/lib/mjs/GiosgTCApi.d.ts +118 -0
- package/lib/mjs/GiosgTCApi.d.ts.map +1 -0
- package/lib/mjs/GiosgTCApi.js +22 -0
- package/lib/mjs/actions.d.ts +72 -0
- package/lib/mjs/actions.d.ts.map +1 -0
- package/lib/mjs/actions.js +60 -0
- package/lib/mjs/apps.d.ts +99 -0
- package/lib/mjs/apps.d.ts.map +1 -0
- package/lib/mjs/apps.js +0 -0
- package/lib/mjs/assets.d.ts +144 -0
- package/lib/mjs/assets.d.ts.map +1 -0
- package/lib/mjs/assets.js +0 -0
- package/lib/mjs/brands.d.ts +41 -0
- package/lib/mjs/brands.d.ts.map +1 -0
- package/lib/mjs/brands.js +0 -0
- package/lib/mjs/call.d.ts +41 -0
- package/lib/mjs/call.d.ts.map +1 -0
- package/lib/mjs/call.js +0 -0
- package/lib/mjs/canned_answers.d.ts +26 -0
- package/lib/mjs/canned_answers.d.ts.map +1 -0
- package/lib/mjs/canned_answers.js +0 -0
- package/lib/mjs/chat.d.ts +1071 -0
- package/lib/mjs/chat.d.ts.map +1 -0
- package/lib/mjs/chat.js +0 -0
- package/lib/mjs/common.d.ts +7 -0
- package/lib/mjs/common.d.ts.map +1 -0
- package/lib/mjs/common.js +625 -0
- package/lib/mjs/conditions.d.ts +98 -0
- package/lib/mjs/conditions.d.ts.map +1 -0
- package/lib/mjs/conditions.js +77 -0
- package/lib/mjs/customer.d.ts +519 -0
- package/lib/mjs/customer.d.ts.map +1 -0
- package/lib/mjs/customer.js +0 -0
- package/lib/mjs/customership.d.ts +79 -0
- package/lib/mjs/customership.d.ts.map +1 -0
- package/lib/mjs/customership.js +0 -0
- package/lib/mjs/email.d.ts +47 -0
- package/lib/mjs/email.d.ts.map +1 -0
- package/lib/mjs/email.js +0 -0
- package/lib/mjs/experiments.d.ts +168 -0
- package/lib/mjs/experiments.d.ts.map +1 -0
- package/lib/mjs/experiments.js +0 -0
- package/lib/mjs/goals.d.ts +126 -0
- package/lib/mjs/goals.d.ts.map +1 -0
- package/lib/mjs/goals.js +0 -0
- package/lib/mjs/index.d.ts +36 -0
- package/lib/mjs/index.d.ts.map +1 -0
- package/lib/mjs/index.js +7 -0
- package/lib/mjs/leadforms.d.ts +30 -0
- package/lib/mjs/leadforms.d.ts.map +1 -0
- package/lib/mjs/leadforms.js +0 -0
- package/lib/mjs/linkpreview.d.ts +16 -0
- package/lib/mjs/linkpreview.d.ts.map +1 -0
- package/lib/mjs/linkpreview.js +0 -0
- package/lib/mjs/oath.d.ts +75 -0
- package/lib/mjs/oath.d.ts.map +1 -0
- package/lib/mjs/oath.js +22 -0
- package/lib/mjs/partnerships.d.ts +54 -0
- package/lib/mjs/partnerships.d.ts.map +1 -0
- package/lib/mjs/partnerships.js +0 -0
- package/lib/mjs/permissions.d.ts +26 -0
- package/lib/mjs/permissions.d.ts.map +1 -0
- package/lib/mjs/permissions.js +0 -0
- package/lib/mjs/public.d.ts +418 -0
- package/lib/mjs/public.d.ts.map +1 -0
- package/lib/mjs/public.js +9 -0
- package/lib/mjs/rooms.d.ts +205 -0
- package/lib/mjs/rooms.d.ts.map +1 -0
- package/lib/mjs/rooms.js +0 -0
- package/lib/mjs/routers.d.ts +76 -0
- package/lib/mjs/routers.d.ts.map +1 -0
- package/lib/mjs/routers.js +0 -0
- package/lib/mjs/rules.d.ts +229 -0
- package/lib/mjs/rules.d.ts.map +1 -0
- package/lib/mjs/rules.js +0 -0
- package/lib/mjs/sharing.d.ts +111 -0
- package/lib/mjs/sharing.d.ts.map +1 -0
- package/lib/mjs/sharing.js +0 -0
- package/lib/mjs/shoppingcarts.d.ts +33 -0
- package/lib/mjs/shoppingcarts.d.ts.map +1 -0
- package/lib/mjs/shoppingcarts.js +0 -0
- package/lib/mjs/system.d.ts +21 -0
- package/lib/mjs/system.d.ts.map +1 -0
- package/lib/mjs/system.js +0 -0
- package/lib/mjs/target.d.ts +105 -0
- package/lib/mjs/target.d.ts.map +1 -0
- package/lib/mjs/target.js +0 -0
- package/lib/mjs/teams.d.ts +78 -0
- package/lib/mjs/teams.d.ts.map +1 -0
- package/lib/mjs/teams.js +0 -0
- package/lib/mjs/types.d.ts +226 -0
- package/lib/mjs/types.d.ts.map +1 -0
- package/lib/mjs/types.js +26 -0
- package/lib/mjs/uploads.d.ts +55 -0
- package/lib/mjs/uploads.d.ts.map +1 -0
- package/lib/mjs/uploads.js +0 -0
- package/lib/mjs/userclients.d.ts +79 -0
- package/lib/mjs/userclients.d.ts.map +1 -0
- package/lib/mjs/userclients.js +0 -0
- package/lib/mjs/variables.d.ts +41 -0
- package/lib/mjs/variables.d.ts.map +1 -0
- package/lib/mjs/variables.js +0 -0
- package/lib/mjs/visitor.d.ts +210 -0
- package/lib/mjs/visitor.d.ts.map +1 -0
- package/lib/mjs/visitor.js +0 -0
- package/lib/mjs/webhooks.d.ts +61 -0
- package/lib/mjs/webhooks.d.ts.map +1 -0
- package/lib/mjs/webhooks.js +0 -0
- package/lib/partnerships.js +0 -1
- package/lib/permissions.js +0 -1
- package/lib/public.d.ts.map +1 -1
- package/lib/rooms.js +0 -1
- package/lib/routers.js +0 -1
- package/lib/rules.js +0 -1
- package/lib/sharing.js +0 -1
- package/lib/shoppingcarts.js +0 -1
- package/lib/system.js +0 -1
- package/lib/target.js +0 -1
- package/lib/teams.js +0 -1
- package/lib/uploads.js +0 -1
- package/lib/userclients.js +0 -1
- package/lib/variables.js +0 -1
- package/lib/visitor.js +0 -1
- package/lib/webhooks.js +0 -1
- package/package.json +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,17 +4,50 @@ Hint: use `git diff <commithash>..HEAD src/` to see changes
|
|
|
4
4
|
|
|
5
5
|
## x.x.x (Not published yet)
|
|
6
6
|
|
|
7
|
+
## 7.0.1
|
|
8
|
+
|
|
9
|
+
- Added interfaces for the brand editor
|
|
10
|
+
|
|
11
|
+
## 7.0.0
|
|
12
|
+
|
|
13
|
+
- Added support for CommonJS
|
|
14
|
+
- Changed import paths by adding `cjs` and `esm` directories to the package - some imports in dependent projects may need to be updated.
|
|
15
|
+
|
|
16
|
+
## 6.10.0
|
|
17
|
+
|
|
18
|
+
- Added the `GiosgBrand` interface
|
|
19
|
+
|
|
20
|
+
## 6.9.0
|
|
21
|
+
|
|
22
|
+
- Removed Reporting Target
|
|
23
|
+
|
|
24
|
+
## 6.8.0
|
|
25
|
+
|
|
26
|
+
- Removed Cobrowse Reporting
|
|
27
|
+
|
|
28
|
+
## 6.7.0
|
|
29
|
+
|
|
30
|
+
- Added `is_user_deleted` field to `ChatMembershipUser` interface
|
|
31
|
+
|
|
32
|
+
## 6.6.0
|
|
33
|
+
|
|
34
|
+
- Added types for giosg Transparency&Consent API
|
|
35
|
+
|
|
7
36
|
## 6.5.0
|
|
37
|
+
|
|
8
38
|
- Renamed `screen_sharing_state` field to `cobrowser_state` at `InCallStatus` interface
|
|
9
39
|
|
|
10
40
|
## 6.4.0
|
|
41
|
+
|
|
11
42
|
- Modified types for call status
|
|
12
43
|
- Added `screen_sharing_state` field to `InCallStatus` interface
|
|
13
44
|
|
|
14
45
|
## 6.3.0
|
|
46
|
+
|
|
15
47
|
- Added type for call status
|
|
16
48
|
|
|
17
49
|
## 6.2.2
|
|
50
|
+
|
|
18
51
|
- Fixed type of `brand` field in `PublicRoom` types
|
|
19
52
|
- Chat button asset fields added to the `Brand` interface
|
|
20
53
|
|
|
@@ -48,12 +81,13 @@ Hint: use `git diff <commithash>..HEAD src/` to see changes
|
|
|
48
81
|
- Add `ComposingStatus`, `ChatWithRoom`, `ChatMessageWithChat` and `RulePrediction`.
|
|
49
82
|
- Correctly mark the domain on `NestedRoom` as a potentially `null` value.
|
|
50
83
|
|
|
51
|
-
|
|
52
84
|
## 4.6.0
|
|
85
|
+
|
|
53
86
|
- Add `is_removed` field for `BarChats`.
|
|
54
87
|
- ConditionHasChattedSettings type was removed
|
|
55
88
|
|
|
56
89
|
## 4.5.0
|
|
90
|
+
|
|
57
91
|
- Add `is_available` field for `BarChats`.
|
|
58
92
|
|
|
59
93
|
## 4.4.5
|
|
@@ -98,7 +132,7 @@ Hint: use `git diff <commithash>..HEAD src/` to see changes
|
|
|
98
132
|
|
|
99
133
|
## 4.0.0
|
|
100
134
|
|
|
101
|
-
### Breaking changes
|
|
135
|
+
### Breaking changes
|
|
102
136
|
|
|
103
137
|
- Removed `unread_message_count` from `BarChat` interface.
|
|
104
138
|
- Removed `is_participating` from `BarChat` interface.
|
|
@@ -140,7 +174,7 @@ Hint: use `git diff <commithash>..HEAD src/` to see changes
|
|
|
140
174
|
- Added `sla` field to `StaffCustomership` and `StaffCustomershipPayload`.
|
|
141
175
|
- Added `is_auto_tagging_enabled` boolean field to `OrganizationRoomSettings` and `OrganizationRoomSettingsPayload` interfaces.
|
|
142
176
|
|
|
143
|
-
### Breaking changes
|
|
177
|
+
### Breaking changes
|
|
144
178
|
|
|
145
179
|
- Merged `RoomVisitorVariable` and `ChatVisitorVariable` to `VisitorVariable`
|
|
146
180
|
- Merged `RoomVisitorVariablePayload` and `ChatVisitorVariablePayload` to `VisitorVariablePayload`
|
|
@@ -153,8 +187,7 @@ Hint: use `git diff <commithash>..HEAD src/` to see changes
|
|
|
153
187
|
|
|
154
188
|
- Added new interfaces `GiosgAppInstance`, `GiosgApp`, `GiosgAppPayload`, `InstalledGiosgApp`, `NestedGiosgApp`, `Brand`, `BrandPayload`, `PublicBrand`, `CannedAnswerIncrement`,`CannedAnswer`, `CannedAnswerPayload`, `ChatAssignment`, `LeadFormData`, `LeadFormDataPayload` `AppShare`, `AppSharePayload`, `ShoppingCartProduct`, `ShoppingCart`, `EndpointMethod` `Endpoint`, `Language`, `NestedTargetRule`, `NestedTargetConfig`, `TargetConfig`, `TargetExperiment`, `TargetedAction`, `TargetedActionPayload`, `VisitorPredictionList`, `VisitorPrediction`, `VisitorPredictionPayload`, `VisitorSessionPrediction`, `VisitorSessionPredictionPayload`, `RoomVisitorVariable`, `RoomVisitorVariablePayload`, `NestedWebhookChannelSubscription`, `NestedWebhookChannelSubscriptionPayload`, `WebhookRequestLogEntry`, `Webhook`, `WebhookPayload`
|
|
155
189
|
|
|
156
|
-
|
|
157
|
-
### Breaking changes:
|
|
190
|
+
### Breaking changes
|
|
158
191
|
|
|
159
192
|
- Renamed `VisitorSessionId` to `VisitorSessionCid`.
|
|
160
193
|
- Renamed `VisitorGlobalSessionId` to `VisitorSessionGid`.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export declare const supportedEventTypes: readonly ["tcChange"];
|
|
2
|
+
export declare type EventType = typeof supportedEventTypes[number];
|
|
3
|
+
export declare type TCEventListener = (consent: TCPreferences) => void;
|
|
4
|
+
/**
|
|
5
|
+
* For further reading reagarding the different purposes https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#A_Purposes.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum Purpose {
|
|
8
|
+
AccessLocalOrSessionStorage = 1,
|
|
9
|
+
SelectBasicAds = 2,
|
|
10
|
+
CreatePersonalizedAdProfile = 3,
|
|
11
|
+
SelectPersonalizedAds = 4,
|
|
12
|
+
CreatePersonalizedContentProfile = 5,
|
|
13
|
+
SelectPersonalizedContent = 6,
|
|
14
|
+
MeasureAdPerformance = 7,
|
|
15
|
+
MeasureContentPerformance = 8,
|
|
16
|
+
ApplyMarketResearchToGenerateAudienceInsights = 9,
|
|
17
|
+
DevelopAndImproveProducts = 10
|
|
18
|
+
}
|
|
19
|
+
export interface TCPreferences {
|
|
20
|
+
purpose: {
|
|
21
|
+
consents: {
|
|
22
|
+
[purposeID: number]: boolean;
|
|
23
|
+
};
|
|
24
|
+
legitimateInterests: {
|
|
25
|
+
[purposeID: number]: boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
vendor: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface IGiosgTCApi {
|
|
31
|
+
/**
|
|
32
|
+
* Returns required purposes.
|
|
33
|
+
*/
|
|
34
|
+
getRequiredTC(): Purpose[];
|
|
35
|
+
/**
|
|
36
|
+
* When a user defines their TC preferences for the site, the site calls this function to notify Giosg.
|
|
37
|
+
* Defaults to false.
|
|
38
|
+
*/
|
|
39
|
+
setVisitorConsent(consent: TCPreferences): void;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the visitorConsent value from the Giosg.
|
|
42
|
+
*/
|
|
43
|
+
getVisitorConsent(): TCPreferences;
|
|
44
|
+
/**
|
|
45
|
+
* Registered callback function gets called if TC preference is changed by user interacting with Giosg products.
|
|
46
|
+
* Returns listener id.
|
|
47
|
+
*/
|
|
48
|
+
addEventListener(eventType: EventType, cb: (consent: TCPreferences) => void): number | void;
|
|
49
|
+
/**
|
|
50
|
+
* Remove event listener for with given listenerID.
|
|
51
|
+
* Return boolean based on the success of removal.
|
|
52
|
+
*/
|
|
53
|
+
removeEventListener(listenerID: number): boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface ITCApi {
|
|
56
|
+
/**
|
|
57
|
+
* This is public only so that the this and customer facing modules can poke each
|
|
58
|
+
* other without hacks and hence the dunder naming.
|
|
59
|
+
* Saves new signal and calls all subscribers for new consent.
|
|
60
|
+
*
|
|
61
|
+
* @param newPreference New preference which all subscribers are notified with.
|
|
62
|
+
*/
|
|
63
|
+
__notifyTCPreferenceChange(newPreference: TCPreferences): void;
|
|
64
|
+
/**
|
|
65
|
+
*
|
|
66
|
+
* @returns List of purposes which are required to run all current giosg services.
|
|
67
|
+
*/
|
|
68
|
+
getRequiredTC(): Purpose[];
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @returns Current visitor consent preferences.
|
|
72
|
+
*/
|
|
73
|
+
getVisitorConsent(): TCPreferences;
|
|
74
|
+
/**
|
|
75
|
+
* Set given purposeIDs true in consent.
|
|
76
|
+
* @param purposeIDs Purposes to enable.
|
|
77
|
+
* @returns Returns boolean based on success.
|
|
78
|
+
*/
|
|
79
|
+
enableVisitorConsent(purposeIDs: Purpose[]): boolean;
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @returns Boolean based on is the IAB TC Framework active in site or not.
|
|
83
|
+
*/
|
|
84
|
+
isTCFrameworkInUse(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Sets the visitor consent preference to be the new provided one.
|
|
87
|
+
* Checks if the IAB TCF is not active and tries to set the consent.
|
|
88
|
+
* If IAB TCF found consents cant be modified and returns false.
|
|
89
|
+
* @param newPreference New visitor TC preference object.
|
|
90
|
+
* @returns Boolean based on was the action successful or not.
|
|
91
|
+
*/
|
|
92
|
+
setVisitorConsent(newPreference: TCPreferences): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Adds a new event listener.
|
|
95
|
+
* @param eventType Event type to subscribe for.
|
|
96
|
+
* @param cb Callback to call when the event happens.
|
|
97
|
+
* @returns Listener ID as a string if event listener registered properly.
|
|
98
|
+
*/
|
|
99
|
+
addEventListener(eventType: EventType, cb: (consent: TCPreferences) => void): string | never;
|
|
100
|
+
/**
|
|
101
|
+
* Removes event listener.
|
|
102
|
+
* @param listenerID Listener ID to be removed.
|
|
103
|
+
* @returns Boolean based on was the action successful
|
|
104
|
+
*/
|
|
105
|
+
removeEventListener(listenerID: string): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Checks if visitor has given permission for given purposes.
|
|
108
|
+
* @param requiredPurposes List of purposes which needs to be true.
|
|
109
|
+
* @returns Boolean based on were all requiredPurposes set to true.
|
|
110
|
+
*/
|
|
111
|
+
hasSufficientPermissions(requiredPurposes: Purpose[]): boolean;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=GiosgTCApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GiosgTCApi.d.ts","sourceRoot":"","sources":["../src/GiosgTCApi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,uBAAwB,CAAC;AACzD,oBAAY,SAAS,GAAG,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC3D,oBAAY,eAAe,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;AAE/D;;GAEG;AACH,oBAAY,OAAO;IACjB,2BAA2B,IAAI;IAC/B,cAAc,IAAI;IAClB,2BAA2B,IAAI;IAC/B,qBAAqB,IAAI;IACzB,gCAAgC,IAAI;IACpC,yBAAyB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aAAa,KAAK,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC;IAE7F;;;;OAIG;IACH,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAEjD;;;;OAIG;IACH,wBAAwB,CAAC,gBAAgB,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;CAChE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export var supportedEventTypes = ["tcChange"];
|
|
2
|
+
/**
|
|
3
|
+
* For further reading reagarding the different purposes https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#A_Purposes.
|
|
4
|
+
*/
|
|
5
|
+
export var Purpose;
|
|
6
|
+
(function (Purpose) {
|
|
7
|
+
Purpose[Purpose["AccessLocalOrSessionStorage"] = 1] = "AccessLocalOrSessionStorage";
|
|
8
|
+
Purpose[Purpose["SelectBasicAds"] = 2] = "SelectBasicAds";
|
|
9
|
+
Purpose[Purpose["CreatePersonalizedAdProfile"] = 3] = "CreatePersonalizedAdProfile";
|
|
10
|
+
Purpose[Purpose["SelectPersonalizedAds"] = 4] = "SelectPersonalizedAds";
|
|
11
|
+
Purpose[Purpose["CreatePersonalizedContentProfile"] = 5] = "CreatePersonalizedContentProfile";
|
|
12
|
+
Purpose[Purpose["SelectPersonalizedContent"] = 6] = "SelectPersonalizedContent";
|
|
13
|
+
Purpose[Purpose["MeasureAdPerformance"] = 7] = "MeasureAdPerformance";
|
|
14
|
+
Purpose[Purpose["MeasureContentPerformance"] = 8] = "MeasureContentPerformance";
|
|
15
|
+
Purpose[Purpose["ApplyMarketResearchToGenerateAudienceInsights"] = 9] = "ApplyMarketResearchToGenerateAudienceInsights";
|
|
16
|
+
Purpose[Purpose["DevelopAndImproveProducts"] = 10] = "DevelopAndImproveProducts";
|
|
17
|
+
})(Purpose || (Purpose = {}));
|
package/lib/apps.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/assets.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/brands.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/call.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/canned_answers.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/chat.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export declare const supportedEventTypes: readonly ["tcChange"];
|
|
2
|
+
export declare type EventType = typeof supportedEventTypes[number];
|
|
3
|
+
export declare type TCEventListener = (consent: TCPreferences) => void;
|
|
4
|
+
/**
|
|
5
|
+
* For further reading reagarding the different purposes https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#A_Purposes.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum Purpose {
|
|
8
|
+
AccessLocalOrSessionStorage = 1,
|
|
9
|
+
SelectBasicAds = 2,
|
|
10
|
+
CreatePersonalizedAdProfile = 3,
|
|
11
|
+
SelectPersonalizedAds = 4,
|
|
12
|
+
CreatePersonalizedContentProfile = 5,
|
|
13
|
+
SelectPersonalizedContent = 6,
|
|
14
|
+
MeasureAdPerformance = 7,
|
|
15
|
+
MeasureContentPerformance = 8,
|
|
16
|
+
ApplyMarketResearchToGenerateAudienceInsights = 9,
|
|
17
|
+
DevelopAndImproveProducts = 10
|
|
18
|
+
}
|
|
19
|
+
export declare enum Service {
|
|
20
|
+
All = 0,
|
|
21
|
+
Chat = 1
|
|
22
|
+
}
|
|
23
|
+
export interface TCPreferences {
|
|
24
|
+
purpose: {
|
|
25
|
+
consents: {
|
|
26
|
+
[purposeID: number]: boolean;
|
|
27
|
+
};
|
|
28
|
+
legitimateInterests: {
|
|
29
|
+
[purposeID: number]: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
vendor: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface IGiosgTCApi {
|
|
35
|
+
/**
|
|
36
|
+
* Returns required purposes.
|
|
37
|
+
*/
|
|
38
|
+
getRequiredTC(): Purpose[];
|
|
39
|
+
/**
|
|
40
|
+
* When a user defines their TC preferences for the site, the site calls this function to notify Giosg.
|
|
41
|
+
* Defaults to false.
|
|
42
|
+
*/
|
|
43
|
+
setVisitorConsent(consent: TCPreferences): void;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the visitorConsent value from the Giosg.
|
|
46
|
+
*/
|
|
47
|
+
getVisitorConsent(): TCPreferences;
|
|
48
|
+
/**
|
|
49
|
+
* Registered callback function gets called if TC preference is changed by user interacting with Giosg products.
|
|
50
|
+
* Returns listener id.
|
|
51
|
+
*/
|
|
52
|
+
addEventListener(eventType: EventType, cb: (consent: TCPreferences) => void): number | void;
|
|
53
|
+
/**
|
|
54
|
+
* Remove event listener for with given listenerID.
|
|
55
|
+
* Return boolean based on the success of removal.
|
|
56
|
+
*/
|
|
57
|
+
removeEventListener(listenerID: number): boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface ITCApi {
|
|
60
|
+
/**
|
|
61
|
+
* This is public only so that the this and customer facing modules can poke each
|
|
62
|
+
* other without hacks and hence the dunder naming.
|
|
63
|
+
* Saves new signal and calls all subscribers for new consent.
|
|
64
|
+
*
|
|
65
|
+
* @param newPreference New preference which all subscribers are notified with.
|
|
66
|
+
*/
|
|
67
|
+
__notifyTCPreferenceChange(newPreference: TCPreferences): void;
|
|
68
|
+
/**
|
|
69
|
+
* @param forService The Service which minimum required TC is requested.
|
|
70
|
+
*
|
|
71
|
+
* @returns List of purposes which are required to run the given giosg Service.
|
|
72
|
+
*/
|
|
73
|
+
getRequiredTC(forService: Service): Purpose[];
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @returns Current visitor consent preferences.
|
|
77
|
+
*/
|
|
78
|
+
getVisitorConsent(): TCPreferences;
|
|
79
|
+
/**
|
|
80
|
+
* Set given purposeIDs true in consent.
|
|
81
|
+
* @param purposeIDs Purposes to enable.
|
|
82
|
+
* @returns Returns boolean based on success.
|
|
83
|
+
*/
|
|
84
|
+
enableVisitorConsent(purposeIDs: Purpose[]): boolean;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @returns Boolean based on is the IAB TC Framework active in site or not.
|
|
88
|
+
*/
|
|
89
|
+
isTCFrameworkInUse(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the visitor consent preference to be the new provided one.
|
|
92
|
+
* Checks if the IAB TCF is not active and tries to set the consent.
|
|
93
|
+
* If IAB TCF found consents cant be modified and returns false.
|
|
94
|
+
* @param newPreference New visitor TC preference object.
|
|
95
|
+
* @returns Boolean based on was the action successful or not.
|
|
96
|
+
*/
|
|
97
|
+
setVisitorConsent(newPreference: TCPreferences): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Adds a new event listener.
|
|
100
|
+
* @param eventType Event type to subscribe for.
|
|
101
|
+
* @param cb Callback to call when the event happens.
|
|
102
|
+
* @returns Listener ID as a string if event listener registered properly.
|
|
103
|
+
*/
|
|
104
|
+
addEventListener(eventType: EventType, cb: (consent: TCPreferences) => void): string | never;
|
|
105
|
+
/**
|
|
106
|
+
* Removes event listener.
|
|
107
|
+
* @param listenerID Listener ID to be removed.
|
|
108
|
+
* @returns Boolean based on was the action successful
|
|
109
|
+
*/
|
|
110
|
+
removeEventListener(listenerID: string): boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Checks if visitor has given permission for given purposes.
|
|
113
|
+
* @param requiredPurposes List of purposes which needs to be true.
|
|
114
|
+
* @returns Boolean based on were all requiredPurposes set to true.
|
|
115
|
+
*/
|
|
116
|
+
hasSufficientPermissions(requiredPurposes: Purpose[]): boolean;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=GiosgTCApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GiosgTCApi.d.ts","sourceRoot":"","sources":["../../src/GiosgTCApi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAm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,UAAU,EAAE,OAAO,GAAG,OAAO,EAAE,CAAC;IAE9C;;;OAGG;IACH,iBAAiB,IAAI,aAAa,CAAC;IAEnC;;;;OAIG;IACH,oBAAoB,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAErD;;;OAGG;IACH,kBAAkB,IAAI,OAAO,CAAC;IAE9B;;;;;;OAMG;IACH,iBAAiB,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC;IAEzD;;;;;OAKG;IACH,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC;IAE7F;;;;OAIG;IACH,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAEjD;;;;OAIG;IACH,wBAAwB,CAAC,gBAAgB,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;CAChE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Service = exports.Purpose = exports.supportedEventTypes = void 0;
|
|
4
|
+
exports.supportedEventTypes = ["tcChange"];
|
|
5
|
+
/**
|
|
6
|
+
* For further reading reagarding the different purposes https://iabeurope.eu/iab-europe-transparency-consent-framework-policies/#A_Purposes.
|
|
7
|
+
*/
|
|
8
|
+
var Purpose;
|
|
9
|
+
(function (Purpose) {
|
|
10
|
+
Purpose[Purpose["AccessLocalOrSessionStorage"] = 1] = "AccessLocalOrSessionStorage";
|
|
11
|
+
Purpose[Purpose["SelectBasicAds"] = 2] = "SelectBasicAds";
|
|
12
|
+
Purpose[Purpose["CreatePersonalizedAdProfile"] = 3] = "CreatePersonalizedAdProfile";
|
|
13
|
+
Purpose[Purpose["SelectPersonalizedAds"] = 4] = "SelectPersonalizedAds";
|
|
14
|
+
Purpose[Purpose["CreatePersonalizedContentProfile"] = 5] = "CreatePersonalizedContentProfile";
|
|
15
|
+
Purpose[Purpose["SelectPersonalizedContent"] = 6] = "SelectPersonalizedContent";
|
|
16
|
+
Purpose[Purpose["MeasureAdPerformance"] = 7] = "MeasureAdPerformance";
|
|
17
|
+
Purpose[Purpose["MeasureContentPerformance"] = 8] = "MeasureContentPerformance";
|
|
18
|
+
Purpose[Purpose["ApplyMarketResearchToGenerateAudienceInsights"] = 9] = "ApplyMarketResearchToGenerateAudienceInsights";
|
|
19
|
+
Purpose[Purpose["DevelopAndImproveProducts"] = 10] = "DevelopAndImproveProducts";
|
|
20
|
+
})(Purpose = exports.Purpose || (exports.Purpose = {}));
|
|
21
|
+
var Service;
|
|
22
|
+
(function (Service) {
|
|
23
|
+
Service[Service["All"] = 0] = "All";
|
|
24
|
+
Service[Service["Chat"] = 1] = "Chat";
|
|
25
|
+
})(Service = exports.Service || (exports.Service = {}));
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { UserUid } from "./types";
|
|
2
|
+
export declare const ActionTypes: {
|
|
3
|
+
/** value: autosuggest message as a string, settings: ActionShowAutosuggestSettings*/
|
|
4
|
+
readonly SEND_AUTOSUGGEST: 1;
|
|
5
|
+
/** value: array of room unique identifiers, settings: none */
|
|
6
|
+
readonly JOIN_ROOMS: 2;
|
|
7
|
+
/** value: none, settings: none */
|
|
8
|
+
readonly NO_CHATBUTTON: 5;
|
|
9
|
+
/** value: none, settings: none */
|
|
10
|
+
readonly NO_AUTOSUGGEST: 6;
|
|
11
|
+
/** value: JavaScript expression as a string, settings:none */
|
|
12
|
+
readonly RUN_JAVASCRIPT: 7;
|
|
13
|
+
/** value: none, settings: none */
|
|
14
|
+
readonly ENABLE_CHATBUTTON: 8;
|
|
15
|
+
/** value: CSS selector as a string, settings: none */
|
|
16
|
+
readonly SHOW_ELEMENTS: 9;
|
|
17
|
+
/** value: CSS selector as a string, settings: none */
|
|
18
|
+
readonly HIDE_ELEMENTS: 10;
|
|
19
|
+
/** value: URL as a string, settings: none */
|
|
20
|
+
readonly REDIRECT: 11;
|
|
21
|
+
/** value: lead form unique identifier, settings: none */
|
|
22
|
+
readonly LOAD_LEAD_FORM: 13;
|
|
23
|
+
/** value: button text as a string, settings: none */
|
|
24
|
+
readonly CHANGE_CB_TEXT: 14;
|
|
25
|
+
/** value: room unique identifier, settings: none */
|
|
26
|
+
readonly CHANGE_CB_TARGET: 15;
|
|
27
|
+
/** value: language as a RFC 3066 code, settings: none */
|
|
28
|
+
readonly CHANGE_LANGUAGE: 16;
|
|
29
|
+
/** value: lead form unique identifier, settings: none */
|
|
30
|
+
readonly SHOW_LEAD_FORM: 17;
|
|
31
|
+
/** value: lead form processor unique identifier, settings: none */
|
|
32
|
+
readonly SET_LEAD_FORM_PROCESSOR: 18;
|
|
33
|
+
/** value: button unique identifier, settings: none */
|
|
34
|
+
readonly SHOW_BUTTON: 19;
|
|
35
|
+
/** value: unique identifier of the parent room of the window, settings: none */
|
|
36
|
+
readonly SHOW_CHAT_DIALOG: 20;
|
|
37
|
+
/** value: priority as an integer [1 - 10], settings: none */
|
|
38
|
+
readonly SET_VISITOR_PRIORITY: 21;
|
|
39
|
+
/** value: none , settings: none */
|
|
40
|
+
readonly DISABLE_CAPACITY_CHECK: 22;
|
|
41
|
+
/** value: CSS code as a string, settings: none */
|
|
42
|
+
readonly INJECT_CSS: 23;
|
|
43
|
+
/** value: message as a string, settings: ActionSendChatMessageSettings */
|
|
44
|
+
readonly SEND_SYSTEM_MESSAGE: 25;
|
|
45
|
+
/** value: interactionUuid, settings: none */
|
|
46
|
+
readonly LOAD_INTERACTION: 26;
|
|
47
|
+
/** value: asset unique identifier, settings: ActionSendInteractionToChatSettings */
|
|
48
|
+
readonly SEND_INTERACTION_TO_CHAT: 27;
|
|
49
|
+
};
|
|
50
|
+
export declare type ActionType = typeof ActionTypes[keyof typeof ActionTypes];
|
|
51
|
+
export declare type ActionTypeString = keyof typeof ActionTypes;
|
|
52
|
+
export declare const ACTION_TYPES: ("SEND_AUTOSUGGEST" | "JOIN_ROOMS" | "NO_CHATBUTTON" | "NO_AUTOSUGGEST" | "RUN_JAVASCRIPT" | "ENABLE_CHATBUTTON" | "SHOW_ELEMENTS" | "HIDE_ELEMENTS" | "REDIRECT" | "LOAD_LEAD_FORM" | "CHANGE_CB_TEXT" | "CHANGE_CB_TARGET" | "CHANGE_LANGUAGE" | "SHOW_LEAD_FORM" | "SET_LEAD_FORM_PROCESSOR" | "SHOW_BUTTON" | "SHOW_CHAT_DIALOG" | "SET_VISITOR_PRIORITY" | "DISABLE_CAPACITY_CHECK" | "INJECT_CSS" | "SEND_SYSTEM_MESSAGE" | "LOAD_INTERACTION" | "SEND_INTERACTION_TO_CHAT")[];
|
|
53
|
+
export interface ActionShowAutosuggestSettings {
|
|
54
|
+
/** Unique identifier of the user from whom the message shall be sent */
|
|
55
|
+
autosuggest_user_id: UserUid;
|
|
56
|
+
/** Delay before the chat window will be closed in seconds */
|
|
57
|
+
close_delay: number;
|
|
58
|
+
}
|
|
59
|
+
export interface ActionSendChatMessageSettings {
|
|
60
|
+
/** Name of the sender */
|
|
61
|
+
sender_public_name: string;
|
|
62
|
+
}
|
|
63
|
+
export interface ActionSendInteractionToChatSettings {
|
|
64
|
+
/** Name of the sender */
|
|
65
|
+
sender_public_name: string;
|
|
66
|
+
/** Optional message to send alongside of the interaction */
|
|
67
|
+
message?: string;
|
|
68
|
+
}
|
|
69
|
+
export declare type ActionSettingsType = ActionShowAutosuggestSettings | ActionSendChatMessageSettings | ActionSendInteractionToChatSettings | {};
|
|
70
|
+
export declare const ACTION_STYLES: readonly ["primary", "secondary", "info", "success", "warning", "danger", "link", "brand_primary", "brand_secondary"];
|
|
71
|
+
export declare type ActionStyle = typeof ACTION_STYLES[number];
|
|
72
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,M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ACTION_STYLES = exports.ACTION_TYPES = exports.ActionTypes = void 0;
|
|
4
|
+
exports.ActionTypes = {
|
|
5
|
+
/** value: autosuggest message as a string, settings: ActionShowAutosuggestSettings*/
|
|
6
|
+
SEND_AUTOSUGGEST: 1,
|
|
7
|
+
/** value: array of room unique identifiers, settings: none */
|
|
8
|
+
JOIN_ROOMS: 2,
|
|
9
|
+
/** value: none, settings: none */
|
|
10
|
+
NO_CHATBUTTON: 5,
|
|
11
|
+
/** value: none, settings: none */
|
|
12
|
+
NO_AUTOSUGGEST: 6,
|
|
13
|
+
/** value: JavaScript expression as a string, settings:none */
|
|
14
|
+
RUN_JAVASCRIPT: 7,
|
|
15
|
+
/** value: none, settings: none */
|
|
16
|
+
ENABLE_CHATBUTTON: 8,
|
|
17
|
+
/** value: CSS selector as a string, settings: none */
|
|
18
|
+
SHOW_ELEMENTS: 9,
|
|
19
|
+
/** value: CSS selector as a string, settings: none */
|
|
20
|
+
HIDE_ELEMENTS: 10,
|
|
21
|
+
/** value: URL as a string, settings: none */
|
|
22
|
+
REDIRECT: 11,
|
|
23
|
+
/** value: lead form unique identifier, settings: none */
|
|
24
|
+
LOAD_LEAD_FORM: 13,
|
|
25
|
+
/** value: button text as a string, settings: none */
|
|
26
|
+
CHANGE_CB_TEXT: 14,
|
|
27
|
+
/** value: room unique identifier, settings: none */
|
|
28
|
+
CHANGE_CB_TARGET: 15,
|
|
29
|
+
/** value: language as a RFC 3066 code, settings: none */
|
|
30
|
+
CHANGE_LANGUAGE: 16,
|
|
31
|
+
/** value: lead form unique identifier, settings: none */
|
|
32
|
+
SHOW_LEAD_FORM: 17,
|
|
33
|
+
/** value: lead form processor unique identifier, settings: none */
|
|
34
|
+
SET_LEAD_FORM_PROCESSOR: 18,
|
|
35
|
+
/** value: button unique identifier, settings: none */
|
|
36
|
+
SHOW_BUTTON: 19,
|
|
37
|
+
/** value: unique identifier of the parent room of the window, settings: none */
|
|
38
|
+
SHOW_CHAT_DIALOG: 20,
|
|
39
|
+
/** value: priority as an integer [1 - 10], settings: none */
|
|
40
|
+
SET_VISITOR_PRIORITY: 21,
|
|
41
|
+
/** value: none , settings: none */
|
|
42
|
+
DISABLE_CAPACITY_CHECK: 22,
|
|
43
|
+
/** value: CSS code as a string, settings: none */
|
|
44
|
+
INJECT_CSS: 23,
|
|
45
|
+
/** value: message as a string, settings: ActionSendChatMessageSettings */
|
|
46
|
+
SEND_SYSTEM_MESSAGE: 25,
|
|
47
|
+
/** value: interactionUuid, settings: none */
|
|
48
|
+
LOAD_INTERACTION: 26,
|
|
49
|
+
/** value: asset unique identifier, settings: ActionSendInteractionToChatSettings */
|
|
50
|
+
SEND_INTERACTION_TO_CHAT: 27,
|
|
51
|
+
};
|
|
52
|
+
exports.ACTION_TYPES = Object.keys(exports.ActionTypes);
|
|
53
|
+
exports.ACTION_STYLES = [
|
|
54
|
+
"primary",
|
|
55
|
+
"secondary",
|
|
56
|
+
"info",
|
|
57
|
+
"success",
|
|
58
|
+
"warning",
|
|
59
|
+
"danger",
|
|
60
|
+
"link",
|
|
61
|
+
"brand_primary",
|
|
62
|
+
"brand_secondary",
|
|
63
|
+
];
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { NestedOrganization } from "./customer";
|
|
2
|
+
import { NestedUser } from "./customer";
|
|
3
|
+
import { PublicNestedAsset } from "./assets";
|
|
4
|
+
import { GiosgAppUid, OrganizationUid, UserUid, AssetUid, GiosgAppInstanceUid, UserPermissionScope } from "./types";
|
|
5
|
+
/** TODO: Add jsdocs and check nullability of fields */
|
|
6
|
+
export interface GiosgAppInstance {
|
|
7
|
+
id: GiosgAppInstanceUid;
|
|
8
|
+
app_id: GiosgAppUid;
|
|
9
|
+
app: NestedGiosgApp;
|
|
10
|
+
organization_id: OrganizationUid;
|
|
11
|
+
organization: NestedOrganization;
|
|
12
|
+
created_at: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
app_user_id: UserUid | null;
|
|
15
|
+
app_user: NestedUser | null;
|
|
16
|
+
allowed_scopes: UserPermissionScope[];
|
|
17
|
+
is_disabled: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare type GiosgAppTriggerCondition = "chat_start" | "chat_end" | "chat_end_with_msgs" | "chat_open" | "chat_close" | "chat_focus" | "console_load" | "setup" | "install" | "uninstall" | "manual_dialog" | "manual_nav";
|
|
20
|
+
/** TODO: Add jsdocs and check nullability of fields */
|
|
21
|
+
export interface GiosgApp {
|
|
22
|
+
id: GiosgAppUid;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
icon_asset_id: AssetUid | null;
|
|
26
|
+
icon_asset: PublicNestedAsset | null;
|
|
27
|
+
owned_by_organization_id: OrganizationUid;
|
|
28
|
+
owned_by_organization: NestedOrganization;
|
|
29
|
+
secret: string;
|
|
30
|
+
is_available_to_anyone: boolean;
|
|
31
|
+
is_available_to_partners: boolean;
|
|
32
|
+
is_app_user_required: boolean;
|
|
33
|
+
app_user_default_first_name: string | null;
|
|
34
|
+
app_user_default_last_name: string | null;
|
|
35
|
+
app_user_default_alias: string | null;
|
|
36
|
+
terms_of_service_url: string;
|
|
37
|
+
privacy_policy_url: string;
|
|
38
|
+
trigger_url: string | null;
|
|
39
|
+
trigger_conditions: GiosgAppTriggerCondition[];
|
|
40
|
+
required_scopes: UserPermissionScope[];
|
|
41
|
+
allowed_redirect_uris: string[];
|
|
42
|
+
installation_count: number;
|
|
43
|
+
created_at: string;
|
|
44
|
+
updated_at: string;
|
|
45
|
+
created_by_user_id: UserUid;
|
|
46
|
+
created_by_user: NestedUser;
|
|
47
|
+
updated_by_user_id: UserUid;
|
|
48
|
+
updated_by_user: NestedUser;
|
|
49
|
+
}
|
|
50
|
+
/** TODO: Add jsdocs and check nullability of fields */
|
|
51
|
+
export interface GiosgAppPayload {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
icon_asset_id?: AssetUid | null;
|
|
55
|
+
is_available_to_anyone?: boolean;
|
|
56
|
+
is_available_to_partners?: boolean;
|
|
57
|
+
is_app_user_required: boolean;
|
|
58
|
+
app_user_default_first_name?: string | null;
|
|
59
|
+
app_user_default_last_name?: string | null;
|
|
60
|
+
app_user_default_alias?: string | null;
|
|
61
|
+
terms_of_service_url: string;
|
|
62
|
+
privacy_policy_url: string;
|
|
63
|
+
trigger_url?: string | null;
|
|
64
|
+
trigger_conditions?: GiosgAppTriggerCondition[];
|
|
65
|
+
required_scopes?: UserPermissionScope[];
|
|
66
|
+
allowed_redirect_uris?: string[];
|
|
67
|
+
}
|
|
68
|
+
/** TODO: Add jsdocs and check nullability of fields */
|
|
69
|
+
export interface InstalledGiosgApp {
|
|
70
|
+
id: GiosgAppUid;
|
|
71
|
+
name: string;
|
|
72
|
+
description: string;
|
|
73
|
+
icon_asset_id: AssetUid;
|
|
74
|
+
icon_asset: PublicNestedAsset;
|
|
75
|
+
owned_by_organization_id: OrganizationUid;
|
|
76
|
+
owned_by_organization: NestedOrganization;
|
|
77
|
+
is_app_user_required: boolean;
|
|
78
|
+
installation_count: number;
|
|
79
|
+
created_at: string;
|
|
80
|
+
updated_at: string;
|
|
81
|
+
trigger_conditions: GiosgAppTriggerCondition[];
|
|
82
|
+
is_disabled: boolean;
|
|
83
|
+
}
|
|
84
|
+
/** TODO: Add jsdocs and check nullability of fields */
|
|
85
|
+
export interface NestedGiosgApp {
|
|
86
|
+
id: GiosgAppUid;
|
|
87
|
+
name: string;
|
|
88
|
+
description: string;
|
|
89
|
+
icon_asset_id: AssetUid;
|
|
90
|
+
icon_asset: PublicNestedAsset;
|
|
91
|
+
owned_by_organization_id: OrganizationUid;
|
|
92
|
+
owned_by_organization: NestedOrganization;
|
|
93
|
+
is_app_user_required: boolean;
|
|
94
|
+
required_scopes: UserPermissionScope[];
|
|
95
|
+
installation_count: number;
|
|
96
|
+
created_at: string;
|
|
97
|
+
updated_at: string;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|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