-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nialexsan/update-packages
- Loading branch information
Showing
40 changed files
with
3,523 additions
and
1,229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Extension metadata | ||
|
||
**DO NOT DELETE THIS FOLDER UNLESS YOU KNOW WHAT YOU ARE DOING** | ||
|
||
This folder contains remotely-updated metadata to provide updates to the Cadence VSCode Extension without requiring a new release of the extension itself. When consuming this metadata, the latest commit to the default repository branch should be assumed to be the latest version of the extension metadata. | ||
|
||
Currently, it is only used by the Cadence VSCode Extension to fetch any notifications that should be displayed to the user. | ||
|
||
## Notfications schema | ||
|
||
```ts | ||
interface Notification { | ||
_type: 'Notification' | ||
id: string | ||
type: 'error' | 'info' | 'warning' | ||
text: string | ||
buttons?: Array<{ | ||
label: string | ||
link: string | ||
}> | ||
suppressable?: boolean | ||
} | ||
``` | ||
|
||
### Fields | ||
|
||
- `_type`: The type of the object. Should always be `"Notification"`. | ||
- `id`: A unique identifier for the notification. This is used to determine if the notification has already been displayed to the user. | ||
- `type`: The type of notification. Can be `"info"`, `"warning"`, or `"error"`. | ||
- `text`: The text to display to the user. | ||
- `buttons`: An array of buttons to display to the user. Each button should have a `label` field and a `link` field. The `link` field should be a URL to open when the button is clicked. | ||
- `suppressable`: Whether or not the user should be able to suppress the notification. (defaults to `true`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
declare module '@onflow/decode' | ||
declare module 'portscanner-sync' | ||
declare module 'elliptic' | ||
declare module 'node-fetch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,7 @@ | ||
import * as crypto from 'crypto' | ||
|
||
globalThis.crypto = { | ||
getRandomValues: (buffer: Buffer) => { | ||
const buf = new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength) | ||
if (!(buf instanceof Uint8Array)) { | ||
throw new TypeError('expected Uint8Array') | ||
} | ||
if (buf.length > 65536) { | ||
const e = new Error() | ||
// @ts-expect-error | ||
e.code = 22 | ||
e.message = `Failed to execute 'getRandomValues' on 'Crypto': The 'ArrayBufferView's byte length (${buf.length}) exceeds the number of bytes of entropy available via this API (65536).` | ||
e.name = 'QuotaExceededError' | ||
throw e | ||
} | ||
const bytes = crypto.randomBytes(buf.length) | ||
buf.set(bytes) | ||
return buf | ||
} | ||
} as any | ||
if (globalThis.crypto == null) { | ||
Object.defineProperty(globalThis, 'crypto', { | ||
value: crypto | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.