diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 5e0b1f0..a405812 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - deno-version: [v2.8.0] + deno-version: [v1.46.3, v2.8.0] os: [ ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} @@ -58,5 +58,10 @@ jobs: with: deno-version: ${{ matrix.deno-version }} - - name: Run tests + - name: Run tests (Deno v1) + if: "contains(matrix.deno-version, 'v1')" + run: deno task test-v1 + + - name: Run tests (Deno v2) + if: "contains(matrix.deno-version, 'v2')" run: deno task test \ No newline at end of file diff --git a/README.md b/README.md index 4918183..ffd5cbe 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ A Deno SDK for Switcher API ### Prerequisites -- **Deno**: Version 2.x or above +- **Deno**: Version 1.4x, 2.x or later - **Permissions**: | Permission | Required For | @@ -75,6 +75,7 @@ A Deno SDK for Switcher API | `--allow-write` | Writing snapshot files (if enabled) | | `--allow-net` | Communicating with the Switcher API | | `--allow-env` | Accessing environment variables for configuration | +| `--unstable-http` | Required for custom SSL certificates in Deno v1.4x (see [Advanced Options](#advanced-options)) | ### Installation diff --git a/deno.jsonc b/deno.jsonc index a32ddc4..4284553 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -7,6 +7,7 @@ "fmt": "deno fmt mod.ts src/ --options-single-quote --options-line-width=120 --check", "fmt:fix": "deno fmt mod.ts src/ --options-single-quote --options-line-width=120", "test": "deno test --allow-read --allow-net --allow-write --allow-env --allow-import --coverage=coverage", + "test-v1": "deno test --allow-read --allow-net --allow-write --allow-env --unstable-http --coverage=coverage", "clean": "rm -rf ./npm ./coverage ./generated-snapshots", "lcov": "deno coverage coverage --lcov --output=coverage/report.lcov", "cover": "deno task clean && deno task test && deno task lcov && genhtml -o coverage/html coverage/report.lcov", diff --git a/src/lib/remoteAuth.ts b/src/lib/remoteAuth.ts index 2550791..ec99a21 100644 --- a/src/lib/remoteAuth.ts +++ b/src/lib/remoteAuth.ts @@ -11,7 +11,7 @@ import * as util from './utils/index.ts'; export class Auth { private static context: SwitcherContext; private static retryOptions: RetryOptions; - private static refreshTimer: NodeJS.Timeout | undefined; + private static refreshTimer: ReturnType | undefined; static init(context: SwitcherContext) { this.context = context; diff --git a/src/lib/snapshotWatcher.ts b/src/lib/snapshotWatcher.ts index e46ae5f..b16d528 100644 --- a/src/lib/snapshotWatcher.ts +++ b/src/lib/snapshotWatcher.ts @@ -10,7 +10,7 @@ import * as util from './utils/index.ts'; */ export class SnapshotWatcher { private _watcher: Deno.FsWatcher | undefined; - private readonly _watchDebounce = new Map(); + private readonly _watchDebounce = new Map>(); async watchSnapshot(environment: string, callback: { success?: () => void | Promise; diff --git a/src/lib/utils/snapshotAutoUpdater.ts b/src/lib/utils/snapshotAutoUpdater.ts index 69185ed..bd4d93c 100644 --- a/src/lib/utils/snapshotAutoUpdater.ts +++ b/src/lib/utils/snapshotAutoUpdater.ts @@ -1,5 +1,5 @@ export default class SnapshotAutoUpdater { - private static _intervalId: NodeJS.Timeout | undefined; + private static _intervalId: ReturnType | undefined; static schedule( interval: number,