Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/instal
rmdir samples || true
mkdir samples

npm install
npm install -g ts-node
npm install --ignore-scripts
npm install -g ts-node --ignore-scripts
npm link
npm link @superbuilders/powerpath
TS_CONFIG_CONTENT=$(cat <<EOL
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/examples/node_modules
.env
.env.local
.env.*.local
/models
/models/errors
/types
Expand Down
6 changes: 5 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
!/**/*.ts
!/**/*.js
!/**/*.mjs
!/**/*.json
!/package.json
!/jsr.json
!/dist/**/*.json
!/esm/**/*.json
!/**/*.map

/eslint.config.mjs
/.oxlintrc.json
/cjs
/.tshy
/.tshy-*
Expand Down
2,259 changes: 1,876 additions & 383 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

35 changes: 33 additions & 2 deletions .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,50 @@ generation:
requestResponseComponentNamesFeb2024: true
securityFeb2025: true
sharedErrorComponentsApr2025: false
sharedNestedComponentsJan2026: false
nameOverrideFeb2026: false
auth:
oAuth2ClientCredentialsEnabled: true
oAuth2PasswordEnabled: true
hoistGlobalSecurity: true
schemas:
allOfMergeStrategy: shallowMerge
requestBodyFieldName: ""
versioningStrategy: automatic
persistentEdits: {}
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
typescript:
version: 0.3.1
version: 0.4.0
acceptHeaderEnum: true
additionalDependencies:
dependencies: {}
devDependencies: {}
peerDependencies: {}
additionalPackageJSON: {}
additionalScripts: {}
alwaysIncludeInboundAndOutbound: false
author: Speakeasy
baseErrorName: PowerPathError
clientServerStatusCodesAsErrors: true
constFieldsAlwaysOptional: true
constFieldsAlwaysOptional: false
defaultErrorName: APIError
enableCustomCodeRegions: false
enableMCPServer: true
enableReactQuery: false
enumFormat: union
envVarPrefix: POWERPATH
exportZodModelNamespace: false
fixEnumNameSanitization: false
flatAdditionalProperties: false
flattenGlobalSecurity: true
flatteningOrder: parameters-first
formStringArrayEncodeMode: encoded-string
forwardCompatibleEnumsByDefault: false
forwardCompatibleUnionsByDefault: "false"
generateExamples: true
imports:
option: openapi
paths:
Expand All @@ -50,13 +68,26 @@ typescript:
operations: models/operations
shared: models/components
webhooks: models/webhooks
inferUnionDiscriminators: true
inputModelSuffix: input
jsonpath: rfc9535
laxMode: strict
legacyFileNaming: true
maxMethodParams: 0
methodArguments: require-security-and-request
modelPropertyCasing: camel
moduleFormat: dual
multipartArrayFormat: legacy
outputModelSuffix: output
packageName: '@superbuilders/powerpath'
preApplyUnionDiscriminators: true
preserveModelFieldNames: false
responseFormat: flat
sseFlatResponse: false
templateVersion: v2
unionStrategy: left-to-right
usageSDKInitImports: []
useIndexModules: true
useOxlint: false
useTsgo: false
zodVersion: v3
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
speakeasyVersion: 1.571.1
speakeasyVersion: 1.761.11
sources:
PowerPath API:
sourceNamespace: power-path-api
sourceRevisionDigest: sha256:59885be5c52aa2250ea04578a4b4d9528ab28277c930b5fc3860d588e13e229e
sourceBlobDigest: sha256:9aa4c2da5074f8b5ce68b1dcfe84491caba3437f55e071ff75ccbff899724361
sourceRevisionDigest: sha256:a22c07071734c293bea1c17dff53730ff443e4d7854a4e6ca7ae1955c2809a93
sourceBlobDigest: sha256:47cee796958ca3c7616e4233a567ad08fbba2186e846823ba9d28c57e4eec74a
tags:
- latest
- 1.0.0
targets:
power-path:
source: PowerPath API
sourceNamespace: power-path-api
sourceRevisionDigest: sha256:59885be5c52aa2250ea04578a4b4d9528ab28277c930b5fc3860d588e13e229e
sourceBlobDigest: sha256:9aa4c2da5074f8b5ce68b1dcfe84491caba3437f55e071ff75ccbff899724361
sourceRevisionDigest: sha256:a22c07071734c293bea1c17dff53730ff443e4d7854a4e6ca7ae1955c2809a93
sourceBlobDigest: sha256:47cee796958ca3c7616e4233a567ad08fbba2186e846823ba9d28c57e4eec74a
codeSamplesNamespace: power-path-api-typescript-code-samples
codeSamplesRevisionDigest: sha256:9cd79c3cee20a8da918234f8dcca890f6b7eb94c7844910bb5dff37166e5d111
codeSamplesRevisionDigest: sha256:45e754b59b74a97ecf519e8ccd64a3161de6da7d54b23be488112696fee8ff71
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
4 changes: 2 additions & 2 deletions FUNCTIONS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Standalone Functions

> [!NOTE]
> This section is useful if you are using a bundler and targetting browsers and
> This section is useful if you are using a bundler and targeting browsers and
> runtimes where the size of an application affects performance and load times.

Every method in this SDK is also available as a standalone function. This
alternative API is suitable when targetting the browser or serverless runtimes
alternative API is suitable when targeting the browser or serverless runtimes
and using a bundler to build your application since all unused functionality
will be tree-shaken away. This includes code for unused methods, Zod schemas,
encoding helpers and response handlers. The result is dramatically smaller
Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ bun add @superbuilders/powerpath
### Yarn

```bash
yarn add @superbuilders/powerpath zod

# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.
yarn add @superbuilders/powerpath
```

> [!NOTE]
Expand Down Expand Up @@ -283,9 +280,9 @@ run();

This SDK supports the following security scheme globally:

| Name | Type | Scheme | Environment Variable |
| ----------------------------- | ------ | ------------------------------ | ----------------------------------------------------------------------------- |
| `clientID`<br/>`clientSecret` | oauth2 | OAuth2 Client Credentials Flow | `POWERPATH_CLIENT_ID`<br/>`POWERPATH_CLIENT_SECRET`<br/>`POWERPATH_TOKEN_URL` |
| Name | Type | Scheme | Environment Variable |
| -------------------------------------------- | ------ | ------------------------------ | ----------------------------------------------------------------------------- |
| `clientID`<br/>`clientSecret`<br/>`tokenURL` | oauth2 | OAuth2 Client Credentials Flow | `POWERPATH_CLIENT_ID`<br/>`POWERPATH_CLIENT_SECRET`<br/>`POWERPATH_TOKEN_URL` |

You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. For example:
```typescript
Expand Down Expand Up @@ -318,13 +315,13 @@ run();
<details open>
<summary>Available methods</summary>

### [lessonPlans](docs/sdks/lessonplans/README.md)
### [LessonPlans](docs/sdks/lessonplans/README.md)

* [getStudentCourseProgress](docs/sdks/lessonplans/README.md#getstudentcourseprogress) - Get course progress
* [updateStudentResponse](docs/sdks/lessonplans/README.md#updatestudentresponse) - Update student item response
* [getSyllabus](docs/sdks/lessonplans/README.md#getsyllabus) - Get course syllabus

### [lessons](docs/sdks/lessons/README.md)
### [Lessons](docs/sdks/lessons/README.md)

* [createAttempt](docs/sdks/lessons/README.md#createattempt) - Create new attempt
* [finalizeResponse](docs/sdks/lessons/README.md#finalizeresponse) - Finalize a test assessments
Expand All @@ -334,16 +331,15 @@ run();
* [resetAttempt](docs/sdks/lessons/README.md#resetattempt) - Reset attempt
* [updateStudentResponse](docs/sdks/lessons/README.md#updatestudentresponse) - Update student question response


### [powerPathCourseMastery](docs/sdks/powerpathcoursemastery/README.md)
### [PowerPathCourseMastery](docs/sdks/powerpathcoursemastery/README.md)

* [createExternalPlacementTest](docs/sdks/powerpathcoursemastery/README.md#createexternalplacementtest) - Create an External Placement Test
* [createExternalTestOut](docs/sdks/powerpathcoursemastery/README.md#createexternaltestout) - Create an External TestOut
* [importExternalTestAssignmentResults](docs/sdks/powerpathcoursemastery/README.md#importexternaltestassignmentresults) - Import external test assignment results
* [makeExternalTestAssignment](docs/sdks/powerpathcoursemastery/README.md#makeexternaltestassignment) - Make external test assignment
* [testOut](docs/sdks/powerpathcoursemastery/README.md#testout) - Test out

### [powerPathLessonPlans](docs/sdks/powerpathlessonplans/README.md)
### [PowerPathLessonPlans](docs/sdks/powerpathlessonplans/README.md)

* [createLessonPlan](docs/sdks/powerpathlessonplans/README.md#createlessonplan) - Create a lesson plan
* [getTree](docs/sdks/powerpathlessonplans/README.md#gettree) - Returns the lesson plan tree for a course and student
Expand All @@ -353,7 +349,7 @@ run();
* [updateLessonPlanItem](docs/sdks/powerpathlessonplans/README.md#updatelessonplanitem) - Update a lesson plan item
* [deleteLessonPlanItem](docs/sdks/powerpathlessonplans/README.md#deletelessonplanitem) - Delete a lesson plan item

### [powerPathPlacement](docs/sdks/powerpathplacement/README.md)
### [PowerPathPlacement](docs/sdks/powerpathplacement/README.md)

* [getAllPlacementTests](docs/sdks/powerpathplacement/README.md#getallplacementtests) - Get all placement tests
* [getCurrentLevel](docs/sdks/powerpathplacement/README.md#getcurrentlevel) - Get current level
Expand Down Expand Up @@ -544,8 +540,8 @@ run();
### Error Classes
**Primary errors:**
* [`PowerPathError`](./src/models/errors/powerpatherror.ts): The base class for HTTP error responses.
* [`UnauthorizedRequestResponseError`](docs/models/errors/unauthorizedrequestresponseerror.md): Unauthorized. Status code `401`.
* [`ForbiddenResponseError`](docs/models/errors/forbiddenresponseerror.md): Forbidden. Status code `403`.
* [`UnauthorizedRequestResponseError`](./src/models/errors/unauthorizedrequestresponseerror.ts): Unauthorized. Status code `401`.
* [`ForbiddenResponseError`](./src/models/errors/forbiddenresponseerror.ts): Forbidden. Status code `403`.

<details><summary>Less common errors (11)</summary>

Expand All @@ -560,11 +556,11 @@ run();


**Inherit from [`PowerPathError`](./src/models/errors/powerpatherror.ts)**:
* [`BadRequestResponseError`](docs/models/errors/badrequestresponseerror.md): Bad Request. Status code `400`. Applicable to 19 of 26 methods.*
* [`NotFoundResponseError`](docs/models/errors/notfoundresponseerror.md): Not Found. Status code `404`. Applicable to 19 of 26 methods.*
* [`UnprocessableEntityResponseError`](docs/models/errors/unprocessableentityresponseerror.md): Unprocessable Entity / Validation Error. Status code `422`. Applicable to 19 of 26 methods.*
* [`TooManyRequestsResponseError`](docs/models/errors/toomanyrequestsresponseerror.md): Too Many Requests. Status code `429`. Applicable to 19 of 26 methods.*
* [`InternalServerErrorResponse`](docs/models/errors/internalservererrorresponse.md): Internal Server Error. Status code `500`. Applicable to 19 of 26 methods.*
* [`BadRequestResponseError`](./src/models/errors/badrequestresponseerror.ts): Bad Request. Status code `400`. Applicable to 19 of 26 methods.*
* [`NotFoundResponseError`](./src/models/errors/notfoundresponseerror.ts): Not Found. Status code `404`. Applicable to 19 of 26 methods.*
* [`UnprocessableEntityResponseError`](./src/models/errors/unprocessableentityresponseerror.ts): Unprocessable Entity / Validation Error. Status code `422`. Applicable to 19 of 26 methods.*
* [`TooManyRequestsResponseError`](./src/models/errors/toomanyrequestsresponseerror.ts): Too Many Requests. Status code `429`. Applicable to 19 of 26 methods.*
* [`InternalServerErrorResponse`](./src/models/errors/internalservererrorresponse.ts): Internal Server Error. Status code `500`. Applicable to 19 of 26 methods.*
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.

</details>
Expand Down Expand Up @@ -616,19 +612,23 @@ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
used to integrate a third-party HTTP client or when writing tests to mock out
the HTTP client and feed in fixtures.

The following example shows how to use the `"beforeRequest"` hook to to add a
custom header and a timeout to requests and how to use the `"requestError"` hook
to log errors:
The following example shows how to:
- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
- use the `"beforeRequest"` hook to add a custom header and a timeout to requests
- use the `"requestError"` hook to log errors

```typescript
import { PowerPath } from "@superbuilders/powerpath";
import { ProxyAgent } from "undici";
import { HTTPClient } from "@superbuilders/powerpath/lib/http";

const dispatcher = new ProxyAgent("http://proxy.example.com:8080");

const httpClient = new HTTPClient({
// fetcher takes a function that has the same signature as native `fetch`.
fetcher: (request) => {
return fetch(request);
}
// 'fetcher' takes a function that has the same signature as native 'fetch'.
fetcher: (input, init) =>
// 'dispatcher' is specific to undici and not part of the standard Fetch API.
fetch(input, { ...init, dispatcher } as RequestInit),
});

httpClient.addHook("beforeRequest", (request) => {
Expand All @@ -648,7 +648,7 @@ httpClient.addHook("requestError", (error, request) => {
console.groupEnd();
});

const sdk = new PowerPath({ httpClient });
const sdk = new PowerPath({ httpClient: httpClient });
```
<!-- End Custom HTTP Client [http-client] -->

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ Based on:
### Generated
- [typescript v0.1.1] .
### Releases
- [NPM v0.1.1] https://www.npmjs.com/package/@superbuilders/powerpath/v/0.1.1 - .
- [NPM v0.1.1] https://www.npmjs.com/package/@superbuilders/powerpath/v/0.1.1 - .

## 2026-05-04 00:28:50
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.761.11 (2.881.17) https://github.com/speakeasy-api/speakeasy
### Generated
- [typescript v0.4.0] .
### Releases
- [NPM v0.4.0] https://www.npmjs.com/package/@superbuilders/powerpath/v/0.4.0 - .
12 changes: 6 additions & 6 deletions RUNTIMES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses the following features:

* [Web Fetch API][web-fetch]
* [Web Streams API][web-streams] and in particular `ReadableStream`
* [Async iterables][async-iter] using `Symbol.asyncIterator`
- [Web Fetch API][web-fetch]
- [Web Streams API][web-streams] and in particular `ReadableStream`
- [Async iterables][async-iter] using `Symbol.asyncIterator`

[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API
Expand All @@ -25,7 +25,7 @@ Runtime environments that are explicitly supported are:

The following `tsconfig.json` options are recommended for projects using this
SDK in order to get static type support for features like async iterables,
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
streams and `fetch`-related APIs ([`for await...of`][for-await-of],
[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and
so on):

Expand All @@ -38,11 +38,11 @@ so on):
{
"compilerOptions": {
"target": "es2020", // or higher
"lib": ["es2020", "dom", "dom.iterable"],
"lib": ["es2020", "dom", "dom.iterable"]
}
}
```

While `target` can be set to older ECMAScript versions, it may result in extra,
unnecessary compatibility code being generated if you are not targeting old
runtimes.
runtimes.
2 changes: 1 addition & 1 deletion docs/models/components/assessmentresult.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let value: AssessmentResult = {
student: {
sourcedId: "<id>",
},
scoreDate: new Date("2023-06-16T22:39:15.818Z"),
scoreDate: new Date("2024-06-15T22:39:15.818Z"),
scoreStatus: "partially graded",
};
```
Expand Down
3 changes: 2 additions & 1 deletion docs/models/components/createexternalplacementinput.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let value: CreateExternalPlacementInput = {
courseId: "<id>",
toolProvider: "edulastic",
vendorId: "<id>",
lessonType: "placement",
grades: [
531.6,
3406.02,
Expand All @@ -32,7 +33,7 @@ let value: CreateExternalPlacementInput = {
| `vendorId` | *string* | :heavy_check_mark: | The ID of the test in the spreadsheet |
| `description` | *string* | :heavy_minus_sign: | Description of the external test that will be added to the Resource entity's metadata |
| `resourceMetadata` | *any* | :heavy_minus_sign: | Additional metadata for the external test resource |
| `lessonType` | *string* | :heavy_check_mark: | N/A |
| `lessonType` | *"placement"* | :heavy_check_mark: | N/A |
| `grades` | *number*[] | :heavy_check_mark: | The grades for the resource |
| `courseIdOnFail` | *string* | :heavy_minus_sign: | The courseId to enroll the student in if they fail the placement test (optional) |
| `xp` | *number* | :heavy_minus_sign: | The XP value for the resource |
Loading