Skip to content

Commit 9aa165e

Browse files
authored
Merge pull request #5 from carbon-aware/release-please--branches--main--changes--next--components--carbonaware-scheduler
release: 0.1.0-alpha.3
2 parents 19eb9bb + f11f3d0 commit 9aa165e

File tree

18 files changed

+217
-141
lines changed

18 files changed

+217
-141
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.2"
2+
".": "0.1.0-alpha.3"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 4
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/carbonaware%2Fcarbonaware-e3e1806cce485c5c219929fa67078fee830c9bf2408402262b4036fcb8c23ffa.yml
3-
openapi_spec_hash: f9d042da5344a170e7bdb6c046d9d9e0
4-
config_hash: 31a35da41386a18c039fc32fbdece9e7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/carbonaware%2Fcarbonaware-2dbf4d087175bcac9c2176c339e7e949347bf2857a5e61b51acc7eca28bd533f.yml
3+
openapi_spec_hash: 6e499aa542851583bc50e7acbde2bff4
4+
config_hash: 8be3b26a504eead5a14b041980ba2b53

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Changelog
22

3+
## 0.1.0-alpha.3 (2025-06-04)
4+
5+
Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/carbon-aware/scheduler-client-typescript/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
6+
7+
### Features
8+
9+
* **api:** api update ([ce3a965](https://github.com/carbon-aware/scheduler-client-typescript/commit/ce3a965f4e9dd3482a95c5ab66c2dc0ce0d9378e))
10+
* **api:** manual updates ([00a583a](https://github.com/carbon-aware/scheduler-client-typescript/commit/00a583a587022827225fbed03a1bcc7928eb30d5))
11+
12+
13+
### Bug Fixes
14+
15+
* compat with more runtimes ([9869c64](https://github.com/carbon-aware/scheduler-client-typescript/commit/9869c64973951e72e3743870832fc951f5e8b985))
16+
17+
18+
### Chores
19+
20+
* adjust eslint.config.mjs ignore pattern ([07d35b5](https://github.com/carbon-aware/scheduler-client-typescript/commit/07d35b549910d6bb24808fe1d7b1292b7bdbcfd8))
21+
* **deps:** bump eslint-plugin-prettier ([e15a5a3](https://github.com/carbon-aware/scheduler-client-typescript/commit/e15a5a3fae9c7804aac17409f95fc04e3361828f))
22+
* **docs:** grammar improvements ([652e4bb](https://github.com/carbon-aware/scheduler-client-typescript/commit/652e4bbd36eda5fa9c4f91dec77c9c13616a3888))
23+
* **docs:** use top-level-await in example snippets ([87d8d31](https://github.com/carbon-aware/scheduler-client-typescript/commit/87d8d319d175302c76be6fa2f4d5a147a4ef0d32))
24+
* improve publish-npm script --latest tag logic ([e4066b4](https://github.com/carbon-aware/scheduler-client-typescript/commit/e4066b4eeb3ccb085d49bd911731cc9a82bfa854))
25+
* **internal:** fix readablestream types in node 20 ([ce90e06](https://github.com/carbon-aware/scheduler-client-typescript/commit/ce90e060fad51d20d3ea987790efbe97cce12481))
26+
* **internal:** update jest config ([985f1da](https://github.com/carbon-aware/scheduler-client-typescript/commit/985f1daa3f86ffdd33377bb5652b157084fdda3d))
27+
328
## 0.1.0-alpha.2 (2025-05-13)
429

530
Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/carbon-aware/scheduler-client-typescript/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)

README.md

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
This library provides convenient access to the Carbonaware Scheduler REST API from server-side TypeScript or JavaScript.
66

7-
The full API of this library can be found in [api.md](api.md).
7+
The REST API documentation can be found on [docs.carbonaware.dev](https://docs.carbonaware.dev/scheduler/). The full API of this library can be found in [api.md](api.md).
88

99
It is generated with [Stainless](https://www.stainless.com/).
1010

@@ -24,17 +24,13 @@ import CarbonawareScheduler from 'carbonaware-scheduler';
2424

2525
const client = new CarbonawareScheduler();
2626

27-
async function main() {
28-
const schedule = await client.schedule.create({
29-
duration: 'PT1H',
30-
windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }],
31-
zones: [{ provider: 'aws', region: 'us-east-1' }],
32-
});
33-
34-
console.log(schedule.ideal);
35-
}
27+
const schedule = await client.schedule.create({
28+
duration: 'PT1H',
29+
windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }],
30+
zones: [{ provider: 'aws', region: 'af-south-1' }],
31+
});
3632

37-
main();
33+
console.log(schedule.ideal);
3834
```
3935

4036
### Request & Response types
@@ -47,16 +43,12 @@ import CarbonawareScheduler from 'carbonaware-scheduler';
4743

4844
const client = new CarbonawareScheduler();
4945

50-
async function main() {
51-
const params: CarbonawareScheduler.ScheduleCreateParams = {
52-
duration: 'PT1H',
53-
windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }],
54-
zones: [{ provider: 'aws', region: 'us-east-1' }],
55-
};
56-
const schedule: CarbonawareScheduler.ScheduleCreateResponse = await client.schedule.create(params);
57-
}
58-
59-
main();
46+
const params: CarbonawareScheduler.ScheduleCreateParams = {
47+
duration: 'PT1H',
48+
windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }],
49+
zones: [{ provider: 'aws', region: 'af-south-1' }],
50+
};
51+
const schedule: CarbonawareScheduler.ScheduleCreateResponse = await client.schedule.create(params);
6052
```
6153

6254
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
@@ -69,25 +61,21 @@ a subclass of `APIError` will be thrown:
6961

7062
<!-- prettier-ignore -->
7163
```ts
72-
async function main() {
73-
const schedule = await client.schedule
74-
.create({
75-
duration: 'PT1H',
76-
windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }],
77-
zones: [{ provider: 'aws', region: 'us-east-1' }],
78-
})
79-
.catch(async (err) => {
80-
if (err instanceof CarbonawareScheduler.APIError) {
81-
console.log(err.status); // 400
82-
console.log(err.name); // BadRequestError
83-
console.log(err.headers); // {server: 'nginx', ...}
84-
} else {
85-
throw err;
86-
}
87-
});
88-
}
89-
90-
main();
64+
const schedule = await client.schedule
65+
.create({
66+
duration: 'PT1H',
67+
windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }],
68+
zones: [{ provider: 'aws', region: 'af-south-1' }],
69+
})
70+
.catch(async (err) => {
71+
if (err instanceof CarbonawareScheduler.APIError) {
72+
console.log(err.status); // 400
73+
console.log(err.name); // BadRequestError
74+
console.log(err.headers); // {server: 'nginx', ...}
75+
} else {
76+
throw err;
77+
}
78+
});
9179
```
9280

9381
Error codes are as follows:
@@ -119,7 +107,7 @@ const client = new CarbonawareScheduler({
119107
});
120108

121109
// Or, configure per-request:
122-
await client.schedule.create({ duration: 'PT1H', windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }], zones: [{ provider: 'aws', region: 'us-east-1' }] }, {
110+
await client.schedule.create({ duration: 'PT1H', windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }], zones: [{ provider: 'aws', region: 'af-south-1' }] }, {
123111
maxRetries: 5,
124112
});
125113
```
@@ -136,7 +124,7 @@ const client = new CarbonawareScheduler({
136124
});
137125

138126
// Override per-request:
139-
await client.schedule.create({ duration: 'PT1H', windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }], zones: [{ provider: 'aws', region: 'us-east-1' }] }, {
127+
await client.schedule.create({ duration: 'PT1H', windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }], zones: [{ provider: 'aws', region: 'af-south-1' }] }, {
140128
timeout: 5 * 1000,
141129
});
142130
```
@@ -163,7 +151,7 @@ const response = await client.schedule
163151
.create({
164152
duration: 'PT1H',
165153
windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }],
166-
zones: [{ provider: 'aws', region: 'us-east-1' }],
154+
zones: [{ provider: 'aws', region: 'af-south-1' }],
167155
})
168156
.asResponse();
169157
console.log(response.headers.get('X-My-Header'));
@@ -173,7 +161,7 @@ const { data: schedule, response: raw } = await client.schedule
173161
.create({
174162
duration: 'PT1H',
175163
windows: [{ end: '2019-12-27T18:11:19.117Z', start: '2019-12-27T18:11:19.117Z' }],
176-
zones: [{ provider: 'aws', region: 'us-east-1' }],
164+
zones: [{ provider: 'aws', region: 'af-south-1' }],
177165
})
178166
.withResponse();
179167
console.log(raw.headers.get('X-My-Header'));

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Carbonaware Scheduler please follow the respective company's security reporting guidelines.
19+
or products provided by Carbonaware Scheduler, please follow the respective company's security reporting guidelines.
2020

2121
### Carbonaware Scheduler Terms and Policies
2222

23-
Please contact ryan@carbonaware.dev for any questions or concerns regarding security of our services.
23+
Please contact ryan@carbonaware.dev for any questions or concerns regarding the security of our services.
2424

2525
---
2626

bin/publish-npm

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,35 @@ set -eux
44

55
npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN"
66

7-
# Build the project
87
yarn build
9-
10-
# Navigate to the dist directory
118
cd dist
129

13-
# Get the version from package.json
10+
# Get latest version from npm
11+
#
12+
# If the package doesn't exist, yarn will return
13+
# {"type":"error","data":"Received invalid response from npm."}
14+
# where .data.version doesn't exist so LAST_VERSION will be an empty string.
15+
LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')"
16+
17+
# Get current version from package.json
1418
VERSION="$(node -p "require('./package.json').version")"
1519

16-
# Extract the pre-release tag if it exists
20+
# Check if current version is pre-release (e.g. alpha / beta / rc)
21+
CURRENT_IS_PRERELEASE=false
1722
if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then
18-
# Extract the part before any dot in the pre-release identifier
19-
TAG="${BASH_REMATCH[1]}"
23+
CURRENT_IS_PRERELEASE=true
24+
CURRENT_TAG="${BASH_REMATCH[1]}"
25+
fi
26+
27+
# Check if last version is a stable release
28+
LAST_IS_STABLE_RELEASE=true
29+
if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then
30+
LAST_IS_STABLE_RELEASE=false
31+
fi
32+
33+
# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease.
34+
if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then
35+
TAG="$CURRENT_TAG"
2036
else
2137
TAG="latest"
2238
fi

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default tseslint.config(
1010
parserOptions: { sourceType: 'module' },
1111
},
1212
files: ['**/*.ts', '**/*.mts', '**/*.cts', '**/*.js', '**/*.mjs', '**/*.cjs'],
13-
ignores: ['dist/**'],
13+
ignores: ['dist/'],
1414
plugins: {
1515
'@typescript-eslint': tseslint.plugin,
1616
'unused-imports': unusedImports,

jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const config: JestConfigWithTsJest = {
1515
'<rootDir>/dist/',
1616
'<rootDir>/deno/',
1717
'<rootDir>/deno_tests/',
18+
'<rootDir>/packages/',
1819
],
1920
testPathIgnorePatterns: ['scripts'],
2021
};

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "carbonaware-scheduler",
3-
"version": "0.1.0-alpha.2",
3+
"version": "0.1.0-alpha.3",
44
"description": "The official TypeScript library for the Carbonaware Scheduler API",
55
"author": "Carbonaware Scheduler <ryan@carbonaware.dev>",
66
"types": "dist/index.d.ts",
@@ -34,7 +34,7 @@
3434
"@typescript-eslint/eslint-plugin": "8.31.1",
3535
"@typescript-eslint/parser": "8.31.1",
3636
"eslint": "^9.20.1",
37-
"eslint-plugin-prettier": "^5.2.3",
37+
"eslint-plugin-prettier": "^5.4.1",
3838
"eslint-plugin-unused-imports": "^4.1.4",
3939
"iconv-lite": "^0.6.3",
4040
"jest": "^29.4.0",
@@ -46,9 +46,6 @@
4646
"tsconfig-paths": "^4.0.0",
4747
"typescript": "5.8.3"
4848
},
49-
"resolutions": {
50-
"synckit": "0.8.8"
51-
},
5249
"imports": {
5350
"carbonaware-scheduler": ".",
5451
"carbonaware-scheduler/*": "./src/*"

scripts/build

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ npm exec tsc-multi
3737
# when building .mjs
3838
node scripts/utils/fix-index-exports.cjs
3939
cp tsconfig.dist-src.json dist/src/tsconfig.json
40-
cp src/internal/shim-types.d.ts dist/internal/shim-types.d.ts
41-
cp src/internal/shim-types.d.ts dist/internal/shim-types.d.mts
4240

4341
node scripts/utils/postprocess-files.cjs
4442

0 commit comments

Comments
 (0)