diff --git a/.changeset/fifty-camels-wink.md b/.changeset/fifty-camels-wink.md new file mode 100644 index 000000000..9497f2830 --- /dev/null +++ b/.changeset/fifty-camels-wink.md @@ -0,0 +1,5 @@ +--- +"@asyncapi/gleequore": minor +--- + +Initial release diff --git a/.changeset/tasty-needles-serve.md b/.changeset/tasty-needles-serve.md new file mode 100644 index 000000000..0494f8cb8 --- /dev/null +++ b/.changeset/tasty-needles-serve.md @@ -0,0 +1,11 @@ +--- +"@asyncapi/glee-redis-cluster-adapter": minor +"@asyncapi/glee-web-server-adapter": minor +"@asyncapi/glee-socketio-adapter": minor +"@asyncapi/glee-kafka-adapter": minor +"@asyncapi/glee-mqtt-adapter": minor +"@asyncapi/glee-shared-utils": minor +"@asyncapi/glee-web-adapter": minor +--- + +Initial release of adapters and shared utils library diff --git a/.github/workflows/release-with-changesets.yml b/.github/workflows/release-with-changesets.yml new file mode 100644 index 000000000..0e849831c --- /dev/null +++ b/.github/workflows/release-with-changesets.yml @@ -0,0 +1,129 @@ +# It does magic only if there is a package.json file in the root of the project +name: Release - if Node project + +on: + push: + branches: + - master + +jobs: + test-nodejs: + # We just check the message of the first commit as there is always just one commit because we squash into one before merging + # "commits" contains an array of objects where one of the properties is the commit "message" + # Release workflow will be skipped if release conventional commits are not used + if: | + startsWith( github.repository, 'asyncapi/' ) + name: Test NodeJS release on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + # Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. + # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 + os: [ubuntu-latest, macos-13, windows-latest] + steps: + - name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows + run: | + git config --global core.autocrlf false + git config --global core.eol lf + shell: bash + - name: Checkout repository + uses: actions/checkout@v4 + - name: Check if Node.js project and has package.json + id: packagejson + run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT + shell: bash + - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock version + uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master + id: lockversion + - if: steps.packagejson.outputs.exists == 'true' + name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ steps.lockversion.outputs.version }}" + - if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' + name: Install npm cli 8 + shell: bash + # npm cli 10 is buggy because of some cache issues + run: npm install -g npm@8.19.4 + - if: steps.packagejson.outputs.exists == 'true' + name: Install dependencies + shell: bash + run: npm ci + - if: steps.packagejson.outputs.exists == 'true' + name: Run test + run: npm test --if-present + - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel + name: Report workflow run status to Slack + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + fields: repo,action,workflow + text: "Release workflow failed in testing job" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} + + release: + needs: [test-nodejs] + name: Publish to any of NPM, GitHub, or Docker Hub + runs-on: ubuntu-latest + steps: + - name: Set git to use LF # To once and for all finish the never-ending fight between Unix and Windows + run: | + git config --global core.autocrlf false + git config --global core.eol lf + - name: Checkout repository + uses: actions/checkout@v4 + - name: Check if Node.js project and has package.json + id: packagejson + run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT + shell: bash + - if: steps.packagejson.outputs.exists == 'true' + name: Check package-lock version + uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master + id: lockversion + - if: steps.packagejson.outputs.exists == 'true' + name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "${{ steps.lockversion.outputs.version }}" + - if: steps.packagejson.outputs.exists == 'true' + name: Install dependencies + shell: bash + run: npm ci + - if: steps.packagejson.outputs.exists == 'true' + name: Build dependency + shell: bash + run: npm run build + - if: steps.packagejson.outputs.exists == 'true' + name: Install changelog + shell: bash + run: npm install @changesets/changelog-git@0.2.0 + - if: steps.packagejson.outputs.exists == 'true' + name: Publish to any of NPM, Github, and Docker Hub + uses: changesets/action@v1 + id: release + with: + version: npx -p @changesets/cli changeset version + commit: version packages + title: "chore(release): version packages" + publish: npx -p @changesets/cli changeset publish + setupGitUser: false + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + GIT_AUTHOR_NAME: asyncapi-bot + GIT_AUTHOR_EMAIL: info@asyncapi.io + GIT_COMMITTER_NAME: asyncapi-bot + GIT_COMMITTER_EMAIL: info@asyncapi.io + - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci Slack channel + name: Report workflow run status to Slack + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + fields: repo,action,workflow + text: "Release workflow failed in release job" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} \ No newline at end of file diff --git a/.sonarcloud.properties b/.sonarcloud.properties index fe5cb976e..0dd94a6fd 100644 --- a/.sonarcloud.properties +++ b/.sonarcloud.properties @@ -1,2 +1,5 @@ #we need to explicitly exclude them as they're not relevant to the source code -sonar.exclusions=packages/glee/examples/**/*,packages/glee/docs/**/* \ No newline at end of file +sonar.exclusions=packages/glee/examples/**/*,packages/glee/docs/**/*,packages/gleequore/docs/**/* + +# Ignore all duplicated code as it will be removed once we replace Glee's core with GleeQuore +sonar.cpd.exclusions=packages/glee/src/adapters/**/*,packages/*-adapter/**/*,packages/shared-utils/**/*,packages/gleequore/**/* diff --git a/CODEOWNERS b/CODEOWNERS index f83cc223b..901155a99 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -7,4 +7,5 @@ # The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file. * @Souvikns @KhudaDad414 @asyncapi-bot-eve -* packages/glee @Souvikns @KhudaDad414 @asyncapi-bot-eve \ No newline at end of file +packages/glee @Souvikns @KhudaDad414 @asyncapi-bot-eve +packages/gleequore @fmvilas @Souvikns @KhudaDad414 @asyncapi-bot-eve \ No newline at end of file diff --git a/packages/glee/docs/reference/classes/adapters_cluster_redis.default.html b/packages/glee/docs/reference/classes/adapters_cluster_redis.default.html index 6cf838256..1bf0c40eb 100644 --- a/packages/glee/docs/reference/classes/adapters_cluster_redis.default.html +++ b/packages/glee/docs/reference/classes/adapters_cluster_redis.default.html @@ -1,4 +1,4 @@ -default | @asyncapi/glee

Hierarchy (view full)

Constructors

constructor +default | @asyncapi/glee

Hierarchy (view full)

Constructors

Properties

captureRejections: boolean

Value: boolean

+

Returns default

Properties

captureRejections: boolean

Value: boolean

Change the default captureRejections option on all new EventEmitter objects.

v13.4.0, v12.16.0

captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

@@ -74,13 +74,13 @@

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no regular 'error' listener is installed.

v13.6.0, v12.17.0

-

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    +

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -107,7 +107,7 @@

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

    Returns Function[]

    v0.1.26

    -
  • Alias for emitter.removeListener().

    +

Returns Promise<void>

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -100,11 +100,11 @@

    Returns (string | symbol)[]

    v6.0.0

    -
  • Returns the current max listener value for the EventEmitter which is either +

  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -115,7 +115,7 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      -
  • Alias for emitter.removeListener().

    +
  • Alias for emitter.removeListener().

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v10.0.0

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already @@ -206,9 +206,9 @@

    Returns a reference to the EventEmitter, so that calls can be chained.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

    -
  • Sends a message to the remote server.

    +
  • By default EventEmitters will print a warning if more than 10 listeners are +

Returns Promise<void>

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -112,11 +112,11 @@

    Returns (string | symbol)[]

    v6.0.0

    -
  • Returns the current max listener value for the EventEmitter which is either +

  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -127,7 +127,7 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      -
  • Alias for emitter.removeListener().

    +
  • Alias for emitter.removeListener().

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v10.0.0

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already @@ -218,9 +218,9 @@

    Returns a reference to the EventEmitter, so that calls can be chained.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

    -
  • Sends a message to the remote server.

    +
  • By default EventEmitters will print a warning if more than 10 listeners are +

Returns Promise<void>

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -94,11 +94,11 @@

    Returns (string | symbol)[]

    v6.0.0

    -
  • Returns the current max listener value for the EventEmitter which is either +

  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -109,7 +109,7 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      -
  • Alias for emitter.removeListener().

    +
  • Alias for emitter.removeListener().

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v10.0.0

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already @@ -200,9 +200,9 @@

    Returns a reference to the EventEmitter, so that calls can be chained.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

    -
  • Sends a message to the remote server.

    +
  • By default EventEmitters will print a warning if more than 10 listeners are +

Returns Promise<void>

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -96,11 +96,11 @@

    Returns (string | symbol)[]

    v6.0.0

    -
  • Returns the current max listener value for the EventEmitter which is either +

  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -111,7 +111,7 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      -
  • Alias for emitter.removeListener().

    +
  • Alias for emitter.removeListener().

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v10.0.0

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already @@ -202,9 +202,9 @@

    Returns a reference to the EventEmitter, so that calls can be chained.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

    -
  • Sends a message to the remote server.

    +
  • By default EventEmitters will print a warning if more than 10 listeners are +

Returns Promise<void>

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -95,11 +95,11 @@

    Returns (string | symbol)[]

    v6.0.0

    -
  • Returns the current max listener value for the EventEmitter which is either +

  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -110,7 +110,7 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      -
  • Alias for emitter.removeListener().

    +
  • Alias for emitter.removeListener().

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v10.0.0

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already @@ -201,9 +201,9 @@

    Returns a reference to the EventEmitter, so that calls can be chained.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

    -
  • Sends a message to the remote server.

    +
  • By default EventEmitters will print a warning if more than 10 listeners are +

Returns Promise<void>

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -94,11 +94,11 @@

    Returns (string | symbol)[]

    v6.0.0

    -
  • Returns the current max listener value for the EventEmitter which is either +

  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -109,7 +109,7 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      -
  • Alias for emitter.removeListener().

    +
  • Alias for emitter.removeListener().

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v10.0.0

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already @@ -200,9 +200,9 @@

    Returns a reference to the EventEmitter, so that calls can be chained.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

    -
  • Sends a message to the remote server.

    +
  • By default EventEmitters will print a warning if more than 10 listeners are +

Returns Promise<void>

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -92,11 +92,11 @@

    Returns (string | symbol)[]

    v6.0.0

    -
  • Returns the current max listener value for the EventEmitter which is either +

  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -107,7 +107,7 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      -
  • Alias for emitter.removeListener().

    +
  • Alias for emitter.removeListener().

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v10.0.0

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already @@ -198,9 +198,9 @@

    Returns a reference to the EventEmitter, so that calls can be chained.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

    -
  • Sends a message to the remote server.

    +
  • By default EventEmitters will print a warning if more than 10 listeners are +

Returns Promise<void>

  • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

    diff --git a/packages/glee/docs/reference/classes/errors_glee_error.default.html b/packages/glee/docs/reference/classes/errors_glee_error.default.html index 279e65d0c..ab1fb2a9d 100644 --- a/packages/glee/docs/reference/classes/errors_glee_error.default.html +++ b/packages/glee/docs/reference/classes/errors_glee_error.default.html @@ -1,4 +1,4 @@ -default | @asyncapi/glee

    Hierarchy

    • Error
      • default

    Constructors

    constructor +default | @asyncapi/glee

    Hierarchy

    • Error
      • default

    Constructors

    Properties

    message name stack? @@ -7,7 +7,7 @@

    Accessors

    Methods

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +

    Constructors

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    stackTraceLimit: number

    Accessors

    Methods

    • Create .stack property on a target object

      +
stackTraceLimit: number

Accessors

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • OptionalconstructorOpt: Function

    Returns void

diff --git a/packages/glee/docs/reference/classes/lib_adapter.default.html b/packages/glee/docs/reference/classes/lib_adapter.default.html index 7e7d259fc..32925502d 100644 --- a/packages/glee/docs/reference/classes/lib_adapter.default.html +++ b/packages/glee/docs/reference/classes/lib_adapter.default.html @@ -1,4 +1,4 @@ -default | @asyncapi/glee

Hierarchy (view full)

Constructors

constructor +default | @asyncapi/glee

Hierarchy (view full)

Constructors

Properties

captureRejections: boolean

Value: boolean

+

Constructors

Properties

captureRejections: boolean

Value: boolean

Change the default captureRejections option on all new EventEmitter objects.

v13.4.0, v12.16.0

captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

@@ -75,10 +75,10 @@

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no regular 'error' listener is installed.

v13.6.0, v12.17.0

-

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    +

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

    Returns Promise<any>

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -91,11 +91,11 @@

    Returns (string | symbol)[]

    v6.0.0

    -
  • Returns the current max listener value for the EventEmitter which is either +

Returns Promise<any>

Returns default

Properties

captureRejections: boolean

Value: boolean

Change the default captureRejections option on all new EventEmitter objects.

v13.4.0, v12.16.0

captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

@@ -71,13 +71,13 @@

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no regular 'error' listener is installed.

v13.6.0, v12.17.0

-

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    +

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -197,10 +197,10 @@

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Serialize a message into JSON.

    +

Returns Promise<any>

Returns boolean

diff --git a/packages/glee/docs/reference/classes/lib_glee.default.html b/packages/glee/docs/reference/classes/lib_glee.default.html index e8c0870b8..1c2c229ab 100644 --- a/packages/glee/docs/reference/classes/lib_glee.default.html +++ b/packages/glee/docs/reference/classes/lib_glee.default.html @@ -1,4 +1,4 @@ -default | @asyncapi/glee

Hierarchy

  • EventEmitter
    • default

Constructors

constructor +default | @asyncapi/glee

Hierarchy

  • EventEmitter
    • default

Constructors

Properties

captureRejections: boolean

Value: boolean

+

Parameters

Returns default

Properties

captureRejections: boolean

Value: boolean

Change the default captureRejections option on all new EventEmitter objects.

v13.4.0, v12.16.0

captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

@@ -75,11 +75,11 @@

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no regular 'error' listener is installed.

v13.6.0, v12.17.0

-

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Adds a connection adapter.

    -

    Parameters

    • Adapter: typeof default
    • __namedParameters: {
          parsedAsyncAPI: AsyncAPIDocumentInterface;
          server: ServerInterface;
          serverName: string;
      }
      • parsedAsyncAPI: AsyncAPIDocumentInterface
      • server: ServerInterface
      • serverName: string

    Returns void

  • Alias for emitter.on(eventName, listener).

    +

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Adds a connection adapter.

    +

    Parameters

    • Adapter: typeof default
    • __namedParameters: {
          parsedAsyncAPI: AsyncAPIDocumentInterface;
          server: ServerInterface;
          serverName: string;
      }
      • parsedAsyncAPI: AsyncAPIDocumentInterface
      • server: ServerInterface
      • serverName: string

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

    Returns Promise<any[]>

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    Returns true if the event had listeners, false otherwise.

    import { EventEmitter } from 'node:events';
    const myEmitter = new EventEmitter();

    // First listener
    myEmitter.on('event', function firstListener() {
    console.log('Helloooo! first listener');
    });
    // Second listener
    myEmitter.on('event', function secondListener(arg1, arg2) {
    console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
    });
    // Third listener
    myEmitter.on('event', function thirdListener(...args) {
    const parameters = args.join(', ');
    console.log(`event with parameters ${parameters} in third listener`);
    });

    console.log(myEmitter.listeners('event'));

    myEmitter.emit('event', 1, 2, 3, 4, 5);

    // Prints:
    // [
    // [Function: firstListener],
    // [Function: secondListener],
    // [Function: thirdListener]
    // ]
    // Helloooo! first listener
    // event with parameters 1, 2 in second listener
    // event with parameters 1, 2, 3, 4, 5 in third listener @@ -98,12 +98,12 @@
  • Injects an error into the Glee inbound error middleware chain.

    Parameters

    • error: Error

      The error.

    • Optionalchannel: string

      The channel of the error.

      -

    Returns void

  • Injects a message into the Glee inbound middleware chain.

    +

Returns void

  • Injects a message into the Glee inbound middleware chain.

    Parameters

    • message: default

      The message you want to send.

    • serverName: string

      The name of the server this message is coming from.

    • Optionalconnection: default

      The connection used when receiving the message. Its type is unknown and must be handled by the adapters.

      -

    Returns void

  • Returns the number of listeners listening for the event named eventName. +

Returns void

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -207,17 +207,17 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.26

  • By default EventEmitters will print a warning if more than 10 listeners are +

Returns void

  • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

    Returns a reference to the EventEmitter, so that calls can be chained.

    Parameters

    • n: number

    Returns this

    v0.3.5

  • Experimental

    Listens once to the abort event on the provided signal.

    Listening to the abort event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call e.stopImmediatePropagation(). Unfortunately Node.js cannot change diff --git a/packages/glee/docs/reference/classes/lib_message.default.html b/packages/glee/docs/reference/classes/lib_message.default.html index e092d873e..6ca0c203d 100644 --- a/packages/glee/docs/reference/classes/lib_message.default.html +++ b/packages/glee/docs/reference/classes/lib_message.default.html @@ -1,4 +1,4 @@ -default | @asyncapi/glee

    Hierarchy

    • EventEmitter
      • default

    Constructors

    constructor +default | @asyncapi/glee

    Hierarchy

    • EventEmitter
      • default

    Constructors

    Properties

    captureRejections: boolean

    Value: boolean

    +

    Parameters

    • options: IGleeMessageConstructor

    Returns default

Properties

captureRejections: boolean

Value: boolean

Change the default captureRejections option on all new EventEmitter objects.

v13.4.0, v12.16.0

captureRejectionSymbol: typeof captureRejectionSymbol

Value: Symbol.for('nodejs.rejection')

@@ -81,7 +81,7 @@

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no regular 'error' listener is installed.

v13.6.0, v12.17.0

-

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    +

Accessors

Methods

  • Type Parameters

    • K

    Parameters

    • error: Error
    • event: string | symbol
    • Rest...args: AnyRest

    Returns void

  • Alias for emitter.on(eventName, listener).

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

    @@ -99,9 +99,9 @@
  • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

    Returns number

    v1.0.0

    -
  • Returns the number of listeners listening for the event named eventName. +

  • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol

      The name of the event being listened for

      @@ -113,8 +113,8 @@

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

  • Alias for emitter.removeListener().

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v10.0.0

  • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already @@ -206,15 +206,15 @@

    Returns a reference to the EventEmitter, so that calls can be chained.

    Type Parameters

    • K

    Parameters

    • eventName: string | symbol
    • listener: ((...args: any[]) => void)
        • (...args): void
        • Parameters

          • Rest...args: any[]

          Returns void

    Returns this

    v0.1.26

  • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

    Returns a reference to the EventEmitter, so that calls can be chained.

    Parameters

    • n: number

    Returns this

    v0.3.5

  • Experimental

    Listens once to the abort event on the provided signal.

    Listening to the abort event on abort signals is unsafe and may lead to resource leaks since another third party with the signal can call e.stopImmediatePropagation(). Unfortunately Node.js cannot change diff --git a/packages/glee/docs/reference/classes/lib_router.default.html b/packages/glee/docs/reference/classes/lib_router.default.html index d65a147a6..c54673d91 100644 --- a/packages/glee/docs/reference/classes/lib_router.default.html +++ b/packages/glee/docs/reference/classes/lib_router.default.html @@ -1,4 +1,4 @@ -default | @asyncapi/glee

    Constructors

    constructor +default | @asyncapi/glee

    Constructors

    Methods

    Methods

    • Adds a normalized middleware to the inbound error middlewares collection.

      Parameters

      Returns void

    • Adds a normalized middleware to the inbound middlewares collection.

      +

    Returns void

  • Adds a normalized middleware to the inbound middlewares collection.

    Parameters

    • middlewares: ChannelMiddlewareTuple[]

      The middlewares to add to the collection.

    • Optionalchannel: string

      The scope channel.

      -

    Returns void

  • Adds a normalized middleware to the outbound error middlewares collection.

    +

Returns void

  • Adds a normalized middleware to the outbound error middlewares collection.

    Parameters

    Returns void

  • Adds a normalized middleware to the outbound middlewares collection.

    +

Returns void

  • Adds a normalized middleware to the outbound middlewares collection.

    Parameters

    • middlewares: ChannelMiddlewareTuple[]

      The middlewares to add to the collection.

    • Optionalchannel: string

      The scope channel.

      -

    Returns void

  • Use a middleware for inbound messages. Please, note that when passing a GleeRouter as a param, +

Returns void

+

Parameters

Returns void

  • Parameters

    Returns void

  • diff --git a/packages/glee/docs/reference/classes/lib_wsHttpAuth.default.html b/packages/glee/docs/reference/classes/lib_wsHttpAuth.default.html index cd5bd70fd..15fc46767 100644 --- a/packages/glee/docs/reference/classes/lib_wsHttpAuth.default.html +++ b/packages/glee/docs/reference/classes/lib_wsHttpAuth.default.html @@ -1,4 +1,4 @@ -default | @asyncapi/glee

    Hierarchy

    • EventEmitter
      • default

    Constructors

    constructor +default | @asyncapi/glee

    Hierarchy

    • EventEmitter
      • default

    Constructors

    • Instantiates authentication.

      -

      Parameters

      • AsyncAPIServer: ServerInterface
      • parsedAsyncAPI: AsyncAPIDocumentInterface
      • serverName: string
      • OptionalauthConfig: any

      Returns default

    Properties

    captureRejections: boolean

    Value: boolean

    +

    Parameters

    • AsyncAPIServer: ServerInterface
    • parsedAsyncAPI: AsyncAPIDocumentInterface
    • serverName: string
    • OptionalauthConfig: any

    Returns default

    Properties

    captureRejections: boolean

    Value: boolean

    Change the default captureRejections option on all new EventEmitter objects.

    v13.4.0, v12.16.0

    captureRejectionSymbol: typeof captureRejectionSymbol

    Value: Symbol.for('nodejs.rejection')

    @@ -70,7 +70,7 @@

    v13.6.0, v12.17.0

    Methods

    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest...args: AnyRest

      Returns void

    • Alias for emitter.on(eventName, listener).

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.26

      -
    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +

    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments to each.

      Returns true if the event had listeners, false otherwise.

      import { EventEmitter } from 'node:events';
      const myEmitter = new EventEmitter();

      // First listener
      myEmitter.on('event', function firstListener() {
      console.log('Helloooo! first listener');
      });
      // Second listener
      myEmitter.on('event', function secondListener(arg1, arg2) {
      console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
      });
      // Third listener
      myEmitter.on('event', function thirdListener(...args) {
      const parameters = args.join(', ');
      console.log(`event with parameters ${parameters} in third listener`);
      });

      console.log(myEmitter.listeners('event'));

      myEmitter.emit('event', 1, 2, 3, 4, 5);

      // Prints:
      // [
      // [Function: firstListener],
      // [Function: secondListener],
      // [Function: thirdListener]
      // ]
      // Helloooo! first listener
      // event with parameters 1, 2 in second listener
      // event with parameters 1, 2, 3, 4, 5 in third listener @@ -83,10 +83,10 @@

      Returns (string | symbol)[]

      v6.0.0

      -
    • Parameters

      • authKeys: any
      • __namedParameters: {
            headers: any;
            query: any;
            url: any;
        }
        • headers: any
        • query: any
        • url: any

      Returns {
          headers: any;
          query: undefined;
          url: any;
      } | {
          headers: any;
          query: any;
          url: any;
      }

    • Returns the current max listener value for the EventEmitter which is either +

    • Parameters

      • authKeys: any
      • __namedParameters: {
            headers: any;
            query: any;
            url: any;
        }
        • headers: any
        • query: any
        • url: any

      Returns {
          headers: any;
          query: undefined;
          url: any;
      } | {
          headers: any;
          query: any;
          url: any;
      }

    • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

      Returns number

      v1.0.0

      -
    • Returns the number of listeners listening for the event named eventName. +

    • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event being listened for

        @@ -149,7 +149,7 @@

        Type Parameters

        • K

        Parameters

        • eventName: string | symbol

          The name of the event.

        • listener: ((...args: any[]) => void)

          The callback function

            • (...args): void
            • Parameters

              • Rest...args: any[]

              Returns void

        Returns this

        v6.0.0

        -
    • Parameters

      Returns Promise<{
          headers: any;
          query: undefined;
          url: any;
      } | {
          headers: any;
          query: any;
          url: any;
      }>

    • Returns a copy of the array of listeners for the event named eventName, +

    • Parameters

      Returns Promise<{
          headers: any;
          query: undefined;
          url: any;
      } | {
          headers: any;
          query: any;
          url: any;
      }>

    • Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

      import { EventEmitter } from 'node:events';
      const emitter = new EventEmitter();
      emitter.once('log', () => console.log('log once'));

      // Returns a new Array with a function `onceWrapper` which has a property
      // `listener` which contains the original listener bound above
      const listeners = emitter.rawListeners('log');
      const logFnWrapper = listeners[0];

      // Logs "log once" to the console and does not unbind the `once` event
      logFnWrapper.listener();

      // Logs "log once" to the console and removes the listener
      logFnWrapper();

      emitter.on('log', () => console.log('log persistently'));
      // Will return a new Array with a single function bound by `.on()` above
      const newListeners = emitter.rawListeners('log');

      // Logs "log persistently" twice
      newListeners[0]();
      emitter.emit('log');
      diff --git a/packages/glee/docs/reference/functions/docs.default.html b/packages/glee/docs/reference/functions/docs.default.html index 42ef4d84c..9bfc4b11c 100644 --- a/packages/glee/docs/reference/functions/docs.default.html +++ b/packages/glee/docs/reference/functions/docs.default.html @@ -1 +1 @@ -default | @asyncapi/glee
      +default | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/index.default.html b/packages/glee/docs/reference/functions/index.default.html index 7c6899e01..aa40b3d09 100644 --- a/packages/glee/docs/reference/functions/index.default.html +++ b/packages/glee/docs/reference/functions/index.default.html @@ -1 +1 @@ -default | @asyncapi/glee
      +default | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_asyncapiFile.getAsyncAPIFileContent.html b/packages/glee/docs/reference/functions/lib_asyncapiFile.getAsyncAPIFileContent.html index 791043120..4bbf1056c 100644 --- a/packages/glee/docs/reference/functions/lib_asyncapiFile.getAsyncAPIFileContent.html +++ b/packages/glee/docs/reference/functions/lib_asyncapiFile.getAsyncAPIFileContent.html @@ -1 +1 @@ -getAsyncAPIFileContent | @asyncapi/glee
      +getAsyncAPIFileContent | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_asyncapiFile.getChannelAddress.html b/packages/glee/docs/reference/functions/lib_asyncapiFile.getChannelAddress.html index 8d391a2f0..05a916320 100644 --- a/packages/glee/docs/reference/functions/lib_asyncapiFile.getChannelAddress.html +++ b/packages/glee/docs/reference/functions/lib_asyncapiFile.getChannelAddress.html @@ -1 +1 @@ -getChannelAddress | @asyncapi/glee
      +getChannelAddress | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_asyncapiFile.getChannelNames.html b/packages/glee/docs/reference/functions/lib_asyncapiFile.getChannelNames.html index 98aaf752a..6bfb280b1 100644 --- a/packages/glee/docs/reference/functions/lib_asyncapiFile.getChannelNames.html +++ b/packages/glee/docs/reference/functions/lib_asyncapiFile.getChannelNames.html @@ -1 +1 @@ -getChannelNames | @asyncapi/glee
      +getChannelNames | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_asyncapiFile.getParsedAsyncAPI.html b/packages/glee/docs/reference/functions/lib_asyncapiFile.getParsedAsyncAPI.html index dc4c1813c..44d8606c5 100644 --- a/packages/glee/docs/reference/functions/lib_asyncapiFile.getParsedAsyncAPI.html +++ b/packages/glee/docs/reference/functions/lib_asyncapiFile.getParsedAsyncAPI.html @@ -1 +1 @@ -getParsedAsyncAPI | @asyncapi/glee
      +getParsedAsyncAPI | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_compiler.compileAndWatch.html b/packages/glee/docs/reference/functions/lib_compiler.compileAndWatch.html index 8e7dfabbc..348578efa 100644 --- a/packages/glee/docs/reference/functions/lib_compiler.compileAndWatch.html +++ b/packages/glee/docs/reference/functions/lib_compiler.compileAndWatch.html @@ -1 +1 @@ -compileAndWatch | @asyncapi/glee
      +compileAndWatch | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_configs.findSpecFile.html b/packages/glee/docs/reference/functions/lib_configs.findSpecFile.html index 0e12b3dd4..3f1436e8a 100644 --- a/packages/glee/docs/reference/functions/lib_configs.findSpecFile.html +++ b/packages/glee/docs/reference/functions/lib_configs.findSpecFile.html @@ -1 +1 @@ -findSpecFile | @asyncapi/glee
      +findSpecFile | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_configs.getConfigs.html b/packages/glee/docs/reference/functions/lib_configs.getConfigs.html index 708d65996..604a55928 100644 --- a/packages/glee/docs/reference/functions/lib_configs.getConfigs.html +++ b/packages/glee/docs/reference/functions/lib_configs.getConfigs.html @@ -1 +1 @@ -getConfigs | @asyncapi/glee
      +getConfigs | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_configs.initializeConfigs.html b/packages/glee/docs/reference/functions/lib_configs.initializeConfigs.html index fdad2893d..ddae640c9 100644 --- a/packages/glee/docs/reference/functions/lib_configs.initializeConfigs.html +++ b/packages/glee/docs/reference/functions/lib_configs.initializeConfigs.html @@ -1 +1 @@ -initializeConfigs | @asyncapi/glee
      +initializeConfigs | @asyncapi/glee
      diff --git a/packages/glee/docs/reference/functions/lib_configs.loadConfigsFromFile.html b/packages/glee/docs/reference/functions/lib_configs.loadConfigsFromFile.html index d78f9050d..af8cd6e07 100644 --- a/packages/glee/docs/reference/functions/lib_configs.loadConfigsFromFile.html +++ b/packages/glee/docs/reference/functions/lib_configs.loadConfigsFromFile.html @@ -1,2 +1,2 @@ loadConfigsFromFile | @asyncapi/glee
      +

      Returns Promise<any>

    diff --git a/packages/glee/docs/reference/functions/lib_docs.generateDocs.html b/packages/glee/docs/reference/functions/lib_docs.generateDocs.html index 7ad2efc1f..a48b87f2d 100644 --- a/packages/glee/docs/reference/functions/lib_docs.generateDocs.html +++ b/packages/glee/docs/reference/functions/lib_docs.generateDocs.html @@ -1 +1 @@ -generateDocs | @asyncapi/glee
    +generateDocs | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_functions.register.html b/packages/glee/docs/reference/functions/lib_functions.register.html index f8629b478..8e0449368 100644 --- a/packages/glee/docs/reference/functions/lib_functions.register.html +++ b/packages/glee/docs/reference/functions/lib_functions.register.html @@ -1 +1 @@ -register | @asyncapi/glee
    +register | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_functions.trigger.html b/packages/glee/docs/reference/functions/lib_functions.trigger.html index e45aa7d8d..3cd1784cd 100644 --- a/packages/glee/docs/reference/functions/lib_functions.trigger.html +++ b/packages/glee/docs/reference/functions/lib_functions.trigger.html @@ -1 +1 @@ -trigger | @asyncapi/glee
    +trigger | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_lifecycleEvents.register.html b/packages/glee/docs/reference/functions/lib_lifecycleEvents.register.html index 38755b9aa..0c1467880 100644 --- a/packages/glee/docs/reference/functions/lib_lifecycleEvents.register.html +++ b/packages/glee/docs/reference/functions/lib_lifecycleEvents.register.html @@ -1 +1 @@ -register | @asyncapi/glee
    +register | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_lifecycleEvents.run.html b/packages/glee/docs/reference/functions/lib_lifecycleEvents.run.html index 38852266c..54f2b073b 100644 --- a/packages/glee/docs/reference/functions/lib_lifecycleEvents.run.html +++ b/packages/glee/docs/reference/functions/lib_lifecycleEvents.run.html @@ -1 +1 @@ -run | @asyncapi/glee
    +run | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logEmptyLines.html b/packages/glee/docs/reference/functions/lib_logger.logEmptyLines.html index 04b98da35..e7aa8b031 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logEmptyLines.html +++ b/packages/glee/docs/reference/functions/lib_logger.logEmptyLines.html @@ -1 +1 @@ -logEmptyLines | @asyncapi/glee
    +logEmptyLines | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logError.html b/packages/glee/docs/reference/functions/lib_logger.logError.html index b327177ec..34b20ad88 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logError.html +++ b/packages/glee/docs/reference/functions/lib_logger.logError.html @@ -1 +1 @@ -logError | @asyncapi/glee
    +logError | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logErrorLine.html b/packages/glee/docs/reference/functions/lib_logger.logErrorLine.html index c40bbec60..5dc0547bb 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logErrorLine.html +++ b/packages/glee/docs/reference/functions/lib_logger.logErrorLine.html @@ -1 +1 @@ -logErrorLine | @asyncapi/glee
    +logErrorLine | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logInboundChannel.html b/packages/glee/docs/reference/functions/lib_logger.logInboundChannel.html index 4af1f22bb..dd69a0690 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logInboundChannel.html +++ b/packages/glee/docs/reference/functions/lib_logger.logInboundChannel.html @@ -1 +1 @@ -logInboundChannel | @asyncapi/glee
    +logInboundChannel | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logInfoMessage.html b/packages/glee/docs/reference/functions/lib_logger.logInfoMessage.html index 164418aba..cc7800f61 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logInfoMessage.html +++ b/packages/glee/docs/reference/functions/lib_logger.logInfoMessage.html @@ -1 +1 @@ -logInfoMessage | @asyncapi/glee
    +logInfoMessage | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logJSON.html b/packages/glee/docs/reference/functions/lib_logger.logJSON.html index eeeee9bd1..25100162d 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logJSON.html +++ b/packages/glee/docs/reference/functions/lib_logger.logJSON.html @@ -1 +1 @@ -logJSON | @asyncapi/glee
    • Parameters

      • json: object | any[]
      • __namedParameters: {
            error: boolean;
        } = {}
        • error: boolean

      Returns void

    +logJSON | @asyncapi/glee
    • Parameters

      • json: object | any[]
      • __namedParameters: {
            error: boolean;
        } = {}
        • error: boolean

      Returns void

    diff --git a/packages/glee/docs/reference/functions/lib_logger.logLineWithIcon.html b/packages/glee/docs/reference/functions/lib_logger.logLineWithIcon.html index ac24e9107..3c60f647e 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logLineWithIcon.html +++ b/packages/glee/docs/reference/functions/lib_logger.logLineWithIcon.html @@ -1 +1 @@ -logLineWithIcon | @asyncapi/glee
    • Parameters

      • icon: string
      • text: string
      • __namedParameters: ILogLineWithIconOptions = {}

      Returns void

    +logLineWithIcon | @asyncapi/glee
    • Parameters

      • icon: string
      • text: string
      • __namedParameters: ILogLineWithIconOptions = {}

      Returns void

    diff --git a/packages/glee/docs/reference/functions/lib_logger.logOutboundChannel.html b/packages/glee/docs/reference/functions/lib_logger.logOutboundChannel.html index 39e6020d9..721a10f55 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logOutboundChannel.html +++ b/packages/glee/docs/reference/functions/lib_logger.logOutboundChannel.html @@ -1 +1 @@ -logOutboundChannel | @asyncapi/glee
    +logOutboundChannel | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logTypeScriptError.html b/packages/glee/docs/reference/functions/lib_logger.logTypeScriptError.html index 590668d4e..d0ec9146f 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logTypeScriptError.html +++ b/packages/glee/docs/reference/functions/lib_logger.logTypeScriptError.html @@ -1 +1 @@ -logTypeScriptError | @asyncapi/glee
    • Parameters

      • code: number
      • message: string
      • fileName: string
      • line: number
      • character: number

      Returns void

    +logTypeScriptError | @asyncapi/glee
    • Parameters

      • code: number
      • message: string
      • fileName: string
      • line: number
      • character: number

      Returns void

    diff --git a/packages/glee/docs/reference/functions/lib_logger.logTypeScriptMessage.html b/packages/glee/docs/reference/functions/lib_logger.logTypeScriptMessage.html index 6f7a58dcc..8f0459844 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logTypeScriptMessage.html +++ b/packages/glee/docs/reference/functions/lib_logger.logTypeScriptMessage.html @@ -1 +1 @@ -logTypeScriptMessage | @asyncapi/glee
    +logTypeScriptMessage | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logWarningMessage.html b/packages/glee/docs/reference/functions/lib_logger.logWarningMessage.html index ab6416abc..ee87de0f1 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logWarningMessage.html +++ b/packages/glee/docs/reference/functions/lib_logger.logWarningMessage.html @@ -1 +1 @@ -logWarningMessage | @asyncapi/glee
    +logWarningMessage | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_logger.logWelcome.html b/packages/glee/docs/reference/functions/lib_logger.logWelcome.html index fb2535362..880acad9f 100644 --- a/packages/glee/docs/reference/functions/lib_logger.logWelcome.html +++ b/packages/glee/docs/reference/functions/lib_logger.logWelcome.html @@ -1 +1 @@ -logWelcome | @asyncapi/glee
    • Parameters

      • __namedParameters: {
            dev: any;
            dir: any;
            experimentalFlags: any;
            functionsDir: any;
            servers: any;
            showAppDir: boolean;
            showFunctionsDir: boolean;
        }
        • dev: any
        • dir: any
        • experimentalFlags: any
        • functionsDir: any
        • servers: any
        • showAppDir: boolean
        • showFunctionsDir: boolean

      Returns void

    +logWelcome | @asyncapi/glee
    • Parameters

      • __namedParameters: {
            dev: any;
            dir: any;
            experimentalFlags: any;
            functionsDir: any;
            servers: any;
            showAppDir: boolean;
            showFunctionsDir: boolean;
        }
        • dev: any
        • dir: any
        • experimentalFlags: any
        • functionsDir: any
        • servers: any
        • showAppDir: boolean
        • showFunctionsDir: boolean

      Returns void

    diff --git a/packages/glee/docs/reference/functions/lib_servers.getSelectedServerNames.html b/packages/glee/docs/reference/functions/lib_servers.getSelectedServerNames.html index f26ea4f36..f26bf8fb6 100644 --- a/packages/glee/docs/reference/functions/lib_servers.getSelectedServerNames.html +++ b/packages/glee/docs/reference/functions/lib_servers.getSelectedServerNames.html @@ -1 +1 @@ -getSelectedServerNames | @asyncapi/glee
    +getSelectedServerNames | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_userAuth.clientAuthConfig.html b/packages/glee/docs/reference/functions/lib_userAuth.clientAuthConfig.html index b8d812e03..d43eeec46 100644 --- a/packages/glee/docs/reference/functions/lib_userAuth.clientAuthConfig.html +++ b/packages/glee/docs/reference/functions/lib_userAuth.clientAuthConfig.html @@ -1 +1 @@ -clientAuthConfig | @asyncapi/glee
    +clientAuthConfig | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_userAuth.register.html b/packages/glee/docs/reference/functions/lib_userAuth.register.html index 651f846cb..01e9ced9c 100644 --- a/packages/glee/docs/reference/functions/lib_userAuth.register.html +++ b/packages/glee/docs/reference/functions/lib_userAuth.register.html @@ -1 +1 @@ -register | @asyncapi/glee
    +register | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_userAuth.triggerAuth.html b/packages/glee/docs/reference/functions/lib_userAuth.triggerAuth.html index 1327bedd3..f87539f60 100644 --- a/packages/glee/docs/reference/functions/lib_userAuth.triggerAuth.html +++ b/packages/glee/docs/reference/functions/lib_userAuth.triggerAuth.html @@ -1 +1 @@ -triggerAuth | @asyncapi/glee
    +triggerAuth | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/lib_util.applyAddressParameters.html b/packages/glee/docs/reference/functions/lib_util.applyAddressParameters.html index 681ebefdb..4e0cb0fd8 100644 --- a/packages/glee/docs/reference/functions/lib_util.applyAddressParameters.html +++ b/packages/glee/docs/reference/functions/lib_util.applyAddressParameters.html @@ -1 +1 @@ -applyAddressParameters | @asyncapi/glee

    Function applyAddressParameters

    +applyAddressParameters | @asyncapi/glee

    Function applyAddressParameters

    diff --git a/packages/glee/docs/reference/functions/lib_util.arrayHasDuplicates.html b/packages/glee/docs/reference/functions/lib_util.arrayHasDuplicates.html index 0849acfb8..50157c8e5 100644 --- a/packages/glee/docs/reference/functions/lib_util.arrayHasDuplicates.html +++ b/packages/glee/docs/reference/functions/lib_util.arrayHasDuplicates.html @@ -1 +1 @@ -arrayHasDuplicates | @asyncapi/glee

    Function arrayHasDuplicates

    +arrayHasDuplicates | @asyncapi/glee

    Function arrayHasDuplicates

    diff --git a/packages/glee/docs/reference/functions/lib_util.extractExpressionValueFromMessage.html b/packages/glee/docs/reference/functions/lib_util.extractExpressionValueFromMessage.html index 26da29c47..a30157246 100644 --- a/packages/glee/docs/reference/functions/lib_util.extractExpressionValueFromMessage.html +++ b/packages/glee/docs/reference/functions/lib_util.extractExpressionValueFromMessage.html @@ -1 +1 @@ -extractExpressionValueFromMessage | @asyncapi/glee

    Function extractExpressionValueFromMessage

    • Parameters

      • message: {
            headers: any;
            payload: any;
        }
        • headers: any
        • payload: any
      • expression: string

      Returns any

    +extractExpressionValueFromMessage | @asyncapi/glee

    Function extractExpressionValueFromMessage

    • Parameters

      • message: {
            headers: any;
            payload: any;
        }
        • headers: any
        • payload: any
      • expression: string

      Returns any

    diff --git a/packages/glee/docs/reference/functions/lib_util.getMessagesSchema.html b/packages/glee/docs/reference/functions/lib_util.getMessagesSchema.html index 0ce45541b..76a673fb0 100644 --- a/packages/glee/docs/reference/functions/lib_util.getMessagesSchema.html +++ b/packages/glee/docs/reference/functions/lib_util.getMessagesSchema.html @@ -1 +1 @@ -getMessagesSchema | @asyncapi/glee

    Function getMessagesSchema

    • Parameters

      • operation: {
            messages: (() => MessagesInterface);
        }
        • messages: (() => MessagesInterface)
            • (): MessagesInterface
            • Returns MessagesInterface

      Returns {
          oneOf: AsyncAPISchemaObject[];
      }

      • oneOf: AsyncAPISchemaObject[]
    +getMessagesSchema | @asyncapi/glee

    Function getMessagesSchema

    • Parameters

      • operation: {
            messages: (() => MessagesInterface);
        }
        • messages: (() => MessagesInterface)
            • (): MessagesInterface
            • Returns MessagesInterface

      Returns {
          oneOf: AsyncAPISchemaObject[];
      }

      • oneOf: AsyncAPISchemaObject[]
    diff --git a/packages/glee/docs/reference/functions/lib_util.gleeMessageToFunctionEvent.html b/packages/glee/docs/reference/functions/lib_util.gleeMessageToFunctionEvent.html index cce6b0787..609ee5d92 100644 --- a/packages/glee/docs/reference/functions/lib_util.gleeMessageToFunctionEvent.html +++ b/packages/glee/docs/reference/functions/lib_util.gleeMessageToFunctionEvent.html @@ -1 +1 @@ -gleeMessageToFunctionEvent | @asyncapi/glee

    Function gleeMessageToFunctionEvent

    +gleeMessageToFunctionEvent | @asyncapi/glee

    Function gleeMessageToFunctionEvent

    diff --git a/packages/glee/docs/reference/functions/lib_util.isRemoteServer.html b/packages/glee/docs/reference/functions/lib_util.isRemoteServer.html index 123a14395..2981d8637 100644 --- a/packages/glee/docs/reference/functions/lib_util.isRemoteServer.html +++ b/packages/glee/docs/reference/functions/lib_util.isRemoteServer.html @@ -1 +1 @@ -isRemoteServer | @asyncapi/glee
    • Parameters

      • parsedAsyncAPI: AsyncAPIDocumentInterface
      • serverName: string

      Returns boolean

    +isRemoteServer | @asyncapi/glee
    • Parameters

      • parsedAsyncAPI: AsyncAPIDocumentInterface
      • serverName: string

      Returns boolean

    diff --git a/packages/glee/docs/reference/functions/lib_util.resolveFunctions.html b/packages/glee/docs/reference/functions/lib_util.resolveFunctions.html index 6538138df..2289f638f 100644 --- a/packages/glee/docs/reference/functions/lib_util.resolveFunctions.html +++ b/packages/glee/docs/reference/functions/lib_util.resolveFunctions.html @@ -1 +1 @@ -resolveFunctions | @asyncapi/glee
    +resolveFunctions | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_buffer2string.default.html b/packages/glee/docs/reference/functions/middlewares_buffer2string.default.html index 9c3c3275f..947183763 100644 --- a/packages/glee/docs/reference/functions/middlewares_buffer2string.default.html +++ b/packages/glee/docs/reference/functions/middlewares_buffer2string.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_channelLogger.default.html b/packages/glee/docs/reference/functions/middlewares_channelLogger.default.html index 111620be9..b0e1c6339 100644 --- a/packages/glee/docs/reference/functions/middlewares_channelLogger.default.html +++ b/packages/glee/docs/reference/functions/middlewares_channelLogger.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_errorLogger.default.html b/packages/glee/docs/reference/functions/middlewares_errorLogger.default.html index f9f3689fd..4d221edbb 100644 --- a/packages/glee/docs/reference/functions/middlewares_errorLogger.default.html +++ b/packages/glee/docs/reference/functions/middlewares_errorLogger.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_existsInAsyncAPI.default.html b/packages/glee/docs/reference/functions/middlewares_existsInAsyncAPI.default.html index 9e9617c42..8cc83b489 100644 --- a/packages/glee/docs/reference/functions/middlewares_existsInAsyncAPI.default.html +++ b/packages/glee/docs/reference/functions/middlewares_existsInAsyncAPI.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_json2string.default.html b/packages/glee/docs/reference/functions/middlewares_json2string.default.html index 9b73f62b7..b502b1bc7 100644 --- a/packages/glee/docs/reference/functions/middlewares_json2string.default.html +++ b/packages/glee/docs/reference/functions/middlewares_json2string.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_payloadLogger.default.html b/packages/glee/docs/reference/functions/middlewares_payloadLogger.default.html index 79d9660fd..b51f0f9b0 100644 --- a/packages/glee/docs/reference/functions/middlewares_payloadLogger.default.html +++ b/packages/glee/docs/reference/functions/middlewares_payloadLogger.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_string2json.default.html b/packages/glee/docs/reference/functions/middlewares_string2json.default.html index afd332078..53512fe85 100644 --- a/packages/glee/docs/reference/functions/middlewares_string2json.default.html +++ b/packages/glee/docs/reference/functions/middlewares_string2json.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_validate.default.html b/packages/glee/docs/reference/functions/middlewares_validate.default.html index 7d33088e1..dd7f8c824 100644 --- a/packages/glee/docs/reference/functions/middlewares_validate.default.html +++ b/packages/glee/docs/reference/functions/middlewares_validate.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/middlewares_validateConnection.default.html b/packages/glee/docs/reference/functions/middlewares_validateConnection.default.html index abfa17940..8a0e26b14 100644 --- a/packages/glee/docs/reference/functions/middlewares_validateConnection.default.html +++ b/packages/glee/docs/reference/functions/middlewares_validateConnection.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/functions/registerAdapters.default.html b/packages/glee/docs/reference/functions/registerAdapters.default.html index 67bd6e6b0..c5538397a 100644 --- a/packages/glee/docs/reference/functions/registerAdapters.default.html +++ b/packages/glee/docs/reference/functions/registerAdapters.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/interfaces/lib.Authenticatable.html b/packages/glee/docs/reference/interfaces/lib.Authenticatable.html index c76a1cb02..636316117 100644 --- a/packages/glee/docs/reference/interfaces/lib.Authenticatable.html +++ b/packages/glee/docs/reference/interfaces/lib.Authenticatable.html @@ -1,4 +1,4 @@ -Authenticatable | @asyncapi/glee

    Interface Authenticatable

    interface Authenticatable {
        headers: Headers;
        query: QueryParam;
        url: URL;
    }

    Properties

    headers +Authenticatable | @asyncapi/glee

    Interface Authenticatable

    interface Authenticatable {
        headers: Headers;
        query: QueryParam;
        url: URL;
    }

    Properties

    Properties

    headers: Headers
    query: QueryParam
    url: URL
    +

    Properties

    headers: Headers
    query: QueryParam
    url: URL
    diff --git a/packages/glee/docs/reference/interfaces/lib.HttpAuthConfig.html b/packages/glee/docs/reference/interfaces/lib.HttpAuthConfig.html index c255722ca..424c0a39d 100644 --- a/packages/glee/docs/reference/interfaces/lib.HttpAuthConfig.html +++ b/packages/glee/docs/reference/interfaces/lib.HttpAuthConfig.html @@ -1,4 +1,4 @@ -HttpAuthConfig | @asyncapi/glee

    Interface HttpAuthConfig

    interface HttpAuthConfig {
        password?: string;
        token?: string;
        username?: string;
    }

    Properties

    password? +HttpAuthConfig | @asyncapi/glee

    Interface HttpAuthConfig

    interface HttpAuthConfig {
        password?: string;
        token?: string;
        username?: string;
    }

    Properties

    password?: string
    token?: string
    username?: string
    +

    Properties

    password?: string
    token?: string
    username?: string
    diff --git a/packages/glee/docs/reference/interfaces/lib.KafkaAuthConfig.html b/packages/glee/docs/reference/interfaces/lib.KafkaAuthConfig.html index 3f9cffc24..7e593b25e 100644 --- a/packages/glee/docs/reference/interfaces/lib.KafkaAuthConfig.html +++ b/packages/glee/docs/reference/interfaces/lib.KafkaAuthConfig.html @@ -1,7 +1,7 @@ -KafkaAuthConfig | @asyncapi/glee

    Interface KafkaAuthConfig

    interface KafkaAuthConfig {
        cert?: string;
        clientId?: string;
        key?: string;
        password?: string;
        rejectUnauthorized?: boolean;
        username?: string;
    }

    Properties

    cert? +KafkaAuthConfig | @asyncapi/glee

    Interface KafkaAuthConfig

    interface KafkaAuthConfig {
        cert?: string;
        clientId?: string;
        key?: string;
        password?: string;
        rejectUnauthorized?: boolean;
        username?: string;
    }

    Properties

    cert?: string
    clientId?: string
    key?: string
    password?: string
    rejectUnauthorized?: boolean
    username?: string
    +

    Properties

    cert?: string
    clientId?: string
    key?: string
    password?: string
    rejectUnauthorized?: boolean
    username?: string
    diff --git a/packages/glee/docs/reference/interfaces/lib.MqttAuthConfig.html b/packages/glee/docs/reference/interfaces/lib.MqttAuthConfig.html index b506c6b3c..2c683a988 100644 --- a/packages/glee/docs/reference/interfaces/lib.MqttAuthConfig.html +++ b/packages/glee/docs/reference/interfaces/lib.MqttAuthConfig.html @@ -1,5 +1,5 @@ -MqttAuthConfig | @asyncapi/glee

    Interface MqttAuthConfig

    interface MqttAuthConfig {
        cert?: string;
        clientId?: string;
        password?: string;
        username?: string;
    }

    Properties

    cert? +MqttAuthConfig | @asyncapi/glee

    Interface MqttAuthConfig

    interface MqttAuthConfig {
        cert?: string;
        clientId?: string;
        password?: string;
        username?: string;
    }

    Properties

    cert?: string
    clientId?: string
    password?: string
    username?: string
    +

    Properties

    cert?: string
    clientId?: string
    password?: string
    username?: string
    diff --git a/packages/glee/docs/reference/interfaces/lib.WsAuthConfig.html b/packages/glee/docs/reference/interfaces/lib.WsAuthConfig.html index 946c15efb..0acf34711 100644 --- a/packages/glee/docs/reference/interfaces/lib.WsAuthConfig.html +++ b/packages/glee/docs/reference/interfaces/lib.WsAuthConfig.html @@ -1,4 +1,4 @@ -WsAuthConfig | @asyncapi/glee

    Interface WsAuthConfig

    interface WsAuthConfig {
        password?: string;
        token?: string;
        username?: string;
    }

    Properties

    password? +WsAuthConfig | @asyncapi/glee

    Interface WsAuthConfig

    interface WsAuthConfig {
        password?: string;
        token?: string;
        username?: string;
    }

    Properties

    password?: string
    token?: string
    username?: string
    +

    Properties

    password?: string
    token?: string
    username?: string
    diff --git a/packages/glee/docs/reference/interfaces/lib_adapter.GleeAdapterOptions.html b/packages/glee/docs/reference/interfaces/lib_adapter.GleeAdapterOptions.html index 18afc22c0..619bd379b 100644 --- a/packages/glee/docs/reference/interfaces/lib_adapter.GleeAdapterOptions.html +++ b/packages/glee/docs/reference/interfaces/lib_adapter.GleeAdapterOptions.html @@ -1,5 +1,5 @@ -GleeAdapterOptions | @asyncapi/glee
    interface GleeAdapterOptions {
        glee: default;
        parsedAsyncAPI: AsyncAPIDocumentInterface;
        server: ServerInterface;
        serverName: string;
    }

    Properties

    glee +GleeAdapterOptions | @asyncapi/glee
    interface GleeAdapterOptions {
        glee: default;
        parsedAsyncAPI: AsyncAPIDocumentInterface;
        server: ServerInterface;
        serverName: string;
    }

    Properties

    glee: default
    parsedAsyncAPI: AsyncAPIDocumentInterface
    server: ServerInterface
    serverName: string
    +

    Properties

    glee: default
    parsedAsyncAPI: AsyncAPIDocumentInterface
    server: ServerInterface
    serverName: string
    diff --git a/packages/glee/docs/reference/modules/adapters_cluster_redis.html b/packages/glee/docs/reference/modules/adapters_cluster_redis.html index 28ea167e3..03969cf30 100644 --- a/packages/glee/docs/reference/modules/adapters_cluster_redis.html +++ b/packages/glee/docs/reference/modules/adapters_cluster_redis.html @@ -1,2 +1,2 @@ -adapters/cluster/redis | @asyncapi/glee

    Module adapters/cluster/redis

    Index

    Classes

    default +adapters/cluster/redis | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/adapters_http_client.html b/packages/glee/docs/reference/modules/adapters_http_client.html index cbf91e247..cb4b1fe73 100644 --- a/packages/glee/docs/reference/modules/adapters_http_client.html +++ b/packages/glee/docs/reference/modules/adapters_http_client.html @@ -1,2 +1,2 @@ -adapters/http/client | @asyncapi/glee

    Module adapters/http/client

    Index

    Classes

    default +adapters/http/client | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/adapters_http_server.html b/packages/glee/docs/reference/modules/adapters_http_server.html index 1b7b99e3e..23731cd48 100644 --- a/packages/glee/docs/reference/modules/adapters_http_server.html +++ b/packages/glee/docs/reference/modules/adapters_http_server.html @@ -1,2 +1,2 @@ -adapters/http/server | @asyncapi/glee

    Module adapters/http/server

    Index

    Classes

    default +adapters/http/server | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/adapters_kafka.html b/packages/glee/docs/reference/modules/adapters_kafka.html index 63b7921ff..7516de610 100644 --- a/packages/glee/docs/reference/modules/adapters_kafka.html +++ b/packages/glee/docs/reference/modules/adapters_kafka.html @@ -1,2 +1,2 @@ -adapters/kafka | @asyncapi/glee

    Module adapters/kafka

    Index

    Classes

    default +adapters/kafka | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/adapters_mqtt.html b/packages/glee/docs/reference/modules/adapters_mqtt.html index b18f2373c..29b01c806 100644 --- a/packages/glee/docs/reference/modules/adapters_mqtt.html +++ b/packages/glee/docs/reference/modules/adapters_mqtt.html @@ -1,2 +1,2 @@ -adapters/mqtt | @asyncapi/glee

    Module adapters/mqtt

    Index

    Classes

    default +adapters/mqtt | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/adapters_socket_io.html b/packages/glee/docs/reference/modules/adapters_socket_io.html index 6fb5b8449..b21a1160c 100644 --- a/packages/glee/docs/reference/modules/adapters_socket_io.html +++ b/packages/glee/docs/reference/modules/adapters_socket_io.html @@ -1,2 +1,2 @@ -adapters/socket.io | @asyncapi/glee

    Module adapters/socket.io

    Index

    Classes

    default +adapters/socket.io | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/adapters_ws_client.html b/packages/glee/docs/reference/modules/adapters_ws_client.html index 2837a6f21..6d5d78c89 100644 --- a/packages/glee/docs/reference/modules/adapters_ws_client.html +++ b/packages/glee/docs/reference/modules/adapters_ws_client.html @@ -1,2 +1,2 @@ -adapters/ws/client | @asyncapi/glee

    Module adapters/ws/client

    Index

    Classes

    default +adapters/ws/client | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/adapters_ws_server.html b/packages/glee/docs/reference/modules/adapters_ws_server.html index 35a3c2241..32c96398a 100644 --- a/packages/glee/docs/reference/modules/adapters_ws_server.html +++ b/packages/glee/docs/reference/modules/adapters_ws_server.html @@ -1,2 +1,2 @@ -adapters/ws/server | @asyncapi/glee

    Module adapters/ws/server

    Index

    Classes

    default +adapters/ws/server | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/cli.html b/packages/glee/docs/reference/modules/cli.html index 007f05efc..c5321b158 100644 --- a/packages/glee/docs/reference/modules/cli.html +++ b/packages/glee/docs/reference/modules/cli.html @@ -1 +1 @@ -cli | @asyncapi/glee
    +cli | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/cli_start.html b/packages/glee/docs/reference/modules/cli_start.html index fd57f6f42..8ae151b7f 100644 --- a/packages/glee/docs/reference/modules/cli_start.html +++ b/packages/glee/docs/reference/modules/cli_start.html @@ -1 +1 @@ -cli/start | @asyncapi/glee
    +cli/start | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/docs.html b/packages/glee/docs/reference/modules/docs.html index d708a41b6..73324fb7f 100644 --- a/packages/glee/docs/reference/modules/docs.html +++ b/packages/glee/docs/reference/modules/docs.html @@ -1,2 +1,2 @@ -docs | @asyncapi/glee

    Index

    Functions

    default +docs | @asyncapi/glee

    Index

    Functions

    diff --git a/packages/glee/docs/reference/modules/errors_glee_error.html b/packages/glee/docs/reference/modules/errors_glee_error.html index 7d63259b9..43f6dd6c6 100644 --- a/packages/glee/docs/reference/modules/errors_glee_error.html +++ b/packages/glee/docs/reference/modules/errors_glee_error.html @@ -1,2 +1,2 @@ -errors/glee-error | @asyncapi/glee

    Module errors/glee-error

    Index

    Classes

    default +errors/glee-error | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/index.html b/packages/glee/docs/reference/modules/index.html index be5158d70..f72de8de1 100644 --- a/packages/glee/docs/reference/modules/index.html +++ b/packages/glee/docs/reference/modules/index.html @@ -1,2 +1,2 @@ -index | @asyncapi/glee

    Index

    Functions

    default +index | @asyncapi/glee

    Index

    Functions

    diff --git a/packages/glee/docs/reference/modules/lib.html b/packages/glee/docs/reference/modules/lib.html index 7a0357c79..300437b29 100644 --- a/packages/glee/docs/reference/modules/lib.html +++ b/packages/glee/docs/reference/modules/lib.html @@ -1,4 +1,4 @@ -lib | @asyncapi/glee

    Index

    Interfaces

    Authenticatable +lib | @asyncapi/glee

    Index

    Interfaces

    Authenticatable HttpAuthConfig KafkaAuthConfig MqttAuthConfig diff --git a/packages/glee/docs/reference/modules/lib_adapter.html b/packages/glee/docs/reference/modules/lib_adapter.html index 069f6f0cd..467bdbb66 100644 --- a/packages/glee/docs/reference/modules/lib_adapter.html +++ b/packages/glee/docs/reference/modules/lib_adapter.html @@ -1,4 +1,4 @@ -lib/adapter | @asyncapi/glee

    Module lib/adapter

    Index

    Classes

    default +lib/adapter | @asyncapi/glee

    Module lib/adapter

    Index

    Classes

    Interfaces

    Type Aliases

    AuthEvent EnrichedEvent diff --git a/packages/glee/docs/reference/modules/lib_asyncapiFile.html b/packages/glee/docs/reference/modules/lib_asyncapiFile.html index 601203daa..1ba9972dd 100644 --- a/packages/glee/docs/reference/modules/lib_asyncapiFile.html +++ b/packages/glee/docs/reference/modules/lib_asyncapiFile.html @@ -1,4 +1,4 @@ -lib/asyncapiFile | @asyncapi/glee

    Module lib/asyncapiFile

    Index

    Functions

    getAsyncAPIFileContent +lib/asyncapiFile | @asyncapi/glee

    Module lib/asyncapiFile

    Index

    Functions

    getAsyncAPIFileContent getChannelAddress getChannelNames getParsedAsyncAPI diff --git a/packages/glee/docs/reference/modules/lib_cluster.html b/packages/glee/docs/reference/modules/lib_cluster.html index 8bc710850..6aa5474d1 100644 --- a/packages/glee/docs/reference/modules/lib_cluster.html +++ b/packages/glee/docs/reference/modules/lib_cluster.html @@ -1,3 +1,3 @@ -lib/cluster | @asyncapi/glee

    Module lib/cluster

    Index

    Classes

    default +lib/cluster | @asyncapi/glee

    Module lib/cluster

    Index

    Classes

    Type Aliases

    diff --git a/packages/glee/docs/reference/modules/lib_compiler.html b/packages/glee/docs/reference/modules/lib_compiler.html index 7c3000ffe..8fedcdaf2 100644 --- a/packages/glee/docs/reference/modules/lib_compiler.html +++ b/packages/glee/docs/reference/modules/lib_compiler.html @@ -1,2 +1,2 @@ -lib/compiler | @asyncapi/glee

    Module lib/compiler

    Index

    Functions

    compileAndWatch +lib/compiler | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/lib_configs.html b/packages/glee/docs/reference/modules/lib_configs.html index c93c78870..63882a0df 100644 --- a/packages/glee/docs/reference/modules/lib_configs.html +++ b/packages/glee/docs/reference/modules/lib_configs.html @@ -1,4 +1,4 @@ -lib/configs | @asyncapi/glee

    Module lib/configs

    Index

    Functions

    findSpecFile +lib/configs | @asyncapi/glee

    Module lib/configs

    Index

    Functions

    findSpecFile getConfigs initializeConfigs loadConfigsFromFile diff --git a/packages/glee/docs/reference/modules/lib_connection.html b/packages/glee/docs/reference/modules/lib_connection.html index 140ca0f9f..0c8782cdf 100644 --- a/packages/glee/docs/reference/modules/lib_connection.html +++ b/packages/glee/docs/reference/modules/lib_connection.html @@ -1,2 +1,2 @@ -lib/connection | @asyncapi/glee

    Module lib/connection

    Index

    Classes

    default +lib/connection | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/lib_docs.html b/packages/glee/docs/reference/modules/lib_docs.html index e75c742df..aafcf246f 100644 --- a/packages/glee/docs/reference/modules/lib_docs.html +++ b/packages/glee/docs/reference/modules/lib_docs.html @@ -1,2 +1,2 @@ -lib/docs | @asyncapi/glee

    Module lib/docs

    Index

    Functions

    generateDocs +lib/docs | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/lib_experimentalFlags.html b/packages/glee/docs/reference/modules/lib_experimentalFlags.html index a846f70db..9981ac059 100644 --- a/packages/glee/docs/reference/modules/lib_experimentalFlags.html +++ b/packages/glee/docs/reference/modules/lib_experimentalFlags.html @@ -1,2 +1,2 @@ -lib/experimentalFlags | @asyncapi/glee

    Module lib/experimentalFlags

    Index

    Variables

    default +lib/experimentalFlags | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/lib_functions.html b/packages/glee/docs/reference/modules/lib_functions.html index cd256cf36..2d3c73c7f 100644 --- a/packages/glee/docs/reference/modules/lib_functions.html +++ b/packages/glee/docs/reference/modules/lib_functions.html @@ -1,4 +1,4 @@ -lib/functions | @asyncapi/glee

    Module lib/functions

    Index

    Variables

    functions +lib/functions | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/lib_glee.html b/packages/glee/docs/reference/modules/lib_glee.html index 6a17f330e..cc4409224 100644 --- a/packages/glee/docs/reference/modules/lib_glee.html +++ b/packages/glee/docs/reference/modules/lib_glee.html @@ -1,2 +1,2 @@ -lib/glee | @asyncapi/glee

    Module lib/glee

    Index

    Classes

    default +lib/glee | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/lib_lifecycleEvents.html b/packages/glee/docs/reference/modules/lib_lifecycleEvents.html index 55003784d..eba44e183 100644 --- a/packages/glee/docs/reference/modules/lib_lifecycleEvents.html +++ b/packages/glee/docs/reference/modules/lib_lifecycleEvents.html @@ -1,4 +1,4 @@ -lib/lifecycleEvents | @asyncapi/glee

    Module lib/lifecycleEvents

    Index

    Variables

    events +lib/lifecycleEvents | @asyncapi/glee

    Module lib/lifecycleEvents

    Index

    Variables

    Functions

    diff --git a/packages/glee/docs/reference/modules/lib_logger.html b/packages/glee/docs/reference/modules/lib_logger.html index 0a6d5a8d1..487db0534 100644 --- a/packages/glee/docs/reference/modules/lib_logger.html +++ b/packages/glee/docs/reference/modules/lib_logger.html @@ -1,4 +1,4 @@ -lib/logger | @asyncapi/glee

    Module lib/logger

    Index

    Namespaces

    chalk +lib/logger | @asyncapi/glee

    Module lib/logger

    Index

    Namespaces

    Functions

    chalk logEmptyLines logError diff --git a/packages/glee/docs/reference/modules/lib_message.html b/packages/glee/docs/reference/modules/lib_message.html index e15054326..5ccf76da9 100644 --- a/packages/glee/docs/reference/modules/lib_message.html +++ b/packages/glee/docs/reference/modules/lib_message.html @@ -1,2 +1,2 @@ -lib/message | @asyncapi/glee

    Module lib/message

    Index

    Classes

    default +lib/message | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/lib_router.html b/packages/glee/docs/reference/modules/lib_router.html index a10fa3bfb..4b828bba4 100644 --- a/packages/glee/docs/reference/modules/lib_router.html +++ b/packages/glee/docs/reference/modules/lib_router.html @@ -1,4 +1,4 @@ -lib/router | @asyncapi/glee

    Module lib/router

    Index

    Classes

    default +lib/router | @asyncapi/glee

    Module lib/router

    Index

    Classes

    Type Aliases

    ChannelErrorMiddlewareTuple ChannelMiddlewareTuple GenericChannelMiddlewareTuple diff --git a/packages/glee/docs/reference/modules/lib_servers.html b/packages/glee/docs/reference/modules/lib_servers.html index aaaa2d538..ecef93b46 100644 --- a/packages/glee/docs/reference/modules/lib_servers.html +++ b/packages/glee/docs/reference/modules/lib_servers.html @@ -1,2 +1,2 @@ -lib/servers | @asyncapi/glee

    Module lib/servers

    Index

    Functions

    getSelectedServerNames +lib/servers | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/lib_userAuth.html b/packages/glee/docs/reference/modules/lib_userAuth.html index 64c458e6f..ab5818b4a 100644 --- a/packages/glee/docs/reference/modules/lib_userAuth.html +++ b/packages/glee/docs/reference/modules/lib_userAuth.html @@ -1,4 +1,4 @@ -lib/userAuth | @asyncapi/glee

    Module lib/userAuth

    Index

    Variables

    authFunctions +lib/userAuth | @asyncapi/glee

    Module lib/userAuth

    Index

    Variables

    Functions

    clientAuthConfig register triggerAuth diff --git a/packages/glee/docs/reference/modules/lib_util.html b/packages/glee/docs/reference/modules/lib_util.html index 8e28b42f5..4b0fc3052 100644 --- a/packages/glee/docs/reference/modules/lib_util.html +++ b/packages/glee/docs/reference/modules/lib_util.html @@ -1,4 +1,4 @@ -lib/util | @asyncapi/glee

    Module lib/util

    Index

    Functions

    applyAddressParameters +lib/util | @asyncapi/glee

    Module lib/util

    Index

    Functions

    applyAddressParameters arrayHasDuplicates extractExpressionValueFromMessage getMessagesSchema diff --git a/packages/glee/docs/reference/modules/lib_wsHttpAuth.html b/packages/glee/docs/reference/modules/lib_wsHttpAuth.html index 538c93794..da31828c8 100644 --- a/packages/glee/docs/reference/modules/lib_wsHttpAuth.html +++ b/packages/glee/docs/reference/modules/lib_wsHttpAuth.html @@ -1,2 +1,2 @@ -lib/wsHttpAuth | @asyncapi/glee

    Module lib/wsHttpAuth

    Index

    Classes

    default +lib/wsHttpAuth | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares.html b/packages/glee/docs/reference/modules/middlewares.html index d8e29d471..4c6c520a4 100644 --- a/packages/glee/docs/reference/modules/middlewares.html +++ b/packages/glee/docs/reference/modules/middlewares.html @@ -1,4 +1,4 @@ -middlewares | @asyncapi/glee

    Module middlewares

    Index

    Type Aliases

    ErrorMiddleware +middlewares | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_buffer2string.html b/packages/glee/docs/reference/modules/middlewares_buffer2string.html index 24b6f9655..f889c06d8 100644 --- a/packages/glee/docs/reference/modules/middlewares_buffer2string.html +++ b/packages/glee/docs/reference/modules/middlewares_buffer2string.html @@ -1,2 +1,2 @@ -middlewares/buffer2string | @asyncapi/glee

    Module middlewares/buffer2string

    Index

    Functions

    default +middlewares/buffer2string | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_channelLogger.html b/packages/glee/docs/reference/modules/middlewares_channelLogger.html index 7cf1010f1..4f13ed3a6 100644 --- a/packages/glee/docs/reference/modules/middlewares_channelLogger.html +++ b/packages/glee/docs/reference/modules/middlewares_channelLogger.html @@ -1,2 +1,2 @@ -middlewares/channelLogger | @asyncapi/glee

    Module middlewares/channelLogger

    Index

    Functions

    default +middlewares/channelLogger | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_errorLogger.html b/packages/glee/docs/reference/modules/middlewares_errorLogger.html index c6e89b7da..9017ae727 100644 --- a/packages/glee/docs/reference/modules/middlewares_errorLogger.html +++ b/packages/glee/docs/reference/modules/middlewares_errorLogger.html @@ -1,2 +1,2 @@ -middlewares/errorLogger | @asyncapi/glee

    Module middlewares/errorLogger

    Index

    Functions

    default +middlewares/errorLogger | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_existsInAsyncAPI.html b/packages/glee/docs/reference/modules/middlewares_existsInAsyncAPI.html index 85a822bb9..ba1174f0f 100644 --- a/packages/glee/docs/reference/modules/middlewares_existsInAsyncAPI.html +++ b/packages/glee/docs/reference/modules/middlewares_existsInAsyncAPI.html @@ -1,2 +1,2 @@ -middlewares/existsInAsyncAPI | @asyncapi/glee

    Module middlewares/existsInAsyncAPI

    Index

    Functions

    default +middlewares/existsInAsyncAPI | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_json2string.html b/packages/glee/docs/reference/modules/middlewares_json2string.html index 1febaaf63..545cfff0f 100644 --- a/packages/glee/docs/reference/modules/middlewares_json2string.html +++ b/packages/glee/docs/reference/modules/middlewares_json2string.html @@ -1,2 +1,2 @@ -middlewares/json2string | @asyncapi/glee

    Module middlewares/json2string

    Index

    Functions

    default +middlewares/json2string | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_payloadLogger.html b/packages/glee/docs/reference/modules/middlewares_payloadLogger.html index 85ee3aa45..1ccecc4c3 100644 --- a/packages/glee/docs/reference/modules/middlewares_payloadLogger.html +++ b/packages/glee/docs/reference/modules/middlewares_payloadLogger.html @@ -1,2 +1,2 @@ -middlewares/payloadLogger | @asyncapi/glee

    Module middlewares/payloadLogger

    Index

    Functions

    default +middlewares/payloadLogger | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_string2json.html b/packages/glee/docs/reference/modules/middlewares_string2json.html index f8442a545..943a5d38e 100644 --- a/packages/glee/docs/reference/modules/middlewares_string2json.html +++ b/packages/glee/docs/reference/modules/middlewares_string2json.html @@ -1,2 +1,2 @@ -middlewares/string2json | @asyncapi/glee

    Module middlewares/string2json

    Index

    Functions

    default +middlewares/string2json | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_validate.html b/packages/glee/docs/reference/modules/middlewares_validate.html index 0c9a5e920..d534724b3 100644 --- a/packages/glee/docs/reference/modules/middlewares_validate.html +++ b/packages/glee/docs/reference/modules/middlewares_validate.html @@ -1,2 +1,2 @@ -middlewares/validate | @asyncapi/glee

    Module middlewares/validate

    Index

    Functions

    default +middlewares/validate | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/middlewares_validateConnection.html b/packages/glee/docs/reference/modules/middlewares_validateConnection.html index 80dd69db9..0f7f8d4fa 100644 --- a/packages/glee/docs/reference/modules/middlewares_validateConnection.html +++ b/packages/glee/docs/reference/modules/middlewares_validateConnection.html @@ -1,2 +1,2 @@ -middlewares/validateConnection | @asyncapi/glee

    Module middlewares/validateConnection

    Index

    Functions

    default +middlewares/validateConnection | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/modules/moduleIndex.html b/packages/glee/docs/reference/modules/moduleIndex.html index 2c85d9baa..ac17ad4bf 100644 --- a/packages/glee/docs/reference/modules/moduleIndex.html +++ b/packages/glee/docs/reference/modules/moduleIndex.html @@ -1,3 +1,3 @@ -moduleIndex | @asyncapi/glee

    Module moduleIndex

    References

    Glee +moduleIndex | @asyncapi/glee

    Module moduleIndex

    References

    References

    Renames and re-exports default
    Renames and re-exports default
    diff --git a/packages/glee/docs/reference/modules/registerAdapters.html b/packages/glee/docs/reference/modules/registerAdapters.html index 23e90fdd2..9349dd216 100644 --- a/packages/glee/docs/reference/modules/registerAdapters.html +++ b/packages/glee/docs/reference/modules/registerAdapters.html @@ -1,2 +1,2 @@ -registerAdapters | @asyncapi/glee

    Module registerAdapters

    Index

    Functions

    default +registerAdapters | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/types/lib.AuthFunction.html b/packages/glee/docs/reference/types/lib.AuthFunction.html index ee10f94df..7c99efbf8 100644 --- a/packages/glee/docs/reference/types/lib.AuthFunction.html +++ b/packages/glee/docs/reference/types/lib.AuthFunction.html @@ -1,4 +1,4 @@ AuthFunction | @asyncapi/glee

    Type Alias AuthFunction<T>

    AuthFunction<T>: (({ serverName, parsedAsyncAPI, -}: {
        parsedAsyncAPI: AsyncAPIDocument;
        serverName: string;
    }) => Promise<T>)

    Type Parameters

    • T
    +}: {
        parsedAsyncAPI: AsyncAPIDocument;
        serverName: string;
    }) => Promise<T>)

    Type Parameters

    • T
    diff --git a/packages/glee/docs/reference/types/lib.AuthProps.html b/packages/glee/docs/reference/types/lib.AuthProps.html index bc9b9d00f..1240e7d4f 100644 --- a/packages/glee/docs/reference/types/lib.AuthProps.html +++ b/packages/glee/docs/reference/types/lib.AuthProps.html @@ -1 +1 @@ -AuthProps | @asyncapi/glee

    Type Alias AuthProps

    AuthProps: {
        getAPIKeys: (() => string);
        getCert: (() => string);
        getHttpAPIKeys: ((name: string) => string);
        getOauthToken: (() => string);
        getToken: (() => string);
        getUserPass: (() => {
            password: string;
            username: string;
        });
    }
    +AuthProps | @asyncapi/glee

    Type Alias AuthProps

    AuthProps: {
        getAPIKeys: (() => string);
        getCert: (() => string);
        getHttpAPIKeys: ((name: string) => string);
        getOauthToken: (() => string);
        getToken: (() => string);
        getUserPass: (() => {
            password: string;
            username: string;
        });
    }
    diff --git a/packages/glee/docs/reference/types/lib.CoreGleeConfig.html b/packages/glee/docs/reference/types/lib.CoreGleeConfig.html index 28bcd8733..6a71185f2 100644 --- a/packages/glee/docs/reference/types/lib.CoreGleeConfig.html +++ b/packages/glee/docs/reference/types/lib.CoreGleeConfig.html @@ -1 +1 @@ -CoreGleeConfig | @asyncapi/glee

    Type Alias CoreGleeConfig

    CoreGleeConfig: {
        asyncapiFilePath?: string;
        functionsDir?: string;
        gleeDir?: string;
        lifecycleDir?: string;
        logs?: LogsConfig;
    }
    +CoreGleeConfig | @asyncapi/glee

    Type Alias CoreGleeConfig

    CoreGleeConfig: {
        asyncapiFilePath?: string;
        functionsDir?: string;
        gleeDir?: string;
        lifecycleDir?: string;
        logs?: LogsConfig;
    }
    diff --git a/packages/glee/docs/reference/types/lib.GleeAuthFunction.html b/packages/glee/docs/reference/types/lib.GleeAuthFunction.html index 3fe3f8f77..3cd9da028 100644 --- a/packages/glee/docs/reference/types/lib.GleeAuthFunction.html +++ b/packages/glee/docs/reference/types/lib.GleeAuthFunction.html @@ -1 +1 @@ -GleeAuthFunction | @asyncapi/glee

    Type Alias GleeAuthFunction

    GleeAuthFunction: ((event: GleeAuthFunctionEvent) => Promise<GleeAuthFunctionEvent>)
    +GleeAuthFunction | @asyncapi/glee

    Type Alias GleeAuthFunction

    GleeAuthFunction: ((event: GleeAuthFunctionEvent) => Promise<GleeAuthFunctionEvent>)
    diff --git a/packages/glee/docs/reference/types/lib.GleeAuthFunctionEvent.html b/packages/glee/docs/reference/types/lib.GleeAuthFunctionEvent.html index 1822cf5b6..15cd5256f 100644 --- a/packages/glee/docs/reference/types/lib.GleeAuthFunctionEvent.html +++ b/packages/glee/docs/reference/types/lib.GleeAuthFunctionEvent.html @@ -1 +1 @@ -GleeAuthFunctionEvent | @asyncapi/glee

    Type Alias GleeAuthFunctionEvent

    GleeAuthFunctionEvent: {
        authProps: AuthProps;
        doc: any;
        done: any;
        glee: Glee;
        serverName: string;
    }
    +GleeAuthFunctionEvent | @asyncapi/glee

    Type Alias GleeAuthFunctionEvent

    GleeAuthFunctionEvent: {
        authProps: AuthProps;
        doc: any;
        done: any;
        glee: Glee;
        serverName: string;
    }
    diff --git a/packages/glee/docs/reference/types/lib.GleeClusterAdapterConfig.html b/packages/glee/docs/reference/types/lib.GleeClusterAdapterConfig.html index 45acff32d..8fa78df29 100644 --- a/packages/glee/docs/reference/types/lib.GleeClusterAdapterConfig.html +++ b/packages/glee/docs/reference/types/lib.GleeClusterAdapterConfig.html @@ -1 +1 @@ -GleeClusterAdapterConfig | @asyncapi/glee

    Type Alias GleeClusterAdapterConfig

    GleeClusterAdapterConfig: {
        adapter?: string | typeof GleeClusterAdapter;
        name?: string;
        url: string;
    }
    +GleeClusterAdapterConfig | @asyncapi/glee

    Type Alias GleeClusterAdapterConfig

    GleeClusterAdapterConfig: {
        adapter?: string | typeof GleeClusterAdapter;
        name?: string;
        url: string;
    }
    diff --git a/packages/glee/docs/reference/types/lib.GleeConfig.html b/packages/glee/docs/reference/types/lib.GleeConfig.html index 98ddf6821..e40d14876 100644 --- a/packages/glee/docs/reference/types/lib.GleeConfig.html +++ b/packages/glee/docs/reference/types/lib.GleeConfig.html @@ -1 +1 @@ -GleeConfig | @asyncapi/glee

    Type Alias GleeConfig

    GleeConfig: {
        cluster?: GleeClusterAdapterConfig;
        glee?: CoreGleeConfig;
        http?: HttpAdapterConfig;
        kafka?: KafkaAdapterConfig;
        mqtt?: MqttAdapterConfig;
        ws?: WebsocketAdapterConfig;
    }
    +GleeConfig | @asyncapi/glee

    Type Alias GleeConfig

    GleeConfig: {
        cluster?: GleeClusterAdapterConfig;
        glee?: CoreGleeConfig;
        http?: HttpAdapterConfig;
        kafka?: KafkaAdapterConfig;
        mqtt?: MqttAdapterConfig;
        ws?: WebsocketAdapterConfig;
    }
    diff --git a/packages/glee/docs/reference/types/lib.GleeFunction.html b/packages/glee/docs/reference/types/lib.GleeFunction.html index cb162c6ad..1c91a26cd 100644 --- a/packages/glee/docs/reference/types/lib.GleeFunction.html +++ b/packages/glee/docs/reference/types/lib.GleeFunction.html @@ -1 +1 @@ -GleeFunction | @asyncapi/glee

    Type Alias GleeFunction

    GleeFunction: ((event: GleeFunctionEvent) => Promise<GleeFunctionReturn>)
    +GleeFunction | @asyncapi/glee

    Type Alias GleeFunction

    GleeFunction: ((event: GleeFunctionEvent) => Promise<GleeFunctionReturn>)
    diff --git a/packages/glee/docs/reference/types/lib.GleeFunctionEvent.html b/packages/glee/docs/reference/types/lib.GleeFunctionEvent.html index 81666dd22..7e97e46a6 100644 --- a/packages/glee/docs/reference/types/lib.GleeFunctionEvent.html +++ b/packages/glee/docs/reference/types/lib.GleeFunctionEvent.html @@ -1 +1 @@ -GleeFunctionEvent | @asyncapi/glee

    Type Alias GleeFunctionEvent

    GleeFunctionEvent: {
        channel?: string;
        connection?: GleeConnection;
        glee: Glee;
        headers?: {
            [key: string]: string;
        };
        payload?: any;
        query?: QueryParam;
        request: GleeMessage;
        serverName: string;
    }
    +GleeFunctionEvent | @asyncapi/glee

    Type Alias GleeFunctionEvent

    GleeFunctionEvent: {
        channel?: string;
        connection?: GleeConnection;
        glee: Glee;
        headers?: {
            [key: string]: string;
        };
        payload?: any;
        query?: QueryParam;
        request: GleeMessage;
        serverName: string;
    }
    diff --git a/packages/glee/docs/reference/types/lib.GleeFunctionReturn.html b/packages/glee/docs/reference/types/lib.GleeFunctionReturn.html index 67a450ca2..bebc731ce 100644 --- a/packages/glee/docs/reference/types/lib.GleeFunctionReturn.html +++ b/packages/glee/docs/reference/types/lib.GleeFunctionReturn.html @@ -1 +1 @@ -GleeFunctionReturn | @asyncapi/glee

    Type Alias GleeFunctionReturn

    GleeFunctionReturn: {
        broadcast?: GleeFunctionReturnBroadcast[];
        reply?: GleeFunctionReturnReply[];
        send?: GleeFunctionReturnSend[];
    }
    +GleeFunctionReturn | @asyncapi/glee

    Type Alias GleeFunctionReturn

    GleeFunctionReturn: {
        broadcast?: GleeFunctionReturnBroadcast[];
        reply?: GleeFunctionReturnReply[];
        send?: GleeFunctionReturnSend[];
    }
    diff --git a/packages/glee/docs/reference/types/lib.GleeFunctionReturnBroadcast.html b/packages/glee/docs/reference/types/lib.GleeFunctionReturnBroadcast.html index 2dc6f4889..65ff4a29f 100644 --- a/packages/glee/docs/reference/types/lib.GleeFunctionReturnBroadcast.html +++ b/packages/glee/docs/reference/types/lib.GleeFunctionReturnBroadcast.html @@ -1 +1 @@ -GleeFunctionReturnBroadcast | @asyncapi/glee

    Type Alias GleeFunctionReturnBroadcast

    GleeFunctionReturnBroadcast: GleeFunctionReturnSend
    +GleeFunctionReturnBroadcast | @asyncapi/glee

    Type Alias GleeFunctionReturnBroadcast

    GleeFunctionReturnBroadcast: GleeFunctionReturnSend
    diff --git a/packages/glee/docs/reference/types/lib.GleeFunctionReturnReply.html b/packages/glee/docs/reference/types/lib.GleeFunctionReturnReply.html index 4a1922522..25f361177 100644 --- a/packages/glee/docs/reference/types/lib.GleeFunctionReturnReply.html +++ b/packages/glee/docs/reference/types/lib.GleeFunctionReturnReply.html @@ -1 +1 @@ -GleeFunctionReturnReply | @asyncapi/glee

    Type Alias GleeFunctionReturnReply

    GleeFunctionReturnReply: Omit<GleeFunctionReturnSend, "channel" | "server">
    +GleeFunctionReturnReply | @asyncapi/glee

    Type Alias GleeFunctionReturnReply

    GleeFunctionReturnReply: Omit<GleeFunctionReturnSend, "channel" | "server">
    diff --git a/packages/glee/docs/reference/types/lib.GleeFunctionReturnSend.html b/packages/glee/docs/reference/types/lib.GleeFunctionReturnSend.html index 45a532fab..f500de1ab 100644 --- a/packages/glee/docs/reference/types/lib.GleeFunctionReturnSend.html +++ b/packages/glee/docs/reference/types/lib.GleeFunctionReturnSend.html @@ -1 +1 @@ -GleeFunctionReturnSend | @asyncapi/glee

    Type Alias GleeFunctionReturnSend

    GleeFunctionReturnSend: {
        channel?: string;
        headers?: {
            [key: string]: string;
        };
        payload?: any;
        query?: QueryParam;
        server?: string;
    }
    +GleeFunctionReturnSend | @asyncapi/glee

    Type Alias GleeFunctionReturnSend

    GleeFunctionReturnSend: {
        channel?: string;
        headers?: {
            [key: string]: string;
        };
        payload?: any;
        query?: QueryParam;
        server?: string;
    }
    diff --git a/packages/glee/docs/reference/types/lib.GleeLifecycleEvent.html b/packages/glee/docs/reference/types/lib.GleeLifecycleEvent.html index 9aeb9de0e..1ec2804ef 100644 --- a/packages/glee/docs/reference/types/lib.GleeLifecycleEvent.html +++ b/packages/glee/docs/reference/types/lib.GleeLifecycleEvent.html @@ -1 +1 @@ -GleeLifecycleEvent | @asyncapi/glee

    Type Alias GleeLifecycleEvent

    GleeLifecycleEvent: Omit<GleeFunctionEvent, "request">
    +GleeLifecycleEvent | @asyncapi/glee

    Type Alias GleeLifecycleEvent

    GleeLifecycleEvent: Omit<GleeFunctionEvent, "request">
    diff --git a/packages/glee/docs/reference/types/lib.Headers.html b/packages/glee/docs/reference/types/lib.Headers.html index eeeffa22b..e8ef4d469 100644 --- a/packages/glee/docs/reference/types/lib.Headers.html +++ b/packages/glee/docs/reference/types/lib.Headers.html @@ -1 +1 @@ -Headers | @asyncapi/glee

    Type Alias Headers

    Headers: {
        [key: string]: string;
    }
    +Headers | @asyncapi/glee

    Type Alias Headers

    Headers: {
        [key: string]: string;
    }
    diff --git a/packages/glee/docs/reference/types/lib.HttpAdapterConfig.html b/packages/glee/docs/reference/types/lib.HttpAdapterConfig.html index c26749b2f..d7b473455 100644 --- a/packages/glee/docs/reference/types/lib.HttpAdapterConfig.html +++ b/packages/glee/docs/reference/types/lib.HttpAdapterConfig.html @@ -1 +1 @@ -HttpAdapterConfig | @asyncapi/glee

    Type Alias HttpAdapterConfig

    HttpAdapterConfig: {
        client?: {
            auth?: HttpAuthConfig | AuthFunction<HttpAuthConfig>;
            body?: any;
            query?: QueryParam;
        };
        server: {
            httpServer?: any;
            port?: number;
        };
    }
    +HttpAdapterConfig | @asyncapi/glee

    Type Alias HttpAdapterConfig

    HttpAdapterConfig: {
        client?: {
            auth?: HttpAuthConfig | AuthFunction<HttpAuthConfig>;
            body?: any;
            query?: QueryParam;
        };
        server: {
            httpServer?: any;
            port?: number;
        };
    }
    diff --git a/packages/glee/docs/reference/types/lib.HttpServerType.html b/packages/glee/docs/reference/types/lib.HttpServerType.html index 5372447b3..0a7926c8a 100644 --- a/packages/glee/docs/reference/types/lib.HttpServerType.html +++ b/packages/glee/docs/reference/types/lib.HttpServerType.html @@ -1 +1 @@ -HttpServerType | @asyncapi/glee

    Type Alias HttpServerType

    HttpServerType
    +HttpServerType | @asyncapi/glee

    Type Alias HttpServerType

    HttpServerType
    diff --git a/packages/glee/docs/reference/types/lib.KafkaAdapterConfig.html b/packages/glee/docs/reference/types/lib.KafkaAdapterConfig.html index e9f2754d5..1e36afcc0 100644 --- a/packages/glee/docs/reference/types/lib.KafkaAdapterConfig.html +++ b/packages/glee/docs/reference/types/lib.KafkaAdapterConfig.html @@ -1 +1 @@ -KafkaAdapterConfig | @asyncapi/glee

    Type Alias KafkaAdapterConfig

    KafkaAdapterConfig: {
        auth?: KafkaAuthConfig | AuthFunction<KafkaAuthConfig>;
    }
    +KafkaAdapterConfig | @asyncapi/glee

    Type Alias KafkaAdapterConfig

    KafkaAdapterConfig: {
        auth?: KafkaAuthConfig | AuthFunction<KafkaAuthConfig>;
    }
    diff --git a/packages/glee/docs/reference/types/lib.Log.html b/packages/glee/docs/reference/types/lib.Log.html index e0dcefe6f..28c4d3295 100644 --- a/packages/glee/docs/reference/types/lib.Log.html +++ b/packages/glee/docs/reference/types/lib.Log.html @@ -1 +1 @@ -Log | @asyncapi/glee

    Type Alias Log

    Log: "channel-only" | "none"
    +Log | @asyncapi/glee

    Type Alias Log

    Log: "channel-only" | "none"
    diff --git a/packages/glee/docs/reference/types/lib.LogsConfig.html b/packages/glee/docs/reference/types/lib.LogsConfig.html index e32c5a963..e05fc1cad 100644 --- a/packages/glee/docs/reference/types/lib.LogsConfig.html +++ b/packages/glee/docs/reference/types/lib.LogsConfig.html @@ -1 +1 @@ -LogsConfig | @asyncapi/glee

    Type Alias LogsConfig

    LogsConfig: {
        incoming: Log;
        outgoing: Log;
    }
    +LogsConfig | @asyncapi/glee

    Type Alias LogsConfig

    LogsConfig: {
        incoming: Log;
        outgoing: Log;
    }
    diff --git a/packages/glee/docs/reference/types/lib.MqttAdapterConfig.html b/packages/glee/docs/reference/types/lib.MqttAdapterConfig.html index d2cd16869..087c4a12f 100644 --- a/packages/glee/docs/reference/types/lib.MqttAdapterConfig.html +++ b/packages/glee/docs/reference/types/lib.MqttAdapterConfig.html @@ -1 +1 @@ -MqttAdapterConfig | @asyncapi/glee

    Type Alias MqttAdapterConfig

    MqttAdapterConfig: {
        auth?: MqttAuthConfig | AuthFunction<MqttAuthConfig>;
    }
    +MqttAdapterConfig | @asyncapi/glee

    Type Alias MqttAdapterConfig

    MqttAdapterConfig: {
        auth?: MqttAuthConfig | AuthFunction<MqttAuthConfig>;
    }
    diff --git a/packages/glee/docs/reference/types/lib.QueryParam.html b/packages/glee/docs/reference/types/lib.QueryParam.html index 7be10231b..f7c2896aa 100644 --- a/packages/glee/docs/reference/types/lib.QueryParam.html +++ b/packages/glee/docs/reference/types/lib.QueryParam.html @@ -1 +1 @@ -QueryParam | @asyncapi/glee

    Type Alias QueryParam

    QueryParam: {
        [key: string]: string;
    } | {
        [key: string]: string[];
    }
    +QueryParam | @asyncapi/glee

    Type Alias QueryParam

    QueryParam: {
        [key: string]: string;
    } | {
        [key: string]: string[];
    }
    diff --git a/packages/glee/docs/reference/types/lib.WebSocketServerType.html b/packages/glee/docs/reference/types/lib.WebSocketServerType.html index d33f28eac..96c14fba9 100644 --- a/packages/glee/docs/reference/types/lib.WebSocketServerType.html +++ b/packages/glee/docs/reference/types/lib.WebSocketServerType.html @@ -1 +1 @@ -WebSocketServerType | @asyncapi/glee

    Type Alias WebSocketServerType

    WebSocketServerType: "native" | "socket.io"
    +WebSocketServerType | @asyncapi/glee

    Type Alias WebSocketServerType

    WebSocketServerType: "native" | "socket.io"
    diff --git a/packages/glee/docs/reference/types/lib.WebsocketAdapterConfig.html b/packages/glee/docs/reference/types/lib.WebsocketAdapterConfig.html index 7655d8d89..b76a17950 100644 --- a/packages/glee/docs/reference/types/lib.WebsocketAdapterConfig.html +++ b/packages/glee/docs/reference/types/lib.WebsocketAdapterConfig.html @@ -1 +1 @@ -WebsocketAdapterConfig | @asyncapi/glee

    Type Alias WebsocketAdapterConfig

    WebsocketAdapterConfig: {
        server?: WebsocketServerAdapterConfig;
    }
    +WebsocketAdapterConfig | @asyncapi/glee

    Type Alias WebsocketAdapterConfig

    WebsocketAdapterConfig: {
        server?: WebsocketServerAdapterConfig;
    }
    diff --git a/packages/glee/docs/reference/types/lib.WebsocketServerAdapterConfig.html b/packages/glee/docs/reference/types/lib.WebsocketServerAdapterConfig.html index 7f20a7a7e..5dd6b7231 100644 --- a/packages/glee/docs/reference/types/lib.WebsocketServerAdapterConfig.html +++ b/packages/glee/docs/reference/types/lib.WebsocketServerAdapterConfig.html @@ -1 +1 @@ -WebsocketServerAdapterConfig | @asyncapi/glee

    Type Alias WebsocketServerAdapterConfig

    WebsocketServerAdapterConfig: {
        adapter?: WebSocketServerType | typeof GleeAdapter;
        httpServer?: any;
        port?: number;
    }
    +WebsocketServerAdapterConfig | @asyncapi/glee

    Type Alias WebsocketServerAdapterConfig

    WebsocketServerAdapterConfig: {
        adapter?: WebSocketServerType | typeof GleeAdapter;
        httpServer?: any;
        port?: number;
    }
    diff --git a/packages/glee/docs/reference/types/lib.WsHttpAuth.html b/packages/glee/docs/reference/types/lib.WsHttpAuth.html index fea8a00f3..5cf9d02ae 100644 --- a/packages/glee/docs/reference/types/lib.WsHttpAuth.html +++ b/packages/glee/docs/reference/types/lib.WsHttpAuth.html @@ -1 +1 @@ -WsHttpAuth | @asyncapi/glee
    +WsHttpAuth | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/types/lib_adapter.AuthEvent.html b/packages/glee/docs/reference/types/lib_adapter.AuthEvent.html index fd50ee458..25ea0b4c5 100644 --- a/packages/glee/docs/reference/types/lib_adapter.AuthEvent.html +++ b/packages/glee/docs/reference/types/lib_adapter.AuthEvent.html @@ -1 +1 @@ -AuthEvent | @asyncapi/glee
    AuthEvent: {
        authProps: AuthProps;
        doc: any;
        done: any;
        serverName: string;
    }
    +AuthEvent | @asyncapi/glee
    AuthEvent: {
        authProps: AuthProps;
        doc: any;
        done: any;
        serverName: string;
    }
    diff --git a/packages/glee/docs/reference/types/lib_adapter.EnrichedEvent.html b/packages/glee/docs/reference/types/lib_adapter.EnrichedEvent.html index bd9313644..c483628df 100644 --- a/packages/glee/docs/reference/types/lib_adapter.EnrichedEvent.html +++ b/packages/glee/docs/reference/types/lib_adapter.EnrichedEvent.html @@ -1 +1 @@ -EnrichedEvent | @asyncapi/glee
    EnrichedEvent: {
        connection?: default;
        server: ServerInterface;
        serverName: string;
    }
    +EnrichedEvent | @asyncapi/glee
    EnrichedEvent: {
        connection?: default;
        server: ServerInterface;
        serverName: string;
    }
    diff --git a/packages/glee/docs/reference/types/lib_cluster.ClusterEvent.html b/packages/glee/docs/reference/types/lib_cluster.ClusterEvent.html index 4ecbd5787..e98d4a017 100644 --- a/packages/glee/docs/reference/types/lib_cluster.ClusterEvent.html +++ b/packages/glee/docs/reference/types/lib_cluster.ClusterEvent.html @@ -1 +1 @@ -ClusterEvent | @asyncapi/glee
    ClusterEvent: {
        adapter: default;
        serverName: string;
    }
    +ClusterEvent | @asyncapi/glee
    ClusterEvent: {
        adapter: default;
        serverName: string;
    }
    diff --git a/packages/glee/docs/reference/types/lib_router.ChannelErrorMiddlewareTuple.html b/packages/glee/docs/reference/types/lib_router.ChannelErrorMiddlewareTuple.html index 9146d69f8..5af44465f 100644 --- a/packages/glee/docs/reference/types/lib_router.ChannelErrorMiddlewareTuple.html +++ b/packages/glee/docs/reference/types/lib_router.ChannelErrorMiddlewareTuple.html @@ -1 +1 @@ -ChannelErrorMiddlewareTuple | @asyncapi/glee

    Type Alias ChannelErrorMiddlewareTuple

    ChannelErrorMiddlewareTuple: {
        channel: string;
        fn: ErrorMiddleware;
    }
    +ChannelErrorMiddlewareTuple | @asyncapi/glee

    Type Alias ChannelErrorMiddlewareTuple

    ChannelErrorMiddlewareTuple: {
        channel: string;
        fn: ErrorMiddleware;
    }
    diff --git a/packages/glee/docs/reference/types/lib_router.ChannelMiddlewareTuple.html b/packages/glee/docs/reference/types/lib_router.ChannelMiddlewareTuple.html index 36c1e8636..e6175a5a9 100644 --- a/packages/glee/docs/reference/types/lib_router.ChannelMiddlewareTuple.html +++ b/packages/glee/docs/reference/types/lib_router.ChannelMiddlewareTuple.html @@ -1 +1 @@ -ChannelMiddlewareTuple | @asyncapi/glee

    Type Alias ChannelMiddlewareTuple

    ChannelMiddlewareTuple: {
        channel: string;
        fn: Middleware;
    }
    +ChannelMiddlewareTuple | @asyncapi/glee

    Type Alias ChannelMiddlewareTuple

    ChannelMiddlewareTuple: {
        channel: string;
        fn: Middleware;
    }
    diff --git a/packages/glee/docs/reference/types/lib_router.GenericChannelMiddlewareTuple.html b/packages/glee/docs/reference/types/lib_router.GenericChannelMiddlewareTuple.html index 132bee021..ea74c1ffe 100644 --- a/packages/glee/docs/reference/types/lib_router.GenericChannelMiddlewareTuple.html +++ b/packages/glee/docs/reference/types/lib_router.GenericChannelMiddlewareTuple.html @@ -1 +1 @@ -GenericChannelMiddlewareTuple | @asyncapi/glee
    +GenericChannelMiddlewareTuple | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/types/lib_router.GenericMiddleware.html b/packages/glee/docs/reference/types/lib_router.GenericMiddleware.html index 413c9ef95..a787be5a1 100644 --- a/packages/glee/docs/reference/types/lib_router.GenericMiddleware.html +++ b/packages/glee/docs/reference/types/lib_router.GenericMiddleware.html @@ -1 +1 @@ -GenericMiddleware | @asyncapi/glee
    +GenericMiddleware | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/types/middlewares.ErrorMiddleware.html b/packages/glee/docs/reference/types/middlewares.ErrorMiddleware.html index 981cde955..3381215a1 100644 --- a/packages/glee/docs/reference/types/middlewares.ErrorMiddleware.html +++ b/packages/glee/docs/reference/types/middlewares.ErrorMiddleware.html @@ -1 +1 @@ -ErrorMiddleware | @asyncapi/glee
    ErrorMiddleware: ((error: Error, message: GleeMessage, next: MiddlewareCallback) => void)
    +ErrorMiddleware | @asyncapi/glee
    ErrorMiddleware: ((error: Error, message: GleeMessage, next: MiddlewareCallback) => void)
    diff --git a/packages/glee/docs/reference/types/middlewares.Middleware.html b/packages/glee/docs/reference/types/middlewares.Middleware.html index 8e9839d64..27b9d78dc 100644 --- a/packages/glee/docs/reference/types/middlewares.Middleware.html +++ b/packages/glee/docs/reference/types/middlewares.Middleware.html @@ -1 +1 @@ -Middleware | @asyncapi/glee
    Middleware: ((message: GleeMessage, next: MiddlewareCallback) => void)
    +Middleware | @asyncapi/glee
    Middleware: ((message: GleeMessage, next: MiddlewareCallback) => void)
    diff --git a/packages/glee/docs/reference/types/middlewares.MiddlewareCallback.html b/packages/glee/docs/reference/types/middlewares.MiddlewareCallback.html index e823232a3..1a221032b 100644 --- a/packages/glee/docs/reference/types/middlewares.MiddlewareCallback.html +++ b/packages/glee/docs/reference/types/middlewares.MiddlewareCallback.html @@ -1 +1 @@ -MiddlewareCallback | @asyncapi/glee

    Type Alias MiddlewareCallback

    MiddlewareCallback: ((error?: Error, message?: GleeMessage) => void)
    +MiddlewareCallback | @asyncapi/glee

    Type Alias MiddlewareCallback

    MiddlewareCallback: ((error?: Error, message?: GleeMessage) => void)
    diff --git a/packages/glee/docs/reference/variables/lib_experimentalFlags.default.html b/packages/glee/docs/reference/variables/lib_experimentalFlags.default.html index ba7b9794a..84fe30b33 100644 --- a/packages/glee/docs/reference/variables/lib_experimentalFlags.default.html +++ b/packages/glee/docs/reference/variables/lib_experimentalFlags.default.html @@ -1 +1 @@ -default | @asyncapi/glee
    +default | @asyncapi/glee
    diff --git a/packages/glee/docs/reference/variables/lib_functions.functions.html b/packages/glee/docs/reference/variables/lib_functions.functions.html index 28d8a86d0..044cf89f0 100644 --- a/packages/glee/docs/reference/variables/lib_functions.functions.html +++ b/packages/glee/docs/reference/variables/lib_functions.functions.html @@ -1 +1 @@ -functions | @asyncapi/glee
    functions: Map<string, FunctionInfo> = ...
    +functions | @asyncapi/glee
    functions: Map<string, FunctionInfo> = ...
    diff --git a/packages/glee/docs/reference/variables/lib_lifecycleEvents.events.html b/packages/glee/docs/reference/variables/lib_lifecycleEvents.events.html index a8cc8cc33..03744ea2a 100644 --- a/packages/glee/docs/reference/variables/lib_lifecycleEvents.events.html +++ b/packages/glee/docs/reference/variables/lib_lifecycleEvents.events.html @@ -1 +1 @@ -events | @asyncapi/glee
    events: Map<string, IEvent[]> = ...
    +events | @asyncapi/glee
    events: Map<string, IEvent[]> = ...
    diff --git a/packages/glee/docs/reference/variables/lib_userAuth.authFunctions.html b/packages/glee/docs/reference/variables/lib_userAuth.authFunctions.html index 52a2cad9f..952b8166a 100644 --- a/packages/glee/docs/reference/variables/lib_userAuth.authFunctions.html +++ b/packages/glee/docs/reference/variables/lib_userAuth.authFunctions.html @@ -1 +1 @@ -authFunctions | @asyncapi/glee

    Variable authFunctionsConst

    authFunctions: Map<string, AuthFunctionInfo> = ...
    +authFunctions | @asyncapi/glee

    Variable authFunctionsConst

    authFunctions: Map<string, AuthFunctionInfo> = ...
    diff --git a/packages/gleequore/.editorconfig b/packages/gleequore/.editorconfig new file mode 100644 index 000000000..3abcad16c --- /dev/null +++ b/packages/gleequore/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/gleequore/.eslintignore b/packages/gleequore/.eslintignore new file mode 100644 index 000000000..fa806b632 --- /dev/null +++ b/packages/gleequore/.eslintignore @@ -0,0 +1,9 @@ +node_modules +examples/social-network/frontend +examples/crypto-websockets +dist +.glee +test +jest.config.js +docs +try.js \ No newline at end of file diff --git a/packages/gleequore/.eslintrc b/packages/gleequore/.eslintrc new file mode 100644 index 000000000..02bbf610b --- /dev/null +++ b/packages/gleequore/.eslintrc @@ -0,0 +1,53 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "rules": { + "curly": [ + "error", + "multi-line" + ], + "security/detect-non-literal-fs-filename": "off", + "@typescript-eslint/no-explicit-any": "off", + "semi": [ + "warn", + "never" + ], + "sonarjs/cognitive-complexity": "warn" + }, + "globals": { + "process": "readonly" + }, + "overrides": [ + { + "files": [ + "*.spec.ts", + "*.spec.tsx", + "src/help/command.ts" + ], + "rules": { + "no-undef": "off", + "security/detect-non-literal-fs-filename": "off", + "sonarjs/no-duplicate-string": "off", + "security/detect-object-injection": "off", + "max-nested-callbacks": "off", + "sonarjs/no-identical-functions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "no-use-before-define": "off", + "sonarjs/cognitive-complexity": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/gleequore/.gitignore b/packages/gleequore/.gitignore new file mode 100644 index 000000000..e816407b6 --- /dev/null +++ b/packages/gleequore/.gitignore @@ -0,0 +1,7 @@ +node_modules +.DS_Store +dist +coverage +.vscode +.glee +.next diff --git a/packages/gleequore/.npmignore b/packages/gleequore/.npmignore new file mode 100644 index 000000000..7e76b75dc --- /dev/null +++ b/packages/gleequore/.npmignore @@ -0,0 +1,4 @@ +assets +.eslintrc +.eslintignore +node_modules diff --git a/packages/gleequore/.prettierignore b/packages/gleequore/.prettierignore new file mode 100644 index 000000000..764aff77b --- /dev/null +++ b/packages/gleequore/.prettierignore @@ -0,0 +1,6 @@ +dist +coverage +.github +examples +node_modules +docs diff --git a/packages/gleequore/.prettierrc.yaml b/packages/gleequore/.prettierrc.yaml new file mode 100644 index 000000000..45c45fea2 --- /dev/null +++ b/packages/gleequore/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: "es5" +tabWidth: 2 +semi: false +singleQuote: true \ No newline at end of file diff --git a/packages/gleequore/.releaserc b/packages/gleequore/.releaserc new file mode 100644 index 000000000..1ac05cb15 --- /dev/null +++ b/packages/gleequore/.releaserc @@ -0,0 +1,24 @@ +--- +branches: +- master +# by default release workflow reacts on push not only to master. +#This is why out of the box sematic release is configured for all these branches +- name: next-spec + prerelease: true +- name: next-major + prerelease: true +- name: next-major-spec + prerelease: true +- name: beta + prerelease: true +- name: alpha + prerelease: true +- name: next + prerelease: true +plugins: +- - "@semantic-release/commit-analyzer" + - preset: conventionalcommits +- - "@semantic-release/release-notes-generator" + - preset: conventionalcommits +- "@semantic-release/npm" +- "@semantic-release/github" diff --git a/packages/gleequore/README.md b/packages/gleequore/README.md new file mode 100644 index 000000000..e3502bcea --- /dev/null +++ b/packages/gleequore/README.md @@ -0,0 +1,13 @@ +## GleeQuore +> The heart of [Glee](https://github.com/asyncapi/glee). + + +## Installation + +```bash +npm install @asyncapi/gleequore +``` + +## Usage + +TO BE DONE diff --git a/packages/gleequore/docs/reference/assets/highlight.css b/packages/gleequore/docs/reference/assets/highlight.css new file mode 100644 index 000000000..484d2745f --- /dev/null +++ b/packages/gleequore/docs/reference/assets/highlight.css @@ -0,0 +1,92 @@ +:root { + --light-hl-0: #AF00DB; + --dark-hl-0: #C586C0; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #001080; + --dark-hl-2: #9CDCFE; + --light-hl-3: #A31515; + --dark-hl-3: #CE9178; + --light-hl-4: #0000FF; + --dark-hl-4: #569CD6; + --light-hl-5: #0070C1; + --dark-hl-5: #4FC1FF; + --light-hl-6: #795E26; + --dark-hl-6: #DCDCAA; + --light-hl-7: #098658; + --dark-hl-7: #B5CEA8; + --light-hl-8: #008000; + --dark-hl-8: #6A9955; + --light-hl-9: #267F99; + --dark-hl-9: #4EC9B0; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --hl-9: var(--light-hl-9); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --hl-9: var(--dark-hl-9); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --hl-9: var(--light-hl-9); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --hl-9: var(--dark-hl-9); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } +.hl-9 { color: var(--hl-9); } +pre, code { background: var(--code-background); } diff --git a/packages/gleequore/docs/reference/assets/icons.js b/packages/gleequore/docs/reference/assets/icons.js new file mode 100644 index 000000000..3dfbd322d --- /dev/null +++ b/packages/gleequore/docs/reference/assets/icons.js @@ -0,0 +1,18 @@ +(function() { + addIcons(); + function addIcons() { + if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons); + const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.innerHTML = `MMNEPVFCICPMFPCPTTAAATR`; + svg.style.display = "none"; + if (location.protocol === "file:") updateUseElements(); + } + + function updateUseElements() { + document.querySelectorAll("use").forEach(el => { + if (el.getAttribute("href").includes("#icon-")) { + el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#")); + } + }); + } +})() \ No newline at end of file diff --git a/packages/gleequore/docs/reference/assets/icons.svg b/packages/gleequore/docs/reference/assets/icons.svg new file mode 100644 index 000000000..a19417dcc --- /dev/null +++ b/packages/gleequore/docs/reference/assets/icons.svg @@ -0,0 +1 @@ +MMNEPVFCICPMFPCPTTAAATR \ No newline at end of file diff --git a/packages/gleequore/docs/reference/assets/main.js b/packages/gleequore/docs/reference/assets/main.js new file mode 100644 index 000000000..99097a053 --- /dev/null +++ b/packages/gleequore/docs/reference/assets/main.js @@ -0,0 +1,60 @@ +"use strict"; +window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings."}; +"use strict";(()=>{var Pe=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Pe(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){se.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!Ve(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function Ve(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),He(t,i,r,e)}function He(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Be(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Be(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",N="mouseup",J={x:0,y:0},me=!1,ne=!1,qe=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(qe=!0,F="touchstart",ye="touchmove",N="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(N,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else{let r=e.appendChild(document.createElement("span"));r.innerHTML='',r.appendChild(document.createElement("span")).textContent=t.text}}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var $e=new U;Object.defineProperty(window,"app",{value:$e});fe();we();})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/packages/gleequore/docs/reference/assets/navigation.js b/packages/gleequore/docs/reference/assets/navigation.js new file mode 100644 index 000000000..8d5c3b04f --- /dev/null +++ b/packages/gleequore/docs/reference/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAE62YXW/aMBSG/4t3S7vCaNdyhxCrkFatm3ZXoco4J+DVOMh2OtDU/z4R8uEExz4BbuP3POf18deBl3/EwNaQEQGlEqVJj2yoWZERWSdRKkB/Pny/Xpm1ID3yxmVERoMeYSsuIgWSjF5KRAQxTYWpGExQrStGPl5n9Qf3H/OPXgnhMoLtsY3sM8rFowD4mSYKxhHdGFA+1ieH+AAf9h+GX26GlrFSOhGpNqA64Y9iwlkSKYEZnkhkBlsfpE/3K4IDF9Ig8wm0pkvAUStxG3ecmtW3VGZTmsk4qbhcGlAxZSW6KW3sk9s7l918LX5s9lHaQ2+J8CXJlb+AJSqq0Ga3qTzbkgbr5uFr/3bQqMWzSja6hVUMhzj1beiz51KG6FWhrPVw453Sk/jTd5CmQ5JMj85UL8MkkTFfBpK5QtD5kFXrXLEu1TqtUt95DGzHBGBS1MXdcyDLdKR3Z8I+P1d91APUVgmQ6boi+UpwbxlqfVQLUOurWjHsu7F56JvX3VX/+ljuu+vqE0HgXQHHCexFEXxB3LWmbY+w4IvXfPC83sUGIUq9v2qcJ8DmlKLQzp9KxdkKoiCxJgzvcna4o9xlywfPL1sBQpQtvzRb51mgbB1imp4eKqOW4xeYbMVC9bnrtm5pD8sHz3dVgBBLMGv2ZpNEaqNSZuxO0TrPNt8X7D/bKklbd+Jh7Pwq5BzMPlxRKUFkPe8TjyIBf6mC3+lGgGtb5mBPVLAjO4R2ztUxzSNIUJx1zuaNQyatosKJKm34dKeGC8cP1j00G2oQ6qevzOMgWIOovddY9+YsbVxDGqogDnoKb0KFWFD2huMW6hB/kcYxqIE2isult7CvNelpRzzO+xQf2Hnm74a1zQBbro2eybHeSTZ+nvmNN9WX9H7Extj/oxOJKrklvKRpG4vxe5AO9mF+v5bwkn5tLMbvOxU8osbxVNvUQnVJpyWzi03fH0cu+OTMJshvfRJoi7JJzD/m/wHpWVM/iRQAAA==" \ No newline at end of file diff --git a/packages/gleequore/docs/reference/assets/search.js b/packages/gleequore/docs/reference/assets/search.js new file mode 100644 index 000000000..d333e13ab --- /dev/null +++ b/packages/gleequore/docs/reference/assets/search.js @@ -0,0 +1 @@ +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE81dXbPbNpL9L/LrzQ27+e03lzez69qZTTaZmRdXKkVLvNea6EoKKSXxpPLftwh+qNFokE1STvbJ8hW7cQAcNIA+APXbpjr9Um9ev/9t8+P+uNu8xofNsXgpN683ZVWdqnrzsLlWh83rzctpdz2U9Zftnx8/Xl4Om4fN9lDUdVlvXm82vz/0PgCzwcuufCquh8vgpjPo3XRfC+4eNueiKo+XG5JbATHcYG5Px/pSXbeXU6Up5JX9/FiBvR0pGBOEKPI10Vixw6PrStyVl2J/0BV5e3ZumUNx++Ou/NWhgPnrKAMwTgYfb66Xj3+5HreX/en47vh0Gtztj5eyeiq2g0f+5DgrWmyEdQHe2ml72JfHS+NwZnGvLMuRkh1zH5S6rH4uqyVQLMuFUDDIU4jR6o1vqtP5RqHLp7OFw3w7r+mTOA5vHf7DD41Lhf9Xw5NTlWsRexr4ubz8/fRjedSX+EhMVEU/dkjvVeUBQOf4i3wmklsN/I3yj7qsvilqTU8TWMTqT2uaHkPfOgALmmeoyOdFNnzC4VO4Am3/J6dVrd691mVlPn4G8I/E+X1qMVGZc1HXv5yq3WepDHH+h1Tmuby8LavLvLp0Fn/aeGvK79tsCXkNfn+DfF1cLx8XhGjL7k9rnBuKvonSBU1E6uJvqP+6XM5vvnn33+WnmUHbNvzTmorA6NsqXtBWtDb+xlrUUP8PGok10JKpzW0cvsz7z0NZ/u/1VJVvD9f6UlZvdsX5UlZvT8en/bOId9TiMy0Hp8vULRHHa+uhUNE+tA7Y483LYoATM4p3nteDVMzmaxA20NYBbD3cEZ93PPTbpK9+bryPorYe/dwjwC1sJvXtinl6qip/upb17Hr33XQznw9pgkPF+bwUVWt6d0Tt7vt/JkefH5jl4e74tqfjsTRPL8Vnebg7vnPx6XAq5FW9AtzN/O7IfrqW1aeluHrju6P6WBa7spLXMwpcN/N7ILtjAOuRaRc8oxCHavoGxcfieCwnpqORETGY36MRvZPQX/dP5fbT9lAqZiH72XnTkBcATRgqMDiPf+7ZUC5w5ozoVnLp3DMKZ8784zqamBVHs7VafMTJZ0G5Ox3X9OdjZ/9ZsGln8XGE82fy+W24XdeE2zsim1w96+LrH7VmXrNcnhWuddV3Hv/c7SAXOLNB3ErOnEf09P0jZ4+1E4dH1Lw92+5Dvz43D9/CtKPweQxWSJzPh7JcVt6rzlTXGHYF9WF2HqQFEXYGsFWg7gvoXFR1uXtTfzpu33zzbiEwx8kdAW7tHOE8YIPxOkCOat0++G259epE9InPpV47ZSgVbAu9p9nfjKQjvQU/vlGlH2378YXI/lhfiuN2Zgs8ErN7IZlYuvmxqGPJfDSLkNwRRdEM+eK8n4mDmN0LydYvJfhxqMLDBAoeG+yE8EiIkB78TJHCW5QuYIhVWhA3pmAow4foZkUUmYSlDCYLcG1bE29QmYRmO/g86P7x7V9XgWvt12NTnQP8AkZPAt5OgnqSXuXx+nJztSbbBbeheTq+bXPb+mJeUZuxtmP18JTftOl8BNRqPYb/2NdLQFhm61F8Z+bAb8ti92kWDNvuXjjeDprH12dyHkUPyHFwf2RvD6e6XAWt97AIG93n2g+xyZVvDRx4S+ZYKyA+XY/bRcW96iz1DTA+y7YLOf/+fhTLzXgFHNor9KzvdJ+4T6/okep6XFDWq9ZsrPpCnebdKOghqK4U8DpqbxRIhaiuFLSVnDzf76zvRwtWLuunS23XAe61ArnU29OrSt1aixBlU3ObmQiCKCO13s0q23p+Rbl1eXm7oOqS2QoUVzLFjJZ7nZxJpkv6+nr5cLoed+oSicGqltYW2T25pqxLUemC0qv+0RWl7Y//KreXv5V1XTwr+5GbrC79q+b+0Jyye4M1rfzpuO1GgbKtLYMVJZcv+8u7ZsI7Fgd7BzNavmS2AkVVPu9NCKDXiUYBMIs1ZV+PM4odHl5R4u0uFju4OjFHOFYrMBBha7TUyUNU063rKGlTLUwM7sApzwZdxS7Hdl1LLIIimK3qd55CmOh+XfZAW+rfT9/ZCWdd6cTsniiUK0PRbhUON40yAUCbQdGXPLcnJMP7IlH3hmi5CouQUprAoM4mzSj7L9XpZV6neGzvjkfdNT7jVYjeHA6dJ18yaQLVmINVyMQElbqxvNZ3wLS0qT5PO0kdYCUqF3SgIk85u/8an4u7rze+b+/NaabP0ka3treT3eou0+S6le0yC4E+067tlQXF36f2M/akt4dXlPhcXr4rD+X2Uu6+G04dKAeG13YmngHMYf/hS36rrdfqDvsPP3Tfjb+5g6nrXx2r/fZjuZNOiVOf1nPjuVcKc5a2Pl7elLROirWtZ1+wUeHQ3K7xQlp6MkaHTHE+Zh2yFajugUh658kUf4dn/gDu2mXN4e2tJmuYIZY/lxU3J8uuMEwDmr63sASPcFlhGsroDYVlKPhxfw0Iv6KpxaDQ0SgQlZYmjwmtouYrTqWq0WpPq1zkms9k6WOXemaVKozIycJnDsVJDP1BYc+e2YvDsbsDFs/550ksyiPPs7B01/3kNZufmLbVHXCczmVVGPF7NwMHs7pfe7zZ7aqylvbnU21CLe+BZ1hCzYFiGd1tBP+jOnz167k47kpXUpwYyLbpIkR2vr4+HX4uPZKIFws3W42jeRGJX5rx4uBm98Dx3fVDva32H8rd25aIM/jiM1+Ny5conWLuPcoWle8Rmo6o3zNK/bk47HfFZcZMRyyWlD668FYX/th/+KJ/h9gcOI+OG++h6PqfzRP3APh487UC6MQi1fN60yVwJ15/eg+0H68vxbFJIhUfDqWcB1qCXHR711rYCZwtO91AEzjdd7MSON3hB9/+t3dJH5te7vcgZ2+BvcVpdsGS8aKN8BQK7V5Y9DOxHRava6hATb1qagYi5Taw96beBrq8mLMNlIpTbwOZsX85Z92bnSx+9KrsrHInNoJi6TN5eKel7AgU7VJWjai/6vNuBhTLZhEG7TLNx8jJZZqybO8yzdMFE8s0danVvjjs/136zg+OkYBbrkazK5fjEW0XIbLnYDfzb03Dw9ejM7E6yt7c6QPtDeHCWCsXqg+3jr1/jFfFL2/dFtWg4Zb3wbMd2yN6G0azM5yDYmo+8ODQTgkzkCjSgz40MzKEcxApkoQ+RDPyhOOIaIz6WNRv2ZvFNFgss3vgeC4v3xa/zMIwmCwt34qMLyxC07DYfTe+OyG3mN4N74HoYvdbIWaRO0a0jDHb6ejZ18KzRudvLlyK4dXUOwwJllFv3i0ve2XgYqBTLw9cC5S/lm8x0KkX9K0FOuTU10Olrj4PWP4218VQp97ruhbo+NuB5mFVzn+r2OouVpYTVrd8WQP3Q3UqdtviHkSgrj5T27L01vKGnbjUsxao/ZLYxTDHXxe7BKRyV9G7VW8p3Elxzn5CKk69mWDGY+tCe2aeRDBnBp5eA37LAu5k8ZbNHerPI/4kgDmRXS9T68ufNwlOIuALnukOmLGwWSEvjZXdv7JYJy45nmwnk5vaGYNzxlJq7WZWBDBzJp9xWmBWhJozPU9icOfiSQjz5lzN1rl4mTFChuf/+AHSFv3Y/vPF7febZg0Qy8nkywZmMGPG+mKyU+zFxGTZ+kXDZKb38u4o37wfGZbE5h4IvJf/xyBMvgBgBoZ9PbsRqMkdyp/fBJbNHXphXvPfp9Tj6bJ/+vTddbst6/rpevimOjWf9kf5tJCIZdTHnRD+pdgfyt1ydIL9ImRWpq06XX3HANqv5p0CaCf7v+13u0P5S1GVf7+eD5I03vmWn5/eRHSoZ58LmC5Wc0Bg1Is2N7UA1OTvRkyCmzg18CRdQdHDexpf3cxE5uGWORszl2CS0R/FMm/Z86km1n0l36bgLSCd6HI18yaBzqKfDqPzRvryWFb77c3Oj9p5dAHfPMXPjbKjZgtgaXNDXfHq1JBT0JzMkFCYOjFk2/pmcelVVr6Sx95mNavE0SWdp2TVkk6H4Lm83Pgib/ckEI7ZHXD0tVqIRza/Ay4WSWaBEmzv2FJrkI34WIuw2C3qQ8fsDjjWcMprfgdci3tOtr1jS61BdmdOWfuY62VPTtrQbYz5ZnwXM3h6uYH68sP16amssL5UdK/WeyZP/mA9OVpSEnknzqfuJVtjrlUzqb8OUzUuf93Xl/rd0TkQI1WaP3zfejveZ1fdqYxyGb8Az6v+PxML+jF4g8Mxor8I407om1lbdu9aljrUrmIpwFnbppHCprZJsunYuybs8DOChD35B9RdKnFOA/C6afr9bXE4fCi2P6q6pH/4D+WBVegyPgyVnAqC/6pPR03QJ8/dN/RRx7OjHkU/VdP2MWxMRmtKnrtvTanj2TWl6Kdq6lwYlKo53Jy6ax0Hr7MrKFzzWzBxieUvmbAcR8qJajAUzmaPdcNb3en3xR3yduZx+Ikq3RBFkEdhcIPFf4bMqX37xiXTL8KzMhr+Ynlvofyuw1ihqpc2awod6WqpXMXZe33R8ivPR4uf8bpzDQT7UuhYyYo3g21+//6h+/T6t03zArOmmV5v8DF8zDcPm6d9edjVm9fvWxgPm+3p5aW9g7k7ba/m4/fdY/8sm0xY83D79JfB5uF98BCFj0n0/fcP73tb83fzh97F7S/GDjYP7+EhDB4hAssQHEOwDHHz8B4fwuQxgNwyRMcQLcPQgzR07ELLLto8vA8fYnwECC3DyDGMLMN48/A+eojSxyCILcPYMYwtw2Tz8D6WSkwcw8QyTDcP7xPJMHUMU8sw2zy8TyXDzDHMLMN88/A+Exo1d+xyu/sbNuQPCI+53YvgEgcYcwx1AgktCOSx2QPoK9elD9j8gYYWAGK5LofAJhFEvnJdFoFNI4h9pi6PwCYSNPQAFCG7XAKbTNBQBETmg8snsAkFDU0gEo1dToFNKsh9NXZpBTavsOEKiIMHXWahzSwET7no8gpZVGq4AuLYQyEw2czC0Feuyyu0eYUNV0AcuugyC21moY9Z6DILbWahYVYmlusyC21mYeor1+UV2rxCw6v8IYJHwNQ2dnmFNq+w4QqKkQNdZqHNrLDhCorDP3SZFdrMChu2oDgQQ5dboc2t0BezQpdZIZvzGrZgKM16wrRnUytsyIKRZOsyK7SZFTZswbiZ33N7eg9daoU2tcKGLJhIXRy61AptaoUNXTCVQLvcCm1uhQ1bUJrNQpdaoU2t0FArl2xdZoU2syLfXBi5vIpsXkUNU8LgIcwfAW1bl1aRTauooUooEjpyiRXZxIoaroQioSOXWRFbUfkmw0hYUtnEimIfKSOXWJFNrCjxLFYil1aRTauoYUoYSou5yOVVZPMqynyDIXJ5Fdm8ihqqhOIqMnKJFdnEihuyhOJkGLvUim1qxb7JMHaZFdvMig2zxMkwdpkV28yKfZNh7PIqtnkVm6W6OBnGLrNitlr3TYaxsFy3iRU3ZAnFyTB2qRXb1IoNtXJxn+BSK7apFXupFbvUim1qxQ1ZImlHFLvMim1mJQ1XIhBsE5dYiU2spCFLhFKFE5daiU2tpCFLJC5KE5daiU2txEetxKVWYlMribzrjsSlVmJTKzE7QXEQJy65ErYZTHxdnAjbQZtbSerr4sSlVmJTK2nYEsUiaJdbic2tJPf3sUuuxCZXasgl72NddqU2u1Jf2EpdbqU2t1L09nHqciu1uZWG3j5OXXalNrvShi+RGLhSl12pza7UsEuMPqnLrtRmV5r4khSpy66UZRsMu3KxYCHhYNMrbQgTB2LJLr1Sm15pQ5gYRGOXXqlNr6whTCxyM3Ppldn0yhrKxOJCIHMJltkEyxrKxOKmOHMJltkEyxrKxOJknrkEy2yCZQ1lYnFIZS7BMptgWUOZWE4PuQTLbIJlJpklsjNzGZbZDMsazsQiwzKXYRnLaTWcScTdXiaktWyGZbkvP5m5BMtsguWBL0WZu/zKbX7l4I26ucuv3OZX3jAmEVf0ucuv3OZX3jAmEVf0ucuv3OZX3jAmEafl3OVXbvMrbxiTiMMid/mV2/zKG8YkcoO5/MptfuUmYZqIxi6/cptfueFXKk0XucuvnOVNG8ok4rDIhdwpT542pEnEcdF+Z5uTv3X2DW9SOYUaCDnUgCVRg4Y6qZwKDYREasAyqUHDnlTOSwZCLjVgydSgIVAqpyYDIaEasIxq0HAolbOTgZBVDVhaNWholIqxuP2O27PMatAwKRXDcfsdt2fJ1cDk68WI3H7H7Vl+NWj4lIrsa7/j9ox/JiOfyvyTEvhOBh+8kz+IOXzGP5OZzzwSgMA/nsk3yflM5q+Uy+fJfJOhl9cfICX0eUbfpOkzmf9SVp+n9U2mPpP5LyX2eWbfJOvlJRBIuX2e3Df5+kweP1J6n+f3TdI+k8ePlONnSX4weftMHj9Cmh9Ynh9M8j6Tx4+Q6weW7AeTv8/k8SOk+4Hl+8Ek8TN5/Ag5f2BJfzB5/Fzmv5D2B5b3hzbxL/NfyP0DS/6DyefnMn+F9D+w/D+YpL68igZBAwAmAoDJ6+cy/wUZAJgOACa1n8v8FZQAYFIAmOx+LvNXEAOAqQFgEvy5zF9BDwAmCECrCMj8FUQBYKoAhL5ECAiyADBdAFphQEzQgyANANMGwC8OgKAOAJMHwGT8xaQGCPoAMIEATNI/l8euoBEAEwnAJP7lthOYx2QCaHUCue4C8ZhSACb9L6WwQdAKgIkF0KoF8rAT9AJgggG0ioGYLQBBMgCmGYCRAeRDH4JoAEw1ACMFiPsqEIQDYMoB+KUDELQDYOIBRN48HAj6ATABAYwmkItpXhAkBGAaAhhdQMy4gqAiAJMRwCgDEMhThqAkAJMSwKgDEMhzhqAmAJMTIG6PbciThqApABMVwOgEEMhRX9AVgAkLYNQCCGT+CuoCMHkBjGIAgRz3BYUBmMQARjeAQA78gs4ATGgAox1AIEd+QWsAJjaA0Q8gyOQ2EHjIBAeI/bteEDQHYKIDxC0R5bWPIDwAUx4g8Z4cEqQHYNoDGDkBPKeHBPkBmP4ARlIQJx9BfwAmQEDSniGSR5GgQgCTIaDVIXxHegQKMikCjLoAnmM9ghoBTI4AIzHI7S8dKWL8MyKDHEUFSQKYJgGJ//gHCKoEMFkCEm9aDwRdApgwAak3sweCMgFMmgCjN8hSHwjyBDB9AozkIDeeIFAAUyggHYt/gkgBTKWAtCWfvG4WhApgSgWk8Uj0EcQKYGoFGAXCE30EwQKYYgFGhAD5fBgIogUw1QKMEAHyQS8QhAtgygUYMQLkE1sgiBfA1AswgoRMYUG+AKZfgJEkZAoLAgYwBQOMKAHywS8QRAxgKgZkbQSU478gZABTMsCIE/IgEKQMYFoGGHnCsw4T1AxgcgYYhUJehwl6BjBBA4xGAfIZNBA0DWCiBhidAuRzaCDoGsCEDWiVDfksGgjiBjB1A4xiASjPIILCAUziAKNaiGe0QNA4gIkcYHQL8agVCCoHMJkDjHIhHpkCQecAJnSA0S4A5SAqaB3AxA4w+oV4JA8EtQOY3AG5fxsi6B3ABA8wGoZn7y5IHsA0D8hb+ol6CwiyBzDdA/KWfqLmAoL0AUz7QKNliKf0UJA+kEkfGHgvHqCgfCBTPjDwXz8QhA9kwgcaIUOkPgq6BzLdA4OWfPJxX0H4QCZ8YOAlHwq6BzLdA4PET34UhA9kwgcaIUMcuyjoHsh0Dwx8uRcUVA9kqgcaFUMc+SiIHshEDzQihjjyUNA8kGkeaDQMeeShoHkg0zzQaBiekYeC6IFM9MD2/gLKZ7YF1QOZ6oHeOwwoaB7INA80GoZn4KMgeiATPdCIGPLAFzQPZJoHttcZUFx4oCB6IBM9sL3SEMrHxwXVA5nqgUbFAPnELQqyB/K7De3lBvnULUrXG/j9BqNjyMtnlO44OJccDAdDcepH8Z4D46ARMiAUdxAo3Xbg1x3a+w7ymVaUbjzwKw9GygD5cCpK9x74xQf07X9RuvjAbz4YJUOOQdLlB377ob3+EKbiIJIuQPAbENhyUA4C0iUIJn1g6Eu/oCB8IBM+MPSeV0dB90Cme2CII9UXhA9kwgeGLf/kICBoH8i0DzRaBkRyEBDED2TiBxo1Q15/COIHMvED28sR4vpDED+QiR9oxAz5tAwK4gcy8QONnCEfmEFB/kAmf6DRMyCSQ6AggCATQNBIGhDJIVDQQJBpIGg0DZBPEKMggiATQdCIGs0bk0UHAgeZCoKtChLJIUzQQZDpIBi1HJRDmKCEIFNC0EgbIJ83RUELQaaFoBE3QD5zioIagkwNQaNugHx2FAU5BJkcgkbfgFgeh4IggkwQwcibCURBDkEmh2Arh8QykQU5BJkcgrF/HyKIIcjEEIx9d8JQUEKQKSHYKiGxPIoEJQSZEoKtEhLLo0hQQpApIei9bYGCDIJMBsFWBpFP0qIggyCTQTD23kAUNBBkGgjGLfnkESyIIMhEEIx9F1xRUECQKSCYtNyTx78ggiATQTDxc0+QQJBJIGhEDZAPBKOggiBTQTDx6sAoaCDINBBsNRD5TDEKGggyDQQT/xwsKCDIFBD0KiAoKCDIFBA0kgbIh5pR0ECQaSDYaiAyeoF7TALBVgKRz0WjIIIgE0HQqBogHzNGQQZBJoOgkTVAPmqMgg6CTAfB9qKGfNwYBSUEmRKCrRIiHzlGQQnp/2beo/FzWV3K3bv2fRrv3w/v0Plt80P3ko28f6HHbxsINq9/+/1hA9j9G3X/xt2/efsvQvdv2P3bfY9p+2/Y2Uedv6jzE3d2cWcXd3ZJ9/+0+745xNN9yLoPSQ8tSbqygqwH03lvti8drKDHhf2HHmGc9h/6urQOf7+9SMT8uW9N813TvMOvhN9aDkjTYYcm6cCkfRMm2Rz3Vbk9VTtaSBTeCklwjq+aukng5ibXutkJlU4InjzSOiqbF79Yb/MjzRilpB2jWOvT6y6m7kKtu1P3ss5xqBn1rWXO4NvrNqFula16PlMft3eL/7YJOxJG/bjVNmrzbsbivLf4R1oz6Uiewyx3dfcjtiTm0KATdUOyUa9Ubq+Xj+XP5pU/xCPpmOYUnNZR/86s/fHpRP3RWqudnavT2epYAqoLN1HSd0mgckt+xYjwBQm8RrToAqFuXA/vt785DIObv6gPwnkf3YM+VPbxvUl1zCip2O2q0rzvidYhQFKHeJZDNkQv7dvgie+QDlPM5/gedUuHKerY2rltzFj9AzoGZmG0HdFpqBGgVY4O+/J4aThrxfabI90IurnZno5P+2fqLKUcDXSDaPhxKMr1hHJ9WIEoW791KM1jhH65ttGoM2Gqpu2nG96dSyecNWeebrVOZlXWmFFYZHpNdXNL56l5oRt1REZVqoTk0CIi7Z50oSZRsr99bZ49imjc7xd3oEc3vIePzKSkG8M+XPdTaqMxdwxUhqyhDDb8aQfHyshNf96BACZRqZug+9Vyv/KGtP9L1q/dg35tHOrG5vC2SVIJUoXWKsv7gvsVfNL/JesX5cGwe+gX5VE/qvsNAibDh34SSvqHlQvqXVmX1b447P9dDj+uTscXjSqp1uWl2NvBl3SibmTtTlvLnqzaoqHtdGzYnY5WnUIKph8JkY6l5cv+Yn6L91gcnGCU0pk60MXK8ljttx/LnbtQS+lCTVdTNt9bHRmTFmwyZ2p/Vj+Subij6cBfHcSno71SoFuafm+Iyuo2a1JrLUqcKdfIdFnrTlQxWTFkupn+uf1JHcUiKSJtiaFuVHTePV0c0n12qOPfc3kpzvsfy0921LV2mmpH4vqmORlPIriuX57Ly7as7CAa0eWb1sv4LjWk1dRFgOfy8vFyOUuNZq16tc682IB2pm7ify4vp6YTLqcfS3uc0a2+bsXV+FLt9GlcUUZk4tvrlk7Wyj3gc3mpil/sRTGdejM1a+ryUG4v5a7dkTt7kpwu2UM1uPr6od5W+w/lTtyfBDTiKyP0c3lxO5tumNSkvtZldS5qtmWi9dR5OpT2ZEti0m3ZqUR1KMufmtchSznFhIZP5cKYOzydnfUm3RFr+2DwSvIklk/SsbEymko+nTVCSAaJMoE3OPbv+ICmLjFVDmnZrzAd0JTDzAaW9yFAt6g4l1tl+6pt6o5GtHRms4r9T8JFrIwW3J/T90gqrUwzDU4P+6dy+2l7KF1GkRGvDeaOV7ENyOSo3MUNjqV9Cc3TozKJ8LGohZxec26fzBG6Zd7Hoq7Kn64lzzfSdVOgG+ofy2LHRAgkQTPsdzt5vw8NlBCvL8XRhLoPB4HlVmxPdCzf8y7xbLSbewQkF6XrndaWZkAIY1qbVBcv9sd/NbM3r3JK+znQDZnWlUDAxJIDtTWsL8VxayedSC37rbsy5vTu9ju7Y+k6WZnH2tf7/ufG6X6CjjHQTbH7+jT8yCR1RUO0cgW6r83PadiVo32Y6Pqw+RU4YZrL6bZEGUEbV1LuFejOP9G1ufElT2h0+9VcFdO6kwIlnScg0/vqf/+bdiLdRSi3heQn+Ojqnu5UI108809a1Fu6xJmw8yfkyHQ19eVd6GJKufq7udoOP8FFXdJ+iHWbGt8+K6YDM9YFnpEfQ6Se6QI9mo2y+yG8/VESW5szegS2Lp54f8yL+qV7+GS+X+uns6hfujBQpsrkH6qiTq2l9Fxq3Zx6ohDNfjXnlTTuuaZC11ZKffF4uuyfPj0V+0O5O1enbVnXvJdoNhhRR9rWbX3dNg6frgefazpclVkcu91SOq8o12qnY3E4tMmG+tYb28Optlozo66Vs6js+nS2cwYZXc4oW5R6btaZn6zZlU47yn3e6SgoVzSMpP0pJ2VaY3B4OblnKzIrTaLtaebQPsVAl9TKfMnpuNvXUrVJ+/WKUPPGtrk+n6rTi1B3ukZUJlNlr3YD0LyYcsF4OjoL9ZyiU0aN03FID1jNSLok7XdSoAuVxKXIH8pwpcwuuLQbkO6bQDtqWkcjcYMuGJQHHzxebbR0mYraIcn98lBEhapMOywlp3bKlo525dq1d+sEN7qm63ViQO3gVMR5KtarJ6HJIJ/T+KQ8ljO4dSM85SoqY8i5rApnoUGP5EHen1JVHoUZXO53LJ1Oa6tcIp6Lqnix3SBdZCmD+rmo6nInnhIkoIajulE/rWW6Kjdp+l/YhsU6B6Nj4rn4dDgVlheavwr7bH0+nITQ1f6na1lZTKFN2B9UxqA/5qAMc1Xxi2+3TEeLMmJU5fPepKnZya6UNqMygdf78m9QU4ow0E1oQnqRZtWGk995f94j0A3oqqxPh59LSaels7dyp1pdrb6gooxSbauuR6cTaDzQVut6lNLOKZ2iAjWika6kC2XQRZW6tLNhCQHVH0qFuP+Q9qfzlTPq+PEd2qfK3Ii71KFHFfr7AEkfHpTHolqvTlcTvsxw42wzSTX701J9VO0bNhmOqPWnvYfU+nDYeKjUcC0hG86z9d2i7nRndUf368pQ33q5Vofy13Nx3JV2zA/oQOkvi4AyfVyXl5FTn8RzrhuBdXmRkshUy0DlzFTfzgfYcxzNJii3LfWlsM+RJPSwuS4WNxO5kPZN6Qoj0E087KgoPZ+gPEhwtdeKCaH+wFHlwf5rXUrtnJA0w3CMM9Q1d3OMgI9OOzuuciPmuwIae2NF133/sDnvz+Vhfyw3r99///vv/wcPzDsgbwoBAA=="; \ No newline at end of file diff --git a/packages/gleequore/docs/reference/assets/style.css b/packages/gleequore/docs/reference/assets/style.css new file mode 100644 index 000000000..178bfb023 --- /dev/null +++ b/packages/gleequore/docs/reference/assets/style.css @@ -0,0 +1,1493 @@ +:root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + --light-color-warning-text: #222; + --light-color-background-warning: #e6e600; + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); + --light-color-text: #222; + --light-color-text-aside: #6e6e6e; + + --light-color-icon-background: var(--light-color-background); + --light-color-icon-text: var(--light-color-text); + + --light-color-comment-tag-text: var(--light-color-text); + --light-color-comment-tag: var(--light-color-background); + + --light-color-link: #1f70c2; + --light-color-focus-outline: #3584e4; + + --light-color-ts-keyword: #056bd6; + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; + --light-color-ts-function: #572be7; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: #4d7fff; + --light-color-ts-property: #ff984d; + --light-color-ts-method: #ff4db8; + --light-color-ts-reference: #ff4d82; + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var(--light-color-ts-constructor); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: #a55c0e; + --light-color-ts-accessor: #ff4d4d; + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + --light-color-document: #000000; + + --light-external-icon: url("data:image/svg+xml;utf8,"); + --light-color-scheme: light; + + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; + --dark-color-text: #f5f5f5; + --dark-color-text-aside: #dddddd; + + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-icon-text: var(--dark-color-text); + + --dark-color-comment-tag-text: var(--dark-color-text); + --dark-color-comment-tag: var(--dark-color-background); + + --dark-color-link: #00aff4; + --dark-color-focus-outline: #4c97f2; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: #4d7fff; + --dark-color-ts-property: #ff984d; + --dark-color-ts-method: #ff4db8; + --dark-color-ts-reference: #ff4d82; + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: #e07d13; + --dark-color-ts-accessor: #ff4d4d; + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + --dark-color-document: #ffffff; + + --dark-external-icon: url("data:image/svg+xml;utf8,"); + --dark-color-scheme: dark; +} + +@media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + + --color-icon-background: var(--light-color-icon-background); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + + --color-icon-background: var(--dark-color-icon-background); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } +} + +html { + color-scheme: var(--color-scheme); +} + +body { + margin: 0; +} + +:root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); +} + +:root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); +} + +*:focus-visible, +.tsd-accordion-summary:focus-visible svg { + outline: 2px solid var(--color-focus-outline); +} + +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.2; +} + +h1 { + font-size: 1.875rem; + margin: 0.67rem 0; +} + +h2 { + font-size: 1.5rem; + margin: 0.83rem 0; +} + +h3 { + font-size: 1.25rem; + margin: 1rem 0; +} + +h4 { + font-size: 1.05rem; + margin: 1.33rem 0; +} + +h5 { + font-size: 1rem; + margin: 1.5rem 0; +} + +h6 { + font-size: 0.875rem; + margin: 2.33rem 0; +} + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +.container { + max-width: 1700px; + padding: 0 2rem; +} + +/* Footer */ +footer { + border-top: 1px solid var(--color-accent); + padding-top: 1rem; + padding-bottom: 1rem; + max-height: 3.5rem; +} +footer > p { + margin: 0 1em; +} + +.container-main { + margin: 0 auto; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } +} +@keyframes fade-in-delayed { + 0% { + opacity: 0; + } + 33% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes fade-out-delayed { + 0% { + opacity: 1; + visibility: visible; + } + 66% { + opacity: 0; + } + 100% { + opacity: 0; + } +} +@keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } +} +@keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } +} +body { + background: var(--color-background); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + font-size: 16px; + color: var(--color-text); +} + +a { + color: var(--color-link); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; +} +a.tsd-anchor-link { + color: var(--color-text); +} + +code, +pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; +} + +pre { + position: relative; + white-space: pre-wrap; + word-wrap: break-word; + padding: 10px; + border: 1px solid var(--color-accent); +} +pre code { + padding: 0; + font-size: 100%; +} +pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; +} +pre:hover > button, +pre > button.visible { + opacity: 1; +} + +blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; +} + +.tsd-typography { + line-height: 1.333em; +} +.tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; +} +.tsd-typography .tsd-index-panel h3, +.tsd-index-panel .tsd-typography h3, +.tsd-typography h4, +.tsd-typography h5, +.tsd-typography h6 { + font-size: 1em; +} +.tsd-typography h5, +.tsd-typography h6 { + font-weight: normal; +} +.tsd-typography p, +.tsd-typography ul, +.tsd-typography ol { + margin: 1em 0; +} +.tsd-typography table { + border-collapse: collapse; + border: none; +} +.tsd-typography td, +.tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); +} +.tsd-typography thead, +.tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); +} + +.tsd-breadcrumb { + margin: 0; + padding: 0; + color: var(--color-text-aside); +} +.tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; +} +.tsd-breadcrumb a:hover { + text-decoration: underline; +} +.tsd-breadcrumb li { + display: inline; +} +.tsd-breadcrumb li:after { + content: " / "; +} + +.tsd-comment-tags { + display: flex; + flex-direction: column; +} +dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; +} +dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; +} +dl.tsd-comment-tag-group dd { + margin: 0; +} +code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; +} +h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; +} + +dl.tsd-comment-tag-group dd:before, +dl.tsd-comment-tag-group dd:after { + content: " "; +} +dl.tsd-comment-tag-group dd pre, +dl.tsd-comment-tag-group dd:after { + clear: both; +} +dl.tsd-comment-tag-group p { + margin: 0; +} + +.tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; +} +.tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; +} + +.tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; +} +.tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; +} +.tsd-filter-input { + display: flex; + width: -moz-fit-content; + width: fit-content; + align-items: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; +} +.tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; +} +.tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; +} +.tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; +} +.tsd-filter-input input[type="checkbox"]:focus-visible + svg { + outline: 2px solid var(--color-focus-outline); +} +.tsd-checkbox-background { + fill: var(--color-accent); +} +input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); +} + +.settings-label { + font-weight: bold; + text-transform: uppercase; + display: inline-block; +} + +.tsd-filter-visibility .settings-label { + margin: 0.75rem 0 0.5rem 0; +} + +.tsd-theme-toggle .settings-label { + margin: 0.75rem 0.75rem 0 0; +} + +.tsd-hierarchy { + list-style: square; + margin: 0; +} +.tsd-hierarchy .target { + font-weight: bold; +} + +.tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); +} +.tsd-full-hierarchy, +.tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; +} +.tsd-full-hierarchy ul { + padding-left: 1.5rem; +} +.tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} + +.tsd-panel-group.tsd-index-group { + margin-bottom: 0; +} +.tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; +} +@media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } +} +.tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; +} + +.tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; +} + +.tsd-anchor { + position: relative; + top: -100px; +} + +.tsd-member { + position: relative; +} +.tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; +} + +.tsd-navigation.settings { + margin: 1rem 0; +} +.tsd-navigation > a, +.tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; +} +.tsd-navigation a, +.tsd-navigation summary > span, +.tsd-page-navigation a { + display: flex; + width: calc(100% - 0.25rem); + align-items: center; + padding: 0.25rem; + color: var(--color-text); + text-decoration: none; + box-sizing: border-box; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); +} +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { + text-decoration: underline; +} +.tsd-navigation ul, +.tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; + padding: 0; + list-style: none; +} +.tsd-navigation li, +.tsd-page-navigation li { + padding: 0; + max-width: 100%; +} +.tsd-navigation .tsd-nav-link { + display: none; +} +.tsd-nested-navigation { + margin-left: 3rem; +} +.tsd-nested-navigation > li > details { + margin-left: -1.5rem; +} +.tsd-small-nested-navigation { + margin-left: 1.5rem; +} +.tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; +} + +.tsd-page-navigation-section { + margin-left: 10px; +} +.tsd-page-navigation-section > summary { + padding: 0.25rem; +} +.tsd-page-navigation-section > div { + margin-left: 20px; +} +.tsd-page-navigation ul { + padding-left: 1.75rem; +} + +#tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; +} +#tsd-sidebar-links a:last-of-type { + margin-bottom: 0; +} + +a.tsd-index-link { + padding: 0.25rem 0 !important; + font-size: 1rem; + line-height: 1.25rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} +.tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ +} +.tsd-accordion-summary, +.tsd-accordion-summary a { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + + cursor: pointer; +} +.tsd-accordion-summary a { + width: calc(100% - 1.5rem); +} +.tsd-accordion-summary > * { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; +} +.tsd-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; + vertical-align: text-top; +} +.tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; +} +.tsd-index-heading { + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.tsd-no-select { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; +} +.tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; +} + +.tsd-panel { + margin-bottom: 2.5rem; +} +.tsd-panel.tsd-member { + margin-bottom: 4rem; +} +.tsd-panel:empty { + display: none; +} +.tsd-panel > h1, +.tsd-panel > h2, +.tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; +} +.tsd-panel > h1.tsd-before-signature, +.tsd-panel > h2.tsd-before-signature, +.tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; +} + +.tsd-panel-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group details { + margin: 2rem 0; +} +.tsd-panel-group > .tsd-accordion-summary { + margin-bottom: 1rem; +} + +#tsd-search { + transition: background-color 0.2s; +} +#tsd-search .title { + position: relative; + z-index: 2; +} +#tsd-search .field { + position: absolute; + left: 0; + top: 0; + right: 2.5rem; + height: 100%; +} +#tsd-search .field input { + box-sizing: border-box; + position: relative; + top: -50px; + z-index: 1; + width: 100%; + padding: 0 10px; + opacity: 0; + outline: 0; + border: 0; + background: transparent; + color: var(--color-text); +} +#tsd-search .field label { + position: absolute; + overflow: hidden; + right: -40px; +} +#tsd-search .field input, +#tsd-search .title, +#tsd-toolbar-links a { + transition: opacity 0.2s; +} +#tsd-search .results { + position: absolute; + visibility: hidden; + top: 40px; + width: 100%; + margin: 0; + padding: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); +} +#tsd-search .results li { + background-color: var(--color-background); + line-height: initial; + padding: 4px; +} +#tsd-search .results li:nth-child(even) { + background-color: var(--color-background-secondary); +} +#tsd-search .results li.state { + display: none; +} +#tsd-search .results li.current:not(.no-results), +#tsd-search .results li:hover:not(.no-results) { + background-color: var(--color-accent); +} +#tsd-search .results a { + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; +} +#tsd-search .results a:before { + top: 10px; +} +#tsd-search .results span.parent { + color: var(--color-text-aside); + font-weight: normal; +} +#tsd-search.has-focus { + background-color: var(--color-accent); +} +#tsd-search.has-focus .field input { + top: 0; + opacity: 1; +} +#tsd-search.has-focus .title, +#tsd-search.has-focus #tsd-toolbar-links a { + z-index: 0; + opacity: 0; +} +#tsd-search.has-focus .results { + visibility: visible; +} +#tsd-search.loading .results li.state.loading { + display: block; +} +#tsd-search.failure .results li.state.failure { + display: block; +} + +#tsd-toolbar-links { + position: absolute; + top: 0; + right: 2rem; + height: 100%; + display: flex; + align-items: center; + justify-content: flex-end; +} +#tsd-toolbar-links a { + margin-left: 1.5rem; +} +#tsd-toolbar-links a:hover { + text-decoration: underline; +} + +.tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + overflow-x: auto; +} + +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + +.tsd-signature-symbol { + color: var(--color-text-aside); + font-weight: normal; +} + +.tsd-signature-type { + font-style: italic; + font-weight: normal; +} + +.tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; +} +.tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; +} +.tsd-signatures .tsd-index-signature:not(:last-child) { + margin-bottom: 1em; +} +.tsd-signatures .tsd-index-signature .tsd-signature { + border-width: 1px; +} +.tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; +} + +ul.tsd-parameter-list, +ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; +} +ul.tsd-parameter-list > li.tsd-parameter-signature, +ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; +} +ul.tsd-parameter-list h5, +ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; +} +.tsd-sources { + margin-top: 1rem; + font-size: 0.875em; +} +.tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; +} +.tsd-sources ul { + list-style: none; + padding: 0; +} + +.tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: 1px var(--color-accent) solid; + transition: transform 0.3s ease-in-out; +} +.tsd-page-toolbar a { + color: var(--color-text); + text-decoration: none; +} +.tsd-page-toolbar a.title { + font-weight: bold; +} +.tsd-page-toolbar a.title:hover { + text-decoration: underline; +} +.tsd-page-toolbar .tsd-toolbar-contents { + display: flex; + justify-content: space-between; + height: 2.5rem; + margin: 0 auto; +} +.tsd-page-toolbar .table-cell { + position: relative; + white-space: nowrap; + line-height: 40px; +} +.tsd-page-toolbar .table-cell:first-child { + width: 100%; +} +.tsd-page-toolbar .tsd-toolbar-icon { + box-sizing: border-box; + line-height: 0; + padding: 12px 0; +} + +.tsd-widget { + display: inline-block; + overflow: hidden; + opacity: 0.8; + height: 40px; + transition: + opacity 0.1s, + background-color 0.2s; + vertical-align: bottom; + cursor: pointer; +} +.tsd-widget:hover { + opacity: 0.9; +} +.tsd-widget.active { + opacity: 1; + background-color: var(--color-accent); +} +.tsd-widget.no-caption { + width: 40px; +} +.tsd-widget.no-caption:before { + margin: 0; +} + +.tsd-widget.options, +.tsd-widget.menu { + display: none; +} +input[type="checkbox"] + .tsd-widget:before { + background-position: -120px 0; +} +input[type="checkbox"]:checked + .tsd-widget:before { + background-position: -160px 0; +} + +img { + max-width: 100%; +} + +.tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + vertical-align: middle; + color: var(--color-text); +} + +.tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; +} + +.tsd-anchor-link:hover > .tsd-anchor-icon svg { + visibility: visible; +} + +.deprecated { + text-decoration: line-through !important; +} + +.warning { + padding: 1rem; + color: var(--color-warning-text); + background: var(--color-background-warning); +} + +.tsd-kind-project { + color: var(--color-ts-project); +} +.tsd-kind-module { + color: var(--color-ts-module); +} +.tsd-kind-namespace { + color: var(--color-ts-namespace); +} +.tsd-kind-enum { + color: var(--color-ts-enum); +} +.tsd-kind-enum-member { + color: var(--color-ts-enum-member); +} +.tsd-kind-variable { + color: var(--color-ts-variable); +} +.tsd-kind-function { + color: var(--color-ts-function); +} +.tsd-kind-class { + color: var(--color-ts-class); +} +.tsd-kind-interface { + color: var(--color-ts-interface); +} +.tsd-kind-constructor { + color: var(--color-ts-constructor); +} +.tsd-kind-property { + color: var(--color-ts-property); +} +.tsd-kind-method { + color: var(--color-ts-method); +} +.tsd-kind-reference { + color: var(--color-ts-reference); +} +.tsd-kind-call-signature { + color: var(--color-ts-call-signature); +} +.tsd-kind-index-signature { + color: var(--color-ts-index-signature); +} +.tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); +} +.tsd-kind-parameter { + color: var(--color-ts-parameter); +} +.tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); +} +.tsd-kind-accessor { + color: var(--color-ts-accessor); +} +.tsd-kind-get-signature { + color: var(--color-ts-get-signature); +} +.tsd-kind-set-signature { + color: var(--color-ts-set-signature); +} +.tsd-kind-type-alias { + color: var(--color-ts-type-alias); +} + +/* if we have a kind icon, don't color the text by kind */ +.tsd-kind-icon ~ span { + color: var(--color-text); +} + +* { + scrollbar-width: thin; + scrollbar-color: var(--color-accent) var(--color-icon-background); +} + +*::-webkit-scrollbar { + width: 0.75rem; +} + +*::-webkit-scrollbar-track { + background: var(--color-icon-background); +} + +*::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + border-radius: 999rem; + border: 0.25rem solid var(--color-icon-background); +} + +/* mobile */ +@media (max-width: 769px) { + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } + + .container-main { + display: flex; + } + html .col-content { + float: none; + max-width: 100%; + width: 100%; + } + html .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + html .col-sidebar > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } + #tsd-toolbar-links { + display: none; + } + .tsd-navigation .tsd-nav-link { + display: flex; + } +} + +/* one sidebar */ +@media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + margin: 2rem auto; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } +} +@media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + padding-top: 1rem; + } + .site-menu { + margin-top: 1rem; + } +} + +/* two sidebars */ +@media (min-width: 1200px) { + .container-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 20rem); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 1rem; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/packages/gleequore/docs/reference/classes/errors.default.html b/packages/gleequore/docs/reference/classes/errors.default.html new file mode 100644 index 000000000..7596b9e8f --- /dev/null +++ b/packages/gleequore/docs/reference/classes/errors.default.html @@ -0,0 +1,13 @@ +default | @asyncapi/gleequore

    Hierarchy

    • Error
      • default

    Constructors

    • Parameters

      • __namedParameters: {
            errors: any;
            humanReadableError: any;
        }
        • errors: any
        • humanReadableError: any

      Returns default

    Properties

    message: string
    name: string
    stack?: string
    prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

    Optional override for formatting stack traces

    +
    stackTraceLimit: number

    Accessors

    Methods

    • Create .stack property on a target object

      +

      Parameters

      • targetObject: object
      • OptionalconstructorOpt: Function

      Returns void

    diff --git a/packages/gleequore/docs/reference/classes/index-1.default.html b/packages/gleequore/docs/reference/classes/index-1.default.html new file mode 100644 index 000000000..57bc9aab1 --- /dev/null +++ b/packages/gleequore/docs/reference/classes/index-1.default.html @@ -0,0 +1,62 @@ +default | @asyncapi/gleequore

    Constructors

    Accessors

    Methods

    • Adds a connection adapter.

      +

      Parameters

      • Adapter: typeof default
      • serverName: string

        The name of the AsyncAPI Server to use with the adapter.

        +
      • Optionalconfig: object

        The configuration for the adapter.

        +

      Returns void

    • Injects an error into the Glee inbound error middleware chain.

      +

      Parameters

      • error: Error

        The error.

        +
      • Optionalchannel: string

        The channel of the error.

        +

      Returns void

    • Injects a message into the Glee inbound middleware chain.

      +

      Parameters

      • message: default

        The message you want to send.

        +
      • serverName: string

        The name of the server this message is coming from.

        +
      • Optionalconnection: default

        The connection used when receiving the message. Its type is unknown and must be handled by the adapters.

        +

      Returns void

    • Parameters

      • errorCallback: ((err: Error) => void)
          • (err): void
          • Parameters

            • err: Error

            Returns void

      Returns Promise<void>

    • Sets the cluster adapter to use.

      +

      Parameters

      • Adapter: typeof default
      • OptionalclusterName: string = 'cluster'

        The name of the cluster.

        +
      • OptionalclusterURL: string

        The URL of the cluster.

        +

      Returns void

    diff --git a/packages/gleequore/docs/reference/classes/lib_adapter.default.html b/packages/gleequore/docs/reference/classes/lib_adapter.default.html new file mode 100644 index 000000000..02b4e1265 --- /dev/null +++ b/packages/gleequore/docs/reference/classes/lib_adapter.default.html @@ -0,0 +1,295 @@ +default | @asyncapi/gleequore

    Hierarchy

    • EventEmitter
      • default

    Constructors

    Properties

    captureRejections: boolean

    Value: boolean

    +

    Change the default captureRejections option on all new EventEmitter objects.

    +

    v13.4.0, v12.16.0

    +
    captureRejectionSymbol: typeof captureRejectionSymbol

    Value: Symbol.for('nodejs.rejection')

    +

    See how to write a custom rejection handler.

    +

    v13.4.0, v12.16.0

    +
    defaultMaxListeners: number

    By default, a maximum of 10 listeners can be registered for any single +event. This limit can be changed for individual EventEmitter instances +using the emitter.setMaxListeners(n) method. To change the default +for allEventEmitter instances, the events.defaultMaxListeners property +can be used. If this value is not a positive number, a RangeError is thrown.

    +

    Take caution when setting the events.defaultMaxListeners because the +change affects all EventEmitter instances, including those created before +the change is made. However, calling emitter.setMaxListeners(n) still has +precedence over events.defaultMaxListeners.

    +

    This is not a hard limit. The EventEmitter instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a "possible EventEmitter memory leak" has been detected. For any single +EventEmitter, the emitter.getMaxListeners() and emitter.setMaxListeners() methods can be used to +temporarily avoid this warning:

    +
    import { EventEmitter } from 'node:events';
    const emitter = new EventEmitter();
    emitter.setMaxListeners(emitter.getMaxListeners() + 1);
    emitter.once('event', () => {
    // do stuff
    emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
    }); +
    + +

    The --trace-warnings command-line flag can be used to display the +stack trace for such warnings.

    +

    The emitted warning can be inspected with process.on('warning') and will +have the additional emitter, type, and count properties, referring to +the event emitter instance, the event's name and the number of attached +listeners, respectively. +Its name property is set to 'MaxListenersExceededWarning'.

    +

    v0.11.2

    +
    errorMonitor: typeof errorMonitor

    This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

    +

    Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no +regular 'error' listener is installed.

    +

    v13.6.0, v12.17.0

    +

    Accessors

    Methods

    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest...args: AnyRest

      Returns void

    • Alias for emitter.on(eventName, listener).

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.26

      +
    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +to each.

      +

      Returns true if the event had listeners, false otherwise.

      +
      import { EventEmitter } from 'node:events';
      const myEmitter = new EventEmitter();

      // First listener
      myEmitter.on('event', function firstListener() {
      console.log('Helloooo! first listener');
      });
      // Second listener
      myEmitter.on('event', function secondListener(arg1, arg2) {
      console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
      });
      // Third listener
      myEmitter.on('event', function thirdListener(...args) {
      const parameters = args.join(', ');
      console.log(`event with parameters ${parameters} in third listener`);
      });

      console.log(myEmitter.listeners('event'));

      myEmitter.emit('event', 1, 2, 3, 4, 5);

      // Prints:
      // [
      // [Function: firstListener],
      // [Function: secondListener],
      // [Function: thirdListener]
      // ]
      // Helloooo! first listener
      // event with parameters 1, 2 in second listener
      // event with parameters 1, 2, 3, 4, 5 in third listener +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • Rest...args: AnyRest

      Returns boolean

      v0.1.26

      +
    • Returns an array listing the events for which the emitter has registered +listeners. The values in the array are strings or Symbols.

      +
      import { EventEmitter } from 'node:events';

      const myEE = new EventEmitter();
      myEE.on('foo', () => {});
      myEE.on('bar', () => {});

      const sym = Symbol('symbol');
      myEE.on(sym, () => {});

      console.log(myEE.eventNames());
      // Prints: [ 'foo', 'bar', Symbol(symbol) ] +
      + +

      Returns (string | symbol)[]

      v6.0.0

      +
    • Returns the current max listener value for the EventEmitter which is either +set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

      +

      Returns number

      v1.0.0

      +
    • Returns the number of listeners listening for the event named eventName. +If listener is provided, it will return how many times the listener is found +in the list of the listeners of the event.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event being listened for

        +
      • Optionallistener: Function

        The event handler function

        +

      Returns number

      v3.2.0

      +
    • Returns a copy of the array of listeners for the event named eventName.

      +
      server.on('connection', (stream) => {
      console.log('someone connected!');
      });
      console.log(util.inspect(server.listeners('connection')));
      // Prints: [ [Function] ] +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      +
    • Alias for emitter.removeListener().

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v10.0.0

      +
    • Adds the listener function to the end of the listeners array for the event +named eventName. No checks are made to see if the listener has already +been added. Multiple calls passing the same combination of eventName and +listener will result in the listener being added, and called, multiple times.

      +
      server.on('connection', (stream) => {
      console.log('someone connected!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

      +
      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.on('foo', () => console.log('a'));
      myEE.prependListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.101

      +
    • Adds a one-time listener function for the event named eventName. The +next time eventName is triggered, this listener is removed and then invoked.

      +
      server.once('connection', (stream) => {
      console.log('Ah, we have our first user!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      By default, event listeners are invoked in the order they are added. The emitter.prependOnceListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

      +
      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.once('foo', () => console.log('a'));
      myEE.prependOnceListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.3.0

      +
    • Adds the listener function to the beginning of the listeners array for the +event named eventName. No checks are made to see if the listener has +already been added. Multiple calls passing the same combination of eventName +and listener will result in the listener being added, and called, multiple times.

      +
      server.prependListener('connection', (stream) => {
      console.log('someone connected!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v6.0.0

      +
    • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this +listener is removed, and then invoked.

      +
      server.prependOnceListener('connection', (stream) => {
      console.log('Ah, we have our first user!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v6.0.0

      +
    • Returns a copy of the array of listeners for the event named eventName, +including any wrappers (such as those created by .once()).

      +
      import { EventEmitter } from 'node:events';
      const emitter = new EventEmitter();
      emitter.once('log', () => console.log('log once'));

      // Returns a new Array with a function `onceWrapper` which has a property
      // `listener` which contains the original listener bound above
      const listeners = emitter.rawListeners('log');
      const logFnWrapper = listeners[0];

      // Logs "log once" to the console and does not unbind the `once` event
      logFnWrapper.listener();

      // Logs "log once" to the console and removes the listener
      logFnWrapper();

      emitter.on('log', () => console.log('log persistently'));
      // Will return a new Array with a single function bound by `.on()` above
      const newListeners = emitter.rawListeners('log');

      // Logs "log persistently" twice
      newListeners[0]();
      emitter.emit('log'); +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v9.4.0

      +
    • Removes all listeners, or those of the specified eventName.

      +

      It is bad practice to remove listeners added elsewhere in the code, +particularly when the EventEmitter instance was created by some other +component or module (e.g. sockets or file streams).

      +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Parameters

      • OptionaleventName: string | symbol

      Returns this

      v0.1.26

      +
    • Removes the specified listener from the listener array for the event named eventName.

      +
      const callback = (stream) => {
      console.log('someone connected!');
      };
      server.on('connection', callback);
      // ...
      server.removeListener('connection', callback); +
      + +

      removeListener() will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified eventName, then removeListener() must be +called multiple times to remove each instance.

      +

      Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution +will not remove them fromemit() in progress. Subsequent events behave as expected.

      +
      import { EventEmitter } from 'node:events';
      class MyEmitter extends EventEmitter {}
      const myEmitter = new MyEmitter();

      const callbackA = () => {
      console.log('A');
      myEmitter.removeListener('event', callbackB);
      };

      const callbackB = () => {
      console.log('B');
      };

      myEmitter.on('event', callbackA);

      myEmitter.on('event', callbackB);

      // callbackA removes listener callbackB but it will still be called.
      // Internal listener array at time of emit [callbackA, callbackB]
      myEmitter.emit('event');
      // Prints:
      // A
      // B

      // callbackB is now removed.
      // Internal listener array [callbackA]
      myEmitter.emit('event');
      // Prints:
      // A +
      + +

      Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered after the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the emitter.listeners() method will need to be recreated.

      +

      When a single function has been added as a handler multiple times for a single +event (as in the example below), removeListener() will remove the most +recently added instance. In the example the once('ping') listener is removed:

      +
      import { EventEmitter } from 'node:events';
      const ee = new EventEmitter();

      function pong() {
      console.log('pong');
      }

      ee.on('ping', pong);
      ee.once('ping', pong);
      ee.removeListener('ping', pong);

      ee.emit('ping');
      ee.emit('ping'); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.26

      +
    • By default EventEmitters will print a warning if more than 10 listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The emitter.setMaxListeners() method allows the limit to be +modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

      +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Parameters

      • n: number

      Returns this

      v0.3.5

      +
    • Parameters

      • data: any
      • schema: object
      • triggerError: boolean = false

      Returns {
          errors: void | IOutputError[];
          humanReadableError: void | IOutputError[];
          isValid: boolean | PromiseLike<any>;
      }

      • errors: void | IOutputError[]
      • humanReadableError: void | IOutputError[]
      • isValid: boolean | PromiseLike<any>
    • Experimental

      Listens once to the abort event on the provided signal.

      +

      Listening to the abort event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call e.stopImmediatePropagation(). Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners.

      +

      This API allows safely using AbortSignals in Node.js APIs by solving these +two issues by listening to the event such that stopImmediatePropagation does +not prevent the listener from running.

      +

      Returns a disposable so that it may be unsubscribed from more easily.

      +
      import { addAbortListener } from 'node:events';

      function example(signal) {
      let disposable;
      try {
      signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
      disposable = addAbortListener(signal, (e) => {
      // Do something when signal is aborted.
      });
      } finally {
      disposable?.[Symbol.dispose]();
      }
      } +
      + +

      Parameters

      • signal: AbortSignal
      • resource: ((event: Event) => void)
          • (event): void
          • Parameters

            • event: Event

            Returns void

      Returns Disposable

      Disposable that removes the abort listener.

      +

      v20.5.0

      +
    • Returns a copy of the array of listeners for the event named eventName.

      +

      For EventEmitters this behaves exactly the same as calling .listeners on +the emitter.

      +

      For EventTargets this is the only way to get the event listeners for the +event target. This is useful for debugging and diagnostic purposes.

      +
      import { getEventListeners, EventEmitter } from 'node:events';

      {
      const ee = new EventEmitter();
      const listener = () => console.log('Events are fun');
      ee.on('foo', listener);
      console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
      }
      {
      const et = new EventTarget();
      const listener = () => console.log('Events are fun');
      et.addEventListener('foo', listener);
      console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
      } +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap> | EventTarget
      • name: string | symbol

      Returns Function[]

      v15.2.0, v14.17.0

      +
    • Returns the currently set max amount of listeners.

      +

      For EventEmitters this behaves exactly the same as calling .getMaxListeners on +the emitter.

      +

      For EventTargets this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning.

      +
      import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';

      {
      const ee = new EventEmitter();
      console.log(getMaxListeners(ee)); // 10
      setMaxListeners(11, ee);
      console.log(getMaxListeners(ee)); // 11
      }
      {
      const et = new EventTarget();
      console.log(getMaxListeners(et)); // 10
      setMaxListeners(11, et);
      console.log(getMaxListeners(et)); // 11
      } +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap> | EventTarget

      Returns number

      v19.9.0

      +
    • A class method that returns the number of listeners for the given eventName registered on the given emitter.

      +
      import { EventEmitter, listenerCount } from 'node:events';

      const myEmitter = new EventEmitter();
      myEmitter.on('event', () => {});
      myEmitter.on('event', () => {});
      console.log(listenerCount(myEmitter, 'event'));
      // Prints: 2 +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>

        The emitter to query

        +
      • eventName: string | symbol

        The event name

        +

      Returns number

      v0.9.12

      +

      Since v3.2.0 - Use listenerCount instead.

      +
    • import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      });

      for await (const event of on(ee, 'foo')) {
      // The execution of this inner block is synchronous and it
      // processes one event at a time (even with await). Do not use
      // if concurrent execution is required.
      console.log(event); // prints ['bar'] [42]
      }
      // Unreachable here +
      + +

      Returns an AsyncIterator that iterates eventName events. It will throw +if the EventEmitter emits 'error'. It removes all listeners when +exiting the loop. The value returned by each iteration is an array +composed of the emitted event arguments.

      +

      An AbortSignal can be used to cancel waiting on events:

      +
      import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ac = new AbortController();

      (async () => {
      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      });

      for await (const event of on(ee, 'foo', { signal: ac.signal })) {
      // The execution of this inner block is synchronous and it
      // processes one event at a time (even with await). Do not use
      // if concurrent execution is required.
      console.log(event); // prints ['bar'] [42]
      }
      // Unreachable here
      })();

      process.nextTick(() => ac.abort()); +
      + +

      Use the close option to specify an array of event names that will end the iteration:

      +
      import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      ee.emit('close');
      });

      for await (const event of on(ee, 'foo', { close: ['close'] })) {
      console.log(event); // prints ['bar'] [42]
      }
      // the loop will exit after 'close' is emitted
      console.log('done'); // prints 'done' +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>
      • eventName: string | symbol
      • Optionaloptions: StaticEventEmitterIteratorOptions

      Returns AsyncIterator<any[], any, any>

      An AsyncIterator that iterates eventName events emitted by the emitter

      +

      v13.6.0, v12.16.0

      +
    • Parameters

      • emitter: EventTarget
      • eventName: string
      • Optionaloptions: StaticEventEmitterIteratorOptions

      Returns AsyncIterator<any[], any, any>

    • Creates a Promise that is fulfilled when the EventEmitter emits the given +event or that is rejected if the EventEmitter emits 'error' while waiting. +The Promise will resolve with an array of all the arguments emitted to the +given event.

      +

      This method is intentionally generic and works with the web platform EventTarget interface, which has no special'error' event +semantics and does not listen to the 'error' event.

      +
      import { once, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      process.nextTick(() => {
      ee.emit('myevent', 42);
      });

      const [value] = await once(ee, 'myevent');
      console.log(value);

      const err = new Error('kaboom');
      process.nextTick(() => {
      ee.emit('error', err);
      });

      try {
      await once(ee, 'myevent');
      } catch (err) {
      console.error('error happened', err);
      } +
      + +

      The special handling of the 'error' event is only used when events.once() is used to wait for another event. If events.once() is used to wait for the +'error' event itself, then it is treated as any other kind of event without +special handling:

      +
      import { EventEmitter, once } from 'node:events';

      const ee = new EventEmitter();

      once(ee, 'error')
      .then(([err]) => console.log('ok', err.message))
      .catch((err) => console.error('error', err.message));

      ee.emit('error', new Error('boom'));

      // Prints: ok boom +
      + +

      An AbortSignal can be used to cancel waiting for the event:

      +
      import { EventEmitter, once } from 'node:events';

      const ee = new EventEmitter();
      const ac = new AbortController();

      async function foo(emitter, event, signal) {
      try {
      await once(emitter, event, { signal });
      console.log('event emitted!');
      } catch (error) {
      if (error.name === 'AbortError') {
      console.error('Waiting for the event was canceled!');
      } else {
      console.error('There was an error', error.message);
      }
      }
      }

      foo(ee, 'foo', ac.signal);
      ac.abort(); // Abort waiting for the event
      ee.emit('foo'); // Prints: Waiting for the event was canceled! +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>
      • eventName: string | symbol
      • Optionaloptions: StaticEventEmitterOptions

      Returns Promise<any[]>

      v11.13.0, v10.16.0

      +
    • Parameters

      • emitter: EventTarget
      • eventName: string
      • Optionaloptions: StaticEventEmitterOptions

      Returns Promise<any[]>

    • import { setMaxListeners, EventEmitter } from 'node:events';

      const target = new EventTarget();
      const emitter = new EventEmitter();

      setMaxListeners(5, target, emitter); +
      + +

      Parameters

      • Optionaln: number

        A non-negative number. The maximum number of listeners per EventTarget event.

        +
      • Rest...eventTargets: (EventEmitter<DefaultEventMap> | EventTarget)[]

        Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, n is set as the default max for all newly created {EventTarget} and {EventEmitter} +objects.

        +

      Returns void

      v15.4.0

      +
    diff --git a/packages/gleequore/docs/reference/classes/lib_cluster.default.html b/packages/gleequore/docs/reference/classes/lib_cluster.default.html new file mode 100644 index 000000000..95e6735d0 --- /dev/null +++ b/packages/gleequore/docs/reference/classes/lib_cluster.default.html @@ -0,0 +1,295 @@ +default | @asyncapi/gleequore

    Hierarchy

    • EventEmitter
      • default

    Constructors

    Properties

    captureRejections: boolean

    Value: boolean

    +

    Change the default captureRejections option on all new EventEmitter objects.

    +

    v13.4.0, v12.16.0

    +
    captureRejectionSymbol: typeof captureRejectionSymbol

    Value: Symbol.for('nodejs.rejection')

    +

    See how to write a custom rejection handler.

    +

    v13.4.0, v12.16.0

    +
    defaultMaxListeners: number

    By default, a maximum of 10 listeners can be registered for any single +event. This limit can be changed for individual EventEmitter instances +using the emitter.setMaxListeners(n) method. To change the default +for allEventEmitter instances, the events.defaultMaxListeners property +can be used. If this value is not a positive number, a RangeError is thrown.

    +

    Take caution when setting the events.defaultMaxListeners because the +change affects all EventEmitter instances, including those created before +the change is made. However, calling emitter.setMaxListeners(n) still has +precedence over events.defaultMaxListeners.

    +

    This is not a hard limit. The EventEmitter instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a "possible EventEmitter memory leak" has been detected. For any single +EventEmitter, the emitter.getMaxListeners() and emitter.setMaxListeners() methods can be used to +temporarily avoid this warning:

    +
    import { EventEmitter } from 'node:events';
    const emitter = new EventEmitter();
    emitter.setMaxListeners(emitter.getMaxListeners() + 1);
    emitter.once('event', () => {
    // do stuff
    emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
    }); +
    + +

    The --trace-warnings command-line flag can be used to display the +stack trace for such warnings.

    +

    The emitted warning can be inspected with process.on('warning') and will +have the additional emitter, type, and count properties, referring to +the event emitter instance, the event's name and the number of attached +listeners, respectively. +Its name property is set to 'MaxListenersExceededWarning'.

    +

    v0.11.2

    +
    errorMonitor: typeof errorMonitor

    This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

    +

    Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no +regular 'error' listener is installed.

    +

    v13.6.0, v12.17.0

    +

    Accessors

    Methods

    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest...args: AnyRest

      Returns void

    • Alias for emitter.on(eventName, listener).

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.26

      +
    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +to each.

      +

      Returns true if the event had listeners, false otherwise.

      +
      import { EventEmitter } from 'node:events';
      const myEmitter = new EventEmitter();

      // First listener
      myEmitter.on('event', function firstListener() {
      console.log('Helloooo! first listener');
      });
      // Second listener
      myEmitter.on('event', function secondListener(arg1, arg2) {
      console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
      });
      // Third listener
      myEmitter.on('event', function thirdListener(...args) {
      const parameters = args.join(', ');
      console.log(`event with parameters ${parameters} in third listener`);
      });

      console.log(myEmitter.listeners('event'));

      myEmitter.emit('event', 1, 2, 3, 4, 5);

      // Prints:
      // [
      // [Function: firstListener],
      // [Function: secondListener],
      // [Function: thirdListener]
      // ]
      // Helloooo! first listener
      // event with parameters 1, 2 in second listener
      // event with parameters 1, 2, 3, 4, 5 in third listener +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • Rest...args: AnyRest

      Returns boolean

      v0.1.26

      +
    • Returns an array listing the events for which the emitter has registered +listeners. The values in the array are strings or Symbols.

      +
      import { EventEmitter } from 'node:events';

      const myEE = new EventEmitter();
      myEE.on('foo', () => {});
      myEE.on('bar', () => {});

      const sym = Symbol('symbol');
      myEE.on(sym, () => {});

      console.log(myEE.eventNames());
      // Prints: [ 'foo', 'bar', Symbol(symbol) ] +
      + +

      Returns (string | symbol)[]

      v6.0.0

      +
    • Returns the current max listener value for the EventEmitter which is either +set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

      +

      Returns number

      v1.0.0

      +
    • Returns the number of listeners listening for the event named eventName. +If listener is provided, it will return how many times the listener is found +in the list of the listeners of the event.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event being listened for

        +
      • Optionallistener: Function

        The event handler function

        +

      Returns number

      v3.2.0

      +
    • Returns a copy of the array of listeners for the event named eventName.

      +
      server.on('connection', (stream) => {
      console.log('someone connected!');
      });
      console.log(util.inspect(server.listeners('connection')));
      // Prints: [ [Function] ] +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      +
    • Alias for emitter.removeListener().

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v10.0.0

      +
    • Adds the listener function to the end of the listeners array for the event +named eventName. No checks are made to see if the listener has already +been added. Multiple calls passing the same combination of eventName and +listener will result in the listener being added, and called, multiple times.

      +
      server.on('connection', (stream) => {
      console.log('someone connected!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

      +
      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.on('foo', () => console.log('a'));
      myEE.prependListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.101

      +
    • Adds a one-time listener function for the event named eventName. The +next time eventName is triggered, this listener is removed and then invoked.

      +
      server.once('connection', (stream) => {
      console.log('Ah, we have our first user!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      By default, event listeners are invoked in the order they are added. The emitter.prependOnceListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

      +
      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.once('foo', () => console.log('a'));
      myEE.prependOnceListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.3.0

      +
    • Adds the listener function to the beginning of the listeners array for the +event named eventName. No checks are made to see if the listener has +already been added. Multiple calls passing the same combination of eventName +and listener will result in the listener being added, and called, multiple times.

      +
      server.prependListener('connection', (stream) => {
      console.log('someone connected!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v6.0.0

      +
    • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this +listener is removed, and then invoked.

      +
      server.prependOnceListener('connection', (stream) => {
      console.log('Ah, we have our first user!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v6.0.0

      +
    • Returns a copy of the array of listeners for the event named eventName, +including any wrappers (such as those created by .once()).

      +
      import { EventEmitter } from 'node:events';
      const emitter = new EventEmitter();
      emitter.once('log', () => console.log('log once'));

      // Returns a new Array with a function `onceWrapper` which has a property
      // `listener` which contains the original listener bound above
      const listeners = emitter.rawListeners('log');
      const logFnWrapper = listeners[0];

      // Logs "log once" to the console and does not unbind the `once` event
      logFnWrapper.listener();

      // Logs "log once" to the console and removes the listener
      logFnWrapper();

      emitter.on('log', () => console.log('log persistently'));
      // Will return a new Array with a single function bound by `.on()` above
      const newListeners = emitter.rawListeners('log');

      // Logs "log persistently" twice
      newListeners[0]();
      emitter.emit('log'); +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v9.4.0

      +
    • Removes all listeners, or those of the specified eventName.

      +

      It is bad practice to remove listeners added elsewhere in the code, +particularly when the EventEmitter instance was created by some other +component or module (e.g. sockets or file streams).

      +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Parameters

      • OptionaleventName: string | symbol

      Returns this

      v0.1.26

      +
    • Removes the specified listener from the listener array for the event named eventName.

      +
      const callback = (stream) => {
      console.log('someone connected!');
      };
      server.on('connection', callback);
      // ...
      server.removeListener('connection', callback); +
      + +

      removeListener() will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified eventName, then removeListener() must be +called multiple times to remove each instance.

      +

      Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution +will not remove them fromemit() in progress. Subsequent events behave as expected.

      +
      import { EventEmitter } from 'node:events';
      class MyEmitter extends EventEmitter {}
      const myEmitter = new MyEmitter();

      const callbackA = () => {
      console.log('A');
      myEmitter.removeListener('event', callbackB);
      };

      const callbackB = () => {
      console.log('B');
      };

      myEmitter.on('event', callbackA);

      myEmitter.on('event', callbackB);

      // callbackA removes listener callbackB but it will still be called.
      // Internal listener array at time of emit [callbackA, callbackB]
      myEmitter.emit('event');
      // Prints:
      // A
      // B

      // callbackB is now removed.
      // Internal listener array [callbackA]
      myEmitter.emit('event');
      // Prints:
      // A +
      + +

      Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered after the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the emitter.listeners() method will need to be recreated.

      +

      When a single function has been added as a handler multiple times for a single +event (as in the example below), removeListener() will remove the most +recently added instance. In the example the once('ping') listener is removed:

      +
      import { EventEmitter } from 'node:events';
      const ee = new EventEmitter();

      function pong() {
      console.log('pong');
      }

      ee.on('ping', pong);
      ee.once('ping', pong);
      ee.removeListener('ping', pong);

      ee.emit('ping');
      ee.emit('ping'); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.26

      +
    • By default EventEmitters will print a warning if more than 10 listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The emitter.setMaxListeners() method allows the limit to be +modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

      +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Parameters

      • n: number

      Returns this

      v0.3.5

      +
    • Experimental

      Listens once to the abort event on the provided signal.

      +

      Listening to the abort event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call e.stopImmediatePropagation(). Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners.

      +

      This API allows safely using AbortSignals in Node.js APIs by solving these +two issues by listening to the event such that stopImmediatePropagation does +not prevent the listener from running.

      +

      Returns a disposable so that it may be unsubscribed from more easily.

      +
      import { addAbortListener } from 'node:events';

      function example(signal) {
      let disposable;
      try {
      signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
      disposable = addAbortListener(signal, (e) => {
      // Do something when signal is aborted.
      });
      } finally {
      disposable?.[Symbol.dispose]();
      }
      } +
      + +

      Parameters

      • signal: AbortSignal
      • resource: ((event: Event) => void)
          • (event): void
          • Parameters

            • event: Event

            Returns void

      Returns Disposable

      Disposable that removes the abort listener.

      +

      v20.5.0

      +
    • Returns a copy of the array of listeners for the event named eventName.

      +

      For EventEmitters this behaves exactly the same as calling .listeners on +the emitter.

      +

      For EventTargets this is the only way to get the event listeners for the +event target. This is useful for debugging and diagnostic purposes.

      +
      import { getEventListeners, EventEmitter } from 'node:events';

      {
      const ee = new EventEmitter();
      const listener = () => console.log('Events are fun');
      ee.on('foo', listener);
      console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
      }
      {
      const et = new EventTarget();
      const listener = () => console.log('Events are fun');
      et.addEventListener('foo', listener);
      console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
      } +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap> | EventTarget
      • name: string | symbol

      Returns Function[]

      v15.2.0, v14.17.0

      +
    • Returns the currently set max amount of listeners.

      +

      For EventEmitters this behaves exactly the same as calling .getMaxListeners on +the emitter.

      +

      For EventTargets this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning.

      +
      import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';

      {
      const ee = new EventEmitter();
      console.log(getMaxListeners(ee)); // 10
      setMaxListeners(11, ee);
      console.log(getMaxListeners(ee)); // 11
      }
      {
      const et = new EventTarget();
      console.log(getMaxListeners(et)); // 10
      setMaxListeners(11, et);
      console.log(getMaxListeners(et)); // 11
      } +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap> | EventTarget

      Returns number

      v19.9.0

      +
    • A class method that returns the number of listeners for the given eventName registered on the given emitter.

      +
      import { EventEmitter, listenerCount } from 'node:events';

      const myEmitter = new EventEmitter();
      myEmitter.on('event', () => {});
      myEmitter.on('event', () => {});
      console.log(listenerCount(myEmitter, 'event'));
      // Prints: 2 +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>

        The emitter to query

        +
      • eventName: string | symbol

        The event name

        +

      Returns number

      v0.9.12

      +

      Since v3.2.0 - Use listenerCount instead.

      +
    • import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      });

      for await (const event of on(ee, 'foo')) {
      // The execution of this inner block is synchronous and it
      // processes one event at a time (even with await). Do not use
      // if concurrent execution is required.
      console.log(event); // prints ['bar'] [42]
      }
      // Unreachable here +
      + +

      Returns an AsyncIterator that iterates eventName events. It will throw +if the EventEmitter emits 'error'. It removes all listeners when +exiting the loop. The value returned by each iteration is an array +composed of the emitted event arguments.

      +

      An AbortSignal can be used to cancel waiting on events:

      +
      import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ac = new AbortController();

      (async () => {
      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      });

      for await (const event of on(ee, 'foo', { signal: ac.signal })) {
      // The execution of this inner block is synchronous and it
      // processes one event at a time (even with await). Do not use
      // if concurrent execution is required.
      console.log(event); // prints ['bar'] [42]
      }
      // Unreachable here
      })();

      process.nextTick(() => ac.abort()); +
      + +

      Use the close option to specify an array of event names that will end the iteration:

      +
      import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      ee.emit('close');
      });

      for await (const event of on(ee, 'foo', { close: ['close'] })) {
      console.log(event); // prints ['bar'] [42]
      }
      // the loop will exit after 'close' is emitted
      console.log('done'); // prints 'done' +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>
      • eventName: string | symbol
      • Optionaloptions: StaticEventEmitterIteratorOptions

      Returns AsyncIterator<any[], any, any>

      An AsyncIterator that iterates eventName events emitted by the emitter

      +

      v13.6.0, v12.16.0

      +
    • Parameters

      • emitter: EventTarget
      • eventName: string
      • Optionaloptions: StaticEventEmitterIteratorOptions

      Returns AsyncIterator<any[], any, any>

    • Creates a Promise that is fulfilled when the EventEmitter emits the given +event or that is rejected if the EventEmitter emits 'error' while waiting. +The Promise will resolve with an array of all the arguments emitted to the +given event.

      +

      This method is intentionally generic and works with the web platform EventTarget interface, which has no special'error' event +semantics and does not listen to the 'error' event.

      +
      import { once, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      process.nextTick(() => {
      ee.emit('myevent', 42);
      });

      const [value] = await once(ee, 'myevent');
      console.log(value);

      const err = new Error('kaboom');
      process.nextTick(() => {
      ee.emit('error', err);
      });

      try {
      await once(ee, 'myevent');
      } catch (err) {
      console.error('error happened', err);
      } +
      + +

      The special handling of the 'error' event is only used when events.once() is used to wait for another event. If events.once() is used to wait for the +'error' event itself, then it is treated as any other kind of event without +special handling:

      +
      import { EventEmitter, once } from 'node:events';

      const ee = new EventEmitter();

      once(ee, 'error')
      .then(([err]) => console.log('ok', err.message))
      .catch((err) => console.error('error', err.message));

      ee.emit('error', new Error('boom'));

      // Prints: ok boom +
      + +

      An AbortSignal can be used to cancel waiting for the event:

      +
      import { EventEmitter, once } from 'node:events';

      const ee = new EventEmitter();
      const ac = new AbortController();

      async function foo(emitter, event, signal) {
      try {
      await once(emitter, event, { signal });
      console.log('event emitted!');
      } catch (error) {
      if (error.name === 'AbortError') {
      console.error('Waiting for the event was canceled!');
      } else {
      console.error('There was an error', error.message);
      }
      }
      }

      foo(ee, 'foo', ac.signal);
      ac.abort(); // Abort waiting for the event
      ee.emit('foo'); // Prints: Waiting for the event was canceled! +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>
      • eventName: string | symbol
      • Optionaloptions: StaticEventEmitterOptions

      Returns Promise<any[]>

      v11.13.0, v10.16.0

      +
    • Parameters

      • emitter: EventTarget
      • eventName: string
      • Optionaloptions: StaticEventEmitterOptions

      Returns Promise<any[]>

    • import { setMaxListeners, EventEmitter } from 'node:events';

      const target = new EventTarget();
      const emitter = new EventEmitter();

      setMaxListeners(5, target, emitter); +
      + +

      Parameters

      • Optionaln: number

        A non-negative number. The maximum number of listeners per EventTarget event.

        +
      • Rest...eventTargets: (EventEmitter<DefaultEventMap> | EventTarget)[]

        Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, n is set as the default max for all newly created {EventTarget} and {EventEmitter} +objects.

        +

      Returns void

      v15.4.0

      +
    diff --git a/packages/gleequore/docs/reference/classes/lib_connection.default.html b/packages/gleequore/docs/reference/classes/lib_connection.default.html new file mode 100644 index 000000000..9d8967fa2 --- /dev/null +++ b/packages/gleequore/docs/reference/classes/lib_connection.default.html @@ -0,0 +1,13 @@ +default | @asyncapi/gleequore

    Constructors

    Accessors

    Methods

    • Checks whether a channel is associated with this connection.

      +

      Parameters

      • channelName: string

        The name of the channel.

        +

      Returns boolean

    diff --git a/packages/gleequore/docs/reference/classes/lib_message.default.html b/packages/gleequore/docs/reference/classes/lib_message.default.html new file mode 100644 index 000000000..dd7d601d2 --- /dev/null +++ b/packages/gleequore/docs/reference/classes/lib_message.default.html @@ -0,0 +1,303 @@ +default | @asyncapi/gleequore

    Hierarchy

    • EventEmitter
      • default

    Constructors

    Properties

    captureRejections: boolean

    Value: boolean

    +

    Change the default captureRejections option on all new EventEmitter objects.

    +

    v13.4.0, v12.16.0

    +
    captureRejectionSymbol: typeof captureRejectionSymbol

    Value: Symbol.for('nodejs.rejection')

    +

    See how to write a custom rejection handler.

    +

    v13.4.0, v12.16.0

    +
    defaultMaxListeners: number

    By default, a maximum of 10 listeners can be registered for any single +event. This limit can be changed for individual EventEmitter instances +using the emitter.setMaxListeners(n) method. To change the default +for allEventEmitter instances, the events.defaultMaxListeners property +can be used. If this value is not a positive number, a RangeError is thrown.

    +

    Take caution when setting the events.defaultMaxListeners because the +change affects all EventEmitter instances, including those created before +the change is made. However, calling emitter.setMaxListeners(n) still has +precedence over events.defaultMaxListeners.

    +

    This is not a hard limit. The EventEmitter instance will allow +more listeners to be added but will output a trace warning to stderr indicating +that a "possible EventEmitter memory leak" has been detected. For any single +EventEmitter, the emitter.getMaxListeners() and emitter.setMaxListeners() methods can be used to +temporarily avoid this warning:

    +
    import { EventEmitter } from 'node:events';
    const emitter = new EventEmitter();
    emitter.setMaxListeners(emitter.getMaxListeners() + 1);
    emitter.once('event', () => {
    // do stuff
    emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));
    }); +
    + +

    The --trace-warnings command-line flag can be used to display the +stack trace for such warnings.

    +

    The emitted warning can be inspected with process.on('warning') and will +have the additional emitter, type, and count properties, referring to +the event emitter instance, the event's name and the number of attached +listeners, respectively. +Its name property is set to 'MaxListenersExceededWarning'.

    +

    v0.11.2

    +
    errorMonitor: typeof errorMonitor

    This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

    +

    Installing a listener using this symbol does not change the behavior once an 'error' event is emitted. Therefore, the process will still crash if no +regular 'error' listener is installed.

    +

    v13.6.0, v12.17.0

    +

    Accessors

    Methods

    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest...args: AnyRest

      Returns void

    • Alias for emitter.on(eventName, listener).

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.26

      +
    • Synchronously calls each of the listeners registered for the event named eventName, in the order they were registered, passing the supplied arguments +to each.

      +

      Returns true if the event had listeners, false otherwise.

      +
      import { EventEmitter } from 'node:events';
      const myEmitter = new EventEmitter();

      // First listener
      myEmitter.on('event', function firstListener() {
      console.log('Helloooo! first listener');
      });
      // Second listener
      myEmitter.on('event', function secondListener(arg1, arg2) {
      console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
      });
      // Third listener
      myEmitter.on('event', function thirdListener(...args) {
      const parameters = args.join(', ');
      console.log(`event with parameters ${parameters} in third listener`);
      });

      console.log(myEmitter.listeners('event'));

      myEmitter.emit('event', 1, 2, 3, 4, 5);

      // Prints:
      // [
      // [Function: firstListener],
      // [Function: secondListener],
      // [Function: thirdListener]
      // ]
      // Helloooo! first listener
      // event with parameters 1, 2 in second listener
      // event with parameters 1, 2, 3, 4, 5 in third listener +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • Rest...args: AnyRest

      Returns boolean

      v0.1.26

      +
    • Returns an array listing the events for which the emitter has registered +listeners. The values in the array are strings or Symbols.

      +
      import { EventEmitter } from 'node:events';

      const myEE = new EventEmitter();
      myEE.on('foo', () => {});
      myEE.on('bar', () => {});

      const sym = Symbol('symbol');
      myEE.on(sym, () => {});

      console.log(myEE.eventNames());
      // Prints: [ 'foo', 'bar', Symbol(symbol) ] +
      + +

      Returns (string | symbol)[]

      v6.0.0

      +
    • Returns the current max listener value for the EventEmitter which is either +set by emitter.setMaxListeners(n) or defaults to defaultMaxListeners.

      +

      Returns number

      v1.0.0

      +
    • Returns the number of listeners listening for the event named eventName. +If listener is provided, it will return how many times the listener is found +in the list of the listeners of the event.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event being listened for

        +
      • Optionallistener: Function

        The event handler function

        +

      Returns number

      v3.2.0

      +
    • Returns a copy of the array of listeners for the event named eventName.

      +
      server.on('connection', (stream) => {
      console.log('someone connected!');
      });
      console.log(util.inspect(server.listeners('connection')));
      // Prints: [ [Function] ] +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v0.1.26

      +
    • Alias for emitter.removeListener().

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v10.0.0

      +
    • Adds the listener function to the end of the listeners array for the event +named eventName. No checks are made to see if the listener has already +been added. Multiple calls passing the same combination of eventName and +listener will result in the listener being added, and called, multiple times.

      +
      server.on('connection', (stream) => {
      console.log('someone connected!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

      +
      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.on('foo', () => console.log('a'));
      myEE.prependListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.101

      +
    • Adds a one-time listener function for the event named eventName. The +next time eventName is triggered, this listener is removed and then invoked.

      +
      server.once('connection', (stream) => {
      console.log('Ah, we have our first user!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      By default, event listeners are invoked in the order they are added. The emitter.prependOnceListener() method can be used as an alternative to add the +event listener to the beginning of the listeners array.

      +
      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.once('foo', () => console.log('a'));
      myEE.prependOnceListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.3.0

      +
    • Adds the listener function to the beginning of the listeners array for the +event named eventName. No checks are made to see if the listener has +already been added. Multiple calls passing the same combination of eventName +and listener will result in the listener being added, and called, multiple times.

      +
      server.prependListener('connection', (stream) => {
      console.log('someone connected!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v6.0.0

      +
    • Adds a one-timelistener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this +listener is removed, and then invoked.

      +
      server.prependOnceListener('connection', (stream) => {
      console.log('Ah, we have our first user!');
      }); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

        The name of the event.

        +
      • listener: ((...args: any[]) => void)

        The callback function

        +
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v6.0.0

      +
    • Returns a copy of the array of listeners for the event named eventName, +including any wrappers (such as those created by .once()).

      +
      import { EventEmitter } from 'node:events';
      const emitter = new EventEmitter();
      emitter.once('log', () => console.log('log once'));

      // Returns a new Array with a function `onceWrapper` which has a property
      // `listener` which contains the original listener bound above
      const listeners = emitter.rawListeners('log');
      const logFnWrapper = listeners[0];

      // Logs "log once" to the console and does not unbind the `once` event
      logFnWrapper.listener();

      // Logs "log once" to the console and removes the listener
      logFnWrapper();

      emitter.on('log', () => console.log('log persistently'));
      // Will return a new Array with a single function bound by `.on()` above
      const newListeners = emitter.rawListeners('log');

      // Logs "log persistently" twice
      newListeners[0]();
      emitter.emit('log'); +
      + +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

      v9.4.0

      +
    • Removes all listeners, or those of the specified eventName.

      +

      It is bad practice to remove listeners added elsewhere in the code, +particularly when the EventEmitter instance was created by some other +component or module (e.g. sockets or file streams).

      +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Parameters

      • OptionaleventName: string | symbol

      Returns this

      v0.1.26

      +
    • Removes the specified listener from the listener array for the event named eventName.

      +
      const callback = (stream) => {
      console.log('someone connected!');
      };
      server.on('connection', callback);
      // ...
      server.removeListener('connection', callback); +
      + +

      removeListener() will remove, at most, one instance of a listener from the +listener array. If any single listener has been added multiple times to the +listener array for the specified eventName, then removeListener() must be +called multiple times to remove each instance.

      +

      Once an event is emitted, all listeners attached to it at the +time of emitting are called in order. This implies that any removeListener() or removeAllListeners() calls after emitting and before the last listener finishes execution +will not remove them fromemit() in progress. Subsequent events behave as expected.

      +
      import { EventEmitter } from 'node:events';
      class MyEmitter extends EventEmitter {}
      const myEmitter = new MyEmitter();

      const callbackA = () => {
      console.log('A');
      myEmitter.removeListener('event', callbackB);
      };

      const callbackB = () => {
      console.log('B');
      };

      myEmitter.on('event', callbackA);

      myEmitter.on('event', callbackB);

      // callbackA removes listener callbackB but it will still be called.
      // Internal listener array at time of emit [callbackA, callbackB]
      myEmitter.emit('event');
      // Prints:
      // A
      // B

      // callbackB is now removed.
      // Internal listener array [callbackA]
      myEmitter.emit('event');
      // Prints:
      // A +
      + +

      Because listeners are managed using an internal array, calling this will +change the position indices of any listener registered after the listener +being removed. This will not impact the order in which listeners are called, +but it means that any copies of the listener array as returned by +the emitter.listeners() method will need to be recreated.

      +

      When a single function has been added as a handler multiple times for a single +event (as in the example below), removeListener() will remove the most +recently added instance. In the example the once('ping') listener is removed:

      +
      import { EventEmitter } from 'node:events';
      const ee = new EventEmitter();

      function pong() {
      console.log('pong');
      }

      ee.on('ping', pong);
      ee.once('ping', pong);
      ee.removeListener('ping', pong);

      ee.emit('ping');
      ee.emit('ping'); +
      + +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args): void
          • Parameters

            • Rest...args: any[]

            Returns void

      Returns this

      v0.1.26

      +
    • By default EventEmitters will print a warning if more than 10 listeners are +added for a particular event. This is a useful default that helps finding +memory leaks. The emitter.setMaxListeners() method allows the limit to be +modified for this specific EventEmitter instance. The value can be set to Infinity (or 0) to indicate an unlimited number of listeners.

      +

      Returns a reference to the EventEmitter, so that calls can be chained.

      +

      Parameters

      • n: number

      Returns this

      v0.3.5

      +
    • Experimental

      Listens once to the abort event on the provided signal.

      +

      Listening to the abort event on abort signals is unsafe and may +lead to resource leaks since another third party with the signal can +call e.stopImmediatePropagation(). Unfortunately Node.js cannot change +this since it would violate the web standard. Additionally, the original +API makes it easy to forget to remove listeners.

      +

      This API allows safely using AbortSignals in Node.js APIs by solving these +two issues by listening to the event such that stopImmediatePropagation does +not prevent the listener from running.

      +

      Returns a disposable so that it may be unsubscribed from more easily.

      +
      import { addAbortListener } from 'node:events';

      function example(signal) {
      let disposable;
      try {
      signal.addEventListener('abort', (e) => e.stopImmediatePropagation());
      disposable = addAbortListener(signal, (e) => {
      // Do something when signal is aborted.
      });
      } finally {
      disposable?.[Symbol.dispose]();
      }
      } +
      + +

      Parameters

      • signal: AbortSignal
      • resource: ((event: Event) => void)
          • (event): void
          • Parameters

            • event: Event

            Returns void

      Returns Disposable

      Disposable that removes the abort listener.

      +

      v20.5.0

      +
    • Returns a copy of the array of listeners for the event named eventName.

      +

      For EventEmitters this behaves exactly the same as calling .listeners on +the emitter.

      +

      For EventTargets this is the only way to get the event listeners for the +event target. This is useful for debugging and diagnostic purposes.

      +
      import { getEventListeners, EventEmitter } from 'node:events';

      {
      const ee = new EventEmitter();
      const listener = () => console.log('Events are fun');
      ee.on('foo', listener);
      console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]
      }
      {
      const et = new EventTarget();
      const listener = () => console.log('Events are fun');
      et.addEventListener('foo', listener);
      console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]
      } +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap> | EventTarget
      • name: string | symbol

      Returns Function[]

      v15.2.0, v14.17.0

      +
    • Returns the currently set max amount of listeners.

      +

      For EventEmitters this behaves exactly the same as calling .getMaxListeners on +the emitter.

      +

      For EventTargets this is the only way to get the max event listeners for the +event target. If the number of event handlers on a single EventTarget exceeds +the max set, the EventTarget will print a warning.

      +
      import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';

      {
      const ee = new EventEmitter();
      console.log(getMaxListeners(ee)); // 10
      setMaxListeners(11, ee);
      console.log(getMaxListeners(ee)); // 11
      }
      {
      const et = new EventTarget();
      console.log(getMaxListeners(et)); // 10
      setMaxListeners(11, et);
      console.log(getMaxListeners(et)); // 11
      } +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap> | EventTarget

      Returns number

      v19.9.0

      +
    • A class method that returns the number of listeners for the given eventName registered on the given emitter.

      +
      import { EventEmitter, listenerCount } from 'node:events';

      const myEmitter = new EventEmitter();
      myEmitter.on('event', () => {});
      myEmitter.on('event', () => {});
      console.log(listenerCount(myEmitter, 'event'));
      // Prints: 2 +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>

        The emitter to query

        +
      • eventName: string | symbol

        The event name

        +

      Returns number

      v0.9.12

      +

      Since v3.2.0 - Use listenerCount instead.

      +
    • import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      });

      for await (const event of on(ee, 'foo')) {
      // The execution of this inner block is synchronous and it
      // processes one event at a time (even with await). Do not use
      // if concurrent execution is required.
      console.log(event); // prints ['bar'] [42]
      }
      // Unreachable here +
      + +

      Returns an AsyncIterator that iterates eventName events. It will throw +if the EventEmitter emits 'error'. It removes all listeners when +exiting the loop. The value returned by each iteration is an array +composed of the emitted event arguments.

      +

      An AbortSignal can be used to cancel waiting on events:

      +
      import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ac = new AbortController();

      (async () => {
      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      });

      for await (const event of on(ee, 'foo', { signal: ac.signal })) {
      // The execution of this inner block is synchronous and it
      // processes one event at a time (even with await). Do not use
      // if concurrent execution is required.
      console.log(event); // prints ['bar'] [42]
      }
      // Unreachable here
      })();

      process.nextTick(() => ac.abort()); +
      + +

      Use the close option to specify an array of event names that will end the iteration:

      +
      import { on, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      // Emit later on
      process.nextTick(() => {
      ee.emit('foo', 'bar');
      ee.emit('foo', 42);
      ee.emit('close');
      });

      for await (const event of on(ee, 'foo', { close: ['close'] })) {
      console.log(event); // prints ['bar'] [42]
      }
      // the loop will exit after 'close' is emitted
      console.log('done'); // prints 'done' +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>
      • eventName: string | symbol
      • Optionaloptions: StaticEventEmitterIteratorOptions

      Returns AsyncIterator<any[], any, any>

      An AsyncIterator that iterates eventName events emitted by the emitter

      +

      v13.6.0, v12.16.0

      +
    • Parameters

      • emitter: EventTarget
      • eventName: string
      • Optionaloptions: StaticEventEmitterIteratorOptions

      Returns AsyncIterator<any[], any, any>

    • Creates a Promise that is fulfilled when the EventEmitter emits the given +event or that is rejected if the EventEmitter emits 'error' while waiting. +The Promise will resolve with an array of all the arguments emitted to the +given event.

      +

      This method is intentionally generic and works with the web platform EventTarget interface, which has no special'error' event +semantics and does not listen to the 'error' event.

      +
      import { once, EventEmitter } from 'node:events';
      import process from 'node:process';

      const ee = new EventEmitter();

      process.nextTick(() => {
      ee.emit('myevent', 42);
      });

      const [value] = await once(ee, 'myevent');
      console.log(value);

      const err = new Error('kaboom');
      process.nextTick(() => {
      ee.emit('error', err);
      });

      try {
      await once(ee, 'myevent');
      } catch (err) {
      console.error('error happened', err);
      } +
      + +

      The special handling of the 'error' event is only used when events.once() is used to wait for another event. If events.once() is used to wait for the +'error' event itself, then it is treated as any other kind of event without +special handling:

      +
      import { EventEmitter, once } from 'node:events';

      const ee = new EventEmitter();

      once(ee, 'error')
      .then(([err]) => console.log('ok', err.message))
      .catch((err) => console.error('error', err.message));

      ee.emit('error', new Error('boom'));

      // Prints: ok boom +
      + +

      An AbortSignal can be used to cancel waiting for the event:

      +
      import { EventEmitter, once } from 'node:events';

      const ee = new EventEmitter();
      const ac = new AbortController();

      async function foo(emitter, event, signal) {
      try {
      await once(emitter, event, { signal });
      console.log('event emitted!');
      } catch (error) {
      if (error.name === 'AbortError') {
      console.error('Waiting for the event was canceled!');
      } else {
      console.error('There was an error', error.message);
      }
      }
      }

      foo(ee, 'foo', ac.signal);
      ac.abort(); // Abort waiting for the event
      ee.emit('foo'); // Prints: Waiting for the event was canceled! +
      + +

      Parameters

      • emitter: EventEmitter<DefaultEventMap>
      • eventName: string | symbol
      • Optionaloptions: StaticEventEmitterOptions

      Returns Promise<any[]>

      v11.13.0, v10.16.0

      +
    • Parameters

      • emitter: EventTarget
      • eventName: string
      • Optionaloptions: StaticEventEmitterOptions

      Returns Promise<any[]>

    • import { setMaxListeners, EventEmitter } from 'node:events';

      const target = new EventTarget();
      const emitter = new EventEmitter();

      setMaxListeners(5, target, emitter); +
      + +

      Parameters

      • Optionaln: number

        A non-negative number. The maximum number of listeners per EventTarget event.

        +
      • Rest...eventTargets: (EventEmitter<DefaultEventMap> | EventTarget)[]

        Zero or more {EventTarget} or {EventEmitter} instances. If none are specified, n is set as the default max for all newly created {EventTarget} and {EventEmitter} +objects.

        +

      Returns void

      v15.4.0

      +
    diff --git a/packages/gleequore/docs/reference/classes/lib_router.default.html b/packages/gleequore/docs/reference/classes/lib_router.default.html new file mode 100644 index 000000000..c2d922937 --- /dev/null +++ b/packages/gleequore/docs/reference/classes/lib_router.default.html @@ -0,0 +1,32 @@ +default | @asyncapi/gleequore

    Constructors

    Methods

    • Adds a normalized middleware to the outbound error middlewares collection.

      +

      Parameters

      Returns void

    • Adds a normalized middleware to the outbound middlewares collection.

      +

      Parameters

      • middlewares: ChannelMiddlewareTuple[]

        The middlewares to add to the collection.

        +
      • Optionalchannel: string

        The scope channel.

        +

      Returns void

    diff --git a/packages/gleequore/docs/reference/enums/index-1.LifecycleEvent.html b/packages/gleequore/docs/reference/enums/index-1.LifecycleEvent.html new file mode 100644 index 000000000..7b46a7f9c --- /dev/null +++ b/packages/gleequore/docs/reference/enums/index-1.LifecycleEvent.html @@ -0,0 +1,7 @@ +LifecycleEvent | @asyncapi/gleequore

    Enumeration LifecycleEvent

    Enumeration Members

    onConnect
    onDisconnect
    onReconnect
    onServerConnectionClose
    onServerConnectionOpen
    onServerReady
    diff --git a/packages/gleequore/docs/reference/functions/middlewares_buffer2string.default.html b/packages/gleequore/docs/reference/functions/middlewares_buffer2string.default.html new file mode 100644 index 000000000..eed7597f2 --- /dev/null +++ b/packages/gleequore/docs/reference/functions/middlewares_buffer2string.default.html @@ -0,0 +1 @@ +default | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/functions/middlewares_existsInAsyncAPI.default.html b/packages/gleequore/docs/reference/functions/middlewares_existsInAsyncAPI.default.html new file mode 100644 index 000000000..1753a4695 --- /dev/null +++ b/packages/gleequore/docs/reference/functions/middlewares_existsInAsyncAPI.default.html @@ -0,0 +1 @@ +default | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/functions/middlewares_json2string.default.html b/packages/gleequore/docs/reference/functions/middlewares_json2string.default.html new file mode 100644 index 000000000..d7e8fbe39 --- /dev/null +++ b/packages/gleequore/docs/reference/functions/middlewares_json2string.default.html @@ -0,0 +1 @@ +default | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/functions/middlewares_string2json.default.html b/packages/gleequore/docs/reference/functions/middlewares_string2json.default.html new file mode 100644 index 000000000..dc5a97423 --- /dev/null +++ b/packages/gleequore/docs/reference/functions/middlewares_string2json.default.html @@ -0,0 +1 @@ +default | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/functions/middlewares_validate.default.html b/packages/gleequore/docs/reference/functions/middlewares_validate.default.html new file mode 100644 index 000000000..136a94298 --- /dev/null +++ b/packages/gleequore/docs/reference/functions/middlewares_validate.default.html @@ -0,0 +1 @@ +default | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/functions/middlewares_validateConnection.default.html b/packages/gleequore/docs/reference/functions/middlewares_validateConnection.default.html new file mode 100644 index 000000000..16db64edb --- /dev/null +++ b/packages/gleequore/docs/reference/functions/middlewares_validateConnection.default.html @@ -0,0 +1 @@ +default | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/index.html b/packages/gleequore/docs/reference/index.html new file mode 100644 index 000000000..47573642d --- /dev/null +++ b/packages/gleequore/docs/reference/index.html @@ -0,0 +1,17 @@ +@asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/interfaces/index-1.FunctionInfoRecord.html b/packages/gleequore/docs/reference/interfaces/index-1.FunctionInfoRecord.html new file mode 100644 index 000000000..4b84f5118 --- /dev/null +++ b/packages/gleequore/docs/reference/interfaces/index-1.FunctionInfoRecord.html @@ -0,0 +1,2 @@ +FunctionInfoRecord | @asyncapi/gleequore

    Interface FunctionInfoRecord

    interface FunctionInfoRecord {
        run: GleeQuoreFunction;
    }

    Properties

    run +

    Properties

    diff --git a/packages/gleequore/docs/reference/interfaces/index-1.LifecycleEventRecord.html b/packages/gleequore/docs/reference/interfaces/index-1.LifecycleEventRecord.html new file mode 100644 index 000000000..108100db7 --- /dev/null +++ b/packages/gleequore/docs/reference/interfaces/index-1.LifecycleEventRecord.html @@ -0,0 +1,3 @@ +LifecycleEventRecord | @asyncapi/gleequore

    Interface LifecycleEventRecord

    interface LifecycleEventRecord {
        func: GleeQuoreLifecycleFunction;
        servers: string[];
    }

    Properties

    Properties

    servers: string[]
    diff --git a/packages/gleequore/docs/reference/interfaces/index.AuthFunctionInfo.html b/packages/gleequore/docs/reference/interfaces/index.AuthFunctionInfo.html new file mode 100644 index 000000000..715b8f2ea --- /dev/null +++ b/packages/gleequore/docs/reference/interfaces/index.AuthFunctionInfo.html @@ -0,0 +1,3 @@ +AuthFunctionInfo | @asyncapi/gleequore
    interface AuthFunctionInfo {
        clientAuth?: GleeQuoreAuthFunction;
        serverAuth?: GleeQuoreAuthFunction;
    }

    Properties

    diff --git a/packages/gleequore/docs/reference/interfaces/index.GleeQuoreAdapterOptions.html b/packages/gleequore/docs/reference/interfaces/index.GleeQuoreAdapterOptions.html new file mode 100644 index 000000000..5f1437ded --- /dev/null +++ b/packages/gleequore/docs/reference/interfaces/index.GleeQuoreAdapterOptions.html @@ -0,0 +1,6 @@ +GleeQuoreAdapterOptions | @asyncapi/gleequore

    Interface GleeQuoreAdapterOptions

    interface GleeQuoreAdapterOptions {
        config?: object;
        glee: GleeQuore;
        parsedAsyncAPI: AsyncAPIDocumentInterface;
        server: ServerInterface;
        serverName: string;
    }

    Properties

    config?: object
    glee: GleeQuore
    parsedAsyncAPI: AsyncAPIDocumentInterface
    server: ServerInterface
    serverName: string
    diff --git a/packages/gleequore/docs/reference/interfaces/lib_message.IGleeQuoreMessageConstructor.html b/packages/gleequore/docs/reference/interfaces/lib_message.IGleeQuoreMessageConstructor.html new file mode 100644 index 000000000..351c63401 --- /dev/null +++ b/packages/gleequore/docs/reference/interfaces/lib_message.IGleeQuoreMessageConstructor.html @@ -0,0 +1,11 @@ +IGleeQuoreMessageConstructor | @asyncapi/gleequore
    interface IGleeQuoreMessageConstructor {
        broadcast?: boolean;
        channel?: string;
        cluster?: boolean;
        connection?: default;
        headers?: MessageHeaders;
        operation?: OperationInterface;
        payload?: any;
        query?: QueryParam;
        request?: default;
        serverName?: string;
    }

    Properties

    broadcast?: boolean
    channel?: string
    cluster?: boolean
    connection?: default
    headers?: MessageHeaders
    operation?: OperationInterface
    payload?: any
    query?: QueryParam
    request?: default
    serverName?: string
    diff --git a/packages/gleequore/docs/reference/modules/errors.html b/packages/gleequore/docs/reference/modules/errors.html new file mode 100644 index 000000000..4d3953e6c --- /dev/null +++ b/packages/gleequore/docs/reference/modules/errors.html @@ -0,0 +1,2 @@ +errors | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/index-1.html b/packages/gleequore/docs/reference/modules/index-1.html new file mode 100644 index 000000000..71e38a673 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/index-1.html @@ -0,0 +1,5 @@ +index | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/index.html b/packages/gleequore/docs/reference/modules/index.html new file mode 100644 index 000000000..d092db9ac --- /dev/null +++ b/packages/gleequore/docs/reference/modules/index.html @@ -0,0 +1,18 @@ +index | @asyncapi/gleequore

    References

    Renames and re-exports default
    Renames and re-exports default
    Renames and re-exports default
    Renames and re-exports default
    Renames and re-exports default
    diff --git a/packages/gleequore/docs/reference/modules/lib_adapter.html b/packages/gleequore/docs/reference/modules/lib_adapter.html new file mode 100644 index 000000000..60d463b60 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/lib_adapter.html @@ -0,0 +1,4 @@ +lib/adapter | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/lib_cluster.html b/packages/gleequore/docs/reference/modules/lib_cluster.html new file mode 100644 index 000000000..73ce3bfef --- /dev/null +++ b/packages/gleequore/docs/reference/modules/lib_cluster.html @@ -0,0 +1,3 @@ +lib/cluster | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/lib_connection.html b/packages/gleequore/docs/reference/modules/lib_connection.html new file mode 100644 index 000000000..425a207e7 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/lib_connection.html @@ -0,0 +1,2 @@ +lib/connection | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/lib_message.html b/packages/gleequore/docs/reference/modules/lib_message.html new file mode 100644 index 000000000..3231770a2 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/lib_message.html @@ -0,0 +1,3 @@ +lib/message | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/lib_router.html b/packages/gleequore/docs/reference/modules/lib_router.html new file mode 100644 index 000000000..ddee0fd51 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/lib_router.html @@ -0,0 +1,6 @@ +lib/router | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/lib_utils.html b/packages/gleequore/docs/reference/modules/lib_utils.html new file mode 100644 index 000000000..a7dca1c27 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/lib_utils.html @@ -0,0 +1 @@ +lib/utils | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/middlewares.html b/packages/gleequore/docs/reference/modules/middlewares.html new file mode 100644 index 000000000..814ecfe5c --- /dev/null +++ b/packages/gleequore/docs/reference/modules/middlewares.html @@ -0,0 +1,4 @@ +middlewares | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/middlewares_buffer2string.html b/packages/gleequore/docs/reference/modules/middlewares_buffer2string.html new file mode 100644 index 000000000..cf7088b0d --- /dev/null +++ b/packages/gleequore/docs/reference/modules/middlewares_buffer2string.html @@ -0,0 +1,2 @@ +middlewares/buffer2string | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/middlewares_existsInAsyncAPI.html b/packages/gleequore/docs/reference/modules/middlewares_existsInAsyncAPI.html new file mode 100644 index 000000000..eef10318e --- /dev/null +++ b/packages/gleequore/docs/reference/modules/middlewares_existsInAsyncAPI.html @@ -0,0 +1,2 @@ +middlewares/existsInAsyncAPI | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/middlewares_json2string.html b/packages/gleequore/docs/reference/modules/middlewares_json2string.html new file mode 100644 index 000000000..a69089c98 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/middlewares_json2string.html @@ -0,0 +1,2 @@ +middlewares/json2string | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/middlewares_string2json.html b/packages/gleequore/docs/reference/modules/middlewares_string2json.html new file mode 100644 index 000000000..6c4f42a61 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/middlewares_string2json.html @@ -0,0 +1,2 @@ +middlewares/string2json | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/middlewares_validate.html b/packages/gleequore/docs/reference/modules/middlewares_validate.html new file mode 100644 index 000000000..449652026 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/middlewares_validate.html @@ -0,0 +1,2 @@ +middlewares/validate | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/modules/middlewares_validateConnection.html b/packages/gleequore/docs/reference/modules/middlewares_validateConnection.html new file mode 100644 index 000000000..d7ca294b2 --- /dev/null +++ b/packages/gleequore/docs/reference/modules/middlewares_validateConnection.html @@ -0,0 +1,2 @@ +middlewares/validateConnection | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/types/index.AdapterRecord.html b/packages/gleequore/docs/reference/types/index.AdapterRecord.html new file mode 100644 index 000000000..a0f9be9af --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.AdapterRecord.html @@ -0,0 +1 @@ +AdapterRecord | @asyncapi/gleequore
    AdapterRecord: {
        Adapter: typeof default;
        asyncapi: AsyncAPIDocumentInterface;
        config?: object;
        instance?: default;
        server: ServerInterface;
        serverName: string;
    }
    diff --git a/packages/gleequore/docs/reference/types/index.AuthProps.html b/packages/gleequore/docs/reference/types/index.AuthProps.html new file mode 100644 index 000000000..d493453f3 --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.AuthProps.html @@ -0,0 +1 @@ +AuthProps | @asyncapi/gleequore
    AuthProps: {
        getAPIKeys: (() => string);
        getCert: (() => string);
        getHttpAPIKeys: ((name: string) => string);
        getOauthToken: (() => string);
        getToken: (() => string);
        getUserPass: (() => {
            password: string;
            username: string;
        });
    }
    diff --git a/packages/gleequore/docs/reference/types/index.ClusterAdapterRecord.html b/packages/gleequore/docs/reference/types/index.ClusterAdapterRecord.html new file mode 100644 index 000000000..06536b673 --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.ClusterAdapterRecord.html @@ -0,0 +1 @@ +ClusterAdapterRecord | @asyncapi/gleequore

    Type Alias ClusterAdapterRecord

    ClusterAdapterRecord: {
        Adapter: typeof default;
        clusterName?: string;
        clusterURL?: string;
        instance?: default;
    }
    diff --git a/packages/gleequore/docs/reference/types/index.GleeQuoreAuthFunction.html b/packages/gleequore/docs/reference/types/index.GleeQuoreAuthFunction.html new file mode 100644 index 000000000..c0a930e77 --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.GleeQuoreAuthFunction.html @@ -0,0 +1 @@ +GleeQuoreAuthFunction | @asyncapi/gleequore

    Type Alias GleeQuoreAuthFunction

    GleeQuoreAuthFunction: ((event: GleeQuoreAuthFunctionEvent) => Promise<GleeQuoreAuthFunctionEvent> | void)
    diff --git a/packages/gleequore/docs/reference/types/index.GleeQuoreAuthFunctionEvent.html b/packages/gleequore/docs/reference/types/index.GleeQuoreAuthFunctionEvent.html new file mode 100644 index 000000000..4193c4132 --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.GleeQuoreAuthFunctionEvent.html @@ -0,0 +1 @@ +GleeQuoreAuthFunctionEvent | @asyncapi/gleequore

    Type Alias GleeQuoreAuthFunctionEvent

    GleeQuoreAuthFunctionEvent: {
        app: GleeQuore;
        authProps: AuthProps;
        doc: any;
        done: any;
        serverName: string;
    }
    diff --git a/packages/gleequore/docs/reference/types/index.GleeQuoreClusterAdapterConfig.html b/packages/gleequore/docs/reference/types/index.GleeQuoreClusterAdapterConfig.html new file mode 100644 index 000000000..77b5ad75f --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.GleeQuoreClusterAdapterConfig.html @@ -0,0 +1 @@ +GleeQuoreClusterAdapterConfig | @asyncapi/gleequore

    Type Alias GleeQuoreClusterAdapterConfig

    GleeQuoreClusterAdapterConfig: {
        adapter?: string | typeof default;
        name?: string;
        url: string;
    }
    diff --git a/packages/gleequore/docs/reference/types/index.GleeQuoreFunction.html b/packages/gleequore/docs/reference/types/index.GleeQuoreFunction.html new file mode 100644 index 000000000..a9212a8d4 --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.GleeQuoreFunction.html @@ -0,0 +1 @@ +GleeQuoreFunction | @asyncapi/gleequore

    Type Alias GleeQuoreFunction

    GleeQuoreFunction: ((event: GleeQuoreFunctionEvent) => Promise<any>)
    diff --git a/packages/gleequore/docs/reference/types/index.GleeQuoreFunctionEvent.html b/packages/gleequore/docs/reference/types/index.GleeQuoreFunctionEvent.html new file mode 100644 index 000000000..8b49180ab --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.GleeQuoreFunctionEvent.html @@ -0,0 +1 @@ +GleeQuoreFunctionEvent | @asyncapi/gleequore

    Type Alias GleeQuoreFunctionEvent

    GleeQuoreFunctionEvent: {
        app: GleeQuore;
        channel?: string;
        connection?: default;
        headers?: {
            [key: string]: string;
        };
        payload?: any;
        query?: QueryParam;
        request: default;
        serverName: string;
    }
    diff --git a/packages/gleequore/docs/reference/types/index.GleeQuoreLifecycleEvent.html b/packages/gleequore/docs/reference/types/index.GleeQuoreLifecycleEvent.html new file mode 100644 index 000000000..4517e4473 --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.GleeQuoreLifecycleEvent.html @@ -0,0 +1 @@ +GleeQuoreLifecycleEvent | @asyncapi/gleequore

    Type Alias GleeQuoreLifecycleEvent

    GleeQuoreLifecycleEvent: Omit<GleeQuoreFunctionEvent, "request">
    diff --git a/packages/gleequore/docs/reference/types/index.GleeQuoreLifecycleFunction.html b/packages/gleequore/docs/reference/types/index.GleeQuoreLifecycleFunction.html new file mode 100644 index 000000000..0fed67a98 --- /dev/null +++ b/packages/gleequore/docs/reference/types/index.GleeQuoreLifecycleFunction.html @@ -0,0 +1 @@ +GleeQuoreLifecycleFunction | @asyncapi/gleequore

    Type Alias GleeQuoreLifecycleFunction

    GleeQuoreLifecycleFunction: ((event: GleeQuoreLifecycleEvent) => Promise<any>)
    diff --git a/packages/gleequore/docs/reference/types/lib_adapter.AuthEvent.html b/packages/gleequore/docs/reference/types/lib_adapter.AuthEvent.html new file mode 100644 index 000000000..4244b1b01 --- /dev/null +++ b/packages/gleequore/docs/reference/types/lib_adapter.AuthEvent.html @@ -0,0 +1 @@ +AuthEvent | @asyncapi/gleequore
    AuthEvent: {
        authProps: AuthProps;
        doc: any;
        done: any;
        serverName: string;
    }
    diff --git a/packages/gleequore/docs/reference/types/lib_adapter.EnrichedEvent.html b/packages/gleequore/docs/reference/types/lib_adapter.EnrichedEvent.html new file mode 100644 index 000000000..01aefa9dc --- /dev/null +++ b/packages/gleequore/docs/reference/types/lib_adapter.EnrichedEvent.html @@ -0,0 +1 @@ +EnrichedEvent | @asyncapi/gleequore
    EnrichedEvent: {
        connection?: default;
        server: ServerInterface;
        serverName: string;
    }
    diff --git a/packages/gleequore/docs/reference/types/lib_cluster.ClusterEvent.html b/packages/gleequore/docs/reference/types/lib_cluster.ClusterEvent.html new file mode 100644 index 000000000..ce287c8d4 --- /dev/null +++ b/packages/gleequore/docs/reference/types/lib_cluster.ClusterEvent.html @@ -0,0 +1 @@ +ClusterEvent | @asyncapi/gleequore
    ClusterEvent: {
        adapter: default;
        serverName: string;
    }
    diff --git a/packages/gleequore/docs/reference/types/lib_router.ChannelErrorMiddlewareTuple.html b/packages/gleequore/docs/reference/types/lib_router.ChannelErrorMiddlewareTuple.html new file mode 100644 index 000000000..d28c072b5 --- /dev/null +++ b/packages/gleequore/docs/reference/types/lib_router.ChannelErrorMiddlewareTuple.html @@ -0,0 +1 @@ +ChannelErrorMiddlewareTuple | @asyncapi/gleequore

    Type Alias ChannelErrorMiddlewareTuple

    ChannelErrorMiddlewareTuple: {
        channel: string;
        fn: ErrorMiddleware;
    }
    diff --git a/packages/gleequore/docs/reference/types/lib_router.ChannelMiddlewareTuple.html b/packages/gleequore/docs/reference/types/lib_router.ChannelMiddlewareTuple.html new file mode 100644 index 000000000..9232d8264 --- /dev/null +++ b/packages/gleequore/docs/reference/types/lib_router.ChannelMiddlewareTuple.html @@ -0,0 +1 @@ +ChannelMiddlewareTuple | @asyncapi/gleequore
    ChannelMiddlewareTuple: {
        channel: string;
        fn: Middleware;
    }
    diff --git a/packages/gleequore/docs/reference/types/lib_router.GenericChannelMiddlewareTuple.html b/packages/gleequore/docs/reference/types/lib_router.GenericChannelMiddlewareTuple.html new file mode 100644 index 000000000..49daa9ab0 --- /dev/null +++ b/packages/gleequore/docs/reference/types/lib_router.GenericChannelMiddlewareTuple.html @@ -0,0 +1 @@ +GenericChannelMiddlewareTuple | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/types/lib_router.GenericMiddleware.html b/packages/gleequore/docs/reference/types/lib_router.GenericMiddleware.html new file mode 100644 index 000000000..509d957ad --- /dev/null +++ b/packages/gleequore/docs/reference/types/lib_router.GenericMiddleware.html @@ -0,0 +1 @@ +GenericMiddleware | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/types/middlewares.ErrorMiddleware.html b/packages/gleequore/docs/reference/types/middlewares.ErrorMiddleware.html new file mode 100644 index 000000000..20206ec34 --- /dev/null +++ b/packages/gleequore/docs/reference/types/middlewares.ErrorMiddleware.html @@ -0,0 +1 @@ +ErrorMiddleware | @asyncapi/gleequore
    ErrorMiddleware: ((error: Error, message: default, next: MiddlewareCallback) => void)
    diff --git a/packages/gleequore/docs/reference/types/middlewares.Middleware.html b/packages/gleequore/docs/reference/types/middlewares.Middleware.html new file mode 100644 index 000000000..b1f8a2d6d --- /dev/null +++ b/packages/gleequore/docs/reference/types/middlewares.Middleware.html @@ -0,0 +1 @@ +Middleware | @asyncapi/gleequore
    diff --git a/packages/gleequore/docs/reference/types/middlewares.MiddlewareCallback.html b/packages/gleequore/docs/reference/types/middlewares.MiddlewareCallback.html new file mode 100644 index 000000000..2dbff0ff4 --- /dev/null +++ b/packages/gleequore/docs/reference/types/middlewares.MiddlewareCallback.html @@ -0,0 +1 @@ +MiddlewareCallback | @asyncapi/gleequore
    MiddlewareCallback: ((error?: Error, message?: default) => void)
    diff --git a/packages/gleequore/jest.config.js b/packages/gleequore/jest.config.js new file mode 100644 index 000000000..4e783dd58 --- /dev/null +++ b/packages/gleequore/jest.config.js @@ -0,0 +1,19 @@ +/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */ +export default { + testMatch: [ + "/test/**/*.test.ts" + ], + preset: 'ts-jest/presets/default-esm', + testEnvironment: 'node', + "setupFilesAfterEnv": ["jest-extended/all"], + collectCoverage: true, + silent: false, + testPathIgnorePatterns: ['functions.test.ts'], + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + '^nimma/legacy$': '/../../node_modules/nimma/dist/legacy/cjs/index.js', + '^nimma/fallbacks$': + '/../../node_modules/nimma/dist/legacy/cjs/fallbacks/index.js', + }, + transform: {}, +} diff --git a/packages/gleequore/package.json b/packages/gleequore/package.json new file mode 100644 index 000000000..11781b1b0 --- /dev/null +++ b/packages/gleequore/package.json @@ -0,0 +1,67 @@ +{ + "name": "@asyncapi/gleequore", + "version": "0.0.0", + "description": "The Quore of Glee", + "main": "./dist/index.js", + "type": "module", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "files": [ + "dist", + "./src/index.d.ts" + ], + "types": "./src/index.d.ts", + "scripts": { + "build": "tsc", + "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", + "dev": "tsc --watch", + "docs": "typedoc --readme none --githubPages false --out docs/reference --entryPointStrategy expand ./src", + "get:version": "echo $npm_package_version", + "get:name": "echo $npm_package_name", + "generate:assets": "npm run docs", + "lint": "eslint --max-warnings 1 --config .eslintrc .", + "lint:fix": "eslint --max-warnings 1 --config .eslintrc . --fix", + "prepublishOnly": "npm run build", + "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", + "test:dev": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch" + }, + "keywords": [ + "asyncapi", + "framework" + ], + "author": "Fran Mendez", + "publishConfig": { + "access": "public" + }, + "license": "Apache-2.0", + "dependencies": { + "@asyncapi/glee-shared-utils": "workspace:*", + "@asyncapi/parser": "^3.1.0", + "async": "^3.2.0", + "debug": "^4.3.1", + "typescript": "^4.5.4", + "uri-templates": "^0.2.0", + "uuid": "^8.3.2" + }, + "devDependencies": { + "@jest/globals": "29.7.0", + "@tsconfig/node14": "^1.0.1", + "@types/async": "^3.2.11", + "@types/debug": "^4.1.7", + "@types/jest": "^29.5.14", + "@types/uri-templates": "^0.1.31", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "eslint": "^8.6.0", + "eslint-plugin-github": "^4.3.5", + "eslint-plugin-jest": "^27.6.0", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.19.0", + "jest": "^29.7.0", + "jest-extended": "^4.0.2", + "ts-jest": "^29.1.1", + "typedoc": "^0.26.10", + "typedoc-plugin-markdown": "^4.2.9" + } +} diff --git a/packages/gleequore/src/errors.ts b/packages/gleequore/src/errors.ts new file mode 100644 index 000000000..6346c69ac --- /dev/null +++ b/packages/gleequore/src/errors.ts @@ -0,0 +1,19 @@ +export default class ValidationError extends Error { + private _errors: Error[] + private _details: string + + constructor({ humanReadableError, errors }) { + super(humanReadableError) + this._errors = errors + this._details = humanReadableError + this.name = 'GleeQuoreError' + } + + get errors(): any[] { + return this._errors + } + + get details(): string { + return this._details + } +} diff --git a/packages/gleequore/src/index.d.ts b/packages/gleequore/src/index.d.ts new file mode 100644 index 000000000..808ab4fc1 --- /dev/null +++ b/packages/gleequore/src/index.d.ts @@ -0,0 +1,92 @@ +import { AsyncAPIDocumentInterface as AsyncAPIDocument } from '@asyncapi/parser' +import GleeQuoreAdapter from './lib/adapter.js' +import GleeQuoreClusterAdapter from './lib/cluster.js' +import GleeQuoreConnection from './lib/connection.js' +import GleeQuore from './index.ts' +import type GleeQuoreMessage from './lib/message.js' + +export { default as GleeQuoreAdapter } from './lib/adapter.js' +export { default as GleeQuoreMessage } from './lib/message.js' +export { default as GleeQuoreConnection } from './lib/connection.js' +export { default as GleeQuoreClusterAdapter } from './lib/cluster.js' +export { default as GleeQuoreError } from './errors.js' + +export interface AuthFunctionInfo { + clientAuth?: GleeQuoreAuthFunction + serverAuth?: GleeQuoreAuthFunction +} + +export type AuthProps = { + getToken: () => string + getUserPass: () => { + username: string + password: string + } + getCert: () => string + getOauthToken: () => string + getHttpAPIKeys: (name: string) => string + getAPIKeys: () => string +} + +export type GleeQuoreClusterAdapterConfig = { + adapter?: string | typeof GleeQuoreClusterAdapter + name?: string + url: string +} + +export type GleeQuoreFunctionEvent = { + request: GleeQuoreMessage + app: GleeQuore + serverName: string + connection?: GleeQuoreConnection + payload?: any + query?: QueryParam + headers?: { [key: string]: string } + channel?: string +} + +export type GleeQuoreLifecycleEvent = Omit + +export type GleeQuoreAuthFunctionEvent = { + app: GleeQuore + authProps: AuthProps + done: any + serverName: string + doc: any +} + +export type GleeQuoreFunction = ( + event: GleeQuoreFunctionEvent +) => Promise + +export type GleeQuoreLifecycleFunction = ( + event: GleeQuoreLifecycleEvent +) => Promise + +export type GleeQuoreAuthFunction = ( + event: GleeQuoreAuthFunctionEvent +) => Promise | void + +export interface GleeQuoreAdapterOptions { + glee: GleeQuore; + serverName: string; + server: ServerInterface; + parsedAsyncAPI: AsyncAPIDocument; + config?: object +} + +export type AdapterRecord = { + Adapter: typeof GleeQuoreAdapter + instance?: GleeQuoreAdapter + serverName: string + server: ServerInterface + asyncapi: AsyncAPIDocumentInterface + config?: object +} + +export type ClusterAdapterRecord = { + Adapter: typeof GleeQuoreClusterAdapter + instance?: GleeQuoreClusterAdapter, + clusterName?: string, + clusterURL?: string +} diff --git a/packages/gleequore/src/index.ts b/packages/gleequore/src/index.ts new file mode 100644 index 000000000..d2743ed5a --- /dev/null +++ b/packages/gleequore/src/index.ts @@ -0,0 +1,643 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import EventEmitter from 'events' +import async from 'async' +import Debug from 'debug' +import GleeQuoreAdapter, { EnrichedEvent, AuthEvent } from './lib/adapter.js' +import GleeQuoreClusterAdapter from './lib/cluster.js' +import GleeQuoreRouter, { + ChannelErrorMiddlewareTuple, + ChannelMiddlewareTuple, + GenericMiddleware, +} from './lib/router.js' +import GleeQuoreMessage, { IGleeQuoreMessageConstructor } from './lib/message.js' +import { matchChannel, getParams, getMessagesSchema } from '@asyncapi/glee-shared-utils' +import { duplicateMessage } from './lib/utils.js' +import GleeQuoreConnection from './lib/connection.js' +import { MiddlewareCallback } from './middlewares/index.js' +import buffer2string from './middlewares/buffer2string.js' +import string2json from './middlewares/string2json.js' +import json2string from './middlewares/json2string.js' +import validate from './middlewares/validate.js' +import existsInAsyncAPI from './middlewares/existsInAsyncAPI.js' +import validateConnection from './middlewares/validateConnection.js' +import { AsyncAPIDocumentInterface } from '@asyncapi/parser' +import { AdapterRecord, AuthFunctionInfo, ClusterAdapterRecord, GleeQuoreFunction, GleeQuoreLifecycleFunction, GleeQuoreLifecycleEvent, GleeQuoreFunctionEvent, GleeQuoreAuthFunctionEvent, GleeQuoreAdapterOptions } from './index.d.js' + +const debug = Debug('gleequore') + +export enum LifecycleEvent { + onConnect = 'onConnect', + onReconnect = 'onReconnect', + onDisconnect = 'onDisconnect', + onServerReady = 'onServerReady', + onServerConnectionOpen = 'onServerConnectionOpen', + onServerConnectionClose = 'onServerConnectionClose', +} + +export interface LifecycleEventRecord { + func: GleeQuoreLifecycleFunction + servers: string[] +} + +export interface FunctionInfoRecord { + run: GleeQuoreFunction +} + +export default class GleeQuore { + private _asyncapi: AsyncAPIDocumentInterface + private _router: GleeQuoreRouter + private _adapters: AdapterRecord[] + private _clusterAdapter: ClusterAdapterRecord + private _internalEvents: EventEmitter + private _lifecycleEvents: Map + private _functions: Map + private _authFunctions: Map + + + /** + * Instantiates the quore of Glee. + * + * @param {Object} [options={}] + */ + constructor(asyncapi: AsyncAPIDocumentInterface) { + this._asyncapi = asyncapi + this._router = new GleeQuoreRouter() + this._adapters = [] + this._internalEvents = new EventEmitter({ captureRejections: true }) + this._lifecycleEvents = new Map() + this._functions = new Map() + this._authFunctions = new Map() + + this.use(existsInAsyncAPI(asyncapi)) + this.useOutbound(existsInAsyncAPI(asyncapi)) + + this.useOutbound(validateConnection) + this.use((err, message, next) => { + this._internalEvents.emit('error', err) + next(err, message) + }) + this.useOutbound((err, message, next) => { + this._internalEvents.emit('error', err) + next(err, message) + }) + this.use(buffer2string) + this.use(string2json) + + asyncapi.operations().filterByReceive().forEach(operation => { + const channel = operation.channels().all()[0] // operation can have only one channel. + if (operation.reply()) { + console.warn(`Operation ${operation.id()} has a reply defined. Glee does not support replies yet.`) + } + const schema = getMessagesSchema(operation) + const contextErrorMessage = `Your application is receiving a message on channel "${channel.id()}" but the payload of the message is not matching the definition(s) in your AsyncAPI document. If you believe your code is correct, have a look at your AsyncAPI document, especially the messages listed in the channels › ${channel.id()} section. Otherwise, check your code. Here's what failed:\n\n` + if (schema.oneOf.length > 1) { + this.use(channel.id(), validate(schema, contextErrorMessage)) + } else if (schema.oneOf.length === 1) { + this.use(channel.id(), validate(schema.oneOf[0], contextErrorMessage)) + } + this.use(channel.id(), (event, next) => { + this.runFunction(operation.id(), event).then(next).catch((err) => { + next(err, event, next) + }) + }) + }) + + asyncapi.operations().filterBySend().forEach(operation => { + const channel = operation.channels().all()[0] // operation can have only one channel. + if (operation.reply()) { + console.warn(`Operation ${operation.id()} has a reply defined. Glee does not support replies yet.`) + } + const schema = getMessagesSchema(operation) + const contextErrorMessage = `Your application is sending a message to channel "${channel.id()}" but the payload of the message is not matching the definition(s) in your AsyncAPI document. If you believe your code is correct, have a look at your AsyncAPI document, especially the messages listed in the channels › ${channel.id()} section. Otherwise, check your code. Here's what failed:\n\n` + if (schema.oneOf.length > 1) { + this.useOutbound(channel.id(), validate(schema, contextErrorMessage)) + } else if (schema.oneOf.length === 1) { + this.useOutbound(channel.id(), validate(schema.oneOf[0], contextErrorMessage)) + } + this.useOutbound(channel.id(), json2string) + }) + + this._internalEvents.on('adapter:auth', async (e: AuthEvent) => { + await this.runAuth({ + app: this, + serverName: e.serverName, + authProps: e.authProps, + done: e.done, + doc: e.doc, + }) + }) + + this._internalEvents.on('adapter:connect', async (e: EnrichedEvent) => { + await this.runLifecycleEvent(LifecycleEvent.onConnect, { + app: this, + serverName: e.serverName, + connection: e.connection, + }) + }) + + this._internalEvents.on('adapter:reconnect', async (e: EnrichedEvent) => { + await this.runLifecycleEvent(LifecycleEvent.onReconnect, { + app: this, + serverName: e.serverName, + connection: e.connection, + }) + }) + + this._internalEvents.on('adapter:close', async (e: EnrichedEvent) => { + await this.runLifecycleEvent(LifecycleEvent.onDisconnect, { + app: this, + serverName: e.serverName, + connection: e.connection, + }) + }) + + this._internalEvents.on('adapter:server:ready', async (e: EnrichedEvent) => { + await this.runLifecycleEvent(LifecycleEvent.onServerReady, { + app: this, + serverName: e.serverName, + }) + }) + + this._internalEvents.on('adapter:server:connection:open', async (e: EnrichedEvent) => { + await this.runLifecycleEvent(LifecycleEvent.onServerConnectionOpen, { + app: this, + serverName: e.serverName, + connection: e.connection, + }) + }) + + this._internalEvents.on('adapter:server:connection:close', async (e: EnrichedEvent) => { + await this.runLifecycleEvent(LifecycleEvent.onServerConnectionClose, { + app: this, + serverName: e.serverName, + connection: e.connection, + }) + }) + } + + get asyncapi(): AsyncAPIDocumentInterface { + return this._asyncapi + } + + get adapters(): AdapterRecord[] { + return this._adapters + } + + get clusterAdapter(): ClusterAdapterRecord { + return this._clusterAdapter + } + + /** + * Adds a connection adapter. + * + * @param {GleeQuoreAdapter} adapter The adapter. + * @param {String} serverName The name of the AsyncAPI Server to use with the adapter. + * @param {Object} [config] The configuration for the adapter. + */ + addAdapter(Adapter: typeof GleeQuoreAdapter, serverName: string, config?: object) { + this._adapters.push({ + Adapter, + serverName, + server: this.asyncapi.servers().get(serverName), + asyncapi: this.asyncapi, + config, + }) + } + + /** + * Sets the cluster adapter to use. + * + * @param {GleeQuoreClusterAdapter} adapter The adapter. + * @param {String} [clusterName] The name of the cluster. + * @param {String} [clusterURL] The URL of the cluster. + */ + setClusterAdapter(Adapter: typeof GleeQuoreClusterAdapter, clusterName = 'cluster', clusterURL: string) { + this._clusterAdapter = { + Adapter, + clusterName, + clusterURL, + } + } + + /** + * Use a middleware for inbound messages. + * @param {String} [channel] The channel you want to scope the middleware to. + * @param {Function|GleeQuoreRouter} ...middlewares A function or GleeRouter to use as a middleware. + */ + use(...middlewares: GenericMiddleware[]): void + use(channel: string, ...middlewares: GenericMiddleware[]): void + use( + channel: string | GenericMiddleware, + ...middlewares: GenericMiddleware[] + ): void { + this._router.use(...arguments) // eslint-disable-line prefer-rest-params + } + + /** + * Use a middleware for outbound messages. + * @param {String} [channel] The channel you want to scope the middleware to. + * @param {Function|GleeQuoreRouter} ...middlewares A function or GleeRouter to use as a middleware. + */ + useOutbound(...middlewares: GenericMiddleware[]): void + useOutbound(channel: string, ...middlewares: GenericMiddleware[]): void + useOutbound( + channel: string | GenericMiddleware, + ...middlewares: GenericMiddleware[] + ): void { + this._router.useOutbound(...arguments) // eslint-disable-line prefer-rest-params + } + + /** + * Send a message to the connected servers. + * + * @param {IGleeQuoreMessageConstructor|GleeQuoreMessage} message The message you want to send. + */ + send(message: IGleeQuoreMessageConstructor | GleeQuoreMessage): void { + console.log(message) + let msg: GleeQuoreMessage + if (message instanceof GleeQuoreMessage) { + msg = message + } else { + msg = new GleeQuoreMessage(message) + } + + msg.setOutbound() + + this._processMessage( + this._router.getOutboundMiddlewares(), + this._router.getOutboundErrorMiddlewares(), + msg + ) + } + + /** + * Starts the application. + */ + async start(): Promise { + const promises = [] + + this._adapters.forEach((a) => { + const adapterOptions: GleeQuoreAdapterOptions = { + glee: this, + serverName: a.serverName, + server: a.server, + parsedAsyncAPI: a.asyncapi, + config: a.config, + } + + a.instance = new a.Adapter(adapterOptions) + promises.push(a.instance.connect()) + }) + + try { + if (this._clusterAdapter) { + this._clusterAdapter.instance = new this._clusterAdapter.Adapter(this) + promises.push(this._clusterAdapter.instance.connect().catch((error) => { + console.error('Error connecting to cluster:', error) + })) + } + } catch (error) { + console.error('Error connecting:', error) + } + + return Promise.all(promises) + } + + /** + * Injects a message into the Glee inbound middleware chain. + * + * @param {GleeQuoreMessage} message The message you want to send. + * @param {String} serverName The name of the server this message is coming from. + * @param {GleeQuoreConnection} [connection] The connection used when receiving the message. Its type is unknown and must be handled by the adapters. + */ + injectMessage( + message: GleeQuoreMessage, + serverName: string, + connection: GleeQuoreConnection + ) { + message.serverName = serverName + message.connection = connection + message.setInbound() + + this._processMessage( + this._router.getMiddlewares(), + this._router.getErrorMiddlewares(), + message + ) + } + + /** + * Injects an error into the Glee inbound error middleware chain. + * + * @param {Any} error The error. + * @param {String} [channel] The channel of the error. + */ + injectError(error: Error, channel?: string) { + this._processError( + this._router.getErrorMiddlewares(), + error, + new GleeQuoreMessage({ channel }) + ) + } + + /** + * Synchronizes the other instances in the cluster with the message. + * + * @param {GleeQuoreMessage} message + */ + syncCluster(message: GleeQuoreMessage): void { + if (this._clusterAdapter && !message.cluster) { + this._clusterAdapter.instance.send(message).catch((e: Error) => { + this._processError(this._router.getErrorMiddlewares(), e, message) + }) + } + } + + /** + * Starts executing the middlewares for the given message. + * + * @param {ChannelMiddlewareTuple} middlewares The middleware chain to execute. + * @param {ChannelErrorMiddlewareTuple} errorMiddlewares The middlewares chain to execute in case of error. + * @param {GleeQuoreMessage} message The message to pass to the middlewares. + * @private + */ + private _processMessage( + middlewares: ChannelMiddlewareTuple[], + errorMiddlewares: ChannelErrorMiddlewareTuple[], + message: GleeQuoreMessage + ): void { + const mws = middlewares + .filter((mw) => matchChannel(mw.channel, message.channel)) + .map((mw) => (msg: GleeQuoreMessage, next: MiddlewareCallback) => { + const msgForMiddleware: GleeQuoreMessage = duplicateMessage(msg) + msgForMiddleware.params = getParams( + mw.channel, + msgForMiddleware.channel + ) + + msgForMiddleware.on('send', (m: GleeQuoreMessage) => { + m.setOutbound() + this._processMessage( + this._router.getOutboundMiddlewares(), + this._router.getOutboundErrorMiddlewares(), + m + ) + }) + + mw.fn.call( + mw.fn, + msgForMiddleware, + (err: Error, newMessage: GleeQuoreMessage) => { + const nextMessage = newMessage || msgForMiddleware + nextMessage.channel = message.channel // This is to avoid the channel to be modified. + next(err, nextMessage) + } + ) + }) + + async.seq(...mws)(message, (err: Error, msg: GleeQuoreMessage) => { + if (err) { + message.notifyFailedProcessing() + debug('Error encountered while processing middlewares.') + this._processError(errorMiddlewares, err, msg) + return + } + + if (middlewares === this._router.getOutboundMiddlewares()) { + debug('Outbound pipeline finished. Sending message...') + this._adapters.forEach((a: AdapterRecord) => { + if ( + a.instance && + (!msg.serverName || msg.serverName === a.serverName) + ) { + a.instance.send(msg).catch((e: Error) => { + this._processError(errorMiddlewares, e, msg) + }) + } + }) + } else { + message.notifySuccessfulProcessing() + debug('Inbound pipeline finished.') + } + }) + } + + /** + * Starts executing the middlewares for the given error and message. + * + * @param {Array} errorMiddlewares The error middlewares chain to execute. + * @param {Any} error The error to pass to the middleware. + * @param {GleeQuoreMessage} message The message to pass to the middlewares. + * @private + */ + private _processError( + errorMiddlewares: ChannelErrorMiddlewareTuple[], + error: Error, + message: GleeQuoreMessage + ): void { + const emws = errorMiddlewares.filter((emw) => + matchChannel(emw.channel, message.channel) + ) + if (!emws.length) return + + this._execErrorMiddleware(emws, 0, error, message) + } + + private _execErrorMiddleware( + emws: ChannelErrorMiddlewareTuple[], + index: number, + error: Error, + message: GleeQuoreMessage + ) { + const emwsLength = emws.length + emws[(index + emwsLength) % emwsLength].fn(error, message, (err: Error) => { + if (!emws[index + 1]) return + this._execErrorMiddleware.call(null, emws, index + 1, err, message) + }) + } + + emitInternalEvent(eventName: string | symbol, ...args: any[]): boolean { + return this._internalEvents.emit(eventName, ...args) + } + + async registerAuth(serverName: string, authInfo: AuthFunctionInfo) { + this._authFunctions.set(serverName, authInfo) + } + + async runAuth(params: GleeQuoreAuthFunctionEvent) { + const { serverName, done } = params + const auth = this._authFunctions.get(serverName) + if (!auth) { + console.error(`Missing Authentication function for server "${serverName}".`) + done(false, 422, 'Cannot find authentication function') + return + } + await auth.serverAuth(params) + } + + async clientAuthConfig(serverName: string) { + return this._authFunctions.get(serverName)?.clientAuth + } + + async on(operationId: string, func: GleeQuoreFunction) { + try { + const operation = this.asyncapi.operations().get(operationId) + if (!operation) { + throw new Error(`There's no operation with ID "${operationId}" in your AsyncAPI document.`) + } else if (operation.action() !== 'receive') { + throw new Error(`The operation with ID "${operationId}" has been defined as a "receive" operation in your AsyncAPI document. You can only call «.on()» over "receive" operations.`) + } + debug(`Registering operation: ${operationId}`) + this._functions.set(operationId, { + run: func, + }) + } catch(err: unknown) { + this.emitInternalEvent('error', err) + } + } + + async runFunction(operationId: string, message: GleeQuoreMessage) { + try { + debug(`Triggering function for operation ID: ${operationId}`) + const operation = this.asyncapi.operations().get(operationId) + if (!operation) { + throw new Error(`Error triggering operation with ID "${operationId}". There's no operation with such ID in your AsyncAPI document.`) + } + const operationFunction = this._functions.get(operationId) + if (!operationFunction) { + throw new Error(`Error triggering operation with ID "${operationId}". No operation has been registered with such ID. Please, register an operation with such ID as follows: «.on('${operationId}', (message) => { /* Your business logic here... */ })».`) + } + message.operation = operation + await operationFunction.run({ + payload: message.payload, + query: message.query, + headers: message.headers, + request: message.request, + channel: message.channel, + connection: message.connection, + serverName: message.serverName, + app: this, + } as GleeQuoreFunctionEvent) + } catch (err: unknown) { + this.emitInternalEvent('error', err) + } + } + + async registerLifecycleEvent(lifecycleEvent: LifecycleEvent, func: GleeQuoreLifecycleFunction, serverNames?: string[]) { + if (!this._lifecycleEvents.has(lifecycleEvent)) { + this._lifecycleEvents.set(lifecycleEvent, []) + } + + this._lifecycleEvents.set(lifecycleEvent, [ + ...this._lifecycleEvents.get(lifecycleEvent), + { + func, + servers: serverNames, + }, + ]) + } + + async runLifecycleEvent(lifecycleEvent: LifecycleEvent, params: GleeQuoreLifecycleEvent) { + try { + if (!Array.isArray(this._lifecycleEvents.get(lifecycleEvent))) return + + const connectionServer = params.connection.serverName + const handlers = this._lifecycleEvents.get(lifecycleEvent).filter((info) => { + if (info.servers) { + return info.servers.includes(connectionServer) + } + + return true + }) + + if (!handlers.length) return + + debug(`Running ${lifecycleEvent} lifecycle event...`) + + await Promise.all(handlers.map((info) => info.func(params))) + } catch (err: unknown) { + this.emitInternalEvent('error', err) + } + } + + async onConnect(func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onConnect, func) + } + + async onConnectToServer(serverName: string, func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onConnect, func, [serverName]) + } + + async onConnectToServers(serverNames: string[], func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onConnect, func, serverNames) + } + + async onReconnect(func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onReconnect, func) + } + + async onReconnectToServer(serverName: string, func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onReconnect, func, [serverName]) + } + + async onReconnectToServers(serverNames: string[], func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onReconnect, func, serverNames) + } + + async onDisconnect(func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onDisconnect, func) + } + + async onDisconnectFromServer(serverName: string, func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onDisconnect, func, [serverName]) + } + + async onDisconnectFromServers(serverNames: string[], func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onDisconnect, func, serverNames) + } + + async onAllServersConnectionClose(func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerConnectionClose, func) + } + + async onServerConnectionCloses(serverName: string, func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerConnectionClose, func, [serverName]) + } + + async onServersConnectionClose(serverNames: string[], func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerConnectionClose, func, serverNames) + } + + async onAllServersConnectionOpen(func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerConnectionOpen, func) + } + + async onServerConnectionOpens(serverName: string, func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerConnectionOpen, func, [serverName]) + } + + async onServersConnectionOpen(serverNames: string[], func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerConnectionOpen, func, serverNames) + } + + async onAllServersReady(func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerReady, func) + } + + async onServerReady(serverName: string, func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerReady, func, [serverName]) + } + + async onServersReady(serverNames: string[], func: GleeQuoreLifecycleFunction) { + this.registerLifecycleEvent(LifecycleEvent.onServerReady, func, serverNames) + } + + async onError(errorCallback: (err: Error) => void) { + this._internalEvents.on('error', errorCallback) + } + + async getSelectedServerNames(): Promise { + const serverNames = this._adapters.map(a => a.serverName).filter(Boolean) + return [...new Set(serverNames)] // Dedupe the array + } +} diff --git a/packages/gleequore/src/lib/adapter.ts b/packages/gleequore/src/lib/adapter.ts new file mode 100644 index 000000000..b1b62f0c2 --- /dev/null +++ b/packages/gleequore/src/lib/adapter.ts @@ -0,0 +1,275 @@ +/* eslint-disable security/detect-object-injection */ +import { AsyncAPIDocumentInterface as AsyncAPIDocument, ServerInterface } from '@asyncapi/parser' +import EventEmitter from 'events' +import uriTemplates from 'uri-templates' +import GleeQuoreConnection from './connection.js' +import GleeQuore from '../index.js' +import GleeQuoreMessage from './message.js' +import { resolveFunctions, validateData } from '@asyncapi/glee-shared-utils' +import { AuthProps, GleeQuoreAdapterOptions } from '../index.d.js' +import GleeQuoreError from '../errors.js' + +export type EnrichedEvent = { + connection?: GleeQuoreConnection + serverName: string + server: ServerInterface +} + +export type AuthEvent = { + serverName: string + authProps: AuthProps + done: any + doc: any +} + +class GleeQuoreAdapter extends EventEmitter { + private _glee: GleeQuore + private _serverName: string + private _AsyncAPIServer: ServerInterface + private _parsedAsyncAPI: AsyncAPIDocument + private _channelNames: string[] + private _operationIds: string[] + private _channelAddresses: string[] + private _connections: GleeQuoreConnection[] + private _serverUrlExpanded: string + private _config: object + + + constructor({ glee, serverName, server, parsedAsyncAPI, config }: GleeQuoreAdapterOptions) { + super() + + this._glee = glee + this._serverName = serverName + this._AsyncAPIServer = server + this._config = config + this._parsedAsyncAPI = parsedAsyncAPI + this._channelNames = this._parsedAsyncAPI.channels().all().map(e => e.id()) + this._channelAddresses = this._parsedAsyncAPI.channels().all().map(c => c.address()) + this._operationIds = this._parsedAsyncAPI.operations().all().map(o => o.id()) + this._connections = [] + + const uriTemplateValues = new Map() + process.env.GLEE_SERVER_VARIABLES?.split(',').forEach((t) => { + const [localServerName, variable, value] = t.split(':') + if (localServerName === this._serverName) { + uriTemplateValues.set(variable, value) + } + }) + this._serverUrlExpanded = uriTemplates(this._AsyncAPIServer.url()).fill( + Object.fromEntries(uriTemplateValues.entries()) + ) + + this.on('error', (err) => { + this._glee.injectError(err) + }) + this.on('message', (message, connection) => { + const conn = new GleeQuoreConnection({ + connection, + channels: this._connections.find((c) => c.rawConnection === connection) + .channels, + serverName, + server, + parsedAsyncAPI, + }) + this._glee.injectMessage(message, serverName, conn) + }) + + function enrichEvent(ev): EnrichedEvent { + return { + ...ev, + ...{ + serverName, + server, + }, + } + } + + function enrichAuthEvent(ev): AuthEvent { + return { + ...ev, + ...{ + serverName, + authProps: ev.authProps, + callback: ev.callback, + doc: ev.doc, + }, + } + } + + function createConnection(ev: { + channels?: string[] + channel?: string + connection: any + }): GleeQuoreConnection { + let channels = ev.channels + if (!channels && ev.channel) channels = [ev.channel] + + return new GleeQuoreConnection({ + connection: ev.connection, + channels, + serverName, + server, + parsedAsyncAPI, + }) + } + + this.on('auth', (ev) => { + this._glee.emitInternalEvent('adapter:auth', enrichAuthEvent(ev)) + }) + + this.on('connect', (ev) => { + const conn = createConnection(ev) + this._connections.push(conn) + + this._glee.emitInternalEvent( + 'adapter:connect', + enrichEvent({ + connection: conn, + }) + ) + }) + + this.on('server:ready', (ev) => { + this._glee.emitInternalEvent('adapter:server:ready', enrichEvent(ev)) + }) + + this.on('server:connection:open', (ev) => { + const conn = createConnection(ev) + this._connections.push(conn) + + this._glee.emitInternalEvent( + 'adapter:server:connection:open', + enrichEvent({ + connection: conn, + }) + ) + }) + + this.on('reconnect', (ev) => { + const conn = createConnection(ev) + + this._glee.emitInternalEvent( + 'adapter:reconnect', + enrichEvent({ + connection: conn, + }) + ) + }) + + this.on('close', (ev) => { + const conn = createConnection(ev) + + this._glee.emitInternalEvent( + 'adapter:close', + enrichEvent({ + connection: conn, + }) + ) + }) + } + + get app(): GleeQuore { + return this._glee + } + + get serverName(): string { + return this._serverName + } + + get AsyncAPIServer(): ServerInterface { + return this._AsyncAPIServer + } + + get parsedAsyncAPI(): AsyncAPIDocument { + return this._parsedAsyncAPI + } + + get channelNames(): string[] { + return this._channelNames + } + + get operationIds(): string[] { + return this._operationIds + } + + get channelAddresses(): string[] { + return this._channelAddresses + } + + get connections(): GleeQuoreConnection[] { + return this._connections + } + + get serverUrlExpanded(): string { + return this._serverUrlExpanded + } + + async resolveConfig() { + if (!this._config) return undefined + const protocolConfig = { ...this._config } as any + await resolveFunctions(protocolConfig) + return protocolConfig + } + + async getAuthConfig(auth: any) { + if (!auth) return + if (typeof auth !== 'function') { + await resolveFunctions(auth) + return auth + } + + return await auth({ + serverName: this._serverName, + parsedAsyncAPI: this._parsedAsyncAPI, + }) + } + + /** + * Returns a list of the channels a given adapter has to subscribe to. + */ + getSubscribedChannels(): string[] { + return this._channelNames.filter((channelName) => { + const channel = this._parsedAsyncAPI.channels().get(channelName) + if (channel.operations().filterByReceive().length > 0) return true + + const channelServers = channel.servers() + ? channel.servers() + : channel.extensions().get('x-servers')?.value() || this._parsedAsyncAPI.allServers() + return channelServers.includes(this._serverName) + }) + } + + /** + * Connects to the remote server. + */ + async connect(): Promise { + throw new Error('Method `connect` is not implemented.') + } + + /** + * Sends a message to the remote server. + * + * @param {GleeQuoreMessage} message The message to send. + */ + + async send( + message: GleeQuoreMessage /* eslint-disable-line @typescript-eslint/no-unused-vars */ + ): Promise { + throw new Error('Method `send` is not implemented.') + } + + validate(data: any, schema: object, triggerError = false) { + const { isValid, errors, humanReadableError } = validateData(data, schema) + if (!isValid && triggerError) { + throw new GleeQuoreError({ humanReadableError, errors }) + } + + return { + isValid, + errors, + humanReadableError, + } + } +} + +export default GleeQuoreAdapter diff --git a/packages/gleequore/src/lib/cluster.ts b/packages/gleequore/src/lib/cluster.ts new file mode 100644 index 000000000..fecba40eb --- /dev/null +++ b/packages/gleequore/src/lib/cluster.ts @@ -0,0 +1,202 @@ +import EventEmitter from 'events' +import uriTemplates from 'uri-templates' +import { v4 as uuidv4 } from 'uuid' +import GleeQuore from '../index.js' +import GleeQuoreMessage from './message.js' +import { validateData } from '@asyncapi/glee-shared-utils' +import GleeError from '../errors.js' + +export type ClusterEvent = { + serverName: string + adapter: GleeQuoreClusterAdapter +} + +const ClusterMessageSchema = { + type: 'object', + properties: { + instanceId: { type: 'string' }, + payload: { type: 'string' }, + headers: { + type: 'object', + propertyNames: { type: 'string' }, + additionProperties: { type: 'string' }, + }, + channel: { type: 'string' }, + serverName: { type: 'string' }, + broadcast: { type: 'boolean' }, + cluster: { type: 'boolean' }, + outbound: { type: 'boolean' }, + inbound: { type: 'boolean' }, + }, + required: ['instanceId', 'payload', 'channel', 'serverName', 'broadcast'], + additionalProperties: false, +} + +class GleeQuoreClusterAdapter extends EventEmitter { + private _glee: GleeQuore + private _serverName: string + private _serverUrlExpanded: string + private _instanceId: string + + /** + * Instantiates a Glee Cluster adapter. + * + * @param {GleeQuore} glee A reference to the Glee app. + */ + constructor(glee: GleeQuore) { + super() + + this._instanceId = uuidv4() + this._glee = glee + const serverName = this._glee.clusterAdapter.clusterName || 'cluster' + this._serverName = serverName + const url = this._glee.clusterAdapter.clusterURL + + if (!url) { + console.log( + 'Please provide a URL for your cluster adapter in glee.config.js' + ) + process.exit(1) + } + + const uriTemplateValues = new Map() + process.env.GLEE_SERVER_VARIABLES?.split(',').forEach((t) => { + const [localServerName, variable, value] = t.split(':') + if (localServerName === this._serverName) + {uriTemplateValues.set(variable, value)} + }) + this._serverUrlExpanded = uriTemplates(url).fill( + Object.fromEntries(uriTemplateValues.entries()) + ) + + function genClusterEvent(ev): ClusterEvent { + return { + ...ev, + serverName, + } + } + + this.on('error', (err) => { + this._glee.injectError(err) + }) + this.on('message', (message) => { + message.cluster = true + this._glee.send(message) + }) + + this.on('connect', (ev) => { + this._glee.emitInternalEvent('adapter:cluster:connect', genClusterEvent(ev)) + }) + + this.on('reconnect', (ev) => { + this._glee.emitInternalEvent('adapter:cluster:reconnect', genClusterEvent(ev)) + }) + + this.on('close', (ev) => { + this._glee.emitInternalEvent('adapter:cluster:close', genClusterEvent(ev)) + }) + } + + get glee(): GleeQuore { + return this._glee + } + + get serverName(): string { + return this._serverName + } + + get serverUrlExpanded(): string { + return this._serverUrlExpanded + } + + get instanceId(): string { + return this._instanceId + } + + /** + * Connects to the remote server. + */ + async connect(): Promise { + throw new Error('Method `connect` is not implemented.') + } + + /** + * Sends a message to the remote server. + * + * @param {GleeQuoreMessage} message The message to send. + */ + async send(message: GleeQuoreMessage): Promise { // eslint-disable-line @typescript-eslint/no-unused-vars + throw new Error('Method `send` is not implemented.') + } + + /** + * Serialize a message into JSON. + * + * @param {GleeQuoreMessage} message The message to serialize. + * @returns {String} The serialized message, + */ + serializeMessage(message: GleeQuoreMessage): string { + return JSON.stringify({ + instanceId: this._instanceId, + payload: message.payload, + headers: message.headers, + channel: message.channel, + serverName: message.serverName, + broadcast: message.broadcast, + cluster: message.cluster, + inbound: message.isInbound(), + outbound: message.isOutbound(), + }) + } + + /** + * Deserializes the serialized message. + * + * @param {String} serialized The serialized message + * @returns {GleeQuoreMessage} The deserialized message. + */ + deserializeMessage(serialized: string): GleeQuoreMessage { + let messageData + try { + messageData = JSON.parse(serialized) + const { errors, humanReadableError, isValid } = validateData( + messageData, + ClusterMessageSchema + ) + if (!isValid) { + throw new GleeError({ humanReadableError, errors }) + } + } catch (e) { + this._glee.injectError(e) + return + } + + let payload = messageData.payload + try { + payload = JSON.parse(messageData.payload) + } catch (e) { + // payload isn't JSON + } + + if (messageData.instanceId === this._instanceId) return + + const message = new GleeQuoreMessage({ + payload: payload, + headers: messageData.headers, + channel: messageData.channel, + serverName: messageData.serverName, + broadcast: messageData.broadcast, + cluster: messageData.cluster, + }) + + if (messageData.inbound && !messageData.outbound) { + message.setInbound() + } else { + message.setOutbound() + } + + return message + } +} + +export default GleeQuoreClusterAdapter diff --git a/packages/gleequore/src/lib/connection.ts b/packages/gleequore/src/lib/connection.ts new file mode 100644 index 000000000..257cb4fff --- /dev/null +++ b/packages/gleequore/src/lib/connection.ts @@ -0,0 +1,82 @@ +import { ServerInterface as AsyncAPIServer, AsyncAPIDocumentInterface as AsyncAPIDocument } from '@asyncapi/parser' + +interface IGleeQuoreConnectionConstructor { + connection: any + channels: string[] + serverName: string + server?: AsyncAPIServer + parsedAsyncAPI: AsyncAPIDocument +} + +class GleeQuoreConnection { + private _rawConnection: any + private _channels: string[] + private _serverName: string + private _AsyncAPIServer: AsyncAPIServer + private _parsedAsyncAPI: AsyncAPIDocument + + /** + * Instantiates a Glee connection. + * + * @param {Object} options + * @param {any} options.connection The raw connection object this GleeQuoreConnection has to represent. + * @param {String[]} options.channels The name of the channels associated to this connection. + * @param {String} options.serverName The name of the AsyncAPI server the connection is pointing to. + * @param {AsyncAPIServer} options.server The AsyncAPI server the connection is pointing to. + * @param {AsyncAPIDocument} options.parsedAsyncAPI The AsyncAPI document. + */ + constructor({ + connection, + channels, + serverName, + server, + parsedAsyncAPI, + }: IGleeQuoreConnectionConstructor) { + this._rawConnection = connection + this._channels = channels + this._serverName = serverName + this._AsyncAPIServer = server + this._parsedAsyncAPI = parsedAsyncAPI + } + + get rawConnection(): any { + return this._rawConnection + } + + get channels(): string[] { + return this._channels + } + + get serverName(): string { + return this._serverName + } + + get AsyncAPIServer(): AsyncAPIServer { + return this._AsyncAPIServer + } + + get parsedAsyncAPI(): AsyncAPIDocument { + return this._parsedAsyncAPI + } + + /** + * Checks whether a channel is associated with this connection. + * + * @param {String} channelName The name of the channel. + * @return {Boolean} + */ + hasChannel(channelName: string): boolean { + return this.channels.includes(channelName) + } + + /** + * Returns the real connection object. + * + * @return {Any} + */ + getRaw(): any { + return this.rawConnection + } +} + +export default GleeQuoreConnection diff --git a/packages/gleequore/src/lib/message.ts b/packages/gleequore/src/lib/message.ts new file mode 100644 index 000000000..ea0b78c63 --- /dev/null +++ b/packages/gleequore/src/lib/message.ts @@ -0,0 +1,216 @@ +import EventEmitter from 'events' +import GleeQuoreConnection from './connection.js' +import { OperationInterface } from '@asyncapi/parser' + +type MessageHeaders = { [key: string]: any } +type QueryParam = { [key: string]: string } | { [key: string]: string[] } + +export interface IGleeQuoreMessageConstructor { + payload?: any + headers?: MessageHeaders + channel?: string + operation?: OperationInterface + request?: GleeQuoreMessage + serverName?: string + connection?: GleeQuoreConnection + broadcast?: boolean + cluster?: boolean + query?: QueryParam +} + +export default class GleeQuoreMessage extends EventEmitter { + private _payload: any + private _headers: { [key: string]: string } + private _channel: string + private _serverName: string + private _connection: GleeQuoreConnection + private _broadcast: boolean + private _inbound: boolean + private _request: GleeQuoreMessage + private _operation: OperationInterface + private _outbound: boolean + private _cluster: boolean + private _params: { [key: string]: string } + private _query: QueryParam + + /** + * Instantiates a new GleeMessage. + * + * @param {Object} options + * @param {Any} [options.payload] Message payload. + * @param {Object} [options.headers] Message headers. + * @param {String} [options.channel] Message channel. + * @param {String} [options.serverName] The name of the associated AsyncAPI server. + * @param {OperationInterface} [options.operation] The operation that this message belongs to. + * @param {GleeQuoreMessage} [options.request] If this message is a reply, the parent message that this message is created for as a reply. + * @param {GleeQuoreConnection} [options.connection] The connection through which the message will be sent or has been received. + * @param {Boolean} [options.broadcast=false] Whether the message should be broadcasted or not. + * @param {Boolean} [options.cluster=false] Whether the message is from a cluster adapter or not. + * @param {Object} [options.query] The query parameters to send or receive query when using the HTTP protocol. + */ + constructor({ + payload, + headers, + channel, + serverName, + operation, + connection, + request, + broadcast = false, + cluster = false, + query, + }: IGleeQuoreMessageConstructor) { + super() + + if (payload) this._payload = payload + if (headers) this._headers = headers + if (channel) this._channel = channel + if (serverName) this._serverName = serverName + if (connection) this._connection = connection + if (broadcast) this._broadcast = !!broadcast + if (cluster) this._cluster = cluster + if (query) this._query = query + if (request) this._request = request + if (operation) this._operation = operation + } + + get payload(): any { + return this._payload + } + + set payload(value: any) { + this._payload = value + } + + hasRequest(): boolean { + return !!this._request + } + + set request(value: GleeQuoreMessage) { + this._request = value + } + + get request() { + return this._request + } + + get operation(): OperationInterface { + return this._operation + } + + set operation(value: OperationInterface) { + this._operation = value + } + + + get headers(): { [key: string]: string } { + return this._headers + } + + set headers(value: { [key: string]: string }) { + this._headers = value + } + + get channel(): string { + return this._channel + } + + set channel(value: string) { + this._channel = value + } + + get serverName(): string { + return this._serverName + } + + set serverName(value: string) { + this._serverName = value + } + + get connection(): GleeQuoreConnection { + return this._connection + } + + set connection(value: GleeQuoreConnection) { + this._connection = value + } + + get broadcast(): boolean { + return this._broadcast + } + + get params(): { [key: string]: string } { + return this._params + } + + set params(value: { [key: string]: string }) { + this._params = value + } + + get cluster(): boolean { + return this._cluster + } + + set cluster(value: boolean) { + this._cluster = value + } + + get query(): QueryParam { + return this._query + } + + set query(value: QueryParam) { + this._query = value + } + + /** + * Makes the message suitable only for the inbound pipeline. + */ + setInbound() { + this._inbound = true + this._outbound = false + } + + /** + * Makes the message suitable only for the outbound pipeline. + */ + setOutbound() { + this._inbound = false + this._outbound = true + } + + /** + * Checks if it's an inbound message. + */ + isInbound() { + return this._inbound && !this._outbound + } + + /** + * Checks if it's an outbound message. + */ + isOutbound() { + return this._outbound && !this._inbound + } + + /** + * Tells Glee to send the message. + */ + send() { + this.emit('send', this) + } + + /** + * Indicates successfully processed the message + */ + notifySuccessfulProcessing() { + this.emit('processing:successful') + } + + /** + * Indicates failure in processing the message + */ + notifyFailedProcessing() { + this.emit('processing:failed') + } +} diff --git a/packages/gleequore/src/lib/router.ts b/packages/gleequore/src/lib/router.ts new file mode 100644 index 000000000..995336708 --- /dev/null +++ b/packages/gleequore/src/lib/router.ts @@ -0,0 +1,211 @@ +import { ErrorMiddleware, Middleware } from '../middlewares/index.js' + +export type ChannelMiddlewareTuple = { + channel: string + fn: Middleware +} + +export type ChannelErrorMiddlewareTuple = { + channel: string + fn: ErrorMiddleware +} + +export type GenericMiddleware = Middleware | ErrorMiddleware +export type GenericChannelMiddlewareTuple = + | ChannelMiddlewareTuple + | ChannelErrorMiddlewareTuple + +class GleeQuoreRouter { + private middlewares: ChannelMiddlewareTuple[] + private outboundMiddlewares: ChannelMiddlewareTuple[] + private errorMiddlewares: ChannelErrorMiddlewareTuple[] + private outboundErrorMiddlewares: ChannelErrorMiddlewareTuple[] + + /** + * Instantiates a GleeRouter. + */ + constructor() { + this.middlewares = [] + this.outboundMiddlewares = [] + this.errorMiddlewares = [] + this.outboundErrorMiddlewares = [] + } + + /** + * Use a middleware for inbound messages. Please, note that when passing a GleeRouter as a param, + * this function will make use of inbound and outbound middlewares. + * + * @param {String} [channel] The channel you want to scope the middleware to. + * @param {GenericMiddleware} middleware A middleware function. + */ + use(...middlewares: GenericMiddleware[]): void + use(channel: string, ...middlewares: GenericMiddleware[]): void + use( + channel: string | GenericMiddleware, + ...middlewares: GenericMiddleware[] + ): void { + const mws: GenericChannelMiddlewareTuple[] = + this.middlewaresToChannelMiddlewaresTuples(channel, ...middlewares) + + mws.forEach((mw) => { + if (mw.fn.length <= 2) { + this.addMiddlewares([mw as ChannelMiddlewareTuple]) + } else { + this.addErrorMiddlewares([mw as ChannelErrorMiddlewareTuple]) + } + }) + } + + /** + * Use a middleware for outbound messages. + * + * @param {String} [channel] The channel you want to scope the middleware to. + * @param {Function|GleeQuoreRouter} ...middlewares A function or GleeRouter to use as a middleware. + */ + useOutbound(...middlewares: GenericMiddleware[]): void + useOutbound(channel: string, ...middlewares: GenericMiddleware[]): void + useOutbound( + channel: string | GenericMiddleware, + ...middlewares: GenericMiddleware[] + ) { + const mws: GenericChannelMiddlewareTuple[] = + this.middlewaresToChannelMiddlewaresTuples(channel, ...middlewares) + + mws.forEach((mw) => { + if (mw.fn.length <= 2) { + this.addOutboundMiddlewares([mw as ChannelMiddlewareTuple]) + } else { + this.addOutboundErrorMiddlewares([mw as ChannelErrorMiddlewareTuple]) + } + }) + } + + private middlewaresToChannelMiddlewaresTuples( + channel: string | GenericMiddleware, + ...middlewares: GenericMiddleware[] + ): GenericChannelMiddlewareTuple[] { + const realChannel = typeof channel === 'string' ? channel : undefined + const allMiddlewares: GenericMiddleware[] = realChannel + ? middlewares + : [channel as GenericMiddleware].concat(middlewares) + return allMiddlewares.map( + (fn) => + ({ + channel: realChannel, + fn, + } as GenericChannelMiddlewareTuple) + ) + } + + /** + * Returns all the inbound middlewares. + * @return {Array} + */ + getMiddlewares(): ChannelMiddlewareTuple[] { + return this.middlewares + } + + /** + * Returns all the outbound middlewares. + * @return {Array} + */ + getOutboundMiddlewares(): ChannelMiddlewareTuple[] { + return this.outboundMiddlewares + } + + /** + * Returns all the inbound error middlewares. + * @return {Array} + */ + getErrorMiddlewares(): ChannelErrorMiddlewareTuple[] { + return this.errorMiddlewares + } + + /** + * Returns all the outbound error middlewares. + * @return {Array} + */ + getOutboundErrorMiddlewares(): ChannelErrorMiddlewareTuple[] { + return this.outboundErrorMiddlewares + } + + /** + * Adds a normalized middleware to a target collection. + * + * @param {Array} target The target collection. + * @param {Array} middlewares The middlewares to add to the collection. + * @param {String} [channel] The scope channel. + * @private + */ + private _addMiddlewares( + target: GenericChannelMiddlewareTuple[], + middlewares: GenericChannelMiddlewareTuple[], + channel: string + ) { + middlewares.forEach((mw) => { + if (channel) { + const compoundchannel = mw.channel + ? `${channel}/${mw.channel}` + : channel + target.push({ ...mw, ...{ channel: compoundchannel } }) + } else { + target.push(mw) + } + }) + } + + /** + * Adds a normalized middleware to the inbound middlewares collection. + * + * @param {Array} middlewares The middlewares to add to the collection. + * @param {String} [channel] The scope channel. + */ + addMiddlewares(middlewares: ChannelMiddlewareTuple[], channel?: string) { + this._addMiddlewares(this.middlewares, middlewares, channel) + } + + /** + * Adds a normalized middleware to the outbound middlewares collection. + * + * @param {Array} middlewares The middlewares to add to the collection. + * @param {String} [channel] The scope channel. + */ + addOutboundMiddlewares( + middlewares: ChannelMiddlewareTuple[], + channel?: string + ) { + this._addMiddlewares(this.outboundMiddlewares, middlewares, channel) + } + + /** + * Adds a normalized middleware to the inbound error middlewares collection. + * + * @param {Array} errorMiddlewares The middlewares to add to the collection. + * @param {String} [channel] The scope channel. + */ + addErrorMiddlewares( + errorMiddlewares: ChannelErrorMiddlewareTuple[], + channel?: string + ) { + this._addMiddlewares(this.errorMiddlewares, errorMiddlewares, channel) + } + + /** + * Adds a normalized middleware to the outbound error middlewares collection. + * + * @param {Array} errorMiddlewares The middlewares to add to the collection. + * @param {String} [channel] The scope channel. + */ + addOutboundErrorMiddlewares( + errorMiddlewares: ChannelErrorMiddlewareTuple[], + channel?: string + ) { + this._addMiddlewares( + this.outboundErrorMiddlewares, + errorMiddlewares, + channel + ) + } +} + +export default GleeQuoreRouter diff --git a/packages/gleequore/src/lib/utils.ts b/packages/gleequore/src/lib/utils.ts new file mode 100644 index 000000000..daa6dae4a --- /dev/null +++ b/packages/gleequore/src/lib/utils.ts @@ -0,0 +1,31 @@ +import GleeQuoreMessage from "./message.js" + +/** + * Duplicates a GleeQuoreMessage. + * + * @private + * @param {GleeQuoreMessage} message The message to duplicate. + * @return {GleeQuoreMessage} + */ +export const duplicateMessage = (message: GleeQuoreMessage): GleeQuoreMessage => { + const newMessage = new GleeQuoreMessage({ + operation: message.operation, + payload: message.payload, + headers: message.headers, + channel: message.channel, + request: message.request, + serverName: message.serverName, + connection: message.connection, + broadcast: message.broadcast, + cluster: message.cluster, + query: message.query, + }) + + if (message.isInbound()) { + newMessage.setInbound() + } else { + newMessage.setOutbound() + } + + return newMessage +} diff --git a/packages/gleequore/src/middlewares/buffer2string.ts b/packages/gleequore/src/middlewares/buffer2string.ts new file mode 100644 index 000000000..6f6486855 --- /dev/null +++ b/packages/gleequore/src/middlewares/buffer2string.ts @@ -0,0 +1,10 @@ +import { MiddlewareCallback } from './index.js' +import GleeQuoreMessage from '../lib/message.js' + +export default function buffer2string(message: GleeQuoreMessage, next: MiddlewareCallback) { + if (message.payload instanceof Buffer) { + message.payload = message.payload.toString() + } + + next() +} diff --git a/packages/gleequore/src/middlewares/existsInAsyncAPI.ts b/packages/gleequore/src/middlewares/existsInAsyncAPI.ts new file mode 100644 index 000000000..16ce6e4f5 --- /dev/null +++ b/packages/gleequore/src/middlewares/existsInAsyncAPI.ts @@ -0,0 +1,30 @@ +import { AsyncAPIDocumentInterface as AsyncAPIDocument } from '@asyncapi/parser' +import { MiddlewareCallback } from './index.js' +import GleeQuoreMessage from '../lib/message.js' + +export default (asyncapi: AsyncAPIDocument) => + function existsInAsyncAPI(event: GleeQuoreMessage, next: MiddlewareCallback) { + const messageChannel = asyncapi.channels().get(event.channel) + if (!messageChannel) { + return next(new Error(`Invalid or undefined channel: '${event.channel}'. Ensure that '${event.channel}' is both a valid name and defined in the AsyncAPI file.`)) + } + const receiveOperations = messageChannel.operations().filterByReceive() + const sendOperations = messageChannel.operations().filterBySend() + if (event.isInbound()) { + const hasReceiveOperations = receiveOperations.length > 0 + if (!hasReceiveOperations) { + return next(new Error(`Your application is receiving a message on channel "${messageChannel.id()}" but none of the operations in your AsyncAPI document defines such behavior. If you belive your code is correct, you may want to add a 'receive' operation or a «reply» field to a 'send' operation in your AsyncAPI document. Otherwise, check your code.`)) + } + } + + if (event.isOutbound()) { + const hasSendOperations = sendOperations.length > 0 + const hasReplyInOperation = receiveOperations.some(operation => operation.reply()) + if (!hasSendOperations && !hasReplyInOperation) { + return next(new Error(`Your application is trying to send a message to channel "${messageChannel.id()}" but none of the operations in your AsyncAPI document defines such behavior. If you believe your code is correct, you may want to add a 'send' operation or a «reply» field to a 'receive' operation in your AsyncAPI document. Otherwise, check your code.`)) + } + } + + + return next() + } diff --git a/packages/gleequore/src/middlewares/index.d.ts b/packages/gleequore/src/middlewares/index.d.ts new file mode 100644 index 000000000..162348d72 --- /dev/null +++ b/packages/gleequore/src/middlewares/index.d.ts @@ -0,0 +1,12 @@ +import GleeQuoreMessage from '../lib/message.js' + +export type Middleware = ( + message: GleeQuoreMessage, + next: MiddlewareCallback +) => void +export type ErrorMiddleware = ( + error: Error, + message: GleeQuoreMessage, + next: MiddlewareCallback +) => void +export type MiddlewareCallback = (error?: Error, message?: GleeQuoreMessage) => void diff --git a/packages/gleequore/src/middlewares/json2string.ts b/packages/gleequore/src/middlewares/json2string.ts new file mode 100644 index 000000000..909db9d74 --- /dev/null +++ b/packages/gleequore/src/middlewares/json2string.ts @@ -0,0 +1,12 @@ +import { MiddlewareCallback } from './index.js' +import GleeQuoreMessage from '../lib/message.js' + +export default (message: GleeQuoreMessage, next: MiddlewareCallback) => { + try { + message.payload = JSON.stringify(message.payload) + } catch (e) { + // We did our best... + } + + next() +} diff --git a/packages/gleequore/src/middlewares/string2json.ts b/packages/gleequore/src/middlewares/string2json.ts new file mode 100644 index 000000000..de8430d6c --- /dev/null +++ b/packages/gleequore/src/middlewares/string2json.ts @@ -0,0 +1,12 @@ +import GleeQuoreMessage from '../lib/message.js' +import { MiddlewareCallback } from './index.js' + +export default function string2json(message: GleeQuoreMessage, next: MiddlewareCallback) { + try { + message.payload = JSON.parse(message.payload) + } catch (e) { + // We did our best... + } + + next() +} diff --git a/packages/gleequore/src/middlewares/validate.ts b/packages/gleequore/src/middlewares/validate.ts new file mode 100644 index 000000000..fa8da983c --- /dev/null +++ b/packages/gleequore/src/middlewares/validate.ts @@ -0,0 +1,22 @@ +import { AsyncAPISchema } from '@asyncapi/parser' +import GleeError from '../errors.js' +import GleeQuoreMessage from '../lib/message.js' +import { validateData } from '@asyncapi/glee-shared-utils' +import { MiddlewareCallback } from './index.js' + +export default (schema: AsyncAPISchema, contextErrorMessage = '') => + function validate(event: GleeQuoreMessage, next: MiddlewareCallback) { + const { humanReadableError, errors, isValid } = validateData( + event.payload, + schema as any + ) + if (!isValid) { + return next( + new GleeError({ + humanReadableError: `${contextErrorMessage}${humanReadableError}`, + errors, + }) + ) + } + next() + } diff --git a/packages/gleequore/src/middlewares/validateConnection.ts b/packages/gleequore/src/middlewares/validateConnection.ts new file mode 100644 index 000000000..05afcaa2c --- /dev/null +++ b/packages/gleequore/src/middlewares/validateConnection.ts @@ -0,0 +1,14 @@ +import { MiddlewareCallback } from './index.js' +import GleeQuoreMessage from '../lib/message.js' + +export default (event: GleeQuoreMessage, next: MiddlewareCallback) => { + if (!event.connection) return next() + const { connection, channel } = event + if (!connection.hasChannel(channel)) { + const err = new Error( + `Can't send a message to channel ${channel} using this connection.` + ) + return next(err) + } + next() +} diff --git a/packages/gleequore/test/index.test.ts b/packages/gleequore/test/index.test.ts new file mode 100644 index 000000000..b16460d46 --- /dev/null +++ b/packages/gleequore/test/index.test.ts @@ -0,0 +1,199 @@ +import { describe, it, jest, beforeEach, expect } from '@jest/globals'; +import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; +import GleeQuore from '../src/index'; +import { EventEmitter } from 'events'; +import { Parser } from '@asyncapi/parser' +import { GleeQuoreAuthFunction, GleeQuoreAuthFunctionEvent } from '../src/index.d'; +import GleeQuoreConnection from '../src/lib/connection'; + +const asyncapiDocumentAsJS = { + asyncapi: '3.0.0', + info: { title: '', version: '' }, + servers: { + test: { + host: 'test.mosquitto.org', + protocol: 'mqtt', + }, + }, + channels: { + testChannel: { + address: 'test/channel', + messages: { + test: { + payload: { + type: 'string', + }, + }, + }, + }, + }, + operations: { + receiveTest: { + action: 'receive', + channel: { + $ref: '#/channels/testChannel' + }, + }, + sendTest: { + action: 'send', + channel: { + $ref: '#/channels/testChannel' + }, + }, + }, +}; + +// Generate tests for GleeQuore class +describe('GleeQuore', () => { + beforeEach(() => { + jest.clearAllMocks(); + jest.restoreAllMocks(); + }); + + it('should instantiate GleeQuore', async () => { + const parser = new Parser() + const { document: asyncapi } = await parser.parse(asyncapiDocumentAsJS) + const gleeQuore = new GleeQuore(asyncapi as AsyncAPIDocumentInterface); + expect(gleeQuore.asyncapi).toBe(asyncapi); + expect(gleeQuore.adapters).toEqual([]); + expect(gleeQuore.clusterAdapter).toBeUndefined(); + expect(gleeQuore['_lifecycleEvents']).toBeInstanceOf(Map); + expect(gleeQuore['_functions']).toBeInstanceOf(Map); + + expect(gleeQuore['_router']['middlewares'][0].channel).toBeUndefined(); + expect(gleeQuore['_router']['middlewares'][0].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['middlewares'][0].fn.name).toBe('existsInAsyncAPI'); + expect(gleeQuore['_router']['middlewares'][1].channel).toBeUndefined(); + expect(gleeQuore['_router']['middlewares'][1].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['middlewares'][1].fn.name).toBe('buffer2string'); + expect(gleeQuore['_router']['middlewares'][2].channel).toBeUndefined(); + expect(gleeQuore['_router']['middlewares'][2].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['middlewares'][2].fn.name).toBe('string2json'); + expect(gleeQuore['_router']['middlewares'][3].channel).toBe('testChannel'); + expect(gleeQuore['_router']['middlewares'][3].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['middlewares'][3].fn.name).toBe('validate'); + expect(gleeQuore['_router']['middlewares'][4].channel).toBe('testChannel'); + expect(gleeQuore['_router']['middlewares'][4].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['middlewares'][4].fn.name).toBe(''); + + expect(gleeQuore['_router']['outboundMiddlewares'][0].channel).toBeUndefined(); + expect(gleeQuore['_router']['outboundMiddlewares'][0].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['outboundMiddlewares'][0].fn.name).toBe('existsInAsyncAPI'); + expect(gleeQuore['_router']['outboundMiddlewares'][1].channel).toBeUndefined(); + expect(gleeQuore['_router']['outboundMiddlewares'][1].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['outboundMiddlewares'][1].fn.name).toBe('default'); + expect(gleeQuore['_router']['outboundMiddlewares'][2].channel).toBe('testChannel'); + expect(gleeQuore['_router']['outboundMiddlewares'][2].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['outboundMiddlewares'][2].fn.name).toBe('validate'); + expect(gleeQuore['_router']['outboundMiddlewares'][3].channel).toBe('testChannel'); + expect(gleeQuore['_router']['outboundMiddlewares'][3].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['outboundMiddlewares'][3].fn.name).toBe('default'); + + expect(gleeQuore['_router']['errorMiddlewares'][0].channel).toBeUndefined(); + expect(gleeQuore['_router']['errorMiddlewares'][0].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['errorMiddlewares'][0].fn.name).toBe(''); + + expect(gleeQuore['_router']['outboundErrorMiddlewares'][0].channel).toBeUndefined(); + expect(gleeQuore['_router']['outboundErrorMiddlewares'][0].fn).toBeInstanceOf(Function); + expect(gleeQuore['_router']['outboundErrorMiddlewares'][0].fn.name).toBe(''); + }); + + // it('should instantiate GleeQuore and listen to internal events', async () => { + // const parser = new Parser() + // const { document: asyncapi } = await parser.parse(asyncapiDocumentAsJS) + // const spyEventEmitterOn = jest.spyOn(EventEmitter.prototype, 'on').mockImplementation(function () { return this; }); + // const gleeQuore = new GleeQuore(asyncapi as AsyncAPIDocumentInterface); + // expect(gleeQuore['_internalEvents']).toBeInstanceOf(EventEmitter); + // expect(gleeQuore['_internalEvents'].on).toHaveBeenCalledWith('adapter:auth', expect.any(Function)); + // expect(gleeQuore['_internalEvents'].on).toHaveBeenCalledWith('adapter:connect', expect.any(Function)); + // expect(gleeQuore['_internalEvents'].on).toHaveBeenCalledWith('adapter:reconnect', expect.any(Function)); + // expect(gleeQuore['_internalEvents'].on).toHaveBeenCalledWith('adapter:close', expect.any(Function)); + // expect(gleeQuore['_internalEvents'].on).toHaveBeenCalledWith('adapter:server:ready', expect.any(Function)); + // expect(gleeQuore['_internalEvents'].on).toHaveBeenCalledWith('adapter:server:connection:open', expect.any(Function)); + // expect(gleeQuore['_internalEvents'].on).toHaveBeenCalledWith('adapter:server:connection:close', expect.any(Function)); + + // spyEventEmitterOn.mockRestore(); + + // jest.spyOn(gleeQuore, 'runAuth').mockImplementation(async () => {}); + // jest.spyOn(gleeQuore, 'runLifecycleEvent').mockImplementation(async () => {}); + + // gleeQuore['_internalEvents'].emit('adapter:auth', { + // serverName: 'testServer', + // authProps: 'testAuthProps', + // done: () => {}, + // doc: asyncapi, + // }) + + // expect(gleeQuore.runAuth).toHaveBeenCalledWith({ + // app: gleeQuore, + // serverName: 'testServer', + // authProps: 'testAuthProps', + // done: expect.any(Function), + // doc: asyncapi, + // }); + + // gleeQuore['_internalEvents'].emit('adapter:connect', { + // serverName: 'testServer', + // connection: () => {}, + // }) + + // expect(gleeQuore.runLifecycleEvent).toHaveBeenCalledWith('onConnect', { + // app: gleeQuore, + // serverName: 'testServer', + // connection: expect.any(Function), + // }); + + // gleeQuore['_internalEvents'].emit('adapter:reconnect', { + // serverName: 'testServer', + // connection: () => {}, + // }) + + // expect(gleeQuore.runLifecycleEvent).toHaveBeenCalledWith('onReconnect', { + // app: gleeQuore, + // serverName: 'testServer', + // connection: expect.any(Function), + // }); + + // gleeQuore['_internalEvents'].emit('adapter:close', { + // serverName: 'testServer', + // connection: () => {}, + // }) + + // expect(gleeQuore.runLifecycleEvent).toHaveBeenCalledWith('onDisconnect', { + // app: gleeQuore, + // serverName: 'testServer', + // connection: expect.any(Function), + // }); + + // gleeQuore['_internalEvents'].emit('adapter:server:ready', { + // serverName: 'testServer', + // }) + + // expect(gleeQuore.runLifecycleEvent).toHaveBeenCalledWith('onServerReady', { + // app: gleeQuore, + // serverName: 'testServer', + // }); + + // gleeQuore['_internalEvents'].emit('adapter:server:connection:open', { + // serverName: 'testServer', + // connection: () => { }, + // }) + + // expect(gleeQuore.runLifecycleEvent).toHaveBeenCalledWith('onServerConnectionOpen', { + // app: gleeQuore, + // serverName: 'testServer', + // connection: expect.any(Function), + // }); + + // gleeQuore['_internalEvents'].emit('adapter:server:connection:close', { + // serverName: 'testServer', + // connection: () => { }, + // }) + + // expect(gleeQuore.runLifecycleEvent).toHaveBeenCalledWith('onServerConnectionClose', { + // app: gleeQuore, + // serverName: 'testServer', + // connection: expect.any(Function), + // }); + // }); +}); diff --git a/packages/gleequore/try.js b/packages/gleequore/try.js new file mode 100644 index 000000000..f9373b2c9 --- /dev/null +++ b/packages/gleequore/try.js @@ -0,0 +1,71 @@ +import GleeQuore from './dist/index.js' +import { Parser } from '@asyncapi/parser' + +const parser = new Parser() +const { document: asyncapi } = await parser.parse({ + asyncapi: '3.0.0', + info: { title: '', version: '' }, + servers: { + test: { + host: 'test.mosquitto.org', + protocol: 'mqtt', + }, + }, + channels: { + testChannel: { + address: 'test/channel', + messages: { + test: { + payload: { + type: 'string', + }, + }, + }, + }, + }, + operations: { + receiveTest: { + action: 'receive', + channel: { + $ref: '#/channels/testChannel' + }, + }, + sendTest: { + action: 'send', + channel: { + $ref: '#/channels/testChannel' + }, + }, + }, +}) + +const gleeQuore = new GleeQuore(asyncapi) + +// gleeQuore.addAdapter(HttpAdapter, 'test', { +// httpServer: { +// port: 3000, +// }, +// }) + +gleeQuore.on('receiveTest', (event) => { + console.log(event.payload) +}) + +// Can we come up with better event names? +// whenConnectedToServer maybe? +// gleeQuore.server('test').onConnect maybe? +// the last one makes sense if we also want to access server variables eventually +// although I don't know how this would look like or what the use cases could be... +// same might apply to channel parameters and message.correlationId pointers +gleeQuore.onConnectToServer('test', () => { + gleeQuore.send({ + channel: 'testChannel', + payload: 'Hola hola' + }) +}) + +gleeQuore.onError((err) => { + console.error(err.message) +}) + +gleeQuore.start().catch(console.error) diff --git a/packages/gleequore/tsconfig.json b/packages/gleequore/tsconfig.json new file mode 100644 index 000000000..9e5eb69c8 --- /dev/null +++ b/packages/gleequore/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "outDir": "./dist", + "allowJs": false, + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "module": "NodeNext", + "rootDir": "./src" + }, + "include": [ + "./src/**/*" + ], + "exclude": [ + "node_modules", + "lib", + "examples" + ] +} \ No newline at end of file diff --git a/packages/kafka-adapter/.editorconfig b/packages/kafka-adapter/.editorconfig new file mode 100644 index 000000000..3abcad16c --- /dev/null +++ b/packages/kafka-adapter/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/kafka-adapter/.eslintignore b/packages/kafka-adapter/.eslintignore new file mode 100644 index 000000000..fa806b632 --- /dev/null +++ b/packages/kafka-adapter/.eslintignore @@ -0,0 +1,9 @@ +node_modules +examples/social-network/frontend +examples/crypto-websockets +dist +.glee +test +jest.config.js +docs +try.js \ No newline at end of file diff --git a/packages/kafka-adapter/.eslintrc b/packages/kafka-adapter/.eslintrc new file mode 100644 index 000000000..02bbf610b --- /dev/null +++ b/packages/kafka-adapter/.eslintrc @@ -0,0 +1,53 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "rules": { + "curly": [ + "error", + "multi-line" + ], + "security/detect-non-literal-fs-filename": "off", + "@typescript-eslint/no-explicit-any": "off", + "semi": [ + "warn", + "never" + ], + "sonarjs/cognitive-complexity": "warn" + }, + "globals": { + "process": "readonly" + }, + "overrides": [ + { + "files": [ + "*.spec.ts", + "*.spec.tsx", + "src/help/command.ts" + ], + "rules": { + "no-undef": "off", + "security/detect-non-literal-fs-filename": "off", + "sonarjs/no-duplicate-string": "off", + "security/detect-object-injection": "off", + "max-nested-callbacks": "off", + "sonarjs/no-identical-functions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "no-use-before-define": "off", + "sonarjs/cognitive-complexity": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/kafka-adapter/.prettierignore b/packages/kafka-adapter/.prettierignore new file mode 100644 index 000000000..764aff77b --- /dev/null +++ b/packages/kafka-adapter/.prettierignore @@ -0,0 +1,6 @@ +dist +coverage +.github +examples +node_modules +docs diff --git a/packages/kafka-adapter/.prettierrc.yaml b/packages/kafka-adapter/.prettierrc.yaml new file mode 100644 index 000000000..45c45fea2 --- /dev/null +++ b/packages/kafka-adapter/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: "es5" +tabWidth: 2 +semi: false +singleQuote: true \ No newline at end of file diff --git a/packages/kafka-adapter/README.md b/packages/kafka-adapter/README.md new file mode 100644 index 000000000..3ac54fec4 --- /dev/null +++ b/packages/kafka-adapter/README.md @@ -0,0 +1,3 @@ +# kafka-adapter + +Kafka adapter for Glee. diff --git a/packages/kafka-adapter/index.d.ts b/packages/kafka-adapter/index.d.ts new file mode 100644 index 000000000..feb4605e2 --- /dev/null +++ b/packages/kafka-adapter/index.d.ts @@ -0,0 +1,14 @@ +import type { AuthFunction } from "@asyncapi/gleequore" + +export interface KafkaAuthConfig { + key?: string + cert?: string + clientId?: string + rejectUnauthorized?: boolean + username?: string + password?: string +} + +export type KafkaAdapterConfig = { + auth?: KafkaAuthConfig | AuthFunction +} diff --git a/packages/kafka-adapter/index.ts b/packages/kafka-adapter/index.ts new file mode 100644 index 000000000..c7688a4ac --- /dev/null +++ b/packages/kafka-adapter/index.ts @@ -0,0 +1,111 @@ +import { Kafka, SASLOptions } from 'kafkajs' +import { GleeQuoreAdapter, GleeQuoreMessage } from '@asyncapi/gleequore' +import { KafkaAdapterConfig, KafkaAuthConfig } from './index.d.js' + +class KafkaAdapter extends GleeQuoreAdapter { + private kafka: Kafka + private firstConnect = true + name(): string { + return 'Kafka adapter' + } + + async connect(): Promise { + await this._connect() + } + + async _connect() { + const kafkaOptions: KafkaAdapterConfig = await this.resolveConfig() + const auth: KafkaAuthConfig = await this.getAuthConfig(kafkaOptions?.auth) + const securityRequirements = this.AsyncAPIServer.security().map( + (sec) => { + const secName = Object.keys(sec.values())[0] + return this.parsedAsyncAPI.components().securitySchemes().get(secName) + } + ) + const userAndPasswordSecurityReq = securityRequirements.find( + (sec) => sec.type() === 'userPassword' + ) + const scramSha256SecurityReq = securityRequirements.find( + (sec) => sec.type() === 'scramSha256' + ) + const scramSha512SecurityReq = securityRequirements.find( + (sec) => sec.type() === 'scramSha512' + ) + + const brokerUrl = new URL(this.AsyncAPIServer.url()) + this.kafka = new Kafka({ + clientId: 'glee-app', + brokers: [brokerUrl.host], + ssl: { + rejectUnauthorized: auth?.rejectUnauthorized, + key: auth?.key, + cert: auth?.cert, + }, + sasl: { + mechanism: + (scramSha256SecurityReq ? 'scram-sha-256' : undefined) || + (scramSha512SecurityReq ? 'scram-sha-512' : undefined) || + 'plain', + username: userAndPasswordSecurityReq ? auth?.username : undefined, + password: userAndPasswordSecurityReq ? auth?.password : undefined, + } as SASLOptions, + }) + + const consumer = this.kafka.consumer({ groupId: 'glee-group' }) + consumer.on('consumer.connect', () => { + if (this.firstConnect) { + this.firstConnect = false + this.emit('connect', { + name: this.name(), + adapter: this, + connection: consumer, + channels: this.getSubscribedChannels(), + }) + } + }) + await consumer.connect() + const subscribedChannels = this.getSubscribedChannels() + await consumer.subscribe({ + topics: subscribedChannels, + fromBeginning: true, + }) + await consumer.run({ + eachMessage: async ({ topic, partition, message }) => { + const msg = this._createMessage(topic, partition, message) + this.emit('message', msg, consumer) + }, + }) + } + + async send(message: GleeQuoreMessage) { + const producer = this.kafka.producer() + await producer.connect() + await producer.send({ + topic: message.channel, + messages: [ + { + key: message.headers.key, + value: message.payload, + timestamp: message.headers.timestamp, + }, + ], + }) + await producer.disconnect() + } + + _createMessage(topic, partition, message) { + return new GleeQuoreMessage({ + channel: topic, + payload: message.value, + headers: { + partition, + key: message.key, + offset: message.offset, + timestamp: message.timestamp, + ...message.headers, + }, + }) + } +} + +export default KafkaAdapter diff --git a/packages/kafka-adapter/package.json b/packages/kafka-adapter/package.json new file mode 100644 index 000000000..5862621dd --- /dev/null +++ b/packages/kafka-adapter/package.json @@ -0,0 +1,41 @@ +{ + "name": "@asyncapi/glee-kafka-adapter", + "version": "0.0.0", + "description": "Kafka adapter for Glee.", + "exports": "./dist/index.js", + "type": "module", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "get:version": "echo $npm_package_version", + "get:name": "echo $npm_package_name", + "generate:assets": "echo 'No generate:assets script. Ignoring...'", + "lint": "eslint --max-warnings 1 --config .eslintrc .", + "lint:fix": "eslint --max-warnings 1 --config .eslintrc . --fix", + "prepublishOnly": "npm run build", + "test": "echo 'No test script. Ignoring...'", + "test:dev": "echo 'No test:dev script. Ignoring...'" + }, + "dependencies": { + "@asyncapi/gleequore": "workspace:*", + "@asyncapi/glee-shared-utils": "workspace:*", + "kafkajs": "^2.2.3" + }, + "devDependencies": { + "@tsconfig/node14": "^1.0.1", + "@types/debug": "^4.1.7", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "eslint": "^8.6.0", + "eslint-plugin-github": "^4.3.5", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.19.0", + "typedoc": "^0.26.10", + "typedoc-plugin-markdown": "^4.2.9", + "typescript": "^4.5.4" + }, + "license": "Apache-2.0" +} diff --git a/packages/kafka-adapter/tsconfig.json b/packages/kafka-adapter/tsconfig.json new file mode 100644 index 000000000..28a356c9d --- /dev/null +++ b/packages/kafka-adapter/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "outDir": "./dist", + "allowJs": false, + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "module": "NodeNext" + }, + "include": [ + "./*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/mqtt-adapter/.editorconfig b/packages/mqtt-adapter/.editorconfig new file mode 100644 index 000000000..3abcad16c --- /dev/null +++ b/packages/mqtt-adapter/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/mqtt-adapter/.eslintignore b/packages/mqtt-adapter/.eslintignore new file mode 100644 index 000000000..fa806b632 --- /dev/null +++ b/packages/mqtt-adapter/.eslintignore @@ -0,0 +1,9 @@ +node_modules +examples/social-network/frontend +examples/crypto-websockets +dist +.glee +test +jest.config.js +docs +try.js \ No newline at end of file diff --git a/packages/mqtt-adapter/.eslintrc b/packages/mqtt-adapter/.eslintrc new file mode 100644 index 000000000..02bbf610b --- /dev/null +++ b/packages/mqtt-adapter/.eslintrc @@ -0,0 +1,53 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "rules": { + "curly": [ + "error", + "multi-line" + ], + "security/detect-non-literal-fs-filename": "off", + "@typescript-eslint/no-explicit-any": "off", + "semi": [ + "warn", + "never" + ], + "sonarjs/cognitive-complexity": "warn" + }, + "globals": { + "process": "readonly" + }, + "overrides": [ + { + "files": [ + "*.spec.ts", + "*.spec.tsx", + "src/help/command.ts" + ], + "rules": { + "no-undef": "off", + "security/detect-non-literal-fs-filename": "off", + "sonarjs/no-duplicate-string": "off", + "security/detect-object-injection": "off", + "max-nested-callbacks": "off", + "sonarjs/no-identical-functions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "no-use-before-define": "off", + "sonarjs/cognitive-complexity": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/mqtt-adapter/.prettierignore b/packages/mqtt-adapter/.prettierignore new file mode 100644 index 000000000..764aff77b --- /dev/null +++ b/packages/mqtt-adapter/.prettierignore @@ -0,0 +1,6 @@ +dist +coverage +.github +examples +node_modules +docs diff --git a/packages/mqtt-adapter/.prettierrc.yaml b/packages/mqtt-adapter/.prettierrc.yaml new file mode 100644 index 000000000..45c45fea2 --- /dev/null +++ b/packages/mqtt-adapter/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: "es5" +tabWidth: 2 +semi: false +singleQuote: true \ No newline at end of file diff --git a/packages/mqtt-adapter/README.md b/packages/mqtt-adapter/README.md new file mode 100644 index 000000000..3c44f0f1a --- /dev/null +++ b/packages/mqtt-adapter/README.md @@ -0,0 +1,3 @@ +# mqtt-adapter + +MQTT adapter for Glee. diff --git a/packages/mqtt-adapter/index.d.ts b/packages/mqtt-adapter/index.d.ts new file mode 100644 index 000000000..5b656b9f9 --- /dev/null +++ b/packages/mqtt-adapter/index.d.ts @@ -0,0 +1,12 @@ +import type { AuthFunction } from "@asyncapi/gleequore" + +export interface MqttAuthConfig { + cert?: string + username?: string + password?: string + clientId?: string +} + +export type MqttAdapterConfig = { + auth?: MqttAuthConfig | AuthFunction +} diff --git a/packages/mqtt-adapter/index.ts b/packages/mqtt-adapter/index.ts new file mode 100644 index 000000000..081326432 --- /dev/null +++ b/packages/mqtt-adapter/index.ts @@ -0,0 +1,282 @@ +import mqtt, { IPublishPacket, MqttClient, QoS } from 'mqtt' +import { GleeQuoreAdapter, GleeQuoreMessage } from '@asyncapi/gleequore' +import { MqttAuthConfig, MqttAdapterConfig } from './index.d.js' +import { SecuritySchemesInterface as SecurityScheme } from '@asyncapi/parser' + +interface IMQTTHeaders { + cmd?: string + retain?: boolean + qos: QoS + dup: boolean + length: number +} + +interface ClientData { + url?: URL + auth?: MqttAuthConfig + serverBinding?: any + protocolVersion?: number + userAndPasswordSecurityReq?: SecurityScheme + X509SecurityReq?: SecurityScheme +} + +const MQTT_UNSPECIFIED_ERROR_REASON = 0x80 +const MQTT_SUCCESS_REASON = 0 +enum SecurityTypes { + USER_PASSWORD = 'userpassword', + X509 = 'x509', +} +class MqttAdapter extends GleeQuoreAdapter { + private client: MqttClient + private firstConnect: boolean + + name(): string { + return 'MQTT adapter' + } + + async connect(): Promise { + return this._connect() + } + + async send(message: GleeQuoreMessage) { + return this._send(message) + } + + private getSecurityReqs() { + let userAndPasswordSecurityReq + let X509SecurityReq + + const securityRequirements = this.AsyncAPIServer.security().map((e) => + e.all().map((e) => e.scheme()) + ) + + securityRequirements.forEach((security) => { + for (const sec of security) { + const securityType = sec.type().toLocaleLowerCase() + switch (securityType) { + case SecurityTypes.USER_PASSWORD: + userAndPasswordSecurityReq = sec + break + case SecurityTypes.X509: + X509SecurityReq = sec + break + default: + this.emit( + 'error', + new Error( + `Invalid security type '${securityType}' specified for server '${this.serverName + }'. Please double-check your configuration to ensure you're using a supported security type. Here is a list of supported types: ${Object.values( + SecurityTypes + )}` + ) + ) + } + } + }) + + return { + userAndPasswordSecurityReq, + X509SecurityReq, + } + } + + private async initializeClient(data: ClientData) { + const { + url, + auth, + serverBinding, + protocolVersion, + userAndPasswordSecurityReq, + X509SecurityReq, + } = data + + return mqtt.connect({ + host: url.hostname, + port: url.port || (url.protocol === 'mqtt:' ? 1883 : 8883), + protocol: url.protocol.slice(0, url.protocol.length - 1), + clientId: serverBinding?.clientId ?? auth?.clientId, + clean: serverBinding?.cleanSession, + will: serverBinding?.will && { + topic: serverBinding?.lastWill?.topic, + qos: serverBinding?.lastWill?.qos, + payload: serverBinding?.lastWill?.message, + retain: serverBinding?.lastWill?.retain, + }, + keepalive: serverBinding?.keepAlive, + username: userAndPasswordSecurityReq ? auth?.username : undefined, + password: userAndPasswordSecurityReq ? auth?.password : undefined, + ca: X509SecurityReq ? auth?.cert : undefined, + protocolVersion, + customHandleAcks: this._customAckHandler.bind(this), + } as any) + } + + private async listenToEvents(data: ClientData) { + const { protocolVersion } = data + + this.client.on('close', () => { + this.emit('close', { + connection: this.client, + channels: this.channelNames.map((channelName) => + this.parsedAsyncAPI.channels().get(channelName).address() + ), + }) + }) + + this.client.on('error', (error) => { + this.emit('error', error) + }) + + this.client.on('message', (channel, message, mqttPacket) => { + const qos = mqttPacket.qos + if (protocolVersion === 5 && qos > 0) return // ignore higher qos messages. already processed + + const msg = this._createMessage(mqttPacket as IPublishPacket) + this.emit('message', msg, this.client) + }) + } + + private checkFirstConnect() { + this.firstConnect = true + this.emit('connect', { + name: this.name(), + adapter: this, + connection: this.client, + channels: this.channelNames, + }) + } + + private subscribe(channels: string[]) { + channels.forEach((channel) => { + const asyncAPIChannel = this.parsedAsyncAPI.channels().get(channel) + const receiveOperations = asyncAPIChannel.operations().filterByReceive() + if (receiveOperations.length > 1) { + this.emit('error', new Error(`Channel ${channel} has more than one receive operation. Please make sure you have only one.`)) + return + } + const binding = asyncAPIChannel.operations().filterByReceive()[0].bindings().get('mqtt')?.value() + const topic = asyncAPIChannel.address() + this.client.subscribe( + topic, + { + qos: binding?.qos ? binding.qos : 0, + }, + (err, granted) => { + if (err) { + console.error(`Error while trying to subscribe to \`${topic}\` topic.`) + console.error(err.message) + return + } + granted.forEach(({ topic, qos }) => { + console.log(`Subscribed to \`${topic}\` topic with QoS ${qos}`) + }) + } + ) + }) + } + + async _connect(): Promise { + const mqttOptions: MqttAdapterConfig = await this.resolveConfig() + const auth: MqttAuthConfig = await this.getAuthConfig(mqttOptions?.auth) + const subscribedChannels = this.getSubscribedChannels() + const mqttServerBinding = this.AsyncAPIServer.bindings().get('mqtt') + const mqtt5ServerBinding = this.AsyncAPIServer.bindings().get('mqtt5') + + const { userAndPasswordSecurityReq, X509SecurityReq } = + this.getSecurityReqs() + + const url = new URL(this.AsyncAPIServer.url()) + + const protocolVersion = parseInt( + this.AsyncAPIServer.protocolVersion() || '4' + ) + const serverBinding = + protocolVersion === 5 ? mqtt5ServerBinding : mqttServerBinding + + this.client = await this.initializeClient({ + url, + auth, + serverBinding, + protocolVersion, + userAndPasswordSecurityReq, + X509SecurityReq, + }) + + await this.listenToEvents({ protocolVersion }) + + const connectClient = (): Promise => { + return new Promise((resolve) => { + this.client.on('connect', (connAckPacket) => { + const isSessionResume = connAckPacket.sessionPresent + + if (!this.firstConnect) { + this.checkFirstConnect() + } + + const shouldSubscribe = + !isSessionResume && Array.isArray(subscribedChannels) + + if (shouldSubscribe) { + this.subscribe(subscribedChannels) + } + + resolve(this) + }) + }) + } + + return connectClient() + + } + + _send(message: GleeQuoreMessage): Promise { + return new Promise((resolve, reject) => { + const channel = this.parsedAsyncAPI.channels().get(message.channel) + const address = channel.address() + const binding = channel.bindings().get('mqtt')?.value() + this.client.publish( + address, + message.payload, + { + qos: binding?.qos ? binding.qos : 2, + retain: binding?.retain ? binding.retain : false, + }, + (err) => { + if (err) { + reject(err) + return + } + + resolve() + } + ) + }) + } + + _createMessage(packet: IPublishPacket): GleeQuoreMessage { + const headers: IMQTTHeaders = { + cmd: packet.cmd, + retain: packet.retain, + qos: packet.qos, + dup: packet.dup, + length: packet.length, + } + const id = this.parsedAsyncAPI.channels().all().filter(channel => channel.address() === packet.topic)[0]?.id() + return new GleeQuoreMessage({ + payload: packet.payload, + headers, + channel: id, + }) + } + + _customAckHandler(channel, message, mqttPacket, done) { + const msg = this._createMessage(mqttPacket as IPublishPacket) + + msg.on('processing:successful', () => done(MQTT_SUCCESS_REASON)) + msg.on('processing:failed', () => done(MQTT_UNSPECIFIED_ERROR_REASON)) + + this.emit('message', msg, this.client) + } +} + +export default MqttAdapter diff --git a/packages/mqtt-adapter/package.json b/packages/mqtt-adapter/package.json new file mode 100644 index 000000000..2fcbd7d86 --- /dev/null +++ b/packages/mqtt-adapter/package.json @@ -0,0 +1,41 @@ +{ + "name": "@asyncapi/glee-mqtt-adapter", + "version": "0.0.0", + "description": "MQTT adapter for Glee.", + "exports": "./dist/index.js", + "type": "module", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "get:version": "echo $npm_package_version", + "get:name": "echo $npm_package_name", + "generate:assets": "echo 'No generate:assets script. Ignoring...'", + "lint": "eslint --max-warnings 1 --config .eslintrc .", + "lint:fix": "eslint --max-warnings 1 --config .eslintrc . --fix", + "prepublishOnly": "npm run build", + "test": "echo 'No test script. Ignoring...'", + "test:dev": "echo 'No test:dev script. Ignoring...'" + }, + "dependencies": { + "@asyncapi/gleequore": "workspace:*", + "@asyncapi/glee-shared-utils": "workspace:*", + "mqtt": "^4.3.7" + }, + "devDependencies": { + "@tsconfig/node14": "^1.0.1", + "@types/debug": "^4.1.7", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "eslint": "^8.6.0", + "eslint-plugin-github": "^4.3.5", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.19.0", + "typedoc": "^0.26.10", + "typedoc-plugin-markdown": "^4.2.9", + "typescript": "^4.5.4" + }, + "license": "Apache-2.0" +} diff --git a/packages/mqtt-adapter/tsconfig.json b/packages/mqtt-adapter/tsconfig.json new file mode 100644 index 000000000..28a356c9d --- /dev/null +++ b/packages/mqtt-adapter/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "outDir": "./dist", + "allowJs": false, + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "module": "NodeNext" + }, + "include": [ + "./*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/redis-cluster-adapter/.editorconfig b/packages/redis-cluster-adapter/.editorconfig new file mode 100644 index 000000000..3abcad16c --- /dev/null +++ b/packages/redis-cluster-adapter/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/redis-cluster-adapter/.eslintignore b/packages/redis-cluster-adapter/.eslintignore new file mode 100644 index 000000000..fa806b632 --- /dev/null +++ b/packages/redis-cluster-adapter/.eslintignore @@ -0,0 +1,9 @@ +node_modules +examples/social-network/frontend +examples/crypto-websockets +dist +.glee +test +jest.config.js +docs +try.js \ No newline at end of file diff --git a/packages/redis-cluster-adapter/.eslintrc b/packages/redis-cluster-adapter/.eslintrc new file mode 100644 index 000000000..02bbf610b --- /dev/null +++ b/packages/redis-cluster-adapter/.eslintrc @@ -0,0 +1,53 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "rules": { + "curly": [ + "error", + "multi-line" + ], + "security/detect-non-literal-fs-filename": "off", + "@typescript-eslint/no-explicit-any": "off", + "semi": [ + "warn", + "never" + ], + "sonarjs/cognitive-complexity": "warn" + }, + "globals": { + "process": "readonly" + }, + "overrides": [ + { + "files": [ + "*.spec.ts", + "*.spec.tsx", + "src/help/command.ts" + ], + "rules": { + "no-undef": "off", + "security/detect-non-literal-fs-filename": "off", + "sonarjs/no-duplicate-string": "off", + "security/detect-object-injection": "off", + "max-nested-callbacks": "off", + "sonarjs/no-identical-functions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "no-use-before-define": "off", + "sonarjs/cognitive-complexity": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/redis-cluster-adapter/.prettierignore b/packages/redis-cluster-adapter/.prettierignore new file mode 100644 index 000000000..764aff77b --- /dev/null +++ b/packages/redis-cluster-adapter/.prettierignore @@ -0,0 +1,6 @@ +dist +coverage +.github +examples +node_modules +docs diff --git a/packages/redis-cluster-adapter/.prettierrc.yaml b/packages/redis-cluster-adapter/.prettierrc.yaml new file mode 100644 index 000000000..45c45fea2 --- /dev/null +++ b/packages/redis-cluster-adapter/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: "es5" +tabWidth: 2 +semi: false +singleQuote: true \ No newline at end of file diff --git a/packages/redis-cluster-adapter/README.md b/packages/redis-cluster-adapter/README.md new file mode 100644 index 000000000..201760d74 --- /dev/null +++ b/packages/redis-cluster-adapter/README.md @@ -0,0 +1,3 @@ +# redis-cluster-adapter + +Redis Cluster adapter for Glee. diff --git a/packages/redis-cluster-adapter/index.ts b/packages/redis-cluster-adapter/index.ts new file mode 100644 index 000000000..c84fd60bd --- /dev/null +++ b/packages/redis-cluster-adapter/index.ts @@ -0,0 +1,72 @@ +import { createClient } from 'redis' +import { GleeQuoreClusterAdapter, GleeQuoreMessage } from '@asyncapi/gleequore' + +const client = createClient() +type RedisClientType = typeof client + +class RedisClusterAdapter extends GleeQuoreClusterAdapter { + private _channelName: string + private _publisher: RedisClientType + + name(): string { + return 'Redis Cluster adapter' + } + + async connect(): Promise { + return this._connect() + } + + async send(message: GleeQuoreMessage): Promise { + return this._send(message) + } + + async _connect(): Promise { + this._channelName = `${this.serverName}-channel` + + this._publisher = createClient({ + url: this.serverUrlExpanded, + }) + const subscriber = this._publisher.duplicate() + + this._publisher.on('error', (err) => { + this.emit('error', err) + }) + + this._publisher.on('reconnecting', () => { + this.emit('reconnect', { name: this.name(), adapter: this }) + }) + + this._publisher.on('end', () => { + this.emit('close', { name: this.name(), adapter: this }) + }) + + subscriber.on('error', (err) => { + this.emit('error', err) + }) + + subscriber.on('reconnecting', () => { + this.emit('reconnect', { name: this.name(), adapter: this }) + }) + + subscriber.on('end', () => { + this.emit('close', { name: this.name(), adapter: this }) + }) + + await Promise.all([this._publisher.connect(), subscriber.connect()]) + + subscriber.subscribe(this._channelName, (serialized) => { + const message = this.deserializeMessage(serialized) + if (message) this.emit('message', message) + }) + + this.emit('connect', { name: this.name(), adapter: this }) + return this + } + + async _send(message: GleeQuoreMessage): Promise { + const serialized = this.serializeMessage(message) + this._publisher.publish(this._channelName, serialized) + } +} + +export default RedisClusterAdapter diff --git a/packages/redis-cluster-adapter/package.json b/packages/redis-cluster-adapter/package.json new file mode 100644 index 000000000..6075f1b8e --- /dev/null +++ b/packages/redis-cluster-adapter/package.json @@ -0,0 +1,41 @@ +{ + "name": "@asyncapi/glee-redis-cluster-adapter", + "version": "0.0.0", + "description": "Redis Cluster adapter for Glee.", + "exports": "./dist/index.js", + "type": "module", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "get:version": "echo $npm_package_version", + "get:name": "echo $npm_package_name", + "generate:assets": "echo 'No generate:assets script. Ignoring...'", + "lint": "eslint --max-warnings 1 --config .eslintrc .", + "lint:fix": "eslint --max-warnings 1 --config .eslintrc . --fix", + "prepublishOnly": "npm run build", + "test": "echo 'No test script. Ignoring...'", + "test:dev": "echo 'No test:dev script. Ignoring...'" + }, + "dependencies": { + "@asyncapi/gleequore": "workspace:*", + "@asyncapi/glee-shared-utils": "workspace:*", + "redis": "^4.0.2" + }, + "devDependencies": { + "@tsconfig/node14": "^1.0.1", + "@types/debug": "^4.1.7", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "eslint": "^8.6.0", + "eslint-plugin-github": "^4.3.5", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.19.0", + "typedoc": "^0.26.10", + "typedoc-plugin-markdown": "^4.2.9", + "typescript": "^4.5.4" + }, + "license": "Apache-2.0" +} diff --git a/packages/redis-cluster-adapter/tsconfig.json b/packages/redis-cluster-adapter/tsconfig.json new file mode 100644 index 000000000..28a356c9d --- /dev/null +++ b/packages/redis-cluster-adapter/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "outDir": "./dist", + "allowJs": false, + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "module": "NodeNext" + }, + "include": [ + "./*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/shared-utils/.editorconfig b/packages/shared-utils/.editorconfig new file mode 100644 index 000000000..3abcad16c --- /dev/null +++ b/packages/shared-utils/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/shared-utils/.eslintignore b/packages/shared-utils/.eslintignore new file mode 100644 index 000000000..fa806b632 --- /dev/null +++ b/packages/shared-utils/.eslintignore @@ -0,0 +1,9 @@ +node_modules +examples/social-network/frontend +examples/crypto-websockets +dist +.glee +test +jest.config.js +docs +try.js \ No newline at end of file diff --git a/packages/shared-utils/.eslintrc b/packages/shared-utils/.eslintrc new file mode 100644 index 000000000..02bbf610b --- /dev/null +++ b/packages/shared-utils/.eslintrc @@ -0,0 +1,53 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "rules": { + "curly": [ + "error", + "multi-line" + ], + "security/detect-non-literal-fs-filename": "off", + "@typescript-eslint/no-explicit-any": "off", + "semi": [ + "warn", + "never" + ], + "sonarjs/cognitive-complexity": "warn" + }, + "globals": { + "process": "readonly" + }, + "overrides": [ + { + "files": [ + "*.spec.ts", + "*.spec.tsx", + "src/help/command.ts" + ], + "rules": { + "no-undef": "off", + "security/detect-non-literal-fs-filename": "off", + "sonarjs/no-duplicate-string": "off", + "security/detect-object-injection": "off", + "max-nested-callbacks": "off", + "sonarjs/no-identical-functions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "no-use-before-define": "off", + "sonarjs/cognitive-complexity": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/shared-utils/.prettierignore b/packages/shared-utils/.prettierignore new file mode 100644 index 000000000..764aff77b --- /dev/null +++ b/packages/shared-utils/.prettierignore @@ -0,0 +1,6 @@ +dist +coverage +.github +examples +node_modules +docs diff --git a/packages/shared-utils/.prettierrc.yaml b/packages/shared-utils/.prettierrc.yaml new file mode 100644 index 000000000..45c45fea2 --- /dev/null +++ b/packages/shared-utils/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: "es5" +tabWidth: 2 +semi: false +singleQuote: true \ No newline at end of file diff --git a/packages/shared-utils/index.ts b/packages/shared-utils/index.ts new file mode 100644 index 000000000..b854b95b8 --- /dev/null +++ b/packages/shared-utils/index.ts @@ -0,0 +1,155 @@ +import { AsyncAPIDocumentInterface as AsyncAPIDocument, MessagesInterface } from '@asyncapi/parser' +import Ajv from 'ajv' +import betterAjvErrors from 'better-ajv-errors' +import { pathToRegexp } from 'path-to-regexp' + +interface IValidateDataReturn { + errors?: void | betterAjvErrors.IOutputError[] + humanReadableError?: void | betterAjvErrors.IOutputError[] + isValid: boolean | PromiseLike +} + +/** + * Determines if a path matches a channel, and returns the matching params and its values. + * + * @private + * @param {String} path The path. + * @param {String} channel The channel. + */ +export const getParams = ( + path: string, + channel: string +): { [key: string]: string } | null => { + if (path === undefined) return {} + + const keys = [] + const re = pathToRegexp(path, keys) + const result = re.exec(channel) + + if (result === null) return null + + return keys + .map((key, index) => ({ [key.name]: result[index + 1] })) + .reduce( + (prev, val) => ({ + ...prev, + ...val, + }), + {} + ) +} + +/** + * Determines if a path matches a channel. + * + * @private + * @param {String} path The path. + * @param {String} channel The channel. + * @return {Boolean} + */ +export const matchChannel = (path: string, channel: string): boolean => { + return getParams(path, channel) !== null +} + +/** + * Validates data against a given JSON Schema definition + * + * @private + * @param {Any} data The data to validate + * @param {Object} schema A JSON Schema definition + * @returns Object + */ +export const validateData = ( + data: any, + schema: object +): IValidateDataReturn => { + const ajv = new Ajv({ allErrors: true, jsonPointers: true }) + const validation = ajv.compile(schema) + const isValid = validation(data || null) + let errors: void | betterAjvErrors.IOutputError[] + let humanReadableError: void | betterAjvErrors.IOutputError[] + if (!isValid) { + humanReadableError = betterAjvErrors(schema, data, validation.errors, { + format: 'cli', + indent: 2, + }) + errors = betterAjvErrors(schema, data, validation.errors, { + format: 'js', + }) + } + return { + errors, + humanReadableError, + isValid, + } +} + +export const isRemoteServer = ( + parsedAsyncAPI: AsyncAPIDocument, + serverName: string +): boolean => { + const remoteServers = parsedAsyncAPI.extensions().get('x-remoteServers')?.value() + if (remoteServers) { + return remoteServers.includes(serverName) + } + return false +} + +export const resolveFunctions = async (object: any) => { + for (const key in object) { + if ( + typeof object[String(key)] === 'object' && + !Array.isArray(object[String(key)]) + ) { + await resolveFunctions(object[String(key)]) + } else if (typeof object[String(key)] === 'function' && key !== 'auth') { + object[String(key)] = await object[String(key)]() + } + } +} + + +function jsonPointer(obj: any, pointer: string): any { + const parts = pointer.split('/').slice(1) + let current = obj + + for (const part of parts) { + if (current === null || typeof current !== 'object') { + return undefined + } + // eslint-disable-next-line + current = current[part] + } + + return current +} + +export function extractExpressionValueFromMessage(message: { headers: any, payload: any }, expression: string): any { + + // Parse the expression + // eslint-disable-next-line + const match = expression.match(/^\$message\.(header|payload)(#.*)?$/) + if (!match) { + throw new Error(`${expression} is invalid.`) + } + + const source = match[1] + const fragment = match[2] ? match[2].slice(1) : undefined + const headers = message?.headers + const payload = message?.payload + // Extract value based on source and fragment + if (source === 'header') { + return fragment ? jsonPointer(headers, fragment) : headers + } else if (source === 'payload') { + return fragment ? jsonPointer(payload, fragment) : payload + } else { + throw new Error(`${expression} source should be "header" or "fragment"`) + } +} + +export function getMessagesSchema(operation: { messages: () => MessagesInterface }) { + const messagesSchemas = operation.messages().all().map(m => m.payload().json()).filter(schema => !!schema) + return { + oneOf: messagesSchemas + } +} diff --git a/packages/shared-utils/package.json b/packages/shared-utils/package.json new file mode 100644 index 000000000..8364e05b8 --- /dev/null +++ b/packages/shared-utils/package.json @@ -0,0 +1,36 @@ +{ + "name": "@asyncapi/glee-shared-utils", + "version": "0.0.0", + "description": "Shared utilities for Glee", + "main": "dist/index.js", + "type": "module", + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "get:version": "echo $npm_package_version", + "get:name": "echo $npm_package_name", + "generate:assets": "echo 'No generate:assets script. Ignoring...'", + "lint": "eslint --max-warnings 1 --config .eslintrc .", + "lint:fix": "eslint --max-warnings 1 --config .eslintrc . --fix", + "prepublishOnly": "npm run build", + "test": "echo 'No test script. Ignoring...'", + "test:dev": "echo 'No test:dev script. Ignoring...'" + }, + "author": "Fran Mendez (https://fmvilas.me)", + "license": "ISC", + "dependencies": { + "@asyncapi/parser": "^3.1.0", + "ajv": "^6.12.6", + "better-ajv-errors": "^0.7.0", + "path-to-regexp": "^6.2.0" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "eslint": "^8.6.0", + "eslint-plugin-github": "^4.3.5", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.19.0", + "typescript": "^4.5.4" + } +} diff --git a/packages/shared-utils/tsconfig.json b/packages/shared-utils/tsconfig.json new file mode 100644 index 000000000..28a356c9d --- /dev/null +++ b/packages/shared-utils/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "outDir": "./dist", + "allowJs": false, + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "module": "NodeNext" + }, + "include": [ + "./*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/socket.io-adapter/.editorconfig b/packages/socket.io-adapter/.editorconfig new file mode 100644 index 000000000..3abcad16c --- /dev/null +++ b/packages/socket.io-adapter/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/socket.io-adapter/.eslintignore b/packages/socket.io-adapter/.eslintignore new file mode 100644 index 000000000..fa806b632 --- /dev/null +++ b/packages/socket.io-adapter/.eslintignore @@ -0,0 +1,9 @@ +node_modules +examples/social-network/frontend +examples/crypto-websockets +dist +.glee +test +jest.config.js +docs +try.js \ No newline at end of file diff --git a/packages/socket.io-adapter/.eslintrc b/packages/socket.io-adapter/.eslintrc new file mode 100644 index 000000000..02bbf610b --- /dev/null +++ b/packages/socket.io-adapter/.eslintrc @@ -0,0 +1,53 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "rules": { + "curly": [ + "error", + "multi-line" + ], + "security/detect-non-literal-fs-filename": "off", + "@typescript-eslint/no-explicit-any": "off", + "semi": [ + "warn", + "never" + ], + "sonarjs/cognitive-complexity": "warn" + }, + "globals": { + "process": "readonly" + }, + "overrides": [ + { + "files": [ + "*.spec.ts", + "*.spec.tsx", + "src/help/command.ts" + ], + "rules": { + "no-undef": "off", + "security/detect-non-literal-fs-filename": "off", + "sonarjs/no-duplicate-string": "off", + "security/detect-object-injection": "off", + "max-nested-callbacks": "off", + "sonarjs/no-identical-functions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "no-use-before-define": "off", + "sonarjs/cognitive-complexity": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/socket.io-adapter/.prettierignore b/packages/socket.io-adapter/.prettierignore new file mode 100644 index 000000000..764aff77b --- /dev/null +++ b/packages/socket.io-adapter/.prettierignore @@ -0,0 +1,6 @@ +dist +coverage +.github +examples +node_modules +docs diff --git a/packages/socket.io-adapter/.prettierrc.yaml b/packages/socket.io-adapter/.prettierrc.yaml new file mode 100644 index 000000000..45c45fea2 --- /dev/null +++ b/packages/socket.io-adapter/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: "es5" +tabWidth: 2 +semi: false +singleQuote: true \ No newline at end of file diff --git a/packages/socket.io-adapter/README.md b/packages/socket.io-adapter/README.md new file mode 100644 index 000000000..16cca3b24 --- /dev/null +++ b/packages/socket.io-adapter/README.md @@ -0,0 +1,3 @@ +# socket.io-adapter + +Socket.IO adapter for Glee. diff --git a/packages/socket.io-adapter/index.ts b/packages/socket.io-adapter/index.ts new file mode 100644 index 000000000..543ca7ae7 --- /dev/null +++ b/packages/socket.io-adapter/index.ts @@ -0,0 +1,104 @@ +import { Server } from 'socket.io' +import { GleeQuoreAdapter, GleeQuoreMessage } from '@asyncapi/gleequore' + +class SocketIOAdapter extends GleeQuoreAdapter { + private server: Server + + name(): string { + return 'Socket.IO adapter' + } + + async connect(): Promise { + return this._connect() + } + + async send(message: GleeQuoreMessage): Promise { + return this._send(message) + } + + async _connect(): Promise { + const config = await this.resolveConfig() + const websocketOptions = config?.server + const serverUrl: URL = new URL(this.serverUrlExpanded) + const asyncapiServerPort: number = serverUrl.port + ? Number(serverUrl.port) + : 80 + const optionsPort: number = websocketOptions?.port + const port: number = optionsPort || asyncapiServerPort + + const serverOptions: { [key: string]: any } = { + path: serverUrl.pathname || '/', + serveClient: false, + transports: ['websocket'], + } + + if (websocketOptions.httpServer) { + const server = websocketOptions.httpServer + if (!optionsPort && String(server.address().port) !== String(port)) { + console.error( + `Your custom HTTP server is listening on port ${ + server.address().port + } but your AsyncAPI file says it must listen on ${port}. Please fix the inconsistency.` + ) + process.exit(1) + } + this.server = new Server(server, serverOptions) + } else { + this.server = new Server({ + ...serverOptions, + ...{ + cors: { + origin: true, + }, + }, + }) + } + + this.server.on('connect', (socket) => { + this.emit('server:ready', { + name: this.name(), + adapter: this, + connection: socket, + channels: this.channelNames, + }) + + socket.onAny((eventName, payload) => { + const msg = this._createMessage(eventName, payload) + this.emit('message', msg, socket) + }) + }) + + if (!websocketOptions.httpServer) { + this.server.listen(port) + } + return this + } + + async _send(message: GleeQuoreMessage): Promise { + if (message.broadcast) { + this.app.syncCluster(message) + + this.connections + .filter(({ channels }) => channels.includes(message.channel)) + .forEach((connection) => { + connection.getRaw().emit(message.channel, message.payload) + }) + } else { + if (!message.connection) { + throw new Error( + 'There is no Socket.IO connection to send the message yet.' + ) + } + message.connection.getRaw().emit(message.channel, message.payload) + } + } + + _createMessage(eventName: string, payload: any) { + return new GleeQuoreMessage({ + payload, + channel: eventName, + }) + } +} + +export default SocketIOAdapter diff --git a/packages/socket.io-adapter/package.json b/packages/socket.io-adapter/package.json new file mode 100644 index 000000000..20378bb83 --- /dev/null +++ b/packages/socket.io-adapter/package.json @@ -0,0 +1,41 @@ +{ + "name": "@asyncapi/glee-socketio-adapter", + "version": "0.0.0", + "description": "Socket.IO adapter for Glee.", + "exports": "./dist/index.js", + "type": "module", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "get:version": "echo $npm_package_version", + "get:name": "echo $npm_package_name", + "generate:assets": "echo 'No generate:assets script. Ignoring...'", + "lint": "eslint --max-warnings 1 --config .eslintrc .", + "lint:fix": "eslint --max-warnings 1 --config .eslintrc . --fix", + "prepublishOnly": "npm run build", + "test": "echo 'No test script. Ignoring...'", + "test:dev": "echo 'No test:dev script. Ignoring...'" + }, + "dependencies": { + "@asyncapi/gleequore": "workspace:*", + "@asyncapi/glee-shared-utils": "workspace:*", + "socket.io": "^4.1.2" + }, + "devDependencies": { + "@tsconfig/node14": "^1.0.1", + "@types/debug": "^4.1.7", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "eslint": "^8.6.0", + "eslint-plugin-github": "^4.3.5", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.19.0", + "typedoc": "^0.26.10", + "typedoc-plugin-markdown": "^4.2.9", + "typescript": "^4.5.4" + }, + "license": "Apache-2.0" +} diff --git a/packages/socket.io-adapter/tsconfig.json b/packages/socket.io-adapter/tsconfig.json new file mode 100644 index 000000000..28a356c9d --- /dev/null +++ b/packages/socket.io-adapter/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "outDir": "./dist", + "allowJs": false, + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "module": "NodeNext" + }, + "include": [ + "./*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/web-adapter/.editorconfig b/packages/web-adapter/.editorconfig new file mode 100644 index 000000000..3abcad16c --- /dev/null +++ b/packages/web-adapter/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/web-adapter/.eslintignore b/packages/web-adapter/.eslintignore new file mode 100644 index 000000000..fa806b632 --- /dev/null +++ b/packages/web-adapter/.eslintignore @@ -0,0 +1,9 @@ +node_modules +examples/social-network/frontend +examples/crypto-websockets +dist +.glee +test +jest.config.js +docs +try.js \ No newline at end of file diff --git a/packages/web-adapter/.eslintrc b/packages/web-adapter/.eslintrc new file mode 100644 index 000000000..02bbf610b --- /dev/null +++ b/packages/web-adapter/.eslintrc @@ -0,0 +1,53 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "rules": { + "curly": [ + "error", + "multi-line" + ], + "security/detect-non-literal-fs-filename": "off", + "@typescript-eslint/no-explicit-any": "off", + "semi": [ + "warn", + "never" + ], + "sonarjs/cognitive-complexity": "warn" + }, + "globals": { + "process": "readonly" + }, + "overrides": [ + { + "files": [ + "*.spec.ts", + "*.spec.tsx", + "src/help/command.ts" + ], + "rules": { + "no-undef": "off", + "security/detect-non-literal-fs-filename": "off", + "sonarjs/no-duplicate-string": "off", + "security/detect-object-injection": "off", + "max-nested-callbacks": "off", + "sonarjs/no-identical-functions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "no-use-before-define": "off", + "sonarjs/cognitive-complexity": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/web-adapter/.prettierignore b/packages/web-adapter/.prettierignore new file mode 100644 index 000000000..764aff77b --- /dev/null +++ b/packages/web-adapter/.prettierignore @@ -0,0 +1,6 @@ +dist +coverage +.github +examples +node_modules +docs diff --git a/packages/web-adapter/.prettierrc.yaml b/packages/web-adapter/.prettierrc.yaml new file mode 100644 index 000000000..45c45fea2 --- /dev/null +++ b/packages/web-adapter/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: "es5" +tabWidth: 2 +semi: false +singleQuote: true \ No newline at end of file diff --git a/packages/web-adapter/README.md b/packages/web-adapter/README.md new file mode 100644 index 000000000..69b078409 --- /dev/null +++ b/packages/web-adapter/README.md @@ -0,0 +1,3 @@ +# web-adapter + +HTTP and WebSocket client adapter for Glee. diff --git a/packages/web-adapter/http.ts b/packages/web-adapter/http.ts new file mode 100644 index 000000000..54c4bbbdf --- /dev/null +++ b/packages/web-adapter/http.ts @@ -0,0 +1,117 @@ +import got, { Method } from 'got' +import http from 'http' +import { GleeQuoreAdapter, GleeQuoreMessage } from '@asyncapi/gleequore' +import { ChannelInterface, OperationInterface } from '@asyncapi/parser' +import type { Authenticatable } from '@asyncapi/gleequore' +import GleeQuoreAuth from './wsHttpAuth.js' + +class HttpClientAdapter extends GleeQuoreAdapter { + name(): string { + return 'HTTP client' + } + async connect(): Promise { + this.emit('connect', { + name: this.name(), + adapter: this, + connection: http, + channel: this.channelNames, + }) + return this + } + + async send(message: GleeQuoreMessage): Promise { + try { + this._validateMessage(message) + await this._sendMessage(message) + } catch (err) { + console.warn(`Failed to Send Message: An attempt to send a message to '${this.name()}' on the '${message.channel}' channel was unsuccessful. Please review the error details below for further information and corrective action.`) + this.emit('error', err) + } + } + + async _sendMessageToChannel(message: GleeQuoreMessage, channel: ChannelInterface, operation: OperationInterface) { + const serverHost = this.serverUrlExpanded + const httpURL = new URL(serverHost + channel.address()) + const { url, headers, query } = await this._applyAuthConfiguration({ headers: message.headers, query: message.query, url: httpURL }) + const method = this._getHttpMethod(operation) + const gotRequest = { + method, + url, + body: message.payload, + searchParams: query as any, + headers, + } + + if (!message.payload) delete gotRequest.body + if (!query) delete gotRequest.searchParams + if (!headers) delete gotRequest.headers + if (message.payload && !this._shouldMethodHaveBody(method)) { + console.warn(`"${method}" can't have a body. Please make sure you are using the correct HTTP method for ${httpURL}. Ignoring the body...`) + delete gotRequest.body + } + try { + const response = await got(gotRequest) + const msg = this._createMessage(message, channel.id(), response.body) + this.emit('message', msg, http) + } catch (e) { + const errorMessage = `Error encountered while sending message. Check the request configuration and network status. Method: ${method}, URL: ${url}, Headers: ${JSON.stringify(headers, null, 2)}, Payload: ${JSON.stringify(message.payload, null, 2)}, Query: ${JSON.stringify(query, null, 2)}` + throw new Error(errorMessage) + } + } + + async _applyAuthConfiguration(authenticatable: Authenticatable): Promise { + const authConfig = await this.app.clientAuthConfig(this.serverName) + const gleeAuth = new GleeQuoreAuth( + this.AsyncAPIServer, + this.parsedAsyncAPI, + this.serverName, + authConfig + ) + + if (!authConfig) return authenticatable + + const authenticated = await gleeAuth.processClientAuth(authenticatable) + return { ...authenticated as Authenticatable } + } + + _getHttpMethod(operation: OperationInterface): Method { + const method = operation.bindings().get("http")?.json()?.method + if (!method) { + console.warn(`"Warning: HTTP Method Not Specified + In the operation '${operation.id()}', no HTTP method is specified. The system will default to using the GET method. Ensure that this is the intended behavior or specify the appropriate HTTP method in the http operation bindings."`) + return 'GET' + } + return method + } + + async _sendMessage(message: GleeQuoreMessage) { + const operation = message.operation + const operationChannels = operation.channels() + operationChannels.forEach(channel => this._sendMessageToChannel(message, channel, operation)) + } + _createMessage(request: GleeQuoreMessage, channelName: string, payload: any) { + return new GleeQuoreMessage({ + request, + payload: JSON.parse(JSON.stringify(payload)), + channel: channelName, + }) + } + + _validateMessage(message: GleeQuoreMessage) { + + const querySchema = message.operation.bindings().get("http")?.json()?.query + if (querySchema) this.validate(message.query, querySchema, true) + const messages = message.operation.messages().all() + if (!messages.length) return + const headersSchema = { + oneOf: messages.map(message => message?.bindings()?.get("http")?.json()?.headers).filter(header => !!header) + } + if (headersSchema.oneOf.length > 0) this.validate(message.headers, headersSchema, true) + } + + _shouldMethodHaveBody(method: Method) { + return ["post", "put", "patch"].includes(method.toLocaleLowerCase()) + } +} + +export default HttpClientAdapter diff --git a/packages/web-adapter/index.d.ts b/packages/web-adapter/index.d.ts new file mode 100644 index 000000000..017582bce --- /dev/null +++ b/packages/web-adapter/index.d.ts @@ -0,0 +1,34 @@ +export type WsHttpAuth = WsAuthConfig | HttpAuthConfig + +export interface HttpAuthConfig { + token?: string + username?: string + password?: string +} + +export interface WsAuthConfig { + token?: string + username?: string + password?: string +} + +export type AuthProps = { + getToken: () => string + getUserPass: () => { + username: string + password: string + } + getCert: () => string + getOauthToken: () => string + getHttpAPIKeys: (name: string) => string + getAPIKeys: () => string +} + +type Headers = { [key: string]: string } +type QueryParam = { [key: string]: string } | { [key: string]: string[] } + +export interface Authenticatable { + headers: Headers, + query: QueryParam + url: URL +} \ No newline at end of file diff --git a/packages/web-adapter/package.json b/packages/web-adapter/package.json new file mode 100644 index 000000000..53af49495 --- /dev/null +++ b/packages/web-adapter/package.json @@ -0,0 +1,46 @@ +{ + "name": "@asyncapi/glee-web-adapter", + "version": "0.0.0", + "description": "HTTP and WebSocket client adapter for Glee.", + "exports": { + "./http": "./dist/http.js", + "./ws": "./dist/ws.js" + }, + "type": "module", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "get:version": "echo $npm_package_version", + "get:name": "echo $npm_package_name", + "generate:assets": "echo 'No generate:assets script. Ignoring...'", + "lint": "eslint --max-warnings 1 --config .eslintrc .", + "lint:fix": "eslint --max-warnings 1 --config .eslintrc . --fix", + "prepublishOnly": "npm run build", + "test": "echo 'No test script. Ignoring...'", + "test:dev": "echo 'No test:dev script. Ignoring...'" + }, + "dependencies": { + "@asyncapi/glee-shared-utils": "workspace:*", + "@asyncapi/gleequore": "workspace:*", + "got": "^12.5.3", + "ws": "^7.4.6" + }, + "devDependencies": { + "@tsconfig/node14": "^1.0.1", + "@types/debug": "^4.1.7", + "@types/ws": "^8.5.3", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "eslint": "^8.6.0", + "eslint-plugin-github": "^4.3.5", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.19.0", + "typedoc": "^0.26.10", + "typedoc-plugin-markdown": "^4.2.9", + "typescript": "^4.5.4" + }, + "license": "Apache-2.0" +} diff --git a/packages/web-adapter/tsconfig.json b/packages/web-adapter/tsconfig.json new file mode 100644 index 000000000..b5a5a8840 --- /dev/null +++ b/packages/web-adapter/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "outDir": "./dist", + "allowJs": false, + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "module": "NodeNext" + }, + "include": [ + "./*.ts" +, "http/client.ts", "http/server.ts" ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/web-adapter/utils.ts b/packages/web-adapter/utils.ts new file mode 100644 index 000000000..24daa9c5d --- /dev/null +++ b/packages/web-adapter/utils.ts @@ -0,0 +1,39 @@ +import type { ChannelInterface, ChannelParameterInterface } from "@asyncapi/parser" +import type { GleeQuoreMessage} from "@asyncapi/gleequore" +import { extractExpressionValueFromMessage } from "@asyncapi/glee-shared-utils" + +export function applyAddressParameters(channel: ChannelInterface, message?: GleeQuoreMessage): string { + let address = channel.address() + const parameters = channel.parameters() + for (const parameter of parameters) { + address = substituteParameterInAddress(parameter, address, message) + } + return address +} + +export function substituteParameterInAddress(parameter: ChannelParameterInterface, address: string, message?: GleeQuoreMessage): string { + const doesExistInAddress = address.includes(`{${parameter.id()}}`) + if (!doesExistInAddress) return address + const parameterValue = getParamValue(parameter, message) + if (!parameterValue) { + throw Error(`parsing parameter "${parameter.id()}" value failed. please make sure it exists in your header/payload or in default field of the parameter.`) + } + address = address.replace(`{${parameter.id()}}`, parameterValue) + return address +} + +const getParamValue = (parameter: ChannelParameterInterface, message: GleeQuoreMessage): string | null => { + const location = parameter.location() + if (!location) return parameter.json().default + const paramFromLocation = getParamFromLocation(location, message) + if (!paramFromLocation) { + return parameter.json().default + } + return paramFromLocation +} + +function getParamFromLocation(location: string, message: GleeQuoreMessage) { + if ((message.payload || message.headers) && location) { + return extractExpressionValueFromMessage(message, location) + } +} \ No newline at end of file diff --git a/packages/web-adapter/ws.ts b/packages/web-adapter/ws.ts new file mode 100644 index 000000000..085701e2d --- /dev/null +++ b/packages/web-adapter/ws.ts @@ -0,0 +1,136 @@ +/* eslint-disable security/detect-object-injection */ +import { GleeQuoreAdapter, GleeQuoreMessage } from '@asyncapi/gleequore' +import ws from 'ws' +import GleeQuoreAuth from './wsHttpAuth.js' +import Debug from 'debug' +import { ChannelInterface } from '@asyncapi/parser' +import { substituteParameterInAddress } from './utils.js' +const debug = Debug("glee:ws:client") +interface Client { + channel: string + client: ws + binding?: any +} + +class WsClientAdapter extends GleeQuoreAdapter { + private clients: Array = [] + + name(): string { + return 'WS adapter' + } + + async connect(): Promise { + return this._connect() + } + + async send(message: GleeQuoreMessage) { + return this._send(message) + } + + private async _connect(): Promise { + const channelsOnThisServer: string[] = this.getWsChannels() + + debug("connecting to ", this.serverName) + for (const channelName of channelsOnThisServer) { + let headers = {} + const authConfig = await this.app.clientAuthConfig(this.serverName) + const gleeAuth = new GleeQuoreAuth( + this.AsyncAPIServer, + this.parsedAsyncAPI, + this.serverName, + authConfig + ) + + const protocol = this.AsyncAPIServer.protocol() + const serverHost = this.AsyncAPIServer.host() + const channel = this.parsedAsyncAPI.channels().get(channelName) + if (!channel) continue + const channelAddress = applyAddressParameters(channel) + let url = new URL(`${protocol}://${serverHost}${channelAddress}`) + if (authConfig) { + const modedAuth = await gleeAuth.processClientAuth({ url, headers, query: {} }) + headers = modedAuth?.headers ? modedAuth.headers : headers + url = modedAuth?.url ? modedAuth.url : url + } + this.clients.push({ + channel: channelName, + client: new ws(url, { headers }), + binding: this.parsedAsyncAPI.channels().get(channelName)?.bindings().get('ws'), + }) + } + + for (const { client, channel } of this.clients) { + client.on('open', () => { + this.emit('connect', { + name: this.name(), + adapter: this, + connection: client, + channels: this.channelNames, + }) + }) + + client.on('message', (data) => { + const msg = this._createMessage(channel, data) + this.emit('message', msg, client) + }) + + client.on('error', (err: any) => { + const errMessage = `Error: Authentication function not found at location auth/${this.serverName}. Expected function 'clientAuth'` + this.emit('error', new Error(errMessage)) + console.error(err) + }) + } + return this + } + + private getWsChannels(): string[] { + const channels: string[] = [] + for (const channel of this.channelNames) { + if (this.parsedAsyncAPI.channels().get(channel)?.servers().all().length !== 0) { // NOSONAR + if ( + this.parsedAsyncAPI + .channels().get(channel) + ?.servers().get(this.serverName) + ) { + channels.push(channel) + } + } else if (channel) { + channels.push(channel) + } + } + + return channels + } + + async _send(message: GleeQuoreMessage): Promise { + const client = this.clients.find( + (cl) => cl.channel === message.channel + )?.client + if (client) { + client.send(message.payload) + } else { + throw new Error( + 'There is no WebSocker connection to send the message yet.' + ) + } + } + + _createMessage(eventName: string, payload: any): GleeQuoreMessage { + return new GleeQuoreMessage({ + payload: payload, + channel: eventName, + }) + } +} + +function applyAddressParameters(channel: ChannelInterface, message?: GleeQuoreMessage): string | undefined { + let address = channel.address() + if (!address) return undefined + + for (const parameter of channel.parameters()) { + address = substituteParameterInAddress(parameter, address, message) + } + return address +} + +export default WsClientAdapter diff --git a/packages/web-adapter/wsHttpAuth.ts b/packages/web-adapter/wsHttpAuth.ts new file mode 100644 index 000000000..155c5b8e8 --- /dev/null +++ b/packages/web-adapter/wsHttpAuth.ts @@ -0,0 +1,133 @@ +import { AsyncAPIDocumentInterface as AsyncAPIDocument, ServerInterface } from '@asyncapi/parser' +import { resolveFunctions } from '@asyncapi/glee-shared-utils' +import { EventEmitter } from 'events' +import { HttpAuthConfig, WsAuthConfig, Authenticatable } from './index.d.js' + +class GleeQuoreAuth extends EventEmitter { + private parsedAsyncAPI: AsyncAPIDocument + private serverName: string + private AsyncAPIServer: ServerInterface + private authConfig: WsAuthConfig | HttpAuthConfig + private auth: { [key: string]: string } | { [key: string]: string[] } + + /** + * Instantiates authentication. + */ + constructor( + AsyncAPIServer: ServerInterface, + parsedAsyncAPI: AsyncAPIDocument, + serverName: string, + authConfig? + ) { + super() + this.parsedAsyncAPI = parsedAsyncAPI + this.serverName = serverName + this.AsyncAPIServer = AsyncAPIServer + this.authConfig = authConfig + } + + checkClientAuthConfig() { + const securitySchemeID = this.parsedAsyncAPI.securitySchemes().all().map(s => s.id()) + + const authKeys = Object.keys(this.auth) + authKeys.forEach(authKey => { + const allowed = securitySchemeID.includes(authKey) + if (!allowed) { + const err = new Error(`${authKey} securityScheme is not defined is your asyncapi.yaml config`) + this.emit('error', err) + } + }) + + return authKeys + } + + async getAuthConfig(auth) { + if (!auth) return + if (typeof auth !== 'function') { + await resolveFunctions(auth) + return auth + } + + return await auth({ + serverName: this.serverName, + parsedAsyncAPI: this.parsedAsyncAPI, + }) + } + + formClientAuth(authKeys, { url, headers, query }) { + if (!authKeys) return { url, headers } + authKeys.map((authKey) => { + const scheme = this.parsedAsyncAPI.securitySchemes().get(authKey) + const currentScheme = scheme.scheme() + const currentType = scheme.type() + if (currentScheme == 'bearer') { + headers.authentication = `bearer ${this.auth[String(authKey)]}` + return + } + if (currentType == 'userPassword' || currentType == 'apiKey') { + url = this.userPassApiKeyLogic(url, authKey) + return + } + if (currentType == 'oauth2') { + headers.oauthToken = this.auth[String(authKey)] + } + if (currentType == 'httpApiKey') { + const conf = this.httpApiKeyLogic(scheme, headers, query, authKey) + headers = conf.headers + query = conf.query + + if (query) { + Object.keys(query).forEach(k => { + // eslint-disable-next-line security/detect-object-injection + url.searchParams.set(k, query[k]) + }) + } + } + }) + return { url, headers, query } + } + + private userPassApiKeyLogic(url, authKey) { + const password = this.auth[String(authKey)]['password'] + const username = this.auth[String(authKey)]['user'] + + if (typeof url == 'object') { + url.password = password + url.username = username + return url + } + + const myURL = new URL(url) + myURL.password = password + myURL.username = username + return myURL + } + + private httpApiKeyLogic(scheme, headers, query, authKey) { + + const loc = scheme.in() + if (loc == 'header') { + headers[scheme.name()] = this.auth[String(authKey)] + } else if (loc == 'query') { + query[scheme.name()] = this.auth[String(authKey)] + } + + return { headers, query } + } + + async processClientAuth({ url, headers, query }: Authenticatable) { + this.auth = await this.getAuthConfig(this.authConfig) + const authKeys = this.checkClientAuthConfig() + if (!authKeys) return + return this.formClientAuth(authKeys, { url, headers, query }) + } + + checkAuthPresense(): boolean { + return ( + this.AsyncAPIServer.security() && + Object.keys(this.AsyncAPIServer.security()).length > 0 + ) + } +} + +export default GleeQuoreAuth diff --git a/packages/web-server-adapter/.editorconfig b/packages/web-server-adapter/.editorconfig new file mode 100644 index 000000000..3abcad16c --- /dev/null +++ b/packages/web-server-adapter/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab + +[*.md] +trim_trailing_whitespace = false diff --git a/packages/web-server-adapter/.eslintignore b/packages/web-server-adapter/.eslintignore new file mode 100644 index 000000000..fa806b632 --- /dev/null +++ b/packages/web-server-adapter/.eslintignore @@ -0,0 +1,9 @@ +node_modules +examples/social-network/frontend +examples/crypto-websockets +dist +.glee +test +jest.config.js +docs +try.js \ No newline at end of file diff --git a/packages/web-server-adapter/.eslintrc b/packages/web-server-adapter/.eslintrc new file mode 100644 index 000000000..02bbf610b --- /dev/null +++ b/packages/web-server-adapter/.eslintrc @@ -0,0 +1,53 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint", + "sonarjs", + "security", + "github" + ], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:sonarjs/recommended", + "plugin:security/recommended" + ], + "rules": { + "curly": [ + "error", + "multi-line" + ], + "security/detect-non-literal-fs-filename": "off", + "@typescript-eslint/no-explicit-any": "off", + "semi": [ + "warn", + "never" + ], + "sonarjs/cognitive-complexity": "warn" + }, + "globals": { + "process": "readonly" + }, + "overrides": [ + { + "files": [ + "*.spec.ts", + "*.spec.tsx", + "src/help/command.ts" + ], + "rules": { + "no-undef": "off", + "security/detect-non-literal-fs-filename": "off", + "sonarjs/no-duplicate-string": "off", + "security/detect-object-injection": "off", + "max-nested-callbacks": "off", + "sonarjs/no-identical-functions": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unused-vars": "off", + "no-use-before-define": "off", + "sonarjs/cognitive-complexity": "off" + } + } + ] +} \ No newline at end of file diff --git a/packages/web-server-adapter/.prettierignore b/packages/web-server-adapter/.prettierignore new file mode 100644 index 000000000..764aff77b --- /dev/null +++ b/packages/web-server-adapter/.prettierignore @@ -0,0 +1,6 @@ +dist +coverage +.github +examples +node_modules +docs diff --git a/packages/web-server-adapter/.prettierrc.yaml b/packages/web-server-adapter/.prettierrc.yaml new file mode 100644 index 000000000..45c45fea2 --- /dev/null +++ b/packages/web-server-adapter/.prettierrc.yaml @@ -0,0 +1,4 @@ +trailingComma: "es5" +tabWidth: 2 +semi: false +singleQuote: true \ No newline at end of file diff --git a/packages/web-server-adapter/README.md b/packages/web-server-adapter/README.md new file mode 100644 index 000000000..2c54322d5 --- /dev/null +++ b/packages/web-server-adapter/README.md @@ -0,0 +1,4 @@ +# web-server-adapter + +HTTP and WebSocket server adapter for Glee. + diff --git a/packages/web-server-adapter/http.ts b/packages/web-server-adapter/http.ts new file mode 100644 index 000000000..316d34e9a --- /dev/null +++ b/packages/web-server-adapter/http.ts @@ -0,0 +1,255 @@ +import { GleeQuoreAdapter, GleeQuoreMessage } from '@asyncapi/gleequore' +import http, { IncomingMessage, ServerResponse } from 'http' +import { StringDecoder } from 'string_decoder' +import * as url from 'url' +import { ChannelInterface } from '@asyncapi/parser' +import GleeQuoreAuth from './wsHttpAuth.js' + +class HttpAdapter extends GleeQuoreAdapter { + private httpResponses = new Map() + + name(): string { + return 'HTTP server' + } + + async connect(): Promise { + return this._connect() + } + + async send(message: GleeQuoreMessage): Promise { + return this._send(message) + } + + async _readRequestBody(req: http.IncomingMessage): Promise { + return new Promise((resolve) => { + const decoder = new StringDecoder("utf-8") + let result = "" + + req.on('data', (chunk) => { + result += decoder.write(chunk) + }) + + req.on('end', () => { + result += decoder.end() + resolve(result) + }) + }) + } + + async _authenticateRequest(req: IncomingMessage, res: ServerResponse) { + + function done() { + let resolveFunc, rejectFunc + const promise = new Promise((resolve, reject) => { + resolveFunc = resolve + rejectFunc = reject + }) + return { + promise, + done: (val: boolean) => { + if (val) { + resolveFunc(true) + } else { + rejectFunc({ code: 401, message: 'Unauthorized' }) + } + }, + } + } + + const gleeAuth = new GleeQuoreAuth( + this.AsyncAPIServer, + this.parsedAsyncAPI, + this.serverName, + req.headers + ) + + const { promise, done: callback } = done() + try { + if (!gleeAuth.checkAuthPresense()) return + this.emit('auth', { + authProps: gleeAuth.getServerAuthProps( + req.headers, + url.parse(req.url, true).query + ), + server: this.serverName, + done: callback, + doc: this.AsyncAPIServer, + }) + await promise + } catch (e) { + res.statusCode = e.code + res.end() + this.emit('error', new Error(`${e.code} ${e.message}`)) + return + } + } + + _storeHttpResponse(res: ServerResponse) { + this.httpResponses.set(this.serverName, res) + } + _extractPathname(req: IncomingMessage) { + const serverUrl = new URL(this.serverUrlExpanded) + let { pathname } = new URL(req.url, serverUrl) + pathname = pathname.startsWith('/') ? pathname.substring(1) : pathname + return pathname || '/' + } + + _getChannel(pathName: string) { + return this.parsedAsyncAPI.channels().all().filter(channel => channel.address() === pathName)[0] + } + async _processIncomingRequest(req: IncomingMessage, res: ServerResponse, body: any) { + this._storeHttpResponse(res) + const pathName = this._extractPathname(req) + const channel = this._getChannel(pathName) + if (!channel) { + this._handleInvalidChannel(res, pathName) + } + + + this._emitConnectionEvent(channel) + this._emitMessageEvent(body, req.url, channel) + + } + _emitMessageEvent(body: any, requestUrl: string, channel: ChannelInterface) { + const { query } = url.parse(requestUrl, true) + const searchParams = { query } + + const channelId = channel.id() + const msg = this._createMessage(channelId, body, searchParams) + + this.emit('message', msg, http) + } + + _emitConnectionEvent(channel: ChannelInterface) { + this.emit('connect', { + name: this.name(), + adapter: this, + connection: http, + channel: channel.id(), + }) + } + + _handleInvalidChannel(res: http.ServerResponse, pathName: string) { + this._endRequest(404, "Channel Not Found", res) + const errorMessage = `A client sent a request to ${pathName} path, but this channel is not defined in your AsyncAPI file.` + this.emit('error', new Error(errorMessage)) + } + + _getFullUrl(req: IncomingMessage) { + const protocol = this.AsyncAPIServer.protocol + const host = req.headers['host'] + const urlPath = req.url + return `${protocol}://${host}${urlPath}` + } + + _handleRequest = async (req: IncomingMessage, res: ServerResponse) => { + try { + await this._authenticateRequest(req, res) + const body = await this._readRequestBody(req) + this._validateRequestAgainstBindings(req, res) + await this._processIncomingRequest(req, res, body) + } catch (e) { + const method = req.method + const url = req.url + const serverName = this.name() // Assuming 'this.name' contains the server's name. Adjust as needed. + const message = `Error occurred while processing ${method} request at ${url} on ${serverName}.` + console.error(message) + if (!res.writableEnded) this._endRequest(500, "Internal Server Error", res) + } + } + + async _connect(): Promise { + const config = await this.resolveConfig() + const httpOptions = config?.server + const httpServer = httpOptions?.httpServer || http.createServer() + const asyncapiServerPort = new URL(this.serverUrlExpanded).port || 80 + const port = asyncapiServerPort + httpServer.on('request', this._handleRequest) + httpServer.listen(port) + this.emit('server:ready', { name: this.name(), adapter: this }) + return this + } + _getOperationBindings(channel: ChannelInterface) { + return channel.operations().filterByReceive().map(operation => operation.bindings().get("http")?.json()) + } + _validateMethod(req: IncomingMessage, res: ServerResponse, operationsBindings): void { + const validMethods = new Set(operationsBindings + .map(operationBindings => operationBindings.method?.toLowerCase())) + if (!validMethods.has(req.method?.toLowerCase())) { + this._endRequest(405, 'Method Not Allowed', res) + throw new Error(`Invalid Request Method: '${req.method}'. Allowed methods for this channel: ${[...validMethods].join(', ')}`) + } + } + _endRequest(code: number, message: string, res: ServerResponse) { + res.statusCode = code + res.end(message) + } + _validateQueries(req: IncomingMessage, res: ServerResponse, operationsBindings) { + const querySchemas: any[] = operationsBindings + .map(operationBindings => operationBindings.query) + .filter(query => query != undefined) + + if (querySchemas.length < 1) return + + const schema = { anyOf: querySchemas } + const { query } = url.parse(req.url, true) + const { isValid, humanReadableError } = this.validate( + query, + schema + ) + if (!isValid) { + this._endRequest(400, 'Bad Request', res) + const message = `Query validation failed: ${humanReadableError}. Please ensure that the query parameters match the expected format and types defined in the schema.` + throw new Error(message) + } + + } + _validateHeaders(req: IncomingMessage, res: ServerResponse, messageBindings: any) { + const headerSchemas = messageBindings + .map(binding => binding?.headers) + .filter(schema => !!schema) + + if (headerSchemas.length < 1) return + + const schema = { anyOf: headerSchemas } + const headers = req.headers + + const { isValid, humanReadableError } = this.validate( + headers, + schema + ) + + if (!isValid) { + this._endRequest(400, "Bad Request", res) + const message = `Header validation failed: ${humanReadableError}. Please ensure that the headers match the expected format and types defined in the schema.` + throw new Error(message) + } + } + private _getMessageBindings(channel: ChannelInterface) { + return channel.messages().all().map(message => message.bindings().get("http")?.json()).filter(b => !!b) + } + _validateRequestAgainstBindings(req: IncomingMessage, res: ServerResponse) { + const pathName = this._extractPathname(req) + const channel = this.parsedAsyncAPI.channels().all().filter(channel => channel.address() === pathName)[0] + const operationsBindings = this._getOperationBindings(channel) + const messageBindings = this._getMessageBindings(channel) + this._validateMethod(req, res, operationsBindings) + this._validateQueries(req, res, operationsBindings) + this._validateHeaders(req, res, messageBindings) + } + async _send(message: GleeQuoreMessage): Promise { + const connection = this.httpResponses.get(message.serverName) + connection.write(message.payload) + connection.end() + } + + _createMessage(pathName: string, body: any, params: any) { + return new GleeQuoreMessage({ + payload: body, + channel: pathName, + query: params.query, + }) + } +} + +export default HttpAdapter diff --git a/packages/web-server-adapter/index.d.ts b/packages/web-server-adapter/index.d.ts new file mode 100644 index 000000000..db2fa4a94 --- /dev/null +++ b/packages/web-server-adapter/index.d.ts @@ -0,0 +1,42 @@ +import { GleeQuoreAdapterOptions } from "@asyncapi/gleequore" + +export type WsHttpAuth = WsAuthConfig | HttpAuthConfig + +export interface HttpAuthConfig { + token?: string + username?: string + password?: string +} + +export interface WsAuthConfig { + token?: string + username?: string + password?: string +} + +export interface WebsocketServerAdapterConfig extends GleeQuoreAdapterOptions { + httpServer?: any + adapter?: WebSocketServerType | typeof GleeQuoreAdapter + port?: number +} + +export type AuthProps = { + getToken: () => string + getUserPass: () => { + username: string + password: string + } + getCert: () => string + getOauthToken: () => string + getHttpAPIKeys: (name: string) => string + getAPIKeys: () => string +} + +type Headers = { [key: string]: string } +type QueryParam = { [key: string]: string } | { [key: string]: string[] } + +export interface Authenticatable { + headers: Headers, + query: QueryParam + url: URL +} \ No newline at end of file diff --git a/packages/web-server-adapter/package.json b/packages/web-server-adapter/package.json new file mode 100644 index 000000000..7a79bdfb2 --- /dev/null +++ b/packages/web-server-adapter/package.json @@ -0,0 +1,45 @@ +{ + "name": "@asyncapi/glee-web-server-adapter", + "version": "0.0.0", + "description": "HTTP and WebSocket server adapter for Glee.", + "exports": { + "./http": "./dist/http.js", + "./ws": "./dist/ws.js" + }, + "type": "module", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "scripts": { + "build": "tsc", + "dev": "tsc --watch", + "get:version": "echo $npm_package_version", + "get:name": "echo $npm_package_name", + "generate:assets": "echo 'No generate:assets script. Ignoring...'", + "lint": "eslint --max-warnings 1 --config .eslintrc .", + "lint:fix": "eslint --max-warnings 1 --config .eslintrc . --fix", + "prepublishOnly": "npm run build", + "test": "echo 'No test script. Ignoring...'", + "test:dev": "echo 'No test:dev script. Ignoring...'" + }, + "dependencies": { + "@asyncapi/glee-shared-utils": "workspace:*", + "@asyncapi/gleequore": "workspace:*", + "ws": "^7.4.6" + }, + "devDependencies": { + "@tsconfig/node14": "^1.0.1", + "@types/debug": "^4.1.7", + "@types/ws": "^8.5.3", + "@typescript-eslint/eslint-plugin": "^5.9.0", + "@typescript-eslint/parser": "^5.9.0", + "eslint": "^8.6.0", + "eslint-plugin-github": "^4.3.5", + "eslint-plugin-security": "^1.4.0", + "eslint-plugin-sonarjs": "^0.19.0", + "typedoc": "^0.26.10", + "typedoc-plugin-markdown": "^4.2.9", + "typescript": "^4.5.4" + }, + "license": "Apache-2.0" +} diff --git a/packages/web-server-adapter/tsconfig.json b/packages/web-server-adapter/tsconfig.json new file mode 100644 index 000000000..b5a5a8840 --- /dev/null +++ b/packages/web-server-adapter/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "skipLibCheck": true, + "outDir": "./dist", + "allowJs": false, + "target": "es6", + "esModuleInterop": true, + "moduleResolution": "nodenext", + "module": "NodeNext" + }, + "include": [ + "./*.ts" +, "http/client.ts", "http/server.ts" ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/packages/web-server-adapter/ws.ts b/packages/web-server-adapter/ws.ts new file mode 100644 index 000000000..fb04c8745 --- /dev/null +++ b/packages/web-server-adapter/ws.ts @@ -0,0 +1,298 @@ +import WebSocket from 'ws' +import http, { IncomingMessage, Server as HttpServer } from 'http' +import type { Duplex } from 'stream' +import { validateData } from '@asyncapi/glee-shared-utils' +import { GleeQuoreAdapter, GleeQuoreMessage, GleeQuoreConnection, GleeQuoreAdapterOptions } from '@asyncapi/gleequore' +import GleeQuoreAuth from './wsHttpAuth.js' +import { WebsocketServerAdapterConfig } from './index.d.js' +import * as url from 'url' + +export default class WebSocketsServerAdapter extends GleeQuoreAdapter { + private config: WebsocketServerAdapterConfig + private serverUrl: URL + private wsHttpServer: HttpServer + private customHttpServer: HttpServer + // WebSockets are limited to a single connection path per server. To accommodate multiple channels, we instantiate a separate server for each channel and maintain a record of these servers here. + private websocketServers: Map + + constructor(options: WebsocketServerAdapterConfig) { + const { httpServer, adapter, port, ...rest } = options // eslint-disable-line @typescript-eslint/no-unused-vars + super(rest as GleeQuoreAdapterOptions) + this.config = options + this.customHttpServer = this.config?.httpServer + this.wsHttpServer = this.customHttpServer || http.createServer() + this.serverUrl = new URL(this.serverUrlExpanded) + this.websocketServers = new Map() + } + + name(): string { + return 'WebSockets adapter' + } + + async connect(): Promise { + try { + await this._connect() + } catch (e) { + const errorMessage = `Unable to connect to ${this.name()}: ${e.message}` + this.emit('error', new Error(errorMessage)) + } + return this + } + + private _createServers() { + const gleeAuth = new GleeQuoreAuth( + this.AsyncAPIServer, + this.parsedAsyncAPI, + this.serverName + ) + const verifyClient = gleeAuth.checkAuthPresense() + ? (info, cb) => { + this._verifyClientFunc(gleeAuth, info, cb) + } + : null + + this.channelNames.forEach((channelName) => { + this.websocketServers.set( + channelName, + new WebSocket.Server({ + noServer: true, + verifyClient + }) + ) + }) + } + + private async _connect(): Promise { + this._validatePort() + this._createServers() + + this.wsHttpServer.on('upgrade', (request: IncomingMessage, socket: Duplex, head: Buffer) => { + try { + this._handleRequest(request, socket, head) + } catch (e) { + const errorMessage = `Error handling request: ${e.message}` + this.emit('error', new Error(errorMessage)) + if (!socket.writableEnded) this._endRequest(500, 'Internal Server Error', socket) + } + }) + + if (!this.customHttpServer) { + this.wsHttpServer.listen(this._getPort()) + } + + this.emit('server:ready', { name: this.name(), adapter: this }) + return this + } + + private _getPort() { + const configPort = this.config?.port + return configPort ? configPort : this.serverUrl.port + } + + private _getChannel(req: IncomingMessage) { + const pathName = this._extractPathname(req) + return this.parsedAsyncAPI.channels().all().filter(channel => { + let address = channel.address() + if (address && address.endsWith('/')) address = address.substring(0, address.length - 1) + + return address === pathName + })[0] + } + + private _endRequest(code: number, message: string, socket: Duplex) { + socket.end(`HTTP/1.1 ${code} ${message}\r\n\r\n`) + } + + private _handleInvalidChannel(res: Duplex, pathName: string) { + this._endRequest(404, "Channel Not Found", res) + const errorMessage = `A client tried to connect to ${pathName}, but this path is not defined in your AsyncAPI file.` + throw new Error(errorMessage) + } + + private _validateRequest(request: IncomingMessage, socket: Duplex) { + const pathName = this._extractPathname(request) + const channel = this._getChannel(request) + if (!channel) { + this._handleInvalidChannel(socket, pathName) + } + this._validateRequestAgainstBindings(request, socket) + } + + private _validateRequestAgainstBindings(req: IncomingMessage, socket: Duplex) { + const channel = this._getChannel(req) + const channelBindings = channel.bindings().get("ws") + if (!channelBindings) return + this._validateMethod(req, socket, channelBindings) + this._validateQueries(req, socket, channelBindings) + this._validateHeaders(req, socket, channelBindings) + } + + private _validateHeaders(req: IncomingMessage, socket: Duplex, channelBindings) { + + const schema = channelBindings.headers + if (!schema) return + const headers = req.headers + + const { isValid, humanReadableError } = validateData( + headers, + schema + ) + + if (!isValid) { + this._endRequest(400, "Bad Request", socket) + const message = `Header validation failed: ${humanReadableError}. Please ensure that the headers match the expected format and types defined in the schema.` + throw new Error(message) + } + } + + private _validateQueries(req: IncomingMessage, socket: Duplex, channelBindings) { + const schema = channelBindings.query + if (!schema) return + const { query } = url.parse(req.url || '', true) + const { isValid, humanReadableError } = validateData( + query, + schema + ) + if (!isValid) { + this._endRequest(400, 'Bad Request', socket) + const message = `Query validation failed: ${humanReadableError}. Please ensure that the query parameters match the expected format and types defined in the schema.` + throw new Error(message) + } + + } + + private _validateMethod(req: IncomingMessage, socket: Duplex, channelBindings): void { + const validMethod = channelBindings?.method?.toLowerCase() + if (!validMethod) return + if (validMethod !== req.method?.toLowerCase()) { + this._endRequest(405, 'Method Not Allowed', socket) + throw new Error(`Invalid Request Method: '${req.method}'. Allowed method for this channel: ${validMethod}`) + } + } + + private _handleRequest(request: IncomingMessage, socket: Duplex, head: Buffer) { + this._validateRequest(request, socket) + const channelId = this._getChannel(request).id() + const server = this.websocketServers.get(channelId) + if (!server) socket.destroy() + + this.websocketServers.get(channelId).handleUpgrade(request, socket, head, (ws) => { + this._initializeServerEvents({ server, ws, request }) + }) + } + + + private _extractPathname(req: IncomingMessage) { + const serverUrl = new URL(this.serverUrlExpanded) + const { pathname } = new URL(req.url || '', serverUrl) + + if (!pathname) return '/' + + if (pathname.endsWith('/')) { + return pathname.substring(0, pathname.length - 1) + } + + return pathname + } + + + private _initializeServerEvents({ server, ws, request }) { + const channelId = this._getChannel(request).id() + server.emit('connect', ws, request) + ws.on('message', (payload) => { + const msg = this._createMessage(channelId, payload) + this.emit('message', msg, ws) + }) + + this.emit('server:connection:open', { + name: this.name(), + adapter: this, + connection: ws, + channel: channelId, + request, + }) + } + + private _validatePort() { + const customServer = this.config?.httpServer + if (!customServer) return + + const customServerPort = String(customServer.address().port) + if (customServerPort !== this._getPort()) { + throw new Error( + `Your custom HTTP server is listening on port ${customServerPort} but your AsyncAPI or config file says it must listen on ${this._getPort()}. Please fix the inconsistency.` + ) + } + } + + private _wrapCallbackDecorator(cb) { + return function done(val: boolean) { + cb(val) + if (val === false) { + const err = new Error("401, Unauthorized") + this.emit('error', err) + } + } + } + + private _verifyClientFunc(gleeAuth, info, cb) { + const authProps = gleeAuth.getServerAuthProps(info.req.headers, {}) + const done = this._wrapCallbackDecorator(cb).bind(this) + this.emit('auth', { + authProps, + server: this.serverName, + done, + doc: this.AsyncAPIServer, + }) + } + + + async send(message: GleeQuoreMessage): Promise { + try { + return this._send(message) + } catch (e) { + const errorMessage = `Error sending message: ${e.message}. Check message validity and connection status.` + this.emit("error", new Error(errorMessage)) + } + } + + private _handleBroadcastMessage(message: GleeQuoreMessage) { + this.app.syncCluster(message) + + this.connections + .filter(({ channels }) => channels.includes(message.channel)) + .forEach((connection) => { + connection.getRaw().send(message.payload) + }) + } + + private _validateDirectMessage(message: GleeQuoreMessage) { + if (!message.connection) { + throw new Error('No WebSocket connection available for sending the message.') + } + if (!(message.connection instanceof GleeQuoreConnection)) { + throw new Error('The connection object is not a valid GleeQuoreConnection instance.') + } + } + + private _handleDirectMessage(message: GleeQuoreMessage) { + this._validateDirectMessage(message) + message.connection.getRaw().send(message.payload) + } + + private _send(message: GleeQuoreMessage) { + if (message.broadcast) { + this._handleBroadcastMessage(message) + } else { + this._handleDirectMessage(message) + } + } + + private _createMessage(eventName: string, payload: any): GleeQuoreMessage { + return new GleeQuoreMessage({ + payload, + channel: eventName, + }) + } +} + diff --git a/packages/web-server-adapter/wsHttpAuth.ts b/packages/web-server-adapter/wsHttpAuth.ts new file mode 100644 index 000000000..371d506e2 --- /dev/null +++ b/packages/web-server-adapter/wsHttpAuth.ts @@ -0,0 +1,170 @@ +import { AsyncAPIDocumentInterface as AsyncAPIDocument, ServerInterface } from '@asyncapi/parser' +import { resolveFunctions } from '@asyncapi/glee-shared-utils' +import { EventEmitter } from 'events' +import { HttpAuthConfig, WsAuthConfig, AuthProps, Authenticatable } from './index.d.js' + +class GleeQuoreAuth extends EventEmitter { + private parsedAsyncAPI: AsyncAPIDocument + private serverName: string + private AsyncAPIServer: ServerInterface + private authConfig: WsAuthConfig | HttpAuthConfig + private auth: { [key: string]: string } | { [key: string]: string[] } + + /** + * Instantiates authentication. + */ + constructor( + AsyncAPIServer: ServerInterface, + parsedAsyncAPI: AsyncAPIDocument, + serverName: string, + authConfig? + ) { + super() + this.parsedAsyncAPI = parsedAsyncAPI + this.serverName = serverName + this.AsyncAPIServer = AsyncAPIServer + this.authConfig = authConfig + } + + checkClientAuthConfig() { + const securitySchemeID = this.parsedAsyncAPI.securitySchemes().all().map(s => s.id()) + + const authKeys = Object.keys(this.auth) + authKeys.forEach(authKey => { + const allowed = securitySchemeID.includes(authKey) + if (!allowed) { + const err = new Error(`${authKey} securityScheme is not defined is your asyncapi.yaml config`) + this.emit('error', err) + } + }) + + return authKeys + } + + async getAuthConfig(auth) { + if (!auth) return + if (typeof auth !== 'function') { + await resolveFunctions(auth) + return auth + } + + return await auth({ + serverName: this.serverName, + parsedAsyncAPI: this.parsedAsyncAPI, + }) + } + + formClientAuth(authKeys, { url, headers, query }) { + if (!authKeys) return { url, headers } + authKeys.map((authKey) => { + const scheme = this.parsedAsyncAPI.securitySchemes().get(authKey) + const currentScheme = scheme.scheme() + const currentType = scheme.type() + if (currentScheme == 'bearer') { + headers.authentication = `bearer ${this.auth[String(authKey)]}` + return + } + if (currentType == 'userPassword' || currentType == 'apiKey') { + url = this.userPassApiKeyLogic(url, authKey) + return + } + if (currentType == 'oauth2') { + headers.oauthToken = this.auth[String(authKey)] + } + if (currentType == 'httpApiKey') { + const conf = this.httpApiKeyLogic(scheme, headers, query, authKey) + headers = conf.headers + query = conf.query + + if (query) { + Object.keys(query).forEach(k => { + // eslint-disable-next-line security/detect-object-injection + url.searchParams.set(k, query[k]) + }) + } + } + }) + return { url, headers, query } + } + + private userPassApiKeyLogic(url, authKey) { + const password = this.auth[String(authKey)]['password'] + const username = this.auth[String(authKey)]['user'] + + if (typeof url == 'object') { + url.password = password + url.username = username + return url + } + + const myURL = new URL(url) + myURL.password = password + myURL.username = username + return myURL + } + + private httpApiKeyLogic(scheme, headers, query, authKey) { + + const loc = scheme.in() + if (loc == 'header') { + headers[scheme.name()] = this.auth[String(authKey)] + } else if (loc == 'query') { + query[scheme.name()] = this.auth[String(authKey)] + } + + return { headers, query } + } + + // getServerAuthReq() {} + + getServerAuthProps(headers, query) { + const authProps: AuthProps = { + getToken: () => { + return headers.authentication + }, + getUserPass: () => { + const buf = headers.authorization + ? Buffer.from(headers.authorization?.split(' ')[1], 'base64') + : undefined + + if (!buf) return + + const [username, password] = buf.toString().split(':') + return { + username, + password, + } + }, + getCert: () => { + return headers.cert + }, + getOauthToken: () => { + return headers.oauthtoken + }, + getHttpAPIKeys: (name: string) => { + return headers[String(name)] ?? query[String(name)] + }, + getAPIKeys: () => { + return `keys` + }, + } + + return authProps + } + + async processClientAuth({ url, headers, query }: Authenticatable) { + this.auth = await this.getAuthConfig(this.authConfig) + const authKeys = this.checkClientAuthConfig() + if (!authKeys) return + return this.formClientAuth(authKeys, { url, headers, query }) + } + + checkAuthPresense(): boolean { + return ( + this.AsyncAPIServer.security() && + Object.keys(this.AsyncAPIServer.security()).length > 0 + ) + } +} + +export default GleeQuoreAuth diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 638a0552c..c342f0c90 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -209,6 +209,407 @@ importers: specifier: ^1.0.0 version: 1.0.0 + packages/gleequore: + dependencies: + '@asyncapi/glee-shared-utils': + specifier: workspace:* + version: link:../shared-utils + '@asyncapi/parser': + specifier: ^3.1.0 + version: 3.3.0 + async: + specifier: ^3.2.0 + version: 3.2.6 + debug: + specifier: ^4.3.1 + version: 4.3.7 + typescript: + specifier: ^4.5.4 + version: 4.9.5 + uri-templates: + specifier: ^0.2.0 + version: 0.2.0 + uuid: + specifier: ^8.3.2 + version: 8.3.2 + devDependencies: + '@jest/globals': + specifier: 29.7.0 + version: 29.7.0 + '@tsconfig/node14': + specifier: ^1.0.1 + version: 1.0.3 + '@types/async': + specifier: ^3.2.11 + version: 3.2.24 + '@types/debug': + specifier: ^4.1.7 + version: 4.1.12 + '@types/jest': + specifier: ^29.5.14 + version: 29.5.14 + '@types/uri-templates': + specifier: ^0.1.31 + version: 0.1.34 + '@typescript-eslint/eslint-plugin': + specifier: ^5.9.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.9.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) + eslint: + specifier: ^8.6.0 + version: 8.57.1 + eslint-plugin-github: + specifier: ^4.3.5 + version: 4.10.2(eslint@8.57.1)(typescript@4.9.5) + eslint-plugin-jest: + specifier: ^27.6.0 + version: 27.9.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.57.1)(jest@29.7.0)(typescript@4.9.5) + eslint-plugin-security: + specifier: ^1.4.0 + version: 1.7.1 + eslint-plugin-sonarjs: + specifier: ^0.19.0 + version: 0.19.0(eslint@8.57.1) + jest: + specifier: ^29.7.0 + version: 29.7.0(@types/node@22.8.0) + jest-extended: + specifier: ^4.0.2 + version: 4.0.2(jest@29.7.0) + ts-jest: + specifier: ^29.1.1 + version: 29.2.5(@babel/core@7.26.0)(jest@29.7.0)(typescript@4.9.5) + typedoc: + specifier: ^0.26.10 + version: 0.26.10(typescript@4.9.5) + typedoc-plugin-markdown: + specifier: ^4.2.9 + version: 4.2.9(typedoc@0.26.10) + + packages/kafka-adapter: + dependencies: + '@asyncapi/glee-shared-utils': + specifier: workspace:* + version: link:../shared-utils + '@asyncapi/gleequore': + specifier: workspace:* + version: link:../gleequore + kafkajs: + specifier: ^2.2.3 + version: 2.2.4 + devDependencies: + '@tsconfig/node14': + specifier: ^1.0.1 + version: 1.0.3 + '@types/debug': + specifier: ^4.1.7 + version: 4.1.12 + '@typescript-eslint/eslint-plugin': + specifier: ^5.9.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.9.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) + eslint: + specifier: ^8.6.0 + version: 8.57.1 + eslint-plugin-github: + specifier: ^4.3.5 + version: 4.10.2(eslint@8.57.1)(typescript@4.9.5) + eslint-plugin-security: + specifier: ^1.4.0 + version: 1.7.1 + eslint-plugin-sonarjs: + specifier: ^0.19.0 + version: 0.19.0(eslint@8.57.1) + typedoc: + specifier: ^0.26.10 + version: 0.26.10(typescript@4.9.5) + typedoc-plugin-markdown: + specifier: ^4.2.9 + version: 4.2.9(typedoc@0.26.10) + typescript: + specifier: ^4.5.4 + version: 4.9.5 + + packages/mqtt-adapter: + dependencies: + '@asyncapi/glee-shared-utils': + specifier: workspace:* + version: link:../shared-utils + '@asyncapi/gleequore': + specifier: workspace:* + version: link:../gleequore + mqtt: + specifier: ^4.3.7 + version: 4.3.8(bufferutil@4.0.8)(utf-8-validate@5.0.10) + devDependencies: + '@tsconfig/node14': + specifier: ^1.0.1 + version: 1.0.3 + '@types/debug': + specifier: ^4.1.7 + version: 4.1.12 + '@typescript-eslint/eslint-plugin': + specifier: ^5.9.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.9.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) + eslint: + specifier: ^8.6.0 + version: 8.57.1 + eslint-plugin-github: + specifier: ^4.3.5 + version: 4.10.2(eslint@8.57.1)(typescript@4.9.5) + eslint-plugin-security: + specifier: ^1.4.0 + version: 1.7.1 + eslint-plugin-sonarjs: + specifier: ^0.19.0 + version: 0.19.0(eslint@8.57.1) + typedoc: + specifier: ^0.26.10 + version: 0.26.10(typescript@4.9.5) + typedoc-plugin-markdown: + specifier: ^4.2.9 + version: 4.2.9(typedoc@0.26.10) + typescript: + specifier: ^4.5.4 + version: 4.9.5 + + packages/redis-cluster-adapter: + dependencies: + '@asyncapi/glee-shared-utils': + specifier: workspace:* + version: link:../shared-utils + '@asyncapi/gleequore': + specifier: workspace:* + version: link:../gleequore + redis: + specifier: ^4.0.2 + version: 4.7.0 + devDependencies: + '@tsconfig/node14': + specifier: ^1.0.1 + version: 1.0.3 + '@types/debug': + specifier: ^4.1.7 + version: 4.1.12 + '@typescript-eslint/eslint-plugin': + specifier: ^5.9.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.9.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) + eslint: + specifier: ^8.6.0 + version: 8.57.1 + eslint-plugin-github: + specifier: ^4.3.5 + version: 4.10.2(eslint@8.57.1)(typescript@4.9.5) + eslint-plugin-security: + specifier: ^1.4.0 + version: 1.7.1 + eslint-plugin-sonarjs: + specifier: ^0.19.0 + version: 0.19.0(eslint@8.57.1) + typedoc: + specifier: ^0.26.10 + version: 0.26.10(typescript@4.9.5) + typedoc-plugin-markdown: + specifier: ^4.2.9 + version: 4.2.9(typedoc@0.26.10) + typescript: + specifier: ^4.5.4 + version: 4.9.5 + + packages/shared-utils: + dependencies: + '@asyncapi/parser': + specifier: ^3.1.0 + version: 3.3.0 + ajv: + specifier: ^6.12.6 + version: 6.12.6 + better-ajv-errors: + specifier: ^0.7.0 + version: 0.7.0(ajv@6.12.6) + path-to-regexp: + specifier: ^6.2.0 + version: 6.3.0 + devDependencies: + '@typescript-eslint/eslint-plugin': + specifier: ^5.9.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.9.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) + eslint: + specifier: ^8.6.0 + version: 8.57.1 + eslint-plugin-github: + specifier: ^4.3.5 + version: 4.10.2(eslint@8.57.1)(typescript@4.9.5) + eslint-plugin-security: + specifier: ^1.4.0 + version: 1.7.1 + eslint-plugin-sonarjs: + specifier: ^0.19.0 + version: 0.19.0(eslint@8.57.1) + typescript: + specifier: ^4.5.4 + version: 4.9.5 + + packages/socket.io-adapter: + dependencies: + '@asyncapi/glee-shared-utils': + specifier: workspace:* + version: link:../shared-utils + '@asyncapi/gleequore': + specifier: workspace:* + version: link:../gleequore + socket.io: + specifier: ^4.1.2 + version: 4.8.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) + devDependencies: + '@tsconfig/node14': + specifier: ^1.0.1 + version: 1.0.3 + '@types/debug': + specifier: ^4.1.7 + version: 4.1.12 + '@typescript-eslint/eslint-plugin': + specifier: ^5.9.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.9.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) + eslint: + specifier: ^8.6.0 + version: 8.57.1 + eslint-plugin-github: + specifier: ^4.3.5 + version: 4.10.2(eslint@8.57.1)(typescript@4.9.5) + eslint-plugin-security: + specifier: ^1.4.0 + version: 1.7.1 + eslint-plugin-sonarjs: + specifier: ^0.19.0 + version: 0.19.0(eslint@8.57.1) + typedoc: + specifier: ^0.26.10 + version: 0.26.10(typescript@4.9.5) + typedoc-plugin-markdown: + specifier: ^4.2.9 + version: 4.2.9(typedoc@0.26.10) + typescript: + specifier: ^4.5.4 + version: 4.9.5 + + packages/web-adapter: + dependencies: + '@asyncapi/glee-shared-utils': + specifier: workspace:* + version: link:../shared-utils + '@asyncapi/gleequore': + specifier: workspace:* + version: link:../gleequore + got: + specifier: ^12.5.3 + version: 12.6.1 + ws: + specifier: ^7.4.6 + version: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) + devDependencies: + '@tsconfig/node14': + specifier: ^1.0.1 + version: 1.0.3 + '@types/debug': + specifier: ^4.1.7 + version: 4.1.12 + '@types/ws': + specifier: ^8.5.3 + version: 8.5.12 + '@typescript-eslint/eslint-plugin': + specifier: ^5.9.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.9.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) + eslint: + specifier: ^8.6.0 + version: 8.57.1 + eslint-plugin-github: + specifier: ^4.3.5 + version: 4.10.2(eslint@8.57.1)(typescript@4.9.5) + eslint-plugin-security: + specifier: ^1.4.0 + version: 1.7.1 + eslint-plugin-sonarjs: + specifier: ^0.19.0 + version: 0.19.0(eslint@8.57.1) + typedoc: + specifier: ^0.26.10 + version: 0.26.10(typescript@4.9.5) + typedoc-plugin-markdown: + specifier: ^4.2.9 + version: 4.2.9(typedoc@0.26.10) + typescript: + specifier: ^4.5.4 + version: 4.9.5 + + packages/web-server-adapter: + dependencies: + '@asyncapi/glee-shared-utils': + specifier: workspace:* + version: link:../shared-utils + '@asyncapi/gleequore': + specifier: workspace:* + version: link:../gleequore + ws: + specifier: ^7.4.6 + version: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) + devDependencies: + '@tsconfig/node14': + specifier: ^1.0.1 + version: 1.0.3 + '@types/debug': + specifier: ^4.1.7 + version: 4.1.12 + '@types/ws': + specifier: ^8.5.3 + version: 8.5.12 + '@typescript-eslint/eslint-plugin': + specifier: ^5.9.0 + version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@4.9.5) + '@typescript-eslint/parser': + specifier: ^5.9.0 + version: 5.62.0(eslint@8.57.1)(typescript@4.9.5) + eslint: + specifier: ^8.6.0 + version: 8.57.1 + eslint-plugin-github: + specifier: ^4.3.5 + version: 4.10.2(eslint@8.57.1)(typescript@4.9.5) + eslint-plugin-security: + specifier: ^1.4.0 + version: 1.7.1 + eslint-plugin-sonarjs: + specifier: ^0.19.0 + version: 0.19.0(eslint@8.57.1) + typedoc: + specifier: ^0.26.10 + version: 0.26.10(typescript@4.9.5) + typedoc-plugin-markdown: + specifier: ^4.2.9 + version: 4.2.9(typedoc@0.26.10) + typescript: + specifier: ^4.5.4 + version: 4.9.5 + packages: /@ampproject/remapping@2.3.0: @@ -2011,7 +2412,6 @@ packages: /@github/browserslist-config@1.0.0: resolution: {integrity: sha512-gIhjdJp/c2beaIWWIlsXdqXVRUz3r2BxBCpfz/F3JXHvSAQ1paMYjLH+maEATtENg+k5eLV7gA+9yPp762ieuw==} - dev: false /@humanwhocodes/config-array@0.13.0: resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} @@ -3305,7 +3705,6 @@ packages: /@pkgr/core@0.1.1: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - dev: false /@protobufjs/aspromise@1.1.2: resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} @@ -3432,7 +3831,6 @@ packages: /@rtsao/scc@1.1.0: resolution: {integrity: sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==} - dev: false /@shikijs/core@1.22.1: resolution: {integrity: sha512-bqAhT/Ri5ixV4oYsvJNH8UJjpjbINWlWyXY6tBTsP4OmD6XnFv43nRJ+lTdxd2rmG5pgam/x+zGR6kLRXrpEKA==} @@ -3856,14 +4254,12 @@ packages: dependencies: expect: 29.7.0 pretty-format: 29.7.0 - dev: false /@types/json-schema@7.0.15: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} /@types/json5@0.0.29: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - dev: false /@types/linkify-it@5.0.0: resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} @@ -4022,7 +4418,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@4.9.5): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} @@ -4063,7 +4458,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/scope-manager@5.62.0: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} @@ -4079,7 +4473,6 @@ packages: dependencies: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 - dev: false /@typescript-eslint/type-utils@5.62.0(eslint@8.57.1)(typescript@4.9.5): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} @@ -4119,7 +4512,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/types@5.62.0: resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} @@ -4129,7 +4521,6 @@ packages: /@typescript-eslint/types@7.18.0: resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} engines: {node: ^18.18.0 || >=20.0.0} - dev: false /@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.5): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} @@ -4172,7 +4563,6 @@ packages: typescript: 4.9.5 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/utils@5.62.0(eslint@8.57.1)(typescript@4.9.5): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} @@ -4208,7 +4598,6 @@ packages: transitivePeerDependencies: - supports-color - typescript - dev: false /@typescript-eslint/visitor-keys@5.62.0: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} @@ -4224,7 +4613,6 @@ packages: dependencies: '@typescript-eslint/types': 7.18.0 eslint-visitor-keys: 3.4.3 - dev: false /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -4512,7 +4900,6 @@ packages: /aria-query@5.3.2: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} - dev: false /array-back@1.0.4: resolution: {integrity: sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==} @@ -4574,7 +4961,6 @@ packages: es-errors: 1.3.0 es-object-atoms: 1.0.0 es-shim-unscopables: 1.0.2 - dev: false /array.prototype.flat@1.3.2: resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} @@ -4613,7 +4999,6 @@ packages: /ast-types-flow@0.0.8: resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==} - dev: false /astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} @@ -4652,12 +5037,10 @@ packages: /axe-core@4.10.2: resolution: {integrity: sha512-RE3mdQ7P3FRSe7eqCWoeQ/Z9QXrtniSjp1wUjt5nRC3WIpz5rSCve6o3fsZ2aCpJtrZjSZgjwXAoTO5k4tEI0w==} engines: {node: '>=4'} - dev: false /axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} - dev: false /babel-jest@29.7.0(@babel/core@7.26.0): resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} @@ -5395,7 +5778,6 @@ packages: /damerau-levenshtein@1.0.8: resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} - dev: false /data-urls@2.0.0: resolution: {integrity: sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==} @@ -5439,7 +5821,6 @@ packages: optional: true dependencies: ms: 2.1.3 - dev: false /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} @@ -5700,7 +6081,6 @@ packages: /emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - dev: false /emojis@1.0.10: resolution: {integrity: sha512-uAdZVlwPFYJg5z4rmIUPRQSbXm3pPN+OZ6m+hxFtxAOsxLYRI6/zAblaJyK/xmxRf//y0edUyeIh5Rq5XiLwWA==} @@ -5869,7 +6249,6 @@ packages: internal-slot: 1.0.7 iterator.prototype: 1.1.3 safe-array-concat: 1.1.2 - dev: false /es-object-atoms@1.0.0: resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} @@ -5933,7 +6312,6 @@ packages: eslint: '>=7.0.0' dependencies: eslint: 8.57.1 - dev: false /eslint-import-resolver-node@0.3.9: resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} @@ -5943,7 +6321,6 @@ packages: resolve: 1.22.8 transitivePeerDependencies: - supports-color - dev: false /eslint-module-utils@2.12.0(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-node@0.3.9)(eslint@8.57.1): resolution: {integrity: sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==} @@ -5972,7 +6349,6 @@ packages: eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - dev: false /eslint-plugin-escompat@3.11.4(eslint@8.57.1): resolution: {integrity: sha512-j0ywwNnIufshOzgAu+PfIig1c7VRClKSNKzpniMT2vXQ4leL5q+e/SpMFQU0nrdL2WFFM44XmhSuwmxb3G0CJg==} @@ -5981,7 +6357,6 @@ packages: dependencies: browserslist: 4.24.2 eslint: 8.57.1 - dev: false /eslint-plugin-eslint-comments@3.2.0(eslint@8.57.1): resolution: {integrity: sha512-0jkOl0hfojIHHmEHgmNdqv4fmh7300NdpA9FFpF7zaoLvB/QeXOGNLIo86oAveJFrfB1p05kC8hpEMHM8DwWVQ==} @@ -5992,7 +6367,6 @@ packages: escape-string-regexp: 1.0.5 eslint: 8.57.1 ignore: 5.3.2 - dev: false /eslint-plugin-filenames@1.3.2(eslint@8.57.1): resolution: {integrity: sha512-tqxJTiEM5a0JmRCUYQmxw23vtTxrb2+a3Q2mMOPhFxvt7ZQQJmdiuMby9B/vUAuVMghyP7oET+nIf6EO6CBd/w==} @@ -6004,7 +6378,6 @@ packages: lodash.kebabcase: 4.1.1 lodash.snakecase: 4.1.1 lodash.upperfirst: 4.3.1 - dev: false /eslint-plugin-github@4.10.2(eslint@8.57.1)(typescript@4.9.5): resolution: {integrity: sha512-F1F5aAFgi1Y5hYoTFzGQACBkw5W1hu2Fu5FSTrMlXqrojJnKl1S2pWO/rprlowRQpt+hzHhqSpsfnodJEVd5QA==} @@ -6036,7 +6409,6 @@ packages: - eslint-import-resolver-webpack - supports-color - typescript - dev: false /eslint-plugin-i18n-text@1.0.1(eslint@8.57.1): resolution: {integrity: sha512-3G3UetST6rdqhqW9SfcfzNYMpQXS7wNkJvp6dsXnjzGiku6Iu5hl3B0kmk6lIcFPwYjhQIY+tXVRtK9TlGT7RA==} @@ -6044,7 +6416,6 @@ packages: eslint: '>=5.0.0' dependencies: eslint: 8.57.1 - dev: false /eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.1): resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==} @@ -6081,7 +6452,6 @@ packages: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - dev: false /eslint-plugin-jest@27.9.0(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.57.1)(jest@29.7.0)(typescript@4.9.5): resolution: {integrity: sha512-QIT7FH7fNmd9n4se7FFKHbsLKGQiw885Ds6Y/sxKgCZ6natwCsXdgPOADnYVxN2QrRweF0FZWbJ6S7Rsn7llug==} @@ -6128,12 +6498,10 @@ packages: object.fromentries: 2.0.8 safe-regex-test: 1.0.3 string.prototype.includes: 2.0.1 - dev: false /eslint-plugin-no-only-tests@3.3.0: resolution: {integrity: sha512-brcKcxGnISN2CcVhXJ/kEQlNa0MEfGRtwKtWA16SkqXHKitaKIMrfemJKLKX1YqDU5C/5JY3PvZXd5jEW04e0Q==} engines: {node: '>=5.0.0'} - dev: false /eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0)(eslint@8.57.1)(prettier@3.3.3): resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} @@ -6154,7 +6522,6 @@ packages: prettier: 3.3.3 prettier-linter-helpers: 1.0.0 synckit: 0.9.2 - dev: false /eslint-plugin-react@7.28.0(eslint@8.57.1): resolution: {integrity: sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw==} @@ -6183,7 +6550,6 @@ packages: resolution: {integrity: sha512-sMStceig8AFglhhT2LqlU5r+/fn9OwsA72O5bBuQVTssPCdQAOQzL+oMn/ZcpeUY6KcNfLJArgcrsSULNjYYdQ==} dependencies: safe-regex: 2.1.1 - dev: false /eslint-plugin-security@3.0.1: resolution: {integrity: sha512-XjVGBhtDZJfyuhIxnQ/WMm385RbX3DBu7H1J7HNNhmB2tnGxMeqVSnYv79oAj992ayvIBZghsymwkYFS6cGH4Q==} @@ -6213,7 +6579,6 @@ packages: /eslint-rule-documentation@1.0.23: resolution: {integrity: sha512-pWReu3fkohwyvztx/oQWWgld2iad25TfUdi6wvhhaDPIQjHU/pyvlKgXFw1kX31SQK2Nq9MH+vRDWB0ZLy8fYw==} engines: {node: '>=4.0.0'} - dev: false /eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} @@ -6430,7 +6795,6 @@ packages: /fast-diff@1.3.0: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - dev: false /fast-glob@3.3.2: resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} @@ -7218,7 +7582,6 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.2 - dev: false /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} @@ -7285,7 +7648,6 @@ packages: resolution: {integrity: sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==} dependencies: call-bind: 1.0.7 - dev: false /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} @@ -7305,7 +7667,6 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.2 - dev: false /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} @@ -7320,7 +7681,6 @@ packages: /is-map@2.0.3: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} - dev: false /is-negative-zero@2.0.3: resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} @@ -7373,7 +7733,6 @@ packages: /is-set@2.0.3: resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} engines: {node: '>= 0.4'} - dev: false /is-shared-array-buffer@1.0.3: resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} @@ -7413,7 +7772,6 @@ packages: /is-weakmap@2.0.2: resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} engines: {node: '>= 0.4'} - dev: false /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} @@ -7426,7 +7784,6 @@ packages: dependencies: call-bind: 1.0.7 get-intrinsic: 1.2.4 - dev: false /is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} @@ -7536,7 +7893,6 @@ packages: has-symbols: 1.0.3 reflect.getprototypeof: 1.0.6 set-function-name: 2.0.2 - dev: false /iterm2-version@5.0.0: resolution: {integrity: sha512-WdLXcMYvN3SXT6vEtuW78vnZs4pVWm2nBnb4VKjOPPXmdlR1xTHmBgqKacOzAe4RXOiY/V+0u/0zsU3LoGQoBg==} @@ -8212,7 +8568,6 @@ packages: hasBin: true dependencies: minimist: 1.2.8 - dev: false /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} @@ -8325,14 +8680,12 @@ packages: /language-subtag-registry@0.3.23: resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} - dev: false /language-tags@1.0.9: resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} engines: {node: '>=0.10'} dependencies: language-subtag-registry: 0.3.23 - dev: false /lazy-cache@2.0.2: resolution: {integrity: sha512-7vp2Acd2+Kz4XkzxGxaB1FWOi8KjWIWsgdfD5MCb86DWvlLqhRPM+d6Pro3iNEL5VT9mstz5hKAlcd+QR6H3aA==} @@ -8428,7 +8781,6 @@ packages: /lodash.kebabcase@4.1.1: resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} - dev: false /lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} @@ -8451,7 +8803,6 @@ packages: /lodash.snakecase@4.1.1: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} - dev: false /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} @@ -8476,7 +8827,6 @@ packages: /lodash.upperfirst@4.3.1: resolution: {integrity: sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==} - dev: false /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} @@ -9244,7 +9594,6 @@ packages: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 - dev: false /object.hasown@1.1.4: resolution: {integrity: sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==} @@ -9589,7 +9938,6 @@ packages: engines: {node: '>=6.0.0'} dependencies: fast-diff: 1.3.0 - dev: false /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} @@ -9600,7 +9948,6 @@ packages: resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} hasBin: true - dev: false /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} @@ -9949,7 +10296,6 @@ packages: get-intrinsic: 1.2.4 globalthis: 1.0.4 which-builtin-type: 1.1.4 - dev: false /regenerate-unicode-properties@10.2.0: resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} @@ -10574,7 +10920,6 @@ packages: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 - dev: false /string.prototype.matchall@4.0.11: resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==} @@ -10646,7 +10991,6 @@ packages: /strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} - dev: false /strip-bom@4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} @@ -10707,7 +11051,6 @@ packages: /svg-element-attributes@1.3.1: resolution: {integrity: sha512-Bh05dSOnJBf3miNMqpsormfNtfidA/GxQVakhtn0T4DECWKeXQRQUceYjJ+OxYiiLdGe4Jo9iFV8wICFapFeIA==} - dev: false /symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} @@ -10728,7 +11071,6 @@ packages: dependencies: '@pkgr/core': 0.1.1 tslib: 2.8.0 - dev: false /table-layout@0.4.5: resolution: {integrity: sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw==} @@ -10939,7 +11281,6 @@ packages: typescript: '>=4.2.0' dependencies: typescript: 4.9.5 - dev: false /ts-jest@29.2.5(@babel/core@7.12.9)(jest@29.7.0)(typescript@4.9.5): resolution: {integrity: sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==} @@ -10979,6 +11320,44 @@ packages: yargs-parser: 21.1.1 dev: true + /ts-jest@29.2.5(@babel/core@7.26.0)(jest@29.7.0)(typescript@4.9.5): + resolution: {integrity: sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==} + engines: {node: ^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/transform': ^29.0.0 + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3 <6' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/transform': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@babel/core': 7.26.0 + bs-logger: 0.2.6 + ejs: 3.1.10 + fast-json-stable-stringify: 2.1.0 + jest: 29.7.0(@types/node@22.8.0) + jest-util: 29.7.0 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.6.3 + typescript: 4.9.5 + yargs-parser: 21.1.1 + dev: true + /ts-node@10.9.2(@types/node@22.8.0)(typescript@4.9.5): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true @@ -11032,14 +11411,12 @@ packages: json5: 1.0.2 minimist: 1.2.8 strip-bom: 3.0.0 - dev: false /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} /tslib@2.8.0: resolution: {integrity: sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==} - dev: false /tsutils@3.21.0(typescript@4.9.5): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -11577,7 +11954,6 @@ packages: which-boxed-primitive: 1.0.2 which-collection: 1.0.2 which-typed-array: 1.1.15 - dev: false /which-collection@1.0.2: resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} @@ -11587,7 +11963,6 @@ packages: is-set: 2.0.3 is-weakmap: 2.0.2 is-weakset: 2.0.3 - dev: false /which-module@2.0.1: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==}