@upstash/qstash 2.8.3 → 2.9.0-rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,12 +6,18 @@ import { Ok, Err } from 'neverthrow';
6
6
  type ReceiverConfig = {
7
7
  /**
8
8
  * The current signing key. Get it from `https://console.upstash.com/qstash
9
+ *
10
+ * If not provided, value will be inferred from environment variables based on QSTASH_REGION
11
+ * and UPSTASH_REGION header.
9
12
  */
10
- currentSigningKey: string;
13
+ currentSigningKey?: string;
11
14
  /**
12
15
  * The next signing key. Get it from `https://console.upstash.com/qstash
16
+ *
17
+ * If not provided, value will be inferred from environment variables based on QSTASH_REGION
18
+ * and UPSTASH_REGION header.
13
19
  */
14
- nextSigningKey: string;
20
+ nextSigningKey?: string;
15
21
  };
16
22
  type VerifyRequest = {
17
23
  /**
@@ -34,6 +40,12 @@ type VerifyRequest = {
34
40
  * @default 0
35
41
  */
36
42
  clockTolerance?: number;
43
+ /**
44
+ * The region from the `upstash-region` header.
45
+ *
46
+ * Used to infer which signing keys to use for verification in multi-region setups.
47
+ */
48
+ upstashRegion?: string;
37
49
  };
38
50
  declare class SignatureError extends Error {
39
51
  constructor(message: string);
@@ -42,9 +54,9 @@ declare class SignatureError extends Error {
42
54
  * Receiver offers a simple way to verify the signature of a request.
43
55
  */
44
56
  declare class Receiver {
45
- private readonly currentSigningKey;
46
- private readonly nextSigningKey;
47
- constructor(config: ReceiverConfig);
57
+ private readonly currentSigningKey?;
58
+ private readonly nextSigningKey?;
59
+ constructor(config?: ReceiverConfig);
48
60
  /**
49
61
  * Verify the signature of a request.
50
62
  *
@@ -863,6 +875,24 @@ type Schedule = {
863
875
  * The label assigned to the schedule for filtering purposes.
864
876
  */
865
877
  label?: string;
878
+ /**
879
+ * The timestamp of the last scheduled execution.
880
+ */
881
+ lastScheduleTime?: number;
882
+ /**
883
+ * The timestamp of the next scheduled execution.
884
+ */
885
+ nextScheduleTime?: number;
886
+ /**
887
+ * The states of the last scheduled messages.
888
+ *
889
+ * Maps message id to state
890
+ */
891
+ lastScheduleStates?: Record<string, "IN_PROGRESS" | "SUCCESS" | "FAIL">;
892
+ /**
893
+ * The IP address of the caller who created the schedule.
894
+ */
895
+ callerIP?: string;
866
896
  };
867
897
  type CreateScheduleRequest = {
868
898
  /**
@@ -6,12 +6,18 @@ import { Ok, Err } from 'neverthrow';
6
6
  type ReceiverConfig = {
7
7
  /**
8
8
  * The current signing key. Get it from `https://console.upstash.com/qstash
9
+ *
10
+ * If not provided, value will be inferred from environment variables based on QSTASH_REGION
11
+ * and UPSTASH_REGION header.
9
12
  */
10
- currentSigningKey: string;
13
+ currentSigningKey?: string;
11
14
  /**
12
15
  * The next signing key. Get it from `https://console.upstash.com/qstash
16
+ *
17
+ * If not provided, value will be inferred from environment variables based on QSTASH_REGION
18
+ * and UPSTASH_REGION header.
13
19
  */
14
- nextSigningKey: string;
20
+ nextSigningKey?: string;
15
21
  };
16
22
  type VerifyRequest = {
17
23
  /**
@@ -34,6 +40,12 @@ type VerifyRequest = {
34
40
  * @default 0
35
41
  */
36
42
  clockTolerance?: number;
43
+ /**
44
+ * The region from the `upstash-region` header.
45
+ *
46
+ * Used to infer which signing keys to use for verification in multi-region setups.
47
+ */
48
+ upstashRegion?: string;
37
49
  };
38
50
  declare class SignatureError extends Error {
39
51
  constructor(message: string);
@@ -42,9 +54,9 @@ declare class SignatureError extends Error {
42
54
  * Receiver offers a simple way to verify the signature of a request.
43
55
  */
44
56
  declare class Receiver {
45
- private readonly currentSigningKey;
46
- private readonly nextSigningKey;
47
- constructor(config: ReceiverConfig);
57
+ private readonly currentSigningKey?;
58
+ private readonly nextSigningKey?;
59
+ constructor(config?: ReceiverConfig);
48
60
  /**
49
61
  * Verify the signature of a request.
50
62
  *
@@ -863,6 +875,24 @@ type Schedule = {
863
875
  * The label assigned to the schedule for filtering purposes.
864
876
  */
865
877
  label?: string;
878
+ /**
879
+ * The timestamp of the last scheduled execution.
880
+ */
881
+ lastScheduleTime?: number;
882
+ /**
883
+ * The timestamp of the next scheduled execution.
884
+ */
885
+ nextScheduleTime?: number;
886
+ /**
887
+ * The states of the last scheduled messages.
888
+ *
889
+ * Maps message id to state
890
+ */
891
+ lastScheduleStates?: Record<string, "IN_PROGRESS" | "SUCCESS" | "FAIL">;
892
+ /**
893
+ * The IP address of the caller who created the schedule.
894
+ */
895
+ callerIP?: string;
866
896
  };
867
897
  type CreateScheduleRequest = {
868
898
  /**
package/cloudflare.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BpQp_dGA.mjs';
1
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BVG9vt90.mjs';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {
package/cloudflare.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BpQp_dGA.js';
1
+ import { a9 as RouteFunction, aa as WorkflowServeOptions } from './client-BVG9vt90.js';
2
2
  import 'neverthrow';
3
3
 
4
4
  type WorkflowBindings = {