{"id":18384128,"url":"https://github.com/speakeasy-sdks/testcompany-sample-sdk-45","last_synced_at":"2025-04-11T23:28:55.021Z","repository":{"id":206096817,"uuid":"715833157","full_name":"speakeasy-sdks/TestCompany-sample-sdk-45","owner":"speakeasy-sdks","description":"A typescript SDK for accessing the The-Speakeasy-Bar API.","archived":false,"fork":false,"pushed_at":"2024-04-02T21:51:51.000Z","size":328,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-16T00:13:30.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/speakeasy-sdks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-07T23:27:44.000Z","updated_at":"2023-11-07T23:37:43.000Z","dependencies_parsed_at":"2023-11-16T02:23:53.750Z","dependency_job_id":"ea44ab06-f359-4c63-8dcc-9df6bea2fb0c","html_url":"https://github.com/speakeasy-sdks/TestCompany-sample-sdk-45","commit_stats":null,"previous_names":["speakeasy-sdks/testcompany-sample-sdk-45"],"tags_count":1,"template":false,"template_full_name":"speakeasy-sdks/template-speakeasy-bar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2FTestCompany-sample-sdk-45","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2FTestCompany-sample-sdk-45/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2FTestCompany-sample-sdk-45/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2FTestCompany-sample-sdk-45/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/speakeasy-sdks","download_url":"https://codeload.github.com/speakeasy-sdks/TestCompany-sample-sdk-45/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248494435,"owners_count":21113432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:13:40.199Z","updated_at":"2025-04-11T23:28:55.001Z","avatar_url":"https://github.com/speakeasy-sdks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Speakeasy Bar Starter SDK\n\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://speakeasyapi.dev/\"\u003e\u003cimg src=\"https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge\u0026logoColor=FBE331\u0026logo=speakeasy\u0026labelColor=545454\" /\u003e\u003c/a\u003e\n    \n\u003c/div\u003e\n\n\u003cbr/\u003e\n\nThis is a sample SDK generated for the Speakeasy Bar API. Have a look around and familiarize yourself with the Speakeasy Product!\n\nWhen you're ready you can use this modify this repo to reference your own OpenAPI spec or go back to the Speakeasy app to complete onboarding and generate your first SDK!\n\n\n## 🏗 **Welcome to your new SDK!** 🏗\n\nIt has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:\n- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks)\n- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy)\n- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks)\n- [ ] ✨ When ready to productionize, delete this section from the README\n\n\n### Local development\n\nOnce you have the SDK setup you may want to iterate on the SDK. Speakeasy supports OpenAPI vendor extensions that can be added to your spec to customize the SDK ergonomics (method names, namespacing resources etc.) and functionality (adding retries, pagination, multiple server support etc)\n\nTo get started install the Speakeasy CLI.\n\nIn your terminal, run:\n\n```bash\nbrew install speakeasy-api/homebrew-tap/speakeasy\n```\nOnce you annonate your spec with an extension you will want to run `speakeasy validate` to check the spec for correctness and `speakeasy generate` to recreate the SDK locally. More documentation on OpenAPI extensions [here](https://speakeasyapi.dev/docs/customize-sdks/namespaces/). Here's an example of adding a multiple server support to the spec so that your SDK supports production and sandbox versions of your API. The attached Makefile also attaches some helper commands.\n\n```yaml\ninfo:\n  title: Example\n  version: 0.0.1\nservers:\n  - url: https://prod.example.com # Used as the default URL by the SDK\n    description: Our production environment\n    x-speakeasy-server-id: prod\n  - url: https://sandbox.example.com\n    description: Our sandbox environment\n    x-speakeasy-server-id: sandbox\n```\n\nOnce you're finished iterating and happy with the output push only the latest version of spec into the repo and regenerate the SDK using step 6 above. \n\n\u003c!-- Start SDK Installation [installation] --\u003e\n## SDK Installation\n\n### NPM\n\n```bash\nnpm add The-Speakeasy-Bar\n```\n\n### Yarn\n\n```bash\nyarn add The-Speakeasy-Bar\n```\n\u003c!-- End SDK Installation [installation] --\u003e\n\n\u003c!-- Start SDK Example Usage [usage] --\u003e\n## SDK Example Usage\n\n### Example\n\n```typescript\nimport { TheSpeakeasyBar } from \"The-Speakeasy-Bar\";\nimport { DrinkType } from \"The-Speakeasy-Bar/dist/models/components\";\nimport { ListDrinksRequest } from \"The-Speakeasy-Bar/dist/models/operations\";\n\nasync function run() {\n    const sdk = new TheSpeakeasyBar();\n    const drinkType: DrinkType = DrinkType.Spirit;\n\n    const res = await sdk.drinks.listDrinks(drinkType);\n\n    if (res.statusCode == 200) {\n        // handle response\n    }\n}\n\nrun();\n\n```\n\u003c!-- End SDK Example Usage [usage] --\u003e\n\n\u003c!-- Start Available Resources and Operations [operations] --\u003e\n## Available Resources and Operations\n\n### [authentication](docs/sdks/authentication/README.md)\n\n* [authenticate](docs/sdks/authentication/README.md#authenticate) - Authenticate with the API by providing a username and password.\n\n### [drinks](docs/sdks/drinks/README.md)\n\n* [getDrink](docs/sdks/drinks/README.md#getdrink) - Get a drink.\n* [listDrinks](docs/sdks/drinks/README.md#listdrinks) - Get a list of drinks.\n\n### [ingredients](docs/sdks/ingredients/README.md)\n\n* [listIngredients](docs/sdks/ingredients/README.md#listingredients) - Get a list of ingredients.\n\n### [orders](docs/sdks/orders/README.md)\n\n* [createOrder](docs/sdks/orders/README.md#createorder) - Create an order.\n\n### [config](docs/sdks/config/README.md)\n\n* [subscribeToWebhooks](docs/sdks/config/README.md#subscribetowebhooks) - Subscribe to webhooks.\n\u003c!-- End Available Resources and Operations [operations] --\u003e\n\n\u003c!-- Start Error Handling [errors] --\u003e\n## Error Handling\n\nHandling errors in this SDK should largely match your expectations.  All operations return a response object or throw an error.  If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type.\n\n| Error Object     | Status Code      | Content Type     |\n| ---------------- | ---------------- | ---------------- |\n| errors.APIError  | 5XX              | application/json |\n| errors.SDKError  | 4xx-5xx          | */*              |\n\nExample\n\n```typescript\nimport { TheSpeakeasyBar } from \"The-Speakeasy-Bar\";\n\nasync function run() {\n    const sdk = new TheSpeakeasyBar();\n\n    let res;\n    try {\n        res = await sdk.authentication.authenticate({});\n    } catch (err) {\n        if (err instanceof errors.APIError) {\n            console.error(err); // handle exception\n            throw err;\n        } else if (err instanceof errors.SDKError) {\n            console.error(err); // handle exception\n            throw err;\n        }\n    }\n\n    if (res.statusCode == 200) {\n        // handle response\n    }\n}\n\nrun();\n\n```\n\u003c!-- End Error Handling [errors] --\u003e\n\n\u003c!-- Start Server Selection [server] --\u003e\n## Server Selection\n\n### Select Server by Name\n\nYou can override the default server globally by passing a server name to the `server: string` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:\n\n| Name | Server | Variables |\n| ----- | ------ | --------- |\n| `prod` | `https://speakeasy.bar` | None |\n| `staging` | `https://staging.speakeasy.bar` | None |\n| `customer` | `https://{organization}.{environment}.speakeasy.bar` | `environment` (default is `prod`), `organization` (default is `api`) |\n\n#### Example\n\n```typescript\nimport { TheSpeakeasyBar } from \"The-Speakeasy-Bar\";\n\nasync function run() {\n    const sdk = new TheSpeakeasyBar({\n        server: \"customer\",\n    });\n\n    const res = await sdk.authentication.authenticate({});\n\n    if (res.statusCode == 200) {\n        // handle response\n    }\n}\n\nrun();\n\n```\n\n#### Variables\n\nSome of the server options above contain variables. If you want to set the values of those variables, the following optional parameters are available when initializing the SDK client instance:\n * `environment: models.ServerEnvironment`\n * `organization: string`\n\n### Override Server URL Per-Client\n\nThe default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example:\n```typescript\nimport { TheSpeakeasyBar } from \"The-Speakeasy-Bar\";\n\nasync function run() {\n    const sdk = new TheSpeakeasyBar({\n        serverURL: \"https://speakeasy.bar\",\n    });\n\n    const res = await sdk.authentication.authenticate({});\n\n    if (res.statusCode == 200) {\n        // handle response\n    }\n}\n\nrun();\n\n```\n\u003c!-- End Server Selection [server] --\u003e\n\n\u003c!-- Start Custom HTTP Client [http-client] --\u003e\n## Custom HTTP Client\n\nThe Typescript SDK makes API calls using the [axios](https://axios-http.com/docs/intro) HTTP library.  In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object.\n\nFor example, you could specify a header for every request that your sdk makes as follows:\n\n```typescript\nimport { The-Speakeasy-Bar } from \"TheSpeakeasyBar\";\nimport axios from \"axios\";\n\nconst httpClient = axios.create({\n    headers: {'x-custom-header': 'someValue'}\n})\n\nconst sdk = new TheSpeakeasyBar({defaultClient: httpClient});\n```\n\u003c!-- End Custom HTTP Client [http-client] --\u003e\n\n\u003c!-- Start Go Types --\u003e\n\n\u003c!-- End Go Types --\u003e\n\n\n\n\u003c!-- Start Authentication [security] --\u003e\n## Authentication\n\n### Per-Client Security Schemes\n\nThis SDK supports the following security scheme globally:\n\n| Name     | Type     | Scheme   |\n| -------- | -------- | -------- |\n| `apiKey` | apiKey   | API key  |\n\nTo authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:\n```typescript\nimport { TheSpeakeasyBar } from \"The-Speakeasy-Bar\";\n\nasync function run() {\n    const sdk = new TheSpeakeasyBar({\n        apiKey: \"\u003cYOUR_API_KEY_HERE\u003e\",\n    });\n\n    const res = await sdk.authentication.authenticate({});\n\n    if (res.statusCode == 200) {\n        // handle response\n    }\n}\n\nrun();\n\n```\n\u003c!-- End Authentication [security] --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nFeel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!\n\n### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-sdks%2Ftestcompany-sample-sdk-45","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspeakeasy-sdks%2Ftestcompany-sample-sdk-45","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-sdks%2Ftestcompany-sample-sdk-45/lists"}