Skip to content

Commit

Permalink
Merge branch 'main' into tshamilov/ci-speed
Browse files Browse the repository at this point in the history
  • Loading branch information
shamilovtim committed Dec 6, 2023
2 parents b30bb0b + 8fe94d0 commit 274818c
Show file tree
Hide file tree
Showing 34 changed files with 4,403 additions and 15,209 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Security Scanning

on:
pull_request_target:
branches:
- main

push:
branches:
- main

# Run every day at 5am UTC
schedule:
- cron: "0 5 * * *"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
snyk:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Install Snyk
uses: snyk/actions/setup@master

- name: Snyk VULN and License Check Test
run: snyk test --all-projects --sarif-file-output=snyk.sarif
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

- name: Upload SARIF result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v2
if: always()
with:
sarif_file: snyk.sarif

fossa:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Run FOSSA Scan
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}

- name: Run FOSSA Test
uses: fossas/fossa-action@main
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true
17 changes: 0 additions & 17 deletions .github/workflows/tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,9 @@ jobs:
node-version: 18
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Install Snyk
uses: snyk/actions/setup@3e2680e8df93a24b52d119b1305fb7cedc60ceae # latest master (no released tag)

- name: Snyk VULN and License Check Test
run: snyk test --all-projects --sarif-file-output=snyk.sarif
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

- name: Report known vulnerabilities
run: npm audit

- name: Upload SARIF result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
if: always()
with:
sarif_file: snyk.sarif

test-with-node:
runs-on: ubuntu-latest
steps:
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ npm install @web5/api
_CDNs_

```yaml
https://unpkg.com/@web5/[email protected].2/dist/browser.js
https://unpkg.com/@web5/[email protected].3/dist/browser.js
```

```yaml
https://cdn.jsdelivr.net/npm/@web5/[email protected].2/dist/browser.mjs
https://cdn.jsdelivr.net/npm/@web5/[email protected].3/dist/browser.mjs
```

## Usage
Expand Down Expand Up @@ -170,12 +170,13 @@ Each `Record` instance has the following instance properties: `id`, `attestation
Each `Record` instance has the following instance methods:

- **`data`** - _`object`_: an object with the following convenience methods that read out the data of the record entry in the following formats:
- **`text`** - _`function`_: produces a textual representation of the data.
- **`json`** - _`function`_: if the value is JSON data, this method will return a parsed JSON object.
- **`stream`** - _`function`_: returns the raw stream of bytes for the data.
- **`blob`** - _`function`_: returns the data as a [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
- **`bytes`** - _`function`_: returns the data as a raw byte array in `Uint8Array` format.
- **`json`** - _`function`_: returns a parsed JSON object.
- **`stream`** - _`function`_: returns the data as a raw stream of bytes.
- **`text`** - _`function`_: returns the data as a string.
- **`send`** - _`function`_: sends the record the instance represents to the DWeb Node endpoints of a provided DID.
- **`update`** - _`function`_: takes in a new request object matching the expected method signature of a `write` and overwrites the record. This is a convenience method that allows you to easily overwrite records with less verbosity.
- **`delete`** - _`function`_: generates a `delete` entry tombstone for the record. This is a convenience method that allows you to easily delete records with less verbosity.

### **`web5.dwn.records.query(request)`**

Expand Down
Loading

0 comments on commit 274818c

Please sign in to comment.