···11+# Contributor Covenant Code of Conduct
22+33+## Our Pledge
44+55+We as members, contributors, and leaders pledge to make participation in our
66+community a harassment-free experience for everyone, regardless of age, body
77+size, visible or invisible disability, ethnicity, sex characteristics, gender
88+identity and expression, level of experience, education, socio-economic status,
99+nationality, personal appearance, race, caste, color, religion, or sexual
1010+identity and orientation.
1111+1212+We pledge to act and interact in ways that contribute to an open, welcoming,
1313+diverse, inclusive, and healthy community.
1414+1515+## Our Standards
1616+1717+Examples of behavior that contributes to a positive environment for our
1818+community include:
1919+2020+* Demonstrating empathy and kindness toward other people
2121+* Being respectful of differing opinions, viewpoints, and experiences
2222+* Giving and gracefully accepting constructive feedback
2323+* Accepting responsibility and apologizing to those affected by our mistakes,
2424+ and learning from the experience
2525+* Focusing on what is best not just for us as individuals, but for the overall
2626+ community
2727+2828+Examples of unacceptable behavior include:
2929+3030+* The use of sexualized language or imagery, and sexual attention or advances of
3131+ any kind
3232+* Trolling, insulting or derogatory comments, and personal or political attacks
3333+* Public or private harassment
3434+* Publishing others' private information, such as a physical or email address,
3535+ without their explicit permission
3636+* Other conduct which could reasonably be considered inappropriate in a
3737+ professional setting
3838+3939+## Enforcement Responsibilities
4040+4141+Community leaders are responsible for clarifying and enforcing our standards of
4242+acceptable behavior and will take appropriate and fair corrective action in
4343+response to any behavior that they deem inappropriate, threatening, offensive,
4444+or harmful.
4545+4646+Community leaders have the right and responsibility to remove, edit, or reject
4747+comments, commits, code, wiki edits, issues, and other contributions that are
4848+not aligned to this Code of Conduct, and will communicate reasons for moderation
4949+decisions when appropriate.
5050+5151+## Scope
5252+5353+This Code of Conduct applies within all community spaces, and also applies when
5454+an individual is officially representing the community in public spaces.
5555+Examples of representing our community include using an official e-mail address,
5656+posting via an official social media account, or acting as an appointed
5757+representative at an online or offline event.
5858+5959+## Enforcement
6060+6161+Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262+reported to the community leaders responsible for enforcement at
6363+[GitHub Issues](https://github.com/fluent-ci-templates/base-pipeline/issues).
6464+All complaints will be reviewed and investigated promptly and fairly.
6565+6666+All community leaders are obligated to respect the privacy and security of the
6767+reporter of any incident.
6868+6969+## Enforcement Guidelines
7070+7171+Community leaders will follow these Community Impact Guidelines in determining
7272+the consequences for any action they deem in violation of this Code of Conduct:
7373+7474+### 1. Correction
7575+7676+**Community Impact**: Use of inappropriate language or other behavior deemed
7777+unprofessional or unwelcome in the community.
7878+7979+**Consequence**: A private, written warning from community leaders, providing
8080+clarity around the nature of the violation and an explanation of why the
8181+behavior was inappropriate. A public apology may be requested.
8282+8383+### 2. Warning
8484+8585+**Community Impact**: A violation through a single incident or series of
8686+actions.
8787+8888+**Consequence**: A warning with consequences for continued behavior. No
8989+interaction with the people involved, including unsolicited interaction with
9090+those enforcing the Code of Conduct, for a specified period of time. This
9191+includes avoiding interactions in community spaces as well as external channels
9292+like social media. Violating these terms may lead to a temporary or permanent
9393+ban.
9494+9595+### 3. Temporary Ban
9696+9797+**Community Impact**: A serious violation of community standards, including
9898+sustained inappropriate behavior.
9999+100100+**Consequence**: A temporary ban from any sort of interaction or public
101101+communication with the community for a specified period of time. No public or
102102+private interaction with the people involved, including unsolicited interaction
103103+with those enforcing the Code of Conduct, is allowed during this period.
104104+Violating these terms may lead to a permanent ban.
105105+106106+### 4. Permanent Ban
107107+108108+**Community Impact**: Demonstrating a pattern of violation of community
109109+standards, including sustained inappropriate behavior, harassment of an
110110+individual, or aggression toward or disparagement of classes of individuals.
111111+112112+**Consequence**: A permanent ban from any sort of public interaction within the
113113+community.
114114+115115+## Attribution
116116+117117+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118118+version 2.1, available at
119119+[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120120+121121+Community Impact Guidelines were inspired by
122122+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123123+124124+For answers to common questions about this code of conduct, see the FAQ at
125125+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126126+[https://www.contributor-covenant.org/translations][translations].
127127+128128+[homepage]: https://www.contributor-covenant.org
129129+[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130130+[Mozilla CoC]: https://github.com/mozilla/diversity
131131+[FAQ]: https://www.contributor-covenant.org/faq
132132+[translations]: https://www.contributor-covenant.org/translations
+53
.fluentci/CONTRIBUTING.md
···11+# Contributing Guidelines
22+33+Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
44+documentation, we greatly value feedback and contributions from our community.
55+66+Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
77+information to effectively respond to your bug report or contribution.
88+99+1010+## Reporting Bugs/Feature Requests
1111+1212+We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1313+1414+When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
1515+reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1616+1717+* A reproducible test case or series of steps
1818+* The version of our code being used
1919+* Any modifications you've made relevant to the bug
2020+* Anything unusual about your environment or deployment
2121+2222+2323+## Contributing via Pull Requests
2424+Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2525+2626+1. You are working against the latest source on the *master* branch.
2727+2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
2828+3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
2929+3030+To send us a pull request, please:
3131+3232+1. Fork the repository.
3333+2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3434+3. Ensure local tests pass.
3535+4. Commit to your fork using clear commit messages.
3636+5. Send us a pull request, answering any default questions in the pull request interface.
3737+6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3838+3939+GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
4040+[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4141+4242+4343+## Finding contributions to work on
4444+Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
4545+4646+4747+## Code of Conduct
4848+This project has adopted the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
4949+5050+5151+## Licensing
5252+5353+See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
+19
.fluentci/LICENSE
···11+Copyright (c) 2023 Tsiry Sandratraina <tsiry.sndr@aol.com>
22+33+Permission is hereby granted, free of charge, to any person obtaining a copy
44+of this software and associated documentation files (the "Software"), to deal
55+in the Software without restriction, including without limitation the rights
66+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
77+copies of the Software, and to permit persons to whom the Software is
88+furnished to do so, subject to the following conditions:
99+1010+The above copyright notice and this permission notice shall be included in all
1111+copies or substantial portions of the Software.
1212+1313+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1414+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1515+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919+SOFTWARE.
+22
.fluentci/README.md
···11+# Base Pipeline
22+33+[](https://pkg.fluentci.io/base_pipeline)
44+
55+66+This repository contains a minimal pipeline for a [Fluent CI](https://fluentci.io) project. It is intended to be used as a template for new projects.
77+Reusing this template will allow you to get started with Fluent CI in a matter of minutes, just run the following command:
88+99+```bash
1010+fluentci init
1111+```
1212+1313+## Files Tree Layout
1414+1515+```plaintext
1616+src
1717+|-- helpers.ts : Contains helper functions
1818+|-- jobs.ts : Contains the job definitions
1919+|-- mod.ts : This is the entry point of the module
2020+|-- pipeline.ts : Contains the pipeline definition
2121+`-- runner.ts : Contains the runner function
2222+```
+3
.fluentci/ci.ts
···11+import { hello } from "https://pkg.fluentci.io/base_pipeline@v0.5.3/mod.ts";
22+33+await hello();
···11+export { assertEquals } from "jsr:@std/testing@0.218.2/asserts";
22+33+export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
44+export {
55+ Directory,
66+ Secret,
77+ File,
88+ type Platform,
99+ Container,
1010+ dag,
1111+} from "./sdk/client.gen.ts";
1212+export { brightGreen } from "jsr:@std/fmt@0.218.2/colors";
1313+export { stringifyTree } from "npm:stringify-tree@1.1.1";
1414+import { gql } from "npm:graphql-request@6.1.0";
1515+export { gql };
1616+export { dirname, join, resolve } from "jsr:@std/path@0.218.2";
1717+export { parse } from "jsr:@std/flags@0.218.2";
1818+1919+import * as _ from "npm:lodash@4.17.21";
2020+const snakeCase = _.default.snakeCase;
2121+const camelCase = _.default.camelCase;
2222+export { snakeCase, camelCase };
2323+2424+import * as env from "jsr:@tsirysndr/env-js@0.1.2";
2525+export { env };
2626+export { exit } from "jsr:@tsirysndr/exit-js@0.1.0";
2727+2828+export { ClientError, GraphQLClient } from "npm:graphql-request@6.1.0";
2929+export {
3030+ DaggerSDKError,
3131+ UnknownDaggerError,
3232+ DockerImageRefValidationError,
3333+ EngineSessionConnectParamsParseError,
3434+ ExecError,
3535+ GraphQLRequestError,
3636+ InitEngineSessionBinaryError,
3737+ TooManyNestedObjectsError,
3838+ EngineSessionError,
3939+ EngineSessionConnectionTimeoutError,
4040+ NotAwaitedRequestError,
4141+ ERROR_CODES,
4242+} from "./sdk/common/errors/index.ts";
4343+4444+export * as FluentGitlabCI from "jsr:@tsirysndr/fluent-gitlab-ci@0.5";
4545+export * as FluentGithubActions from "jsr:@tsirysndr/fluent-gh-actions@0.3";
4646+export * as FluentCircleCI from "jsr:@tsirysndr/fluent-circleci@0.3";
4747+export * as FluentAzurePipelines from "jsr:@tsirysndr/fluent-az-pipelines@0.3";
4848+export * as FluentAWSCodePipeline from "jsr:@tsirysndr/fluent-codepipeline@0.3";
+28
.fluentci/fixtures/.gitlab-ci.yml
···11+# Do not edit this file directly. It is generated by https://deno.land/x/fluent_gitlab_ci
22+33+.docker:
44+ image: denoland/deno:alpine
55+ services:
66+ - docker:${DOCKER_VERSION}-dind
77+ variables:
88+ DOCKER_HOST: tcp://docker:2376
99+ DOCKER_TLS_VERIFY: "1"
1010+ DOCKER_TLS_CERTDIR: /certs
1111+ DOCKER_CERT_PATH: /certs/client
1212+ DOCKER_DRIVER: overlay2
1313+ DOCKER_VERSION: 20.10.16
1414+1515+.dagger:
1616+ extends: .docker
1717+ before_script:
1818+ - apk add docker-cli curl unzip
1919+ - deno install -A -r https://cli.fluentci.io -n fluentci
2020+ - curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
2121+ - mv bin/dagger /usr/local/bin
2222+ - dagger version
2323+2424+base:
2525+ extends: .dagger
2626+ script:
2727+ - fluentci run .
2828+
+22
.fluentci/fixtures/azure-pipelines.yml
···11+# Do not edit this file directly. It is generated by https://deno.land/x/fluent_azure_pipelines
22+33+trigger:
44+ - main
55+pool:
66+ name: Default
77+ vmImage: ubuntu-latest
88+steps:
99+ - script: |
1010+ curl -fsSL https://deno.land/x/install/install.sh | sh
1111+ export DENO_INSTALL="$HOME/.deno"
1212+ export PATH="$DENO_INSTALL/bin:$PATH"
1313+ displayName: Install Deno
1414+ - script: deno install -A -r https://cli.fluentci.io -n fluentci
1515+ displayName: Setup Fluent CI CLI
1616+ - script: |
1717+ curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
1818+ sudo mv bin/dagger /usr/local/bin
1919+ dagger version
2020+ displayName: Setup Dagger
2121+ - script: fluentci run .
2222+ displayName: Run Dagger Pipelines
+16
.fluentci/fixtures/base.yml
···11+# Do not edit this file directly. It is generated by https://deno.land/x/fluent_github_actions
22+33+name: base
44+on:
55+ push:
66+ branches:
77+ - main
88+jobs:
99+ tests:
1010+ runs-on: ubuntu-latest
1111+ steps:
1212+ - uses: actions/checkout@v3
1313+ - name: Setup Fluent CI
1414+ uses: fluentci-io/setup-fluentci@v3
1515+ - name: Run Dagger Pipelines
1616+ run: fluentci run .
+19
.fluentci/fixtures/buildspec.yml
···11+# Do not edit this file directly. It is generated by https://deno.land/x/fluent_aws_codepipeline
22+33+version: 0.2
44+phases:
55+ install:
66+ commands:
77+ - curl -fsSL https://deno.land/x/install/install.sh | sh
88+ - export DENO_INSTALL="$HOME/.deno"
99+ - export PATH="$DENO_INSTALL/bin:$PATH"
1010+ - deno install -A -r https://cli.fluentci.io -n fluentci
1111+ - curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
1212+ - mv bin/dagger /usr/local/bin
1313+ - dagger version
1414+ build:
1515+ commands:
1616+ - fluentci run .
1717+ post_build:
1818+ commands:
1919+ - echo Build completed on `date`
+26
.fluentci/fixtures/config.yml
···11+# Do not edit this file directly. It is generated by https://deno.land/x/fluent_circleci
22+33+version: 2.1
44+jobs:
55+ base:
66+ steps:
77+ - checkout
88+ - run: sudo apt-get update && sudo apt-get install -y curl unzip
99+ - run: |
1010+ curl -fsSL https://deno.land/x/install/install.sh | sh
1111+ export DENO_INSTALL="$HOME/.deno"
1212+ export PATH="$DENO_INSTALL/bin:$PATH"
1313+ - run: deno install -A -r https://cli.fluentci.io -n fluentci
1414+ - run: |
1515+ curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.7 sh
1616+ sudo mv bin/dagger /usr/local/bin
1717+ dagger version
1818+ - run:
1919+ name: Run Dagger Pipelines
2020+ command: fluentci run .
2121+ machine:
2222+ image: ubuntu-2004:2023.07.1
2323+workflows:
2424+ dagger:
2525+ jobs:
2626+ - base
···11+import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts";
22+import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts";
33+44+type EngineSessionErrorOptions = DaggerSDKErrorOptions;
55+66+/**
77+ * This error is thrown if the EngineSession does not manage to parse the required port successfully because a EOF is read before any valid port.
88+ * This usually happens if no connection can be established.
99+ */
1010+export class EngineSessionError extends DaggerSDKError {
1111+ name = ERROR_NAMES.EngineSessionError;
1212+ code = ERROR_CODES.EngineSessionError;
1313+1414+ /**
1515+ * @hidden
1616+ */
1717+ constructor(message: string, options?: EngineSessionErrorOptions) {
1818+ super(message, options);
1919+ }
2020+}
+54
.fluentci/sdk/common/errors/ExecError.ts
···11+import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts";
22+import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts";
33+44+interface ExecErrorOptions extends DaggerSDKErrorOptions {
55+ cmd: string[];
66+ exitCode: number;
77+ stdout: string;
88+ stderr: string;
99+}
1010+1111+/**
1212+ * API error from an exec operation in a pipeline.
1313+ */
1414+export class ExecError extends DaggerSDKError {
1515+ name = ERROR_NAMES.ExecError;
1616+ code = ERROR_CODES.ExecError;
1717+1818+ /**
1919+ * The command that caused the error.
2020+ */
2121+ cmd: string[];
2222+2323+ /**
2424+ * The exit code of the command.
2525+ */
2626+ exitCode: number;
2727+2828+ /**
2929+ * The stdout of the command.
3030+ */
3131+ stdout: string;
3232+3333+ /**
3434+ * The stderr of the command.
3535+ */
3636+ stderr: string;
3737+3838+ /**
3939+ * @hidden
4040+ */
4141+ constructor(message: string, options: ExecErrorOptions) {
4242+ super(message, options);
4343+ this.cmd = options.cmd;
4444+ this.exitCode = options.exitCode;
4545+ this.stdout = options.stdout;
4646+ this.stderr = options.stderr;
4747+ }
4848+4949+ toString(): string {
5050+ return `${super.toString()}\nStdout:\n${this.stdout}\nStderr:\n${
5151+ this.stderr
5252+ }`;
5353+ }
5454+}
···11+import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts";
22+import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts";
33+44+/**
55+ * This error is thrown if the dagger binary cannot be copied from the dagger docker image and copied to the local host.
66+ */
77+export class InitEngineSessionBinaryError extends DaggerSDKError {
88+ name = ERROR_NAMES.InitEngineSessionBinaryError;
99+ code = ERROR_CODES.InitEngineSessionBinaryError;
1010+1111+ /**
1212+ * @hidden
1313+ */
1414+ constructor(message: string, options?: DaggerSDKErrorOptions) {
1515+ super(message, options);
1616+ }
1717+}
···11+import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts";
22+import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts";
33+44+interface TooManyNestedObjectsErrorOptions extends DaggerSDKErrorOptions {
55+ response: unknown;
66+}
77+88+/**
99+ * Dagger only expects one response value from the engine. If the engine returns more than one value this error is thrown.
1010+ */
1111+export class TooManyNestedObjectsError extends DaggerSDKError {
1212+ name = ERROR_NAMES.TooManyNestedObjectsError;
1313+ code = ERROR_CODES.TooManyNestedObjectsError;
1414+1515+ /**
1616+ * the response containing more than one value.
1717+ */
1818+ response: unknown;
1919+2020+ /**
2121+ * @hidden
2222+ */
2323+ constructor(message: string, options: TooManyNestedObjectsErrorOptions) {
2424+ super(message, options);
2525+ this.response = options.response;
2626+ }
2727+}
+17
.fluentci/sdk/common/errors/UnknownDaggerError.ts
···11+import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts";
22+import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts";
33+44+/**
55+ * This error is thrown if the dagger SDK does not identify the error and just wraps the cause.
66+ */
77+export class UnknownDaggerError extends DaggerSDKError {
88+ name = ERROR_NAMES.UnknownDaggerError;
99+ code = ERROR_CODES.UnknownDaggerError;
1010+1111+ /**
1212+ * @hidden
1313+ */
1414+ constructor(message: string, options: DaggerSDKErrorOptions) {
1515+ super(message, options);
1616+ }
1717+}
···11+import { Writable } from "node:stream";
22+import { Client } from "./client.gen.ts";
33+import { Context } from "./context.ts";
44+55+/**
66+ * ConnectOpts defines option used to connect to an engine.
77+ */
88+export interface ConnectOpts {
99+ /**
1010+ * Use to overwrite Dagger workdir
1111+ * @defaultValue process.cwd()
1212+ */
1313+ Workdir?: string;
1414+ /**
1515+ * Enable logs output
1616+ * @example
1717+ * LogOutput
1818+ * ```ts
1919+ * connect(async (client: Client) => {
2020+ const source = await client.host().workdir().id()
2121+ ...
2222+ }, {LogOutput: process.stdout})
2323+ ```
2424+ */
2525+ LogOutput?: Writable;
2626+}
2727+2828+export type CallbackFct = (client: Client) => Promise<void>;
2929+3030+export interface ConnectParams {
3131+ port: number;
3232+ session_token: string;
3333+}
3434+3535+/**
3636+ * connect runs GraphQL server and initializes a
3737+ * GraphQL client to execute query on it through its callback.
3838+ * This implementation is based on the existing Go SDK.
3939+ */
4040+export async function connect(
4141+ cb: CallbackFct,
4242+ _config: ConnectOpts = {}
4343+): Promise<void> {
4444+ const ctx = new Context();
4545+ const client = new Client({ ctx: ctx });
4646+4747+ // Initialize connection
4848+ await ctx.connection();
4949+5050+ await cb(client).finally(() => {
5151+ ctx.close();
5252+ });
5353+}
+53
.fluentci/sdk/context.ts
···11+import { GraphQLClient } from "../deps.ts";
22+33+import { initDefaultContext } from "./builder.ts";
44+55+interface ContextConfig {
66+ client?: GraphQLClient;
77+}
88+99+/**
1010+ * Context abstracts the connection to the engine.
1111+ *
1212+ * It's required to implement the default global SDK.
1313+ * Its purpose is to store and returns the connection to the graphQL API, if
1414+ * no connection is set, it can create its own.
1515+ *
1616+ * This is also useful for lazy evaluation with the default global client,
1717+ * this one should only run the engine if it actually executes something.
1818+ */
1919+export class Context {
2020+ private _client?: GraphQLClient;
2121+2222+ constructor(config?: ContextConfig) {
2323+ this._client = config?.client;
2424+ }
2525+2626+ /**
2727+ * Returns a GraphQL client connected to the engine.
2828+ *
2929+ * If no client is set, it will create one.
3030+ */
3131+ public async connection(): Promise<GraphQLClient> {
3232+ if (!this._client) {
3333+ const defaultCtx = await initDefaultContext();
3434+ this._client = defaultCtx._client as GraphQLClient;
3535+ }
3636+3737+ return this._client;
3838+ }
3939+4040+ /**
4141+ * Close the connection and the engine if this one was started by the node
4242+ * SDK.
4343+ */
4444+ public close(): void {
4545+ // Reset client, so it can restart a new connection if necessary
4646+ this._client = undefined;
4747+ }
4848+}
4949+5050+/**
5151+ * Expose a default context for the global client
5252+ */
5353+export const defaultContext = new Context();