From 82c32cac901518aa2d504c04085a1f992c8c5458 Mon Sep 17 00:00:00 2001 From: MregXN Date: Tue, 21 Nov 2023 10:30:39 +0800 Subject: [PATCH 1/5] add undefined type Signed-off-by: MregXN --- src/actors/runtime/AbstractActor.ts | 2 +- src/types/ActorReminder.type.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actors/runtime/AbstractActor.ts b/src/actors/runtime/AbstractActor.ts index f42fbb98..37329e0e 100644 --- a/src/actors/runtime/AbstractActor.ts +++ b/src/actors/runtime/AbstractActor.ts @@ -95,7 +95,7 @@ export default abstract class AbstractActor { async registerActorReminder<_Type>( reminderName: string, dueTime: Temporal.Duration, - period: Temporal.Duration, + period: Temporal.Duration | undefined, ttl?: Temporal.Duration, state?: any, ) { diff --git a/src/types/ActorReminder.type.ts b/src/types/ActorReminder.type.ts index 0f010d2c..06912b03 100644 --- a/src/types/ActorReminder.type.ts +++ b/src/types/ActorReminder.type.ts @@ -14,7 +14,7 @@ limitations under the License. import { Temporal } from "@js-temporal/polyfill"; export type ActorReminderType = { - period: Temporal.Duration; // e.g. 0h0m9s0ms + period: Temporal.Duration | undefined; // e.g. 0h0m9s0ms dueTime?: Temporal.Duration; // e.g. 1m or 0h0m0s0ms defaults to 0s data?: any; // the data to pass ttl?: Temporal.Duration; // e.g. 1m From 9df145409ab7154d415db939104fd16f20fbce0d Mon Sep 17 00:00:00 2001 From: MregXN Date: Tue, 21 Nov 2023 13:43:31 +0800 Subject: [PATCH 2/5] npm run pretty-fix Signed-off-by: MregXN --- daprdocs/content/en/js-sdk-docs/js-server/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/js-sdk-docs/js-server/_index.md b/daprdocs/content/en/js-sdk-docs/js-server/_index.md index eaaba059..656a8f53 100644 --- a/daprdocs/content/en/js-sdk-docs/js-server/_index.md +++ b/daprdocs/content/en/js-sdk-docs/js-server/_index.md @@ -112,8 +112,8 @@ const daprServer = new DaprServer({ serverPort: "50002", // App Port serverHttp: myApp, clientOptions: { - daprHost, - daprPort, + daprHost + daprPort } }); From 522f635db74dabfe06e8536d2fe4e111bc573aa3 Mon Sep 17 00:00:00 2001 From: MregXN Date: Tue, 21 Nov 2023 13:56:33 +0800 Subject: [PATCH 3/5] add undefind type for ttl Signed-off-by: MregXN --- src/actors/runtime/AbstractActor.ts | 2 +- src/types/ActorReminder.type.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actors/runtime/AbstractActor.ts b/src/actors/runtime/AbstractActor.ts index 37329e0e..60bb84b2 100644 --- a/src/actors/runtime/AbstractActor.ts +++ b/src/actors/runtime/AbstractActor.ts @@ -96,7 +96,7 @@ export default abstract class AbstractActor { reminderName: string, dueTime: Temporal.Duration, period: Temporal.Duration | undefined, - ttl?: Temporal.Duration, + ttl?: Temporal.Duration | undefined, state?: any, ) { await this.actorClient.actor.registerActorReminder(this.actorType, this.id, reminderName, { diff --git a/src/types/ActorReminder.type.ts b/src/types/ActorReminder.type.ts index 06912b03..9d48308b 100644 --- a/src/types/ActorReminder.type.ts +++ b/src/types/ActorReminder.type.ts @@ -17,5 +17,5 @@ export type ActorReminderType = { period: Temporal.Duration | undefined; // e.g. 0h0m9s0ms dueTime?: Temporal.Duration; // e.g. 1m or 0h0m0s0ms defaults to 0s data?: any; // the data to pass - ttl?: Temporal.Duration; // e.g. 1m + ttl?: Temporal.Duration | undefined; // e.g. 1m }; From db46fa357a2703fa7b72f8cc0a49d475c9666e91 Mon Sep 17 00:00:00 2001 From: MregXN Date: Tue, 21 Nov 2023 22:52:17 +0800 Subject: [PATCH 4/5] add undefind type Signed-off-by: MregXN --- src/actors/runtime/AbstractActor.ts | 4 ++-- src/types/ActorReminder.type.ts | 0 src/types/ActorTimer.type.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 src/actors/runtime/AbstractActor.ts mode change 100644 => 100755 src/types/ActorReminder.type.ts mode change 100644 => 100755 src/types/ActorTimer.type.ts diff --git a/src/actors/runtime/AbstractActor.ts b/src/actors/runtime/AbstractActor.ts old mode 100644 new mode 100755 index 60bb84b2..1be2dcea --- a/src/actors/runtime/AbstractActor.ts +++ b/src/actors/runtime/AbstractActor.ts @@ -115,8 +115,8 @@ export default abstract class AbstractActor { timerName: string, callback: string, dueTime: Temporal.Duration, - period: Temporal.Duration, - ttl?: Temporal.Duration, + period: Temporal.Duration | undefined, + ttl?: Temporal.Duration | undefined, state?: any, ) { // Register the timer in the sidecar diff --git a/src/types/ActorReminder.type.ts b/src/types/ActorReminder.type.ts old mode 100644 new mode 100755 diff --git a/src/types/ActorTimer.type.ts b/src/types/ActorTimer.type.ts old mode 100644 new mode 100755 index 9c29d258..16a67fdd --- a/src/types/ActorTimer.type.ts +++ b/src/types/ActorTimer.type.ts @@ -14,9 +14,9 @@ limitations under the License. import { Temporal } from "@js-temporal/polyfill"; export type ActorTimerType = { - period: Temporal.Duration; // e.g. 0h0m9s0ms + period: Temporal.Duration | undefined; // e.g. 0h0m9s0ms dueTime?: Temporal.Duration; // e.g. 1m or 0h0m0s0ms defaults to 0s data?: any; // the data to pass - ttl?: Temporal.Duration; // e.g. 1m + ttl?: Temporal.Duration | undefined; // e.g. 1m callback: string; // which method to execute as callback method }; From 010f26d118f94d9471736ccbe7a18ed8ecf2a430 Mon Sep 17 00:00:00 2001 From: MregXN Date: Thu, 23 Nov 2023 19:12:29 +0800 Subject: [PATCH 5/5] make type optional Signed-off-by: MregXN --- src/actors/runtime/AbstractActor.ts | 8 ++++---- src/types/ActorReminder.type.ts | 4 ++-- src/types/ActorTimer.type.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/actors/runtime/AbstractActor.ts b/src/actors/runtime/AbstractActor.ts index 1be2dcea..18100142 100755 --- a/src/actors/runtime/AbstractActor.ts +++ b/src/actors/runtime/AbstractActor.ts @@ -95,8 +95,8 @@ export default abstract class AbstractActor { async registerActorReminder<_Type>( reminderName: string, dueTime: Temporal.Duration, - period: Temporal.Duration | undefined, - ttl?: Temporal.Duration | undefined, + period?: Temporal.Duration, + ttl?: Temporal.Duration, state?: any, ) { await this.actorClient.actor.registerActorReminder(this.actorType, this.id, reminderName, { @@ -115,8 +115,8 @@ export default abstract class AbstractActor { timerName: string, callback: string, dueTime: Temporal.Duration, - period: Temporal.Duration | undefined, - ttl?: Temporal.Duration | undefined, + period?: Temporal.Duration, + ttl?: Temporal.Duration, state?: any, ) { // Register the timer in the sidecar diff --git a/src/types/ActorReminder.type.ts b/src/types/ActorReminder.type.ts index 9d48308b..c5d0614a 100755 --- a/src/types/ActorReminder.type.ts +++ b/src/types/ActorReminder.type.ts @@ -14,8 +14,8 @@ limitations under the License. import { Temporal } from "@js-temporal/polyfill"; export type ActorReminderType = { - period: Temporal.Duration | undefined; // e.g. 0h0m9s0ms + period?: Temporal.Duration; // e.g. 0h0m9s0ms dueTime?: Temporal.Duration; // e.g. 1m or 0h0m0s0ms defaults to 0s data?: any; // the data to pass - ttl?: Temporal.Duration | undefined; // e.g. 1m + ttl?: Temporal.Duration; // e.g. 1m }; diff --git a/src/types/ActorTimer.type.ts b/src/types/ActorTimer.type.ts index 16a67fdd..ed8b5899 100755 --- a/src/types/ActorTimer.type.ts +++ b/src/types/ActorTimer.type.ts @@ -14,9 +14,9 @@ limitations under the License. import { Temporal } from "@js-temporal/polyfill"; export type ActorTimerType = { - period: Temporal.Duration | undefined; // e.g. 0h0m9s0ms + period?: Temporal.Duration; // e.g. 0h0m9s0ms dueTime?: Temporal.Duration; // e.g. 1m or 0h0m0s0ms defaults to 0s data?: any; // the data to pass - ttl?: Temporal.Duration | undefined; // e.g. 1m + ttl?: Temporal.Duration; // e.g. 1m callback: string; // which method to execute as callback method };