Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
461 commits
Select commit Hold shift + click to select a range
a6870ae
codegen metadata
stainless-app[bot] Apr 3, 2025
c190469
codegen metadata
stainless-app[bot] Apr 3, 2025
6c1f35f
codegen metadata
stainless-app[bot] Apr 3, 2025
3003514
codegen metadata
stainless-app[bot] Apr 3, 2025
3951962
codegen metadata
stainless-app[bot] Apr 3, 2025
79a00d6
codegen metadata
stainless-app[bot] Apr 3, 2025
1d34e21
codegen metadata
stainless-app[bot] Apr 3, 2025
2f090eb
feat(api): api update (#2578)
stainless-app[bot] Apr 3, 2025
3f802e9
codegen metadata
stainless-app[bot] Apr 3, 2025
3700e03
fix(api): improve type resolution when importing as a package (#2579)
stainless-app[bot] Apr 3, 2025
fc30bfd
codegen metadata
stainless-app[bot] Apr 3, 2025
9878009
codegen metadata
stainless-app[bot] Apr 3, 2025
014099d
codegen metadata
stainless-app[bot] Apr 3, 2025
51615a1
codegen metadata
stainless-app[bot] Apr 3, 2025
580eb23
codegen metadata
stainless-app[bot] Apr 3, 2025
0035efd
codegen metadata
stainless-app[bot] Apr 3, 2025
4b23fe1
codegen metadata
stainless-app[bot] Apr 3, 2025
eac9b3c
feat(api): api update (#2580)
stainless-app[bot] Apr 4, 2025
052f78a
codegen metadata
stainless-app[bot] Apr 4, 2025
6122281
chore(internal): update response_info (#2581)
stainless-app[bot] Apr 4, 2025
941c088
feat(workflows): add events (#2582)
stainless-app[bot] Apr 4, 2025
4e4464f
codegen metadata
stainless-app[bot] Apr 4, 2025
ea0d3c9
codegen metadata
stainless-app[bot] Apr 4, 2025
4e2f355
chore(internal): force response_info model generation (#2583)
stainless-app[bot] Apr 4, 2025
82b05a2
codegen metadata
stainless-app[bot] Apr 4, 2025
806d46f
codegen metadata
stainless-app[bot] Apr 4, 2025
8679109
codegen metadata
stainless-app[bot] Apr 4, 2025
31843fe
feat(api): api update (#2584)
stainless-app[bot] Apr 4, 2025
012fa88
feat(api): api update (#2585)
stainless-app[bot] Apr 4, 2025
757caec
codegen metadata
stainless-app[bot] Apr 4, 2025
ea4cafd
codegen metadata
stainless-app[bot] Apr 4, 2025
61b987d
codegen metadata
stainless-app[bot] Apr 4, 2025
30d7c7a
codegen metadata
stainless-app[bot] Apr 4, 2025
613c193
codegen metadata
stainless-app[bot] Apr 4, 2025
e56d868
codegen metadata
stainless-app[bot] Apr 4, 2025
54bc542
codegen metadata
stainless-app[bot] Apr 4, 2025
779ed26
codegen metadata
stainless-app[bot] Apr 4, 2025
c08b740
feat(api): api update (#2586)
stainless-app[bot] Apr 4, 2025
609999a
codegen metadata
stainless-app[bot] Apr 4, 2025
b6c0817
codegen metadata
stainless-app[bot] Apr 4, 2025
b1b0fbd
feat(api): api update (#2588)
stainless-app[bot] Apr 4, 2025
d319d33
codegen metadata
stainless-app[bot] Apr 4, 2025
da4779a
codegen metadata
stainless-app[bot] Apr 4, 2025
0176802
chore(internal): improve index signature formatting (#2589)
stainless-app[bot] Apr 4, 2025
5df56d4
codegen metadata
stainless-app[bot] Apr 4, 2025
f497123
feat(api): api update (#2590)
stainless-app[bot] Apr 4, 2025
4bc596c
codegen metadata
stainless-app[bot] Apr 4, 2025
932dca9
chore(internal): codegen related update (#2591)
stainless-app[bot] Apr 4, 2025
322aff7
fix(mcp): remove unused tools.ts (#2592)
stainless-app[bot] Apr 4, 2025
3dca3c7
codegen metadata
stainless-app[bot] Apr 5, 2025
f801095
codegen metadata
stainless-app[bot] Apr 5, 2025
358cbf0
codegen metadata
stainless-app[bot] Apr 6, 2025
a0c9f9a
codegen metadata
stainless-app[bot] Apr 6, 2025
459a9e4
codegen metadata
stainless-app[bot] Apr 6, 2025
e775017
codegen metadata
stainless-app[bot] Apr 6, 2025
d62998c
codegen metadata
stainless-app[bot] Apr 6, 2025
8f28191
codegen metadata
stainless-app[bot] Apr 7, 2025
f08e0a0
codegen metadata
stainless-app[bot] Apr 7, 2025
ae34d0b
codegen metadata
stainless-app[bot] Apr 7, 2025
9dbc988
feat(api): api update (#2594)
stainless-app[bot] Apr 7, 2025
5c31c8d
feat(api): api update (#2595)
stainless-app[bot] Apr 7, 2025
f854b9b
codegen metadata
stainless-app[bot] Apr 7, 2025
5b7ff2e
feat(api): api update (#2596)
stainless-app[bot] Apr 7, 2025
0b28ef3
codegen metadata
stainless-app[bot] Apr 7, 2025
6c4b093
fix(client): send all configured auth headers (#2597)
stainless-app[bot] Apr 7, 2025
b7d4e21
feat(api): api update (#2598)
stainless-app[bot] Apr 7, 2025
d8ae028
feat(api): api update (#2599)
stainless-app[bot] Apr 7, 2025
72c5571
codegen metadata
stainless-app[bot] Apr 7, 2025
6caff8f
codegen metadata
stainless-app[bot] Apr 7, 2025
53d5f1b
codegen metadata
stainless-app[bot] Apr 7, 2025
f24deaa
feat(api): api update
stainless-app[bot] Apr 7, 2025
0e1c619
chore(internal): only run examples workflow in main repo (#2600)
stainless-app[bot] Apr 9, 2025
b786656
feat(api): api update (#2601)
stainless-app[bot] Apr 7, 2025
2f213a8
feat(api): Add workers telemetry routes (#2602)
stainless-app[bot] Apr 7, 2025
893533f
feat(api): api update (#2603)
stainless-app[bot] Apr 7, 2025
40d4b15
feat(api): api update
stainless-app[bot] Apr 7, 2025
75af6a1
feat(api): api update
stainless-app[bot] Apr 7, 2025
e521813
feat(api): api update (#2604)
stainless-app[bot] Apr 7, 2025
9efb930
feat(api): api update
stainless-app[bot] Apr 7, 2025
20a65d9
feat(api): api update
stainless-app[bot] Apr 7, 2025
60d8a4f
feat(api): api update
stainless-app[bot] Apr 7, 2025
abce587
feat(api): api update
stainless-app[bot] Apr 7, 2025
a9cfa77
feat(api): api update
stainless-app[bot] Apr 7, 2025
cb11123
feat(api): api update
stainless-app[bot] Apr 7, 2025
daba569
feat(api): api update
stainless-app[bot] Apr 7, 2025
b5f2e7f
feat(api): api update (#2605)
stainless-app[bot] Apr 7, 2025
cec0ed7
feat(api): api update (#2606)
stainless-app[bot] Apr 7, 2025
b88e5d8
feat(devices): add registrations support (#2607)
stainless-app[bot] Apr 8, 2025
e1da551
feat(secret_store): add support (#2608)
stainless-app[bot] Apr 8, 2025
1be04c6
feat(secrets_store): remove incorrect bulk edit endpoint (#2609)
stainless-app[bot] Apr 8, 2025
250295c
feat(docs): add secrets store to navigation
stainless-app[bot] Apr 8, 2025
906c862
feat(api): api update
stainless-app[bot] Apr 8, 2025
651a833
feat(api): manual updates
stainless-app[bot] Apr 8, 2025
e1fcf61
feat(api): manual updates (#2610)
stainless-app[bot] Apr 8, 2025
d7c2322
feat(api): manual updates
stainless-app[bot] Apr 8, 2025
0a6b93b
feat(api): manual updates (#2611)
stainless-app[bot] Apr 8, 2025
edbf17b
feat(api): manual updates
stainless-app[bot] Apr 8, 2025
bdf1162
feat(api): manual updates
stainless-app[bot] Apr 8, 2025
f30d5a5
feat(api): manual updates
stainless-app[bot] Apr 8, 2025
0074b30
feat(api): api update
stainless-app[bot] Apr 8, 2025
d7336eb
feat(api): api update (#2612)
stainless-app[bot] Apr 8, 2025
c68d67e
feat(api): api update
stainless-app[bot] Apr 8, 2025
ba8bd8a
feat(api): api update
stainless-app[bot] Apr 8, 2025
5ebce93
feat(api): api update
stainless-app[bot] Apr 8, 2025
1316668
feat(api): api update
stainless-app[bot] Apr 8, 2025
c7fbb93
feat(api): api update
stainless-app[bot] Apr 8, 2025
fa0c24e
chore(tests): improve enum examples (#2613)
stainless-app[bot] Apr 8, 2025
13aa6f9
feat(api): api update
stainless-app[bot] Apr 8, 2025
a487087
feat(api): api update
stainless-app[bot] Apr 8, 2025
6f37358
feat(api): api update
stainless-app[bot] Apr 8, 2025
0628ce1
feat(api): api update
stainless-app[bot] Apr 8, 2025
69dfc35
feat(api): api update
stainless-app[bot] Apr 8, 2025
e903f2b
feat(api): api update
stainless-app[bot] Apr 8, 2025
fa86152
feat(api): api update (#2614)
stainless-app[bot] Apr 8, 2025
c97cddd
feat(api): api update
stainless-app[bot] Apr 8, 2025
5336ff7
feat(api): api update (#2615)
stainless-app[bot] Apr 8, 2025
1dce00c
feat(api): api update
stainless-app[bot] Apr 8, 2025
9b7728c
feat(api): api update
stainless-app[bot] Apr 8, 2025
d7d30a0
feat(api): api update (#2616)
stainless-app[bot] Apr 8, 2025
875e4d1
feat(api): api update (#2617)
stainless-app[bot] Apr 8, 2025
d74f2c7
feat(api): api update
stainless-app[bot] Apr 8, 2025
8f922b8
feat(api): api update
stainless-app[bot] Apr 8, 2025
478fa7a
feat(api): api update (#2618)
stainless-app[bot] Apr 8, 2025
c694cdd
feat(api): api update
stainless-app[bot] Apr 8, 2025
80a19e7
feat(api): api update
stainless-app[bot] Apr 8, 2025
37d15c6
feat(api): api update
stainless-app[bot] Apr 8, 2025
629e513
feat(api): api update (#2619)
stainless-app[bot] Apr 8, 2025
15df56f
feat(api): api update
stainless-app[bot] Apr 8, 2025
b6df43c
feat(api): api update
stainless-app[bot] Apr 8, 2025
9ed5f60
feat(api): Update workers telemetry route methods (#2620)
stainless-app[bot] Apr 8, 2025
9428193
feat(api): api update
stainless-app[bot] Apr 8, 2025
24237ec
feat(api): api update
stainless-app[bot] Apr 8, 2025
0c9dd1c
feat(api): api update
stainless-app[bot] Apr 8, 2025
d23a98e
feat(pipelines): add support (#2621)
stainless-app[bot] Apr 8, 2025
fffcedd
feat(api): api update
stainless-app[bot] Apr 9, 2025
d134f30
feat(api): api update
stainless-app[bot] Apr 9, 2025
44ebe25
chore: configure new SDK language
stainless-app[bot] Apr 9, 2025
ef453a2
feat(api): api update
stainless-app[bot] Apr 9, 2025
4912bd7
feat(api): api update
stainless-app[bot] Apr 9, 2025
446c8bf
feat(api): api update
stainless-app[bot] Apr 9, 2025
bfd1cef
feat(api): api update
stainless-app[bot] Apr 9, 2025
289adb2
feat(api): api update (#2622)
stainless-app[bot] Apr 9, 2025
be45c73
feat(api): api update
stainless-app[bot] Apr 9, 2025
c9a6af2
feat(api): api update (#2623)
stainless-app[bot] Apr 9, 2025
2de3479
feat(api): api update (#2624)
stainless-app[bot] Apr 9, 2025
4cd3d4f
feat(api): api update
stainless-app[bot] Apr 9, 2025
840a396
feat(api): api update
stainless-app[bot] Apr 9, 2025
85ffe86
feat(api): api update (#2625)
stainless-app[bot] Apr 9, 2025
80a754b
feat(api): api update (#2626)
stainless-app[bot] Apr 9, 2025
f4d5c47
feat(api): api update
stainless-app[bot] Apr 9, 2025
a859f2e
feat(api): api update
stainless-app[bot] Apr 9, 2025
136c709
feat(api): api update
stainless-app[bot] Apr 9, 2025
a99dd71
feat(api): api update
stainless-app[bot] Apr 9, 2025
47d7bc4
feat(api): api update
stainless-app[bot] Apr 9, 2025
f209201
feat(api): api update
stainless-app[bot] Apr 9, 2025
0ee3262
chore(internal): upload builds and expand CI branch coverage (#2627)
stainless-app[bot] Apr 9, 2025
fc993db
feat(api): api update (#2628)
stainless-app[bot] Apr 9, 2025
00a7ba9
feat(api): api update
stainless-app[bot] Apr 9, 2025
9de0862
feat(api): api update
stainless-app[bot] Apr 9, 2025
4efa760
feat(api): api update
stainless-app[bot] Apr 9, 2025
f4676e3
feat(api): api update
stainless-app[bot] Apr 9, 2025
bd466c7
feat(api): api update
stainless-app[bot] Apr 9, 2025
acd8e39
feat(api): api update
stainless-app[bot] Apr 9, 2025
371a714
feat(api): patch and put endpoints for d1 database
stainless-app[bot] Apr 9, 2025
b547033
chore(internal): reduce CI branch coverage
stainless-app[bot] Apr 9, 2025
bd73469
feat(api): api update
stainless-app[bot] Apr 9, 2025
93dc3e1
feat(pipelines): add terraform resource
stainless-app[bot] Apr 9, 2025
ecddaea
chore(pipelines): move pipeline nav hierarchy
stainless-app[bot] Apr 9, 2025
f1a815c
feat(api): api update
stainless-app[bot] Apr 9, 2025
f59cde4
chore: revert auth handling
jacobbednarz Apr 10, 2025
38f474a
feat(api): api update
stainless-app[bot] Apr 10, 2025
f04946e
feat(api): api update
stainless-app[bot] Apr 10, 2025
3d4d7cd
feat(api): api update
stainless-app[bot] Apr 10, 2025
62a979e
feat(api): api update
stainless-app[bot] Apr 10, 2025
d47842a
feat(api): api update
stainless-app[bot] Apr 10, 2025
4224237
feat(api): api update
stainless-app[bot] Apr 10, 2025
7ffc47f
feat(api): api update
stainless-app[bot] Apr 10, 2025
8d62492
feat(api): api update
stainless-app[bot] Apr 10, 2025
a5e1858
feat(api): api update
stainless-app[bot] Apr 10, 2025
2187feb
feat(api): api update
stainless-app[bot] Apr 10, 2025
4dba940
feat(api): api update
stainless-app[bot] Apr 10, 2025
33e30ae
feat(api): api update
stainless-app[bot] Apr 10, 2025
4801125
feat(api): api update
stainless-app[bot] Apr 10, 2025
b8255a7
feat(api): api update
stainless-app[bot] Apr 10, 2025
6976246
feat(api): api update
stainless-app[bot] Apr 10, 2025
10728de
feat(api): api update
stainless-app[bot] Apr 10, 2025
cd24483
feat(api): api update
stainless-app[bot] Apr 10, 2025
4292760
feat(api): api update
stainless-app[bot] Apr 10, 2025
43b5fd4
feat(api): api update
stainless-app[bot] Apr 10, 2025
0a30c66
feat(api): api update
stainless-app[bot] Apr 10, 2025
b4e105f
feat(api): api update
stainless-app[bot] Apr 10, 2025
3770814
feat(api): api update
stainless-app[bot] Apr 10, 2025
df4e35d
chore(internal): update shared response info for optional fields
stainless-app[bot] Apr 10, 2025
ee079a4
feat: support API versioning
jacobbednarz Apr 11, 2025
aa20454
feat(devices): add next generation under devices
stainless-app[bot] Apr 11, 2025
d40ff07
test(api): skip failing tests for python
stainless-app[bot] Apr 11, 2025
8489997
feat(api): api update
stainless-app[bot] Apr 11, 2025
7549ad3
feat(api): api update
stainless-app[bot] Apr 11, 2025
983c058
feat(api): api update
stainless-app[bot] Apr 11, 2025
1160378
feat(api): api update
stainless-app[bot] Apr 11, 2025
a48d434
feat(api): api update
stainless-app[bot] Apr 11, 2025
745797a
feat(api): api update
stainless-app[bot] Apr 11, 2025
d7c02fb
feat(api): api update
stainless-app[bot] Apr 11, 2025
b9a7d44
feat(api): api update
stainless-app[bot] Apr 11, 2025
366d5c4
feat(api): api update
stainless-app[bot] Apr 11, 2025
bbab4f0
feat(api): api update
stainless-app[bot] Apr 11, 2025
41e8b96
feat(api): api update
stainless-app[bot] Apr 11, 2025
59233d2
feat(api): api update
stainless-app[bot] Apr 11, 2025
839b65c
feat(api): api update
stainless-app[bot] Apr 11, 2025
e17d42b
feat(api): api update
stainless-app[bot] Apr 11, 2025
5c259ac
feat(api): api update
stainless-app[bot] Apr 11, 2025
c8faaca
feat(api): api update
stainless-app[bot] Apr 11, 2025
5c4d68e
feat(api): api update
stainless-app[bot] Apr 11, 2025
8aa6a4b
feat(api): api update
stainless-app[bot] Apr 11, 2025
7514b02
feat(api): api update
stainless-app[bot] Apr 11, 2025
2d2492e
feat(api): api update
stainless-app[bot] Apr 12, 2025
73f18ae
feat(api): api update
stainless-app[bot] Apr 14, 2025
fbe392d
feat(api): api update
stainless-app[bot] Apr 14, 2025
e5bbc06
chore(internal): codegen related update
stainless-app[bot] Apr 14, 2025
6693b16
feat(api): api update
stainless-app[bot] Apr 14, 2025
8c14592
feat(api): api update
stainless-app[bot] Apr 14, 2025
2b5f646
chore(client): minor internal fixes
stainless-app[bot] Apr 14, 2025
5a0576d
feat(api): api update
stainless-app[bot] Apr 14, 2025
11b0714
feat(api): api update
stainless-app[bot] Apr 14, 2025
690bd57
feat(api): api update
stainless-app[bot] Apr 14, 2025
90c3414
feat(api): api update
stainless-app[bot] Apr 14, 2025
6e64a75
feat(api): api update
stainless-app[bot] Apr 14, 2025
8faaa75
feat(api): api update
stainless-app[bot] Apr 14, 2025
833b533
feat(api): api update
stainless-app[bot] Apr 14, 2025
81ee8d6
feat(api): api update
stainless-app[bot] Apr 14, 2025
7b09df9
feat(api): api update
stainless-app[bot] Apr 14, 2025
bb7a90b
feat(api): api update
stainless-app[bot] Apr 14, 2025
0c66d79
feat(api): api update
stainless-app[bot] Apr 14, 2025
c44cc9a
feat(api): api update
stainless-app[bot] Apr 14, 2025
56cf9b8
feat(api): api update
stainless-app[bot] Apr 14, 2025
bd539e2
feat(api): api update
stainless-app[bot] Apr 14, 2025
185b9d4
feat(api): api update
stainless-app[bot] Apr 14, 2025
c4dec12
feat(api): api update
stainless-app[bot] Apr 15, 2025
ee69ba2
fix: correct workers upload types
stainless-app[bot] Apr 15, 2025
994f114
chore: more workers fixes
stainless-app[bot] Apr 15, 2025
1c9e305
feat(api): api update
stainless-app[bot] Apr 15, 2025
450aef4
feat(api): api update
stainless-app[bot] Apr 15, 2025
4864aee
feat(api): api update
stainless-app[bot] Apr 15, 2025
1b63a12
feat(api): api update
stainless-app[bot] Apr 15, 2025
833792a
feat(api): api update
stainless-app[bot] Apr 15, 2025
34cdfd5
feat(api): api update
stainless-app[bot] Apr 15, 2025
66b08aa
feat(api): api update
stainless-app[bot] Apr 15, 2025
1d86ec6
feat(api): api update
stainless-app[bot] Apr 15, 2025
d5ea2ed
feat(api): api update
stainless-app[bot] Apr 15, 2025
88f6ff3
release: 4.3.0
stainless-app[bot] Apr 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 19 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v4

Expand All @@ -35,8 +34,9 @@ jobs:
build:
name: build
runs-on: ubuntu-latest


permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

Expand All @@ -50,11 +50,25 @@ jobs:

- name: Check build
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/cloudflare-node'
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/cloudflare-node'
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh
test:
name: test
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4

Expand All @@ -71,6 +85,7 @@ jobs:
examples:
name: examples
runs-on: ubuntu-latest
if: github.repository == 'cloudflare/cloudflare-typescript'
timeout-minutes: 5

steps:
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.2.0"
".": "4.3.0"
}
6 changes: 4 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
configured_endpoints: 1655
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ed9f898b31619623e50d660d04beca50e44987bfd3eb3a6ff98d3bca2a9c569.yml
configured_endpoints: 1711
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-081c85aaff4176a6887a5cd88d02e125ba9de863a7cdf30ee28fc65ddafe6c35.yml
openapi_spec_hash: 96411a46013095a31ff6b4cb1000e19d
config_hash: 67f412c990647f3cb598378fa22a9db5
224 changes: 224 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

286 changes: 265 additions & 21 deletions api.md

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions examples/workers/script-upload.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env -S npm run tsn -T

/*
* Generate an API token: https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
* (Not Global API Key!)
*
* Find your account id: https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/
*
* Set these environment variables:
* - CLOUDFLARE_API_TOKEN
* - CLOUDFLARE_ACCOUNT_ID
*/

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'] ?? '',
});
const accountID = process.env['CLOUDFLARE_ACCOUNT_ID'] ?? '';

async function main() {
const scriptName = 'my-hello-world-script';
const scriptFileName = `${scriptName}.mjs`;
const scriptContent = `
export default {
async fetch(request, env, ctx) {
return new Response(env.MESSAGE, { status: 200 });
}
};
`;

const script: Cloudflare.Workers.Scripts.ScriptUpdateResponse = await client.workers.scripts.update(
scriptName,
{
account_id: accountID,
/*
* Add script content keyed by the filename
*/
// @ts-ignore
[scriptFileName]: new File([scriptContent], scriptFileName, {
type: 'application/javascript+module',
}),
// @ts-ignore
metadata: new File(
[
JSON.stringify({
// https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/
bindings: [
{
type: 'plain_text',
name: 'MESSAGE',
text: 'Hello World!',
},
],
main_module: scriptFileName,
}),
],
'metadata.json',
{
type: 'application/json',
},
),
},
);

console.log(script.id);
}

main();
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudflare",
"version": "4.2.0",
"version": "4.3.0",
"description": "The official TypeScript library for the Cloudflare API",
"author": "Cloudflare <api@cloudflare.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -107,17 +107,17 @@
"default": "./dist/index.mjs"
},
"./*.mjs": {
"types": ["./dist/*.d.ts", "./dist/*/index.d.ts"],
"default": ["./dist/*.mjs", "./dist/*/index.mjs"]
"types": "./dist/*.d.ts",
"default": "./dist/*.mjs"
},
"./*.js": {
"types": ["./dist/*.d.ts", "./dist/*/index.d.ts"],
"default": ["./dist/*.js", "./dist/*/index.js"]
"types": "./dist/*.d.ts",
"default": "./dist/*.js"
},
"./*": {
"types": ["./dist/*.d.ts", "./dist/*/index.d.ts"],
"require": ["./dist/*.js", "./dist/*/index.js"],
"default": ["./dist/*.mjs", "./dist/*/index.mjs"]
"types": "./dist/*.d.ts",
"require": "./dist/*.js",
"default": "./dist/*.mjs"
}
}
}
25 changes: 25 additions & 0 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -exuo pipefail

RESPONSE=$(curl -X POST "$URL" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")

SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')

if [[ "$SIGNED_URL" == "null" ]]; then
echo -e "\033[31mFailed to get signed URL.\033[0m"
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/cloudflare-node/$SHA'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
fi
2 changes: 2 additions & 0 deletions src/_shims/index-deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable {
const _ReadableStream = ReadableStream;
type _ReadableStream = ReadableStream;
export { _ReadableStream as ReadableStream };

export const init = () => {};
2 changes: 2 additions & 0 deletions src/_shims/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi
export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;

export function isFsReadStream(value: any): value is FsReadStream;

export const init: () => void;
6 changes: 5 additions & 1 deletion src/_shims/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
*/
const shims = require('./registry');
const auto = require('cloudflare/_shims/auto/runtime');
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
exports.init = () => {
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
};
for (const property of Object.keys(shims)) {
Object.defineProperty(exports, property, {
get() {
return shims[property];
},
});
}

exports.init();
6 changes: 5 additions & 1 deletion src/_shims/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@
*/
import * as shims from './registry.mjs';
import * as auto from 'cloudflare/_shims/auto/runtime';
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
export const init = () => {
if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
};
export * from './registry.mjs';

init();
Loading
Loading