@ada-support/web-storage 1.2.9 → 1.3.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.
@@ -11,7 +11,7 @@ jobs:
11
11
  notify:
12
12
  runs-on: ubuntu-latest
13
13
  env:
14
- SLACK_CHANNEL: "#chatx-engineering-internal" #default
14
+ SLACK_CHANNEL: "#t-messaging-experience" #default
15
15
  SLACK_USERNAME: "`@ada-support/web-storage` package updates"
16
16
  SLACK_ICON_EMOJI: ":sparkles:"
17
17
  SLACK_COLOR: "#f5e512"
@@ -21,10 +21,10 @@ jobs:
21
21
  MSG_MINIMAL: true
22
22
 
23
23
  steps:
24
- - name: "Notify ChatX team"
24
+ - name: "Notify messaging-experience team"
25
25
  uses: rtCamp/action-slack-notify@v2
26
26
  env:
27
- SLACK_CHANNEL: "#chatx-engineering-internal"
27
+ SLACK_CHANNEL: "#t-messaging-experience"
28
28
 
29
29
  - name: "Notify #p-cookies-updates-management"
30
30
  uses: rtCamp/action-slack-notify@v2
@@ -8,23 +8,35 @@ jobs:
8
8
  npm-publish:
9
9
  name: "NPM publish"
10
10
  runs-on: ubuntu-latest
11
+ # Trusted publishing (OIDC) mints a short-lived token from this workflow's
12
+ # identity instead of a long-lived NPM_TOKEN. `id-token: write` is required
13
+ # for npm to request the OIDC token; `contents: read` is least-privilege for
14
+ # checkout.
15
+ permissions:
16
+ contents: read
17
+ id-token: write
11
18
  steps:
12
19
  - name: "Checkout source code"
13
- uses: "actions/checkout@v2"
14
- env:
15
- GITHUB_TOKEN: ${{ secrets.PUSH_ACCESS_TOKEN }}
20
+ uses: "actions/checkout@v4"
16
21
  with:
17
22
  ref: ${{ github.ref }}
18
23
 
19
- - uses: actions/setup-node@v2
24
+ # NOTE: deliberately no `registry-url` here. setup-node's `registry-url`
25
+ # writes an .npmrc with `//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}`
26
+ # (resolving to setup-node's placeholder token). npm only uses OIDC trusted
27
+ # publishing when NO auth is configured, so that placeholder token shadows
28
+ # OIDC and the publish 404s. Without registry-url npm uses the default
29
+ # registry (registry.npmjs.org) with no token, so OIDC engages.
30
+ - uses: actions/setup-node@v4
20
31
  with:
21
- node-version: "16.x"
22
- registry-url: "https://registry.npmjs.org"
32
+ node-version: "20.x"
33
+
34
+ # OIDC trusted publishing requires npm >= 11.5.1; the npm bundled with Node
35
+ # 20 is older, so upgrade before publishing. (npm 11 itself needs Node >= 20.)
36
+ - run: npm install -g npm@latest
23
37
 
24
38
  - run: |
25
39
  yarn install
26
40
  yarn compile
27
41
  mv "README_NPM.md" "README.md"
28
42
  npm publish
29
- env:
30
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/CODEOWNERS CHANGED
@@ -1,3 +1,3 @@
1
- src/ @AdaSupport/channels-and-handoffs
1
+ src/ @AdaSupport/messaging-experience
2
2
  src/third-party-items.ts @AdaSupport/security
3
3
  src/storage-keys.ts @AdaSupport/security
@@ -209,12 +209,36 @@ border: 1px solid;
209
209
  <td>Persistent</td>
210
210
  </tr>
211
211
  <tr>
212
+ <td>LaunchDarkly_[alphanumeric ID]_[alphanumeric ID]</td>
213
+ <td>Used by LaunchDarkly to cache feature flag values for the chat widget. Scoped per bot (client_handle), not per end-user.</td>
214
+ <td>Web Storage (functional)</td>
215
+ <td>Persistent</td>
216
+ </tr>
217
+ <tr>
218
+ <td>LaunchDarkly_[alphanumeric ID]_[alphanumeric ID]_freshness</td>
219
+ <td>Used by LaunchDarkly to record when the associated cached feature flag values were last refreshed. Paired with the flag cache entry.</td>
220
+ <td>Web Storage (functional)</td>
221
+ <td>Persistent</td>
222
+ </tr>
223
+ <tr>
224
+ <td>LaunchDarkly_[alphanumeric ID]_ContextIndex</td>
225
+ <td>Used by LaunchDarkly to index evaluation contexts (bots) that have fetched feature flags for the chat widget.</td>
226
+ <td>Web Storage (functional)</td>
227
+ <td>Persistent</td>
228
+ </tr>
229
+ <tr>
212
230
  <td>liveChatPending</td>
213
231
  <td>Indicates whether user is waiting to connect to a live agent.</td>
214
232
  <td>Web Storage (functional)</td>
215
233
  <td>Persistent</td>
216
234
  </tr>
217
235
  <tr>
236
+ <td>messagingAuthState</td>
237
+ <td>Stores the messaging authentication state (a short-lived messaging access token and its expiry, a rotating session refresh token, and a refresh counter) used to authenticate the visitor's generative chat session with Ada. Set on the bot's Ada subdomain.</td>
238
+ <td>Web Storage (functional)</td>
239
+ <td>Persistent</td>
240
+ </tr>
241
+ <tr>
218
242
  <td>netDisruptionMsgStartTime</td>
219
243
  <td>Used to implement Chat reconnection after an interruption.</td>
220
244
  <td>Web Storage (functional)</td>
@@ -1,4 +1,15 @@
1
1
  import type { AdaFunctionalStorageValue } from "./functional-storage";
2
+ /**
3
+ * Messaging JWT auth state. Defined as a named type (not an inline object) so the
4
+ * `StorageValueByKey` entry below stays brace-free — `generate-html.ts` parses that
5
+ * interface up to its first `}`, so an inline object value would truncate the parse.
6
+ */
7
+ export interface MessagingAuthState {
8
+ messagingToken: string;
9
+ messagingTokenExpiresAt: number;
10
+ sessionRefreshToken: string;
11
+ refreshGeneration: number;
12
+ }
2
13
  /**
3
14
  * IMPORTANT
4
15
  * You most likely don't need to modify anything here.
@@ -51,6 +62,8 @@ export interface StorageValueByKey {
51
62
  "previouslyAuthenticated": boolean;
52
63
  /** Used for chatter authentication. */
53
64
  "ada-embed_session-token": string;
65
+ /** Stores the messaging authentication state (a short-lived messaging access token and its expiry, a rotating session refresh token, and a refresh counter) used to authenticate the visitor's generative chat session with Ada. Set on the bot's Ada subdomain. */
66
+ "messagingAuthState": MessagingAuthState;
54
67
  /** Used to implement Chat reconnection after an interruption. */
55
68
  "backoffTimeout": number;
56
69
  /** Used during Oracle handoffs to indicate whether the agent has sent a request for a secret message. Allows the state to persist between page changes. */
@@ -181,4 +181,25 @@ exports.THIRD_PARTY_ITEMS = [
181
181
  duration: "2 Year",
182
182
  purpose: ["Functional"]
183
183
  },
184
+ {
185
+ keyName: "LaunchDarkly_[alphanumeric ID]_[alphanumeric ID]",
186
+ description: "Used by LaunchDarkly to cache feature flag values for the chat widget. Scoped per bot (client_handle), not per end-user.",
187
+ type: "Web Storage",
188
+ duration: "Persistent",
189
+ purpose: ["Functional"]
190
+ },
191
+ {
192
+ keyName: "LaunchDarkly_[alphanumeric ID]_ContextIndex",
193
+ description: "Used by LaunchDarkly to index evaluation contexts (bots) that have fetched feature flags for the chat widget.",
194
+ type: "Web Storage",
195
+ duration: "Persistent",
196
+ purpose: ["Functional"]
197
+ },
198
+ {
199
+ keyName: "LaunchDarkly_[alphanumeric ID]_[alphanumeric ID]_freshness",
200
+ description: "Used by LaunchDarkly to record when the associated cached feature flag values were last refreshed. Paired with the flag cache entry.",
201
+ type: "Web Storage",
202
+ duration: "Persistent",
203
+ purpose: ["Functional"]
204
+ },
184
205
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/web-storage",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
4
4
  "description": "A package to provide access to Web Storage API",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {
@@ -1,5 +1,17 @@
1
1
  import type { AdaFunctionalStorageValue } from "./functional-storage";
2
2
 
3
+ /**
4
+ * Messaging JWT auth state. Defined as a named type (not an inline object) so the
5
+ * `StorageValueByKey` entry below stays brace-free — `generate-html.ts` parses that
6
+ * interface up to its first `}`, so an inline object value would truncate the parse.
7
+ */
8
+ export interface MessagingAuthState {
9
+ messagingToken: string;
10
+ messagingTokenExpiresAt: number;
11
+ sessionRefreshToken: string;
12
+ refreshGeneration: number;
13
+ }
14
+
3
15
  /**
4
16
  * IMPORTANT
5
17
  * You most likely don't need to modify anything here.
@@ -73,6 +85,9 @@ export interface StorageValueByKey {
73
85
  /** Used for chatter authentication. */
74
86
  "ada-embed_session-token": string;
75
87
 
88
+ /** Stores the messaging authentication state (a short-lived messaging access token and its expiry, a rotating session refresh token, and a refresh counter) used to authenticate the visitor's generative chat session with Ada. Set on the bot's Ada subdomain. */
89
+ "messagingAuthState": MessagingAuthState;
90
+
76
91
  /** Used to implement Chat reconnection after an interruption. */
77
92
  "backoffTimeout": number;
78
93
 
@@ -186,5 +186,29 @@ export const THIRD_PARTY_ITEMS: WebStorageItem[] = [
186
186
  duration: "2 Year",
187
187
  purpose: ["Functional"],
188
188
  },
189
+ {
190
+ keyName: "LaunchDarkly_[alphanumeric ID]_[alphanumeric ID]",
191
+ description:
192
+ "Used by LaunchDarkly to cache feature flag values for the chat widget. Scoped per bot (client_handle), not per end-user.",
193
+ type: "Web Storage",
194
+ duration: "Persistent",
195
+ purpose: ["Functional"],
196
+ },
197
+ {
198
+ keyName: "LaunchDarkly_[alphanumeric ID]_ContextIndex",
199
+ description:
200
+ "Used by LaunchDarkly to index evaluation contexts (bots) that have fetched feature flags for the chat widget.",
201
+ type: "Web Storage",
202
+ duration: "Persistent",
203
+ purpose: ["Functional"],
204
+ },
205
+ {
206
+ keyName: "LaunchDarkly_[alphanumeric ID]_[alphanumeric ID]_freshness",
207
+ description:
208
+ "Used by LaunchDarkly to record when the associated cached feature flag values were last refreshed. Paired with the flag cache entry.",
209
+ type: "Web Storage",
210
+ duration: "Persistent",
211
+ purpose: ["Functional"],
212
+ },
189
213
 
190
214
  ];