Releases: dapr/js-sdk
Release v3.1.0
What's Changed
Features
- feat(state): add optional attributes in state management APIs by @SoTrx in #476
- feat(lock): Implement the Lock API on HTTP by @XavierGeerinck in #478
- feat(crypto): add encrypt and decrypt APIs by @ItalyPaleAle in #491
- feat(workflow): Add workflow management HTTP APIs by @shubham1172 in #485
Fixes
- fix(state): return an empty array instead of empty string when state.query does not return anything by @salmankhan-prs in #471
- fix(actor): Configured the delete operation in the state provider by @ruokun-niu in #486
- fix(ci): explicitly call pre-build while building for publish steps by @shubham1172 in #495
Chores
- chore(http): replace method "createHTTPMetadataQueryParam" with "createHTTPQueryParam" by @SoTrx in #480
- chore(proto): update protos for 1.11 by @ItalyPaleAle in #490
- chore(release): add support to release dev packages @shubham1172 in #493
- chore(config): updating config API to use v1 endpoint by @shivamkm07 in #496
- chore(release): prepare for v3.1.0 release by @shubham1172 in #501
New Contributors
- @SoTrx made their first contribution in #476
- @ruokun-niu made their first contribution in #486
- @shivamkm07 made their first contribution in #496
Full Changelog: v3.0.0...v3.1.0
Release v3.0.0
What's Changed
In this release we focused on cleaning up technical debt and introducing breaking changes. Please read carefully how to migrate your application code for the impacted lines.
Breaking Changes
Deprecation for dapr-client
As discussed in Deprecate dapr-client NPM package, the dapr-client package won't be published anymore from v3.0.0. Please use the newer @dapr/dapr package.
DaprClient's publish method now infers the content-type from data
feat(pubsub): Allow publishing CloudEvents directly by @shubham1172
Introduced by #371, this enhances the publish
method to infer the content-type of the data instead of always using application/json
. This enables CloudEvents to be published directly. Earlier, CloudEvents were also sent with the content-type application/json
which was treated by the Dapr runtime as a JSON value and embedded in another CloudEvent. This means, editing CloudEvent fields (like type
) was not possible earlier.
// Publish message to topic as application/cloudevents+json
// You can also use the cloudevent SDK to create cloudevents https://github.com/cloudevents/sdk-javascript
const cloudEvent = {
specversion: "1.0",
source: "/some/source",
type: "example",
id: "1234",
};
await client.pubsub.publish(pubSubName, topic, cloudEvent);
// Other examples where content-type is automatically inferred correctly.
// Publish message to topic as text/plain
await client.pubsub.publish(pubSubName, topic, "hello, world!");
// Publish message to topic as application/json
await client.pubsub.publish(pubSubName, topic, { hello: "world" });
DaprClient's publish method allows specifying an explicit content-type
feat(pubsub): Allow setting explicit content-type during publish operations by @shubham1172
The content-type used in the publish
method can also be explicitly specified instead of inferring from the data itself. This can be useful in scenarios when users want to send a JSON data as plain text, or a CloudEvent as vanilla JSON.
// Publish a JSON message as plain text
const options = { contentType: "text/plain" };
await client.pubsub.publish(pubSubName, topic, { hello: "world" }, options)
Address parity between DaprServer's subscribe method's HTTP and gRPC implementations
fix(pubsub): Fix parity between HTTPs and gRPC pub/sub by @shubham1172
Introduced by #343, this aligns the HTTP and gRPC pubsub systems to return data in the same way for both the normal
and rawPayload
modes.
The HTTP subscribe callback now returns data after parsing it correctly. Data is either extracted from the body's data
field, or the data_base64
field. data_base64
is always expected to be a base64 encoded string, and will be decoded and parsed as JSON if possible. If it is not JSON, it will be returned as a string. If data is not found in either field, the entire body will be returned as-is.
Update DaprClient APIs
chore: Update DaprClient API by @shubham1172
Introduced by #442, this introduces a new API specification for DaprClient. As the Dapr JS SDK grew, so did the the parameters to the different functions. The API has changed to incorporate an options object where it makes sense. More specifically the following APIs are impacted:
DaprClient
: anoptions
parameter containing details like communication protocols, Dapr sidecar's host and address, etc. is used to instantiate the object. Options can also be empty, which then uses some sane defaults (e.g.new DaprClient()
) specified here.IClientState
:getBulk
method now takes anoptions
parameter to configure the metadata and parallelism.IClientPubSub
:publish
method now takes anoptions
parameter to configure the metadata and content-type for the data.
Update DaprServer APIs
chore: refactor DaprServer API by @DeepanshuA
Introduced by #444, this is similar to the above change and introduces a new API specification for DaprServer.
DaprServer
's instantiation does not need any required parameters now. All the configuration can be passed using an options
parameter. Note, logger settings and communication protocol is shared with the underlying DaprClient object unless it has its own such parameters specified.
Features
- feat(core): Allow payloads larger than 4MB by @XavierGeerinck in #381
- feat(core): Implement serialization for gRPC and HTTP in a similar way by @XavierGeerinck in #381
- feat(core): Implement deserialization for gRPC and HTTP in a similary way by @XavierGeerinck in #381
- feat(core): Support bring your own
express
instance through theserverHttp
option by @XavierGeerinck in #381 - feat(pubsub): Add bulk publish support by @shubham1172 in #430
- feat(pubsub): Add retry logic for PubSub and Implement Deserialization generalized by @XavierGeerinck in #453
- feat(state): Allow passing metadata to client.state.save and return a custom response with error by @shubham1172 in #461
Fixes
- fix(invoke): Allow invocations for non-string or object data by @XavierGeerinck in #381
- fix(actors): Error shouldn't cause Client Fail If Actor Non-Existent method called by @DeepanshuA in #422
- fix(docs): Fix broken link to Setting up a Typescript project by @marcduiker in #450
- fix(pubsub): Fix metadata setting in gRPC pubsub and bindings by @shubham1172 in #458
Chores
- chore(misc): Add CODE_OF_CONDUCT.md by @shubham1172 in #423
- chore(misc): Add community details and CoC to README by @shubham1172 in #424
- chore(misc): Remove
crypto.randomUUID()
by @XavierGeerinck in #381 - chore(misc): Remove Restana in favor of Express by @XavierGeerinck in #381
- chore(misc): add extra logging to HTTPClient error Throwing by @XavierGeerinck in #432
- chore(deps): Bump qs from 6.9.6 to 6.11.0 by @dependabot in #427
- chore(deps): Bump json5 from 2.2.0 to 2.2.3 by @dependabot in #436
- chore(misc): Update README.md by @DarqueWarrior in #446
- chore(release) Update workflows and protos to use v1.10.0 Dapr by @shubham1172 in #455
- chore(deps): Bump golang.org/x/text from 0.3.3 to 0.3.8 in /examples/grpc/proxying/server by @dependabot in #456
- chore(deps): Bump golang.org/x/net from 0.0.0-20201021035429-f5854403a974 to 0.7.0 in /examples/grpc/proxying/server by @dependabot in #459
- chore(release): deprecate dapr-client NPM package by @shubham1172 in #467
- chore(release): bump version to v3.0.0 by @shubham1172 in #468
Tests
- test: Allow writing Dapr logs to file in e2e test shell script by @shubham1172 in #457
New Contributors
- @DarqueWarrior made their first contribution in #446
- @marcduiker made their first contribution in #450
Full Changelog: v2.5.0...v3.0.0
Release v2.5.0
What's Changed
Features
- feat(configuration): Change configuration API response to dictionary by @addjuarez in #345
- feat(bindings): Pass Metadata in grpc binding invocation by @DeepanshuA in #348
- feat(client): Report SDK version in user-agent by @ItalyPaleAle in #402
- feat(invocation): Allow sending and receiving headers during HTTP service invocation by @salmankhan-prs in #408
Fixes
- fix(docs): Update titles and links for examples of Xavier Geerinck by @giovannism20 in #418
- fix(invocation): Fix error reporting in HTTP service invocation by @salmankhan-prs in #415
Chores
- chore(deps): Bump got and nodemon in examples by @dependabot in #393, #394, #395, #396, #397, #398
- chore(deps): Update nodemon and node-fetch to fix dependabot alerts by @shubham1172 in #405
- chore(ci): Remove Husky initialization on npm install by @XavierGeerinck in #407
- chore(release): bump version to v2.5.0 by @shubham1172 in #420
Tests
- tests(e2e/ts): End to end test for testing typescript build by @amulyavarote in #388
New Contributors
- @ItalyPaleAle made their first contribution in #402
- @salmankhan-prs made their first contribution in #408
- @giovannism20 made their first contribution in #418
- @addjuarez made their first contribution in #345
Full Changelog: v2.4.2...v2.5.0
Release v2.4.2
What's Changed
Features
- feat(client): add DAPR_API_TOKEN to headers by @ahmedhesham6 in #364
- feat(actors): add ability to specify type in ActorStateManager by @shubham1172 in #372
Fixes
- fix(test): remove DAPR_API_TOKEN from test sidecar by @ahmedhesham6 in #376
- fix(pubsub): pass headers to PubSub system so that users can get the properties by @XavierGeerinck in #389
Chores
- chore(ci): Add prettier configuration, prettify the codebase, and add to build validation by @shubham1172 in #384
- chore(dev): Add pre-commit hooks for help in prettier configuration by @XavierGeerinck in #391
- chores(proto): manage grpc-tools installation via script by @shubham1172 in #392
Documentation
- docs: Move pubsub subscribe to the correct place by @XavierGeerinck in #375
New Contributors
- @ahmedhesham6 made their first contribution in #364
Full Changelog: v2.4.1...v2.4.2
Release v2.4.1
What's Changed
Fixes
- fix(logger): Propagate logger to sidecar awaiting method by @shubham1172 in #358
- fix(type): Mark exported types as dependencies in package.json by @shubham1172 in #359
Chores
- chore(release): bump version to v2.4.1 by @shubham1172 in #367
Documentation
- docs(lock): added distributed locks documentation by @amulyavarote in #362
Full Changelog: v2.4.0...v2.4.1
Release v2.4.0
What's Changed
Features
- feat(pubsub): Allow passing metadata to publish and subscribe API by @shubham1172 in #329
- feat(pubsub): Implement pubsub dead letter & single/multi routing by @XavierGeerinck in #342
- feat(actors): Allow actors to be configurable by @shubham1172 in #346
- feat(metadata): Support capabilities field in metadata API by @DeepanshuA in #347
Fixes
- fix(lock): Renaming distributed lock API UnlockResponse.Status (#336) by @tmacam in #337
- fix(pubsub): Send correct HTTP response status in subscription event handler by @DeepanshuA in #334
- fix(client): Reusing same HTTP client instance by @DeepanshuA in #340
Chores
- chore(release): bump version to v2.4.0 by @shubham1172 in #355
Documentation
- docs(dev) Add reference docs for releasing by @shubham1172 in #353
New Contributors💖
- @tmacam made their first contribution in #337
- @DeepanshuA made their first contribution in #334
Full Changelog: v2.3.1...v2.4.0
Release v2.3.1
What's Changed
Features
- feat(state): add Metadata field to the State Save operation by @XavierGeerinck in #323
- feat(lock): Added distributed lock API support to javascript SDK by @amulyavarote in #306
Fixes
- fix(package-lock): bump version by @webup in #309
- fix(sidecar): sidecar would not be started when getClient was called due to previous abstraction by @XavierGeerinck in #324
- fix(types/http): use
import * as
http(s) by @webup in #308
Chores
- chore(deprecation): add warning message to dapr-client builds by @shubham1172 in #313
- chore(proto): latest proto and version changes for v1.8.0 by @amulyavarote in #326
- chore(github): Update references to master to main by @shubham1172 in #331
- chore(release): bump version to v2.3.1 by @shubham1172 in #332
Documentation
- docs(SDK): fix index documentation page for SDK by @shubham1172 in #311
Tests
- tests(e2e/grpc): add Configuration API test for subscribe all keys by @shubham1172 in #327
New Contributors💖
Full Changelog: v2.3.0...v2.3.1
Release v2.3.0
What's Changed
For this release, we focused on solving issues to provide a more stable environment and let gRPC become more mature as well through features such as bring-your-own-proto.
Features
- Bring your own proto support #298
- Use a logging module and make it extensible by @shubham1172 in #276
- Implement
await client.start()
to ensure sidecar has started by @XavierGeerinck in #272
Fixes
- Check if data is Buffer already by @jilichao in #293
- Update method signature for http client invoker to use optional parameter by @shubham1172 in #299
- Linting fixes by @XavierGeerinck in #277
- Add
req.body
to the subscribe response as well by @XavierGeerinck in #269
Documentation
- Add documentation for logger usage and make keepAlive optional by @shubham1172 in #289
- Rework README by @XavierGeerinck in #278
Bugs
Tests & CI
- Update build workflow to run on PRs and manually by @shubham1172 in #287
- Introduce test-init to initialize test services by @XavierGeerinck in #271
Misc
Bumps
- Bump protobufjs from 6.11.2 to 6.11.3 by @dependabot in #285
New Contributors 💖
- @jilichao made their first contribution in #293
Full Changelog: v2.2.1...v2.3.0
Release v2.2.0 - v2.2.1
What's Changed
dapr-client
npm repository towards the @dapr/dapr
organization on NPM.
Next to the above, we focused on streamlining the tests as much as possible and becoming up to date with Dapr 1.7.0
Breaking Changes & Deprecations
We are moving from the dapr-client
NPM package towards the @dapr/dapr
package as per #207
Since this is a breaking change for everyone, a deprecation schedule (#259) is in place, and we will be updating both packages for the coming months. The current plan is to maintain both package until at least version 2.3.0 of the Dapr JS SDK
Features
- feat: Use environment variables to initialize the Client and Server
- feat: Configuration API
- feat: Actors Reminder/Timer TTL
- feat: State Store Query API: Sync with latest spec
Documentation
- doc: Make distinction between client and server clearer
Bugs
Tests & CI
- ci: E2E tests to cancel the pipeline when they fail
- tests: Fix actors E2E tests
Misc
- chore: Add license headers everywhere
Bumps
Full
Full Changelog: v2.1.0...v2.2.0-rc.0
Release v2.1.0
What's Changed
This sprint we worked on defining a more sprint-like release cycle to catch up with the latest Dapr features. We made quite some progress and are working to streamline the release process as much as possible.
Features
- feat: Use environment variables to initialize the Client and Server
Misc
- feat: Upgrade Node.JS to 16.14.0
- ci: Resolve tests and fix the build process to catch errors
Bugs
- bug: resolve an issue with Typescript types
Bumps
Full
Full Changelog: v2.0.1...v2.1.0