@ada-support/embed2 1.0.33 → 1.0.39

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/README.md CHANGED
@@ -67,6 +67,18 @@ yarn bundle-report:legacy
67
67
 
68
68
  You will notice that many tabs are opened when running this command. Because Embed 2 is split between many sub-applications (representing framed components), a bundle analyzer is run for each application. The total bundle size is equal to sum of bundle sizes, plus external dependencies.
69
69
 
70
+ ## Connecting to an external bot
71
+ In certain scenarios it can be useful to run Embed 2 locally, but connect to a bot that exists on one of our external environments (`production`, `staging`, `dev`, `dev2`). To achieve this follow the steps below.
72
+ 1. open example/index.html and modify the `domain` parameter in the settings dictionary to match the environment the external bot exists on, should be one of `ada-dev`, `ada-dev2`, `ada-stage`, `ada` for dev, dev2, stage, or production respectively.
73
+ 2. open src/common/helpers/url/index.ts and modify the `getURL` function to return early after constructing the `prodURL`
74
+ ```javascript
75
+ export function getURL({
76
+ ...
77
+ const prodUrl = `https://${handle}${clusterString}.${domainString}.support/${name}/${routeString}${questionSym}${queryString}`;
78
+ return prodURL
79
+ })
80
+ ```
81
+ After starting Embed 2, access the example page by entering `http://<bot-handle>.localhost:9000` and replace <bot-handle> with the bot handle as it exists on the external environment.
70
82
  ## Testing
71
83
 
72
84
  ### Unit testing
@@ -110,44 +122,31 @@ yarn ci-cypress
110
122
 
111
123
  ### Steps to Deploy
112
124
 
113
- Follow instructions listed on [this notion page](https://www.notion.so/adasupport/Deploying-Embed-2-71e2775038cd47c78732bf04bf1d0525)
125
+ Follow instructions listed on [this notion page](https://www.notion.so/adasupport/Embed-2-deployment-runbook-fb81e8a28cb14ef1a607059914fb875a)
114
126
 
115
- ### Beta
116
- Deployment of the beta script is handled automatically by CircleCI when merging a branch into `master`. Once merged, two different scripts will be added to the Ada CDN:
127
+ Deployment of the static script is handled automatically by CircleCI when merging a branch into `master`. Once merged, two script will be added to the Ada CDN:
117
128
 
118
129
  ```
119
- # Verisoned
120
-
121
- https://static.ada.support/embed-beta/legacy/entry/<FIRST 7 CHAR OF COMMIT HASH>/embed2.beta.js
130
+ https://static.ada.support/embed2.<VERSION>.js
122
131
  ```
123
132
 
124
- And:
125
-
133
+ #### Example
126
134
  ```
127
- # Verisonless
128
-
129
- https://static.ada.support/embed2.beta.js
135
+ https://static.ada.support/embed2.1.0.35.js
130
136
  ```
131
137
 
132
- Before deploying to production, you should manually smoke test to make sure the beta script is working [here](https://jsfiddle.net/gn3ukc4r/show/).
133
-
134
- ### Production
135
- Once a beta script has been created, a production deployment will be "held" until approved by an Embed 2 admin. To approve the deploy, open the CircleCI job in question, and click on "Approve Job". You can read more about manual approval [here](https://circleci.com/docs/2.0/workflows/#holding-a-workflow-for-a-manual-approval).
138
+ Once static script is created, production deployment will be "held" until approved by an Embed 2 admin. To approve the deploy, open the CircleCI job in question, and click on "Approve Job". You can read more about manual approval [here](https://circleci.com/docs/2.0/workflows/#holding-a-workflow-for-a-manual-approval).
136
139
 
137
- Deploying production will create the following scripts:
140
+ Deploying production will create the versionless script
138
141
 
139
142
  ```
140
- # Verisoned
141
-
142
- https://static.ada.support/embed/legacy/entry/<FIRST 7 CHAR OF COMMIT HASH>/embed2.js
143
+ https://static.ada.support/embed2.js
143
144
  ```
144
145
 
145
- And:
146
+ Deploying to other cluster will create a script in following format.
146
147
 
147
148
  ```
148
- # Verisonless
149
-
150
- https://static.ada.support/embed2.js
149
+ https://static.ada.support/embed2.<CLUSTER>.js
151
150
  ```
152
151
 
153
152
  If you require access to the [Embed Procuction Deploys](https://github.com/orgs/AdaSupport/teams/embed-production-deploys) team (needed for production deployment), please reach out to an Engineering admin.
@@ -12,5 +12,5 @@ interface TriggerCampaignImplParams {
12
12
  messageService: MessageService;
13
13
  }
14
14
  export declare function triggerCampaignImpl({ adaSettings, chatterToken, campaign, ignoreStatus, ignoreFrequency, clearCampaignToTrigger, messageService, }: TriggerCampaignImplParams): void;
15
- export declare const getCampaignToTrigger: (adaSettings: StartOptions, chatterToken: string, marketingCampaigns: MarketingCampaign[], options: EvaluateCampaignParams) => MarketingCampaign;
15
+ export declare const getCampaignToTrigger: (adaSettings: StartOptions, marketingCampaigns: MarketingCampaign[] | undefined, options: EvaluateCampaignParams, onlyBasic: boolean) => MarketingCampaign;
16
16
  export {};
@@ -20,6 +20,7 @@ export declare class Embed {
20
20
  unmountCallback: () => void;
21
21
  initializationReject: (error: Error) => void;
22
22
  initializationResolve: () => void;
23
+ private debounceCampaignTrigger;
23
24
  static embed2Version: string;
24
25
  constructor(adaSettings: StartOptions, unmountCallback: () => void);
25
26
  renderPreactApp(): void;
@@ -3,5 +3,6 @@ export declare const CHATTER_CREATED_STORAGE_KEY = "ada-embed_chatter-created";
3
3
  export declare const IN_LIVE_CHAT_STORAGE_KEY = "inLiveChat";
4
4
  export declare const ZD_SESSION_STORAGE_KEY = "ada-embed_zd-session-id";
5
5
  export declare const ZD_PREVIOUS_TAGS_STORAGE_KEY = "ada-embed_zd-previous-tags";
6
+ export declare const IS_DRAWER_OPEN_STORAGE_KEY = "ada-embed_is-drawer-open";
6
7
  /** @deprecated - Use CHATTER_TOKEN_STORAGE_KEY */
7
8
  export declare const CHATTER_STORAGE_KEY = "chatter";