Skip to content

Commit

Permalink
Merge pull request #6 from ryan-timothy-albert/speakeasy-sdk-regen-17…
Browse files Browse the repository at this point in the history
…24899464

chore: 🐝 Update SDK - Generate 0.0.1
  • Loading branch information
ryan-timothy-albert authored Aug 29, 2024
2 parents c4b455c + aa71030 commit 1db6457
Show file tree
Hide file tree
Showing 73 changed files with 8,188 additions and 7 deletions.
35 changes: 35 additions & 0 deletions package/.devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

<div align="center">
<a href="https://codespaces.new/ryan-timothy-albert/test_nested_repo.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
</div>
<br>

> **Remember to shutdown a GitHub Codespace when it is not in use!**
# Dev Containers Quick Start

The default location for usage snippets is the `samples` directory.

## Running a Usage Sample

A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.

```
ts-node root.ts
```

## Generating Additional Usage Samples

The speakeasy CLI allows you to generate more usage snippets. Here's how:

- To generate a sample for a specific operation by providing an operation ID, use:

```
speakeasy generate usage -s https://example.com/OVERWRITE_WHEN_SAMPLE_SPEC_IS_WRITTEN -l typescript -i {INPUT_OPERATION_ID} -o ./samples
```

- To generate samples for an entire namespace (like a tag or group name), use:

```
speakeasy generate usage -s https://example.com/OVERWRITE_WHEN_SAMPLE_SPEC_IS_WRITTEN -l typescript -n {INPUT_TAG_NAME} -o ./samples
```
45 changes: 45 additions & 0 deletions package/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/images/tree/main/src/typescript-node
{
"name": "TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.vscode-typescript-tslint-plugin",
"esbenp.prettier-vscode",
"github.vscode-pull-request-github"
],
"settings": {
"files.eol": "\n",
"editor.formatOnSave": true,
"typescript.tsc.autoDetect": "on",
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.preferences.importModuleSpecifier": "relative",
"[typescript]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"[typescriptreact]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
},
"codespaces": {
"openFiles": [
".devcontainer/README.md"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
30 changes: 30 additions & 0 deletions package/.devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Install the speakeasy CLI
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh

# Setup samples directory
rmdir samples || true
mkdir samples

npm install
npm install -g ts-node
npm link
npm link total-test
TS_CONFIG_CONTENT=$(cat <<EOL
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"openapi": ["../src/index"],
"openapi/*": ["../src/*"]
}
},
"include": ["./**/*.ts"]
}
EOL
)
echo "$TS_CONFIG_CONTENT" > samples/tsconfig.json

# Generate starter usage sample with speakeasy
speakeasy generate usage -s https://example.com/OVERWRITE_WHEN_SAMPLE_SPEC_IS_WRITTEN -l typescript -o samples/root.ts
28 changes: 28 additions & 0 deletions package/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/* eslint-env node */
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
settings: {
"import/resolver": {
typescript: true,
node: true,
},
},
rules: {
// Handled by typescript compiler
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-explicit-any": "off",
"import/no-named-as-default-member": "off",

"import/no-default-export": "error",
},
};
2 changes: 2 additions & 0 deletions package/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This allows generated code to be indexed correctly
*.ts linguist-generated=false
16 changes: 16 additions & 0 deletions package/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/models
/models/errors
/types
/node_modules
/lib
/sdk
/funcs
/hooks
/index.*
/core.*
/cjs
/esm
/dist
/.tsbuildinfo
/.tshy
/.tshy-*
9 changes: 9 additions & 0 deletions package/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/*
!/**/*.ts
!/**/*.js
!/**/*.map

