@ada-support/web-storage 1.4.5 → 1.4.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/web-storage",
3
- "version": "1.4.5",
3
+ "version": "1.4.7",
4
4
  "description": "A package to provide access to Web Storage API",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {
@@ -13,11 +13,12 @@
13
13
  },
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "git+https://github.com/AdaSupport/web-storage.git"
16
+ "url": "git+https://github.com/AdaSupport/monorepo.git",
17
+ "directory": "web-storage"
17
18
  },
18
19
  "author": "",
19
20
  "license": "ISC",
20
- "homepage": "https://github.com/AdaSupport/web-storage#readme",
21
+ "homepage": "https://github.com/AdaSupport/monorepo/tree/main/web-storage#readme",
21
22
  "dependencies": {
22
23
  "ts-node": "^10.9.1",
23
24
  "typescript": "^4.8.4"
@@ -1,13 +0,0 @@
1
- ### Changes
2
-
3
- > _List out the changes_
4
-
5
- ### Why this is Important?
6
-
7
- > _A bit of context_
8
-
9
- ---
10
-
11
- ### Checklist
12
-
13
- - [ ] [Security team](https://adasupport.slack.com/archives/C030WPEMRCZ) is notified about the changes and approves them.
@@ -1,11 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "npm"
4
- directory: "/"
5
- schedule:
6
- interval: "daily"
7
- time: "15:15"
8
- timezone: "America/Toronto"
9
- open-pull-requests-limit: 0
10
- assignees:
11
- - AdaSupport/channels-and-handoffs
@@ -1,26 +0,0 @@
1
- on:
2
- pull_request:
3
- branches:
4
- - main
5
-
6
- name: Open Jira Ticket for Dependabot PRs
7
-
8
- jobs:
9
- create-jira-ticket:
10
- runs-on: ubuntu-latest
11
- if: github.actor == 'dependabot[bot]'
12
- steps:
13
- - name: Jira Login
14
- uses: atlassian/gajira-login@v3
15
- env:
16
- JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
17
- JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
18
- JIRA_API_TOKEN: ${{ secrets.TEMP_JIRA_TOKEN }}
19
- - name: Create Ticket
20
- id: create
21
- uses: atlassian/gajira-create@v3
22
- with:
23
- project: CH
24
- issuetype: KTLO
25
- summary: Vulnerable Package Upgrades
26
- description: "Dependabot has opened a new PR: ${{ github.event.pull_request.html_url }}"
@@ -1,44 +0,0 @@
1
- name: "Deploy HTML page"
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
-
7
- jobs:
8
- deploy:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - name: "Checkout source code"
12
- uses: "actions/checkout@v2"
13
- env:
14
- GITHUB_TOKEN: ${{ secrets.PUSH_ACCESS_TOKEN }}
15
- with:
16
- ref: ${{ github.ref }}
17
-
18
- - uses: actions/setup-node@v2
19
- with:
20
- node-version: "16.x"
21
- registry-url: "https://registry.npmjs.org"
22
-
23
- - name: "Compile"
24
- run: |
25
- yarn install
26
- yarn compile
27
-
28
- - name: "Upload ada-web-storage-list.html"
29
- run: |
30
- aws s3 cp dist/ada-web-storage-list.html s3://ada-static-cdn-prod/ada-web-storage-list.html
31
-
32
- env:
33
- AWS_ACCESS_KEY_ID: ${{ secrets.ADA_STATIC_CDN_PROD_ACCESS_KEY_ID }}
34
- AWS_SECRET_ACCESS_KEY: ${{ secrets.ADA_STATIC_CDN_PROD_SECRET_ACCESS_KEY }}
35
- AWS_DEFAULT_REGION: us-east-1
36
-
37
- - name: "Create invalidation"
38
- run: |
39
- aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/ada-web-storage-list.html"
40
-
41
- env:
42
- AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFRONT_INVALIDATION_ACCESS_KEY_ID }}
43
- AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFRONT_INVALIDATION_SECRET_KEY }}
44
- AWS_DEFAULT_REGION: us-east-1
@@ -1,45 +0,0 @@
1
- name: Notify Slack flag-cleanup channel on new "Vega" PR
2
-
3
- on:
4
- pull_request:
5
- types: [opened]
6
-
7
- permissions:
8
- pull-requests: write
9
-
10
- jobs:
11
- check-title:
12
- runs-on: ubuntu-latest
13
- if: contains(github.event.pull_request.title, '[Vega]')
14
- steps:
15
- - name: Build Slack payload
16
- id: build-payload
17
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
18
- env:
19
- PR_TITLE: ${{ github.event.pull_request.title }}
20
- PR_URL: ${{ github.event.pull_request.html_url }}
21
- with:
22
- script: |
23
- const payload = {
24
- text: `New flag cleanup PR opened by Vega: <${process.env.PR_URL}|${process.env.PR_TITLE}>`
25
- };
26
- core.setOutput('payload', JSON.stringify(payload));
27
-
28
- - name: Send Slack notification
29
- uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
30
- with:
31
- webhook: ${{ secrets.SLACK_WEBHOOK_FLAG_CLEANUP }}
32
- webhook-type: incoming-webhook
33
- payload: ${{ steps.build-payload.outputs.payload }}
34
-
35
- - name: Request review from flag-cleanup team
36
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
37
- with:
38
- github-token: ${{ secrets.FLAG_CLEANUP_PAT }}
39
- script: |
40
- await github.rest.pulls.requestReviewers({
41
- owner: context.repo.owner,
42
- repo: context.repo.repo,
43
- pull_number: context.payload.pull_request.number,
44
- team_reviewers: ['flag-cleanup']
45
- });
@@ -1,87 +0,0 @@
1
- # One-time migration: copy web-storage's CI Actions secrets into the shared `api`
2
- # Doppler project, so the migrated monorepo workflows can fetch them over OIDC
3
- # (see .github/workflows/web-storage-{deploy-html,notify-people}.yml).
4
- #
5
- # WHERE TO RUN: commit and run this in the STANDALONE `AdaSupport/web-storage`
6
- # repo. The source secrets it reads are only readable there — running it in the
7
- # monorepo would read empty values (the guard below blocks that). Trigger it
8
- # manually from the Actions tab (workflow_dispatch), confirm success in the
9
- # Doppler dashboard, then delete this workflow and the DOPPLER_TOKEN secret.
10
- #
11
- # MIGRATED: the 5 repo-level AWS/CloudFront secrets, plus SLACK_WEBHOOK_URL
12
- # (org-level, but readable in this repo's workflow context — notify-people now
13
- # fetches it from Doppler too).
14
- #
15
- # EXCLUDED on purpose (do NOT migrate):
16
- # - NPM_TOKEN -> publish now uses npm OIDC trusted publishing.
17
- # - JIRA_* / TEMP_JIRA -> the dependabot-jira workflow was dropped.
18
- # - SONAR_TOKEN -> not used by any migrated workflow.
19
- #
20
- # NAMING: values are written to Doppler with a `WEB_STORAGE_` prefix (e.g.
21
- # WEB_STORAGE_CLOUDFRONT_DISTRIBUTION_ID) to avoid collisions in the shared `api`
22
- # project. The consuming workflow reads them as steps.doppler.outputs.WEB_STORAGE_*.
23
- #
24
- # PREREQUISITE: a Doppler token with WRITE access to api/ci_github_actions,
25
- # stored as the `DOPPLER_TOKEN` Actions secret on this repo (remove it after).
26
-
27
- name: "Migrate web-storage repo secrets to Doppler (one-time)"
28
-
29
- on:
30
- workflow_dispatch:
31
-
32
- jobs:
33
- migrate:
34
- runs-on: ubuntu-latest
35
- env:
36
- DOPPLER_PROJECT: api
37
- DOPPLER_CONFIG: ci_github_actions
38
- DOPPLER_TOKEN: ${{ secrets.DOPPLER_TOKEN }}
39
- ADA_STATIC_CDN_PROD_ACCESS_KEY_ID: ${{ secrets.ADA_STATIC_CDN_PROD_ACCESS_KEY_ID }}
40
- ADA_STATIC_CDN_PROD_SECRET_ACCESS_KEY: ${{ secrets.ADA_STATIC_CDN_PROD_SECRET_ACCESS_KEY }}
41
- CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
42
- CLOUDFRONT_INVALIDATION_ACCESS_KEY_ID: ${{ secrets.CLOUDFRONT_INVALIDATION_ACCESS_KEY_ID }}
43
- CLOUDFRONT_INVALIDATION_SECRET_KEY: ${{ secrets.CLOUDFRONT_INVALIDATION_SECRET_KEY }}
44
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
45
- steps:
46
- - name: Install Doppler CLI
47
- uses: dopplerhq/cli-action@v3
48
-
49
- - name: Guard — refuse to run without the source secrets present
50
- run: |
51
- set -euo pipefail
52
- if [ -z "${DOPPLER_TOKEN:-}" ]; then
53
- echo "::error::DOPPLER_TOKEN is not set — add a Doppler token with write access to api/ci_github_actions."
54
- exit 1
55
- fi
56
- missing=0
57
- for name in \
58
- ADA_STATIC_CDN_PROD_ACCESS_KEY_ID \
59
- ADA_STATIC_CDN_PROD_SECRET_ACCESS_KEY \
60
- CLOUDFRONT_DISTRIBUTION_ID \
61
- CLOUDFRONT_INVALIDATION_ACCESS_KEY_ID \
62
- CLOUDFRONT_INVALIDATION_SECRET_KEY \
63
- SLACK_WEBHOOK_URL; do
64
- if [ -z "${!name:-}" ]; then
65
- echo "::error::$name is empty — are you running this in AdaSupport/web-storage?"
66
- missing=1
67
- fi
68
- done
69
- [ "$missing" -eq 0 ] || exit 1
70
-
71
- - name: Push repo-level secrets to Doppler (api / ci_github_actions)
72
- run: |
73
- set -euo pipefail
74
- for name in \
75
- ADA_STATIC_CDN_PROD_ACCESS_KEY_ID \
76
- ADA_STATIC_CDN_PROD_SECRET_ACCESS_KEY \
77
- CLOUDFRONT_DISTRIBUTION_ID \
78
- CLOUDFRONT_INVALIDATION_ACCESS_KEY_ID \
79
- CLOUDFRONT_INVALIDATION_SECRET_KEY \
80
- SLACK_WEBHOOK_URL; do
81
- echo "Setting WEB_STORAGE_$name in $DOPPLER_PROJECT/$DOPPLER_CONFIG"
82
- # Value piped via stdin so it never appears in argv/process list.
83
- # Read from the unprefixed GitHub secret, write with the WEB_STORAGE_ prefix.
84
- printf '%s' "${!name}" | doppler secrets set "WEB_STORAGE_$name" \
85
- --project "$DOPPLER_PROJECT" --config "$DOPPLER_CONFIG" --silent
86
- done
87
- echo "Done. Verify in the Doppler dashboard, then delete this workflow and the DOPPLER_TOKEN secret."
@@ -1,42 +0,0 @@
1
- name: "Notify people"
2
-
3
- on:
4
- pull_request:
5
- types: [opened, reopened, ready_for_review]
6
- paths:
7
- - "src/storage-keys.ts"
8
- - "src/third-party-items.ts"
9
-
10
- jobs:
11
- notify:
12
- runs-on: ubuntu-latest
13
- env:
14
- SLACK_CHANNEL: "#t-messaging-experience" #default
15
- SLACK_USERNAME: "`@ada-support/web-storage` package updates"
16
- SLACK_ICON_EMOJI: ":sparkles:"
17
- SLACK_COLOR: "#f5e512"
18
- SLACK_TITLE: "Changes have been made to Ada's `web-storage`. Please review the pull request below."
19
- SLACK_MESSAGE: "${{github.event.pull_request.title}}\n ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.number }}\n\n *REMINDER: Ada Security is expected to approve this PR 30 days after affected customers have been notified by their respective CSM. Details steps can be found within the README (https://github.com/AdaSupport/web-storage#contributing)*"
20
- SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
21
- MSG_MINIMAL: true
22
-
23
- steps:
24
- - name: "Notify messaging-experience team"
25
- uses: rtCamp/action-slack-notify@v2
26
- env:
27
- SLACK_CHANNEL: "#t-messaging-experience"
28
-
29
- - name: "Notify #p-cookies-updates-management"
30
- uses: rtCamp/action-slack-notify@v2
31
- env:
32
- SLACK_CHANNEL: "#p-cookies-updates-management"
33
-
34
- - name: "Notify security team"
35
- uses: rtCamp/action-slack-notify@v2
36
- env:
37
- SLACK_CHANNEL: "#t-security"
38
-
39
- - name: "Notify Canva CSM"
40
- uses: rtCamp/action-slack-notify@v2
41
- env:
42
- SLACK_CHANNEL: "#canva-internal"
@@ -1,45 +0,0 @@
1
- name: "NPM publish"
2
-
3
- on:
4
- push:
5
- branches: [ main ]
6
-
7
- jobs:
8
- npm-publish:
9
- name: "NPM publish"
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
18
- steps:
19
- - name: "Checkout source code"
20
- uses: "actions/checkout@v4"
21
- with:
22
- ref: ${{ github.ref }}
23
-
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
31
- with:
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
40
-
41
- - run: |
42
- yarn install
43
- yarn compile
44
- mv "README_NPM.md" "README.md"
45
- npm publish
@@ -1,34 +0,0 @@
1
- name: "Verify code"
2
-
3
- on:
4
- pull_request:
5
- jobs:
6
- verify:
7
- name: "Verify code"
8
- runs-on: ubuntu-latest
9
- steps:
10
- - name: "Checkout source code"
11
- uses: "actions/checkout@v3"
12
- env:
13
- GITHUB_TOKEN: ${{ secrets.PUSH_ACCESS_TOKEN }}
14
- with:
15
- ref: ${{ github.ref }}
16
- fetch-depth: 0 # We need this to be able to run `diff` with `main` branch
17
-
18
- - uses: actions/setup-node@v3
19
- with:
20
- node-version: "16"
21
- registry-url: "https://registry.npmjs.org"
22
- cache: "npm"
23
-
24
- - name: "Yarn install"
25
- run: yarn install
26
-
27
- - name: "Check package version"
28
- run: yarn check-package-version
29
-
30
- - name: "Lint"
31
- run: yarn lint
32
-
33
- - name: "Compile"
34
- run: yarn compile