@ada-support/web-storage 1.2.10 → 1.4.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/.github/workflows/notify-people.yml +3 -3
- package/.github/workflows/npm-publish.yml +23 -8
- package/dist/ada-web-storage-list.html +6 -0
- package/dist/functional-storage.d.ts +3 -0
- package/dist/storage-keys.d.ts +13 -0
- package/package.json +1 -1
- package/src/functional-storage.ts +3 -0
- package/src/storage-keys.ts +15 -0
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
notify:
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
13
|
env:
|
|
14
|
-
SLACK_CHANNEL: "#
|
|
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
|
|
24
|
+
- name: "Notify messaging-experience team"
|
|
25
25
|
uses: rtCamp/action-slack-notify@v2
|
|
26
26
|
env:
|
|
27
|
-
SLACK_CHANNEL: "#
|
|
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,38 @@ 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@
|
|
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
|
-
|
|
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: "
|
|
22
|
-
|
|
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. Pin to npm@11 (not @latest):
|
|
36
|
+
# npm@12 dropped Node 20 support (requires Node >= 22), so @latest now
|
|
37
|
+
# EBADENGINE-fails on this runner. npm@11 supports Node 20 and satisfies the
|
|
38
|
+
# OIDC minimum.
|
|
39
|
+
- run: npm install -g npm@11
|
|
23
40
|
|
|
24
41
|
- run: |
|
|
25
42
|
yarn install
|
|
26
43
|
yarn compile
|
|
27
44
|
mv "README_NPM.md" "README.md"
|
|
28
45
|
npm publish
|
|
29
|
-
env:
|
|
30
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -233,6 +233,12 @@ border: 1px solid;
|
|
|
233
233
|
<td>Persistent</td>
|
|
234
234
|
</tr>
|
|
235
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>
|
|
236
242
|
<td>netDisruptionMsgStartTime</td>
|
|
237
243
|
<td>Used to implement Chat reconnection after an interruption.</td>
|
|
238
244
|
<td>Web Storage (functional)</td>
|
package/dist/storage-keys.d.ts
CHANGED
|
@@ -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. */
|
package/package.json
CHANGED
package/src/storage-keys.ts
CHANGED
|
@@ -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
|
|