/.eslintrc.js
/cjs
/.tshy
/.tshy-*
91 changes: 91 additions & 0 deletions package/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
lockVersion: 2.0.0
id: 0a32a4a8-9444-4346-8d6e-82cb01090bb2
management:
docChecksum: 1bdb7a6f8bf3995d4b40475228403253
docVersion: 1.0.0
speakeasyVersion: 1.382.0
generationVersion: 2.404.11
releaseVersion: 0.0.1
configChecksum: 636d6ce96b491232cc0245f524e68563
repoURL: https://github.com/ryan-timothy-albert/test_nested_repo.git
repoSubDirectory: package
installationURL: https://gitpkg.now.sh/ryan-timothy-albert/test_nested_repo/package
published: true
features:
typescript:
additionalDependencies: 0.1.0
core: 3.14.1
defaultEnabledRetries: 0.1.0
devContainers: 2.90.0
envVarSecurityUsage: 0.1.1
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.4
responseFormat: 0.2.3
retries: 2.83.0
sdkHooks: 0.1.0
generatedFiles:
- src/funcs/petsListPets.ts
- src/funcs/petsCreatePets.ts
- src/funcs/petsShowPetById.ts
- src/sdk/pets.ts
- src/sdk/sdk.ts
- .eslintrc.cjs
- .npmignore
- FUNCTIONS.md
- RUNTIMES.md
- jsr.json
- package.json
- src/core.ts
- src/index.ts
- src/lib/base64.ts
- src/lib/config.ts
- src/lib/dlv.ts
- src/lib/encodings.ts
- src/lib/http.ts
- src/lib/is-plain-object.ts
- src/lib/logger.ts
- src/lib/matchers.ts
- src/lib/primitives.ts
- src/lib/retries.ts
- src/lib/schemas.ts
- src/lib/sdks.ts
- src/lib/security.ts
- src/lib/url.ts
- src/sdk/index.ts
- src/models/errors/httpclienterrors.ts
- src/models/errors/sdkerror.ts
- src/models/errors/sdkvalidationerror.ts
- src/types/blobs.ts
- src/types/constdatetime.ts
- src/types/enums.ts
- src/types/fp.ts
- src/types/index.ts
- src/types/operations.ts
- src/types/rfcdate.ts
- tsconfig.json
- src/models/operations/listpets.ts
- src/models/operations/showpetbyid.ts
- src/models/components/pet.ts
- src/models/components/error.ts
- src/models/errors/index.ts
- src/models/operations/index.ts
- src/models/components/index.ts
- docs/models/operations/listpetsrequest.md
- docs/models/operations/listpetsresponseresult.md
- docs/models/operations/listpetsresponse.md
- docs/models/operations/showpetbyidrequest.md
- docs/models/operations/showpetbyidresponse.md
- docs/models/components/pet.md
- docs/models/components/errort.md
- docs/sdks/petstore/README.md
- docs/lib/utils/retryconfig.md
- docs/sdks/pets/README.md
- USAGE.md
- .gitattributes
- .devcontainer/README.md
- .devcontainer/devcontainer.json
- .devcontainer/setup.sh
- src/hooks/hooks.ts
- src/hooks/types.ts
- src/hooks/index.ts
- CONTRIBUTING.md
2 changes: 1 addition & 1 deletion package/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ typescript:
packageName: total-test
responseFormat: flat
templateVersion: v2
useIndexModules: true
useIndexModules: true
12 changes: 6 additions & 6 deletions package/.speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
speakeasyVersion: 1.378.0
speakeasyVersion: 1.382.0
sources:
petstore-oas:
sourceNamespace: petstore-oas
sourceRevisionDigest: sha256:b49d6adb32fea5d5acb70aa5f84d16b8a020a565bf1020dbb7d7759290e0300c
sourceBlobDigest: sha256:9480cf4cfe4bec2b7aebbca1acc70012d890dc26bf83a293e6f9e682952509fb
sourceRevisionDigest: sha256:af31c22da21c79b1e52ec0bb07f3b39e42bd3989f1879ec3b560d6eb32097523
sourceBlobDigest: sha256:ea345c5fff9396f9d26f06eb40051420eb8f4754000693080ce1ac6f4d44a179
tags:
- latest
- main
targets:
petstore:
source: petstore-oas
sourceNamespace: petstore-oas
sourceRevisionDigest: sha256:b49d6adb32fea5d5acb70aa5f84d16b8a020a565bf1020dbb7d7759290e0300c
sourceBlobDigest: sha256:9480cf4cfe4bec2b7aebbca1acc70012d890dc26bf83a293e6f9e682952509fb
sourceRevisionDigest: sha256:af31c22da21c79b1e52ec0bb07f3b39e42bd3989f1879ec3b560d6eb32097523
sourceBlobDigest: sha256:ea345c5fff9396f9d26f06eb40051420eb8f4754000693080ce1ac6f4d44a179
outLocation: /github/workspace/repo/package
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
sources:
petstore-oas:
inputs:
- location: openapi.yaml
- location: https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v3.0/petstore.yaml
registry:
location: registry.speakeasyapi.dev/ryan-local/ryan-telemetry/petstore-oas
targets:
Expand Down
26 changes: 26 additions & 0 deletions package/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Contributing to This Repository

Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements.

## How to Report Issues

If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes:

- A clear and descriptive title
- Steps to reproduce the issue
- Expected and actual behavior
- Any relevant logs, screenshots, or error messages
- Information about your environment (e.g., operating system, software versions)
- For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed

## Issue Triage and Upstream Fixes

We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code.

## Contact

If you have any questions or need further assistance, please feel free to reach out by opening an issue.

Thank you for your understanding and cooperation!

The Maintainers
Loading

0 comments on commit 1db6457

Please sign in to comment.