@hotmeshio/hotmesh 0.3.10 → 0.3.11

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.
Files changed (88) hide show
  1. package/README.md +6 -6
  2. package/build/modules/key.d.ts +4 -0
  3. package/build/modules/key.js +1 -1
  4. package/build/modules/utils.js +1 -1
  5. package/build/package.json +19 -15
  6. package/build/services/activities/activity.js +1 -1
  7. package/build/services/activities/await.js +1 -1
  8. package/build/services/activities/cycle.js +1 -1
  9. package/build/services/activities/hook.js +1 -1
  10. package/build/services/activities/index.js +1 -1
  11. package/build/services/activities/interrupt.js +1 -1
  12. package/build/services/activities/signal.js +1 -1
  13. package/build/services/activities/trigger.js +1 -1
  14. package/build/services/activities/worker.js +1 -1
  15. package/build/services/collator/index.js +1 -1
  16. package/build/services/compiler/deployer.js +1 -1
  17. package/build/services/compiler/index.js +1 -1
  18. package/build/services/compiler/validator.js +1 -1
  19. package/build/services/connector/factory.js +29 -17
  20. package/build/services/connector/index.d.ts +2 -0
  21. package/build/services/connector/index.js +2 -0
  22. package/build/services/connector/providers/nats.js +8 -2
  23. package/build/services/connector/providers/postgres.js +7 -3
  24. package/build/services/engine/index.js +1 -1
  25. package/build/services/exporter/index.js +1 -1
  26. package/build/services/mapper/index.js +1 -1
  27. package/build/services/meshflow/client.js +1 -1
  28. package/build/services/meshflow/exporter.js +1 -1
  29. package/build/services/pipe/functions/array.js +1 -1
  30. package/build/services/pipe/functions/bitwise.js +1 -1
  31. package/build/services/pipe/functions/conditional.js +1 -1
  32. package/build/services/pipe/functions/cron.js +1 -1
  33. package/build/services/pipe/functions/date.js +1 -1
  34. package/build/services/pipe/functions/index.js +1 -1
  35. package/build/services/pipe/functions/json.js +1 -1
  36. package/build/services/pipe/functions/logical.js +1 -1
  37. package/build/services/pipe/functions/math.js +1 -1
  38. package/build/services/pipe/functions/number.js +1 -1
  39. package/build/services/pipe/functions/object.js +1 -1
  40. package/build/services/pipe/functions/string.js +1 -1
  41. package/build/services/pipe/functions/symbol.js +1 -1
  42. package/build/services/pipe/functions/unary.js +1 -1
  43. package/build/services/pipe/index.js +1 -1
  44. package/build/services/quorum/index.js +1 -1
  45. package/build/services/reporter/index.d.ts +3 -0
  46. package/build/services/reporter/index.js +1 -1
  47. package/build/services/router/index.js +1 -1
  48. package/build/services/search/providers/redis/ioredis.js +1 -1
  49. package/build/services/search/providers/redis/redis.js +1 -1
  50. package/build/services/serializer/index.js +1 -1
  51. package/build/services/store/factory.d.ts +1 -1
  52. package/build/services/store/factory.js +9 -5
  53. package/build/services/store/index.d.ts +2 -1
  54. package/build/services/store/providers/postgres/kvsql.d.ts +155 -0
  55. package/build/services/store/providers/postgres/kvsql.js +1 -0
  56. package/build/services/store/providers/postgres/postgres.d.ts +107 -0
  57. package/build/services/store/providers/postgres/postgres.js +1 -0
  58. package/build/services/store/providers/redis/_base.d.ts +0 -1
  59. package/build/services/store/providers/redis/_base.js +1 -1
  60. package/build/services/store/providers/redis/ioredis.js +1 -1
  61. package/build/services/store/providers/redis/redis.d.ts +0 -1
  62. package/build/services/store/providers/redis/redis.js +1 -1
  63. package/build/services/store/providers/store-initializable.js +1 -1
  64. package/build/services/stream/factory.js +5 -1
  65. package/build/services/stream/providers/nats/nats.js +1 -1
  66. package/build/services/stream/providers/postgres/postgres.d.ts +4 -0
  67. package/build/services/stream/providers/postgres/postgres.js +1 -1
  68. package/build/services/stream/providers/redis/ioredis.js +1 -1
  69. package/build/services/stream/providers/redis/redis.js +1 -1
  70. package/build/services/stream/providers/stream-initializable.js +1 -1
  71. package/build/services/sub/providers/redis/ioredis.js +1 -1
  72. package/build/services/sub/providers/redis/redis.js +1 -1
  73. package/build/services/task/index.js +1 -1
  74. package/build/services/telemetry/index.js +1 -1
  75. package/build/services/worker/index.js +1 -1
  76. package/build/types/hotmesh.d.ts +4 -0
  77. package/build/types/provider.d.ts +44 -1
  78. package/package.json +19 -15
  79. package/types/hotmesh.ts +15 -0
  80. package/types/provider.ts +74 -3
  81. package/build/services/store/providers/postgres/types/hash.d.ts +0 -0
  82. package/build/services/store/providers/postgres/types/hash.js +0 -0
  83. package/build/services/store/providers/postgres/types/list.d.ts +0 -0
  84. package/build/services/store/providers/postgres/types/list.js +0 -0
  85. package/build/services/store/providers/postgres/types/string.d.ts +0 -0
  86. package/build/services/store/providers/postgres/types/string.js +0 -0
  87. package/build/services/store/providers/postgres/types/zset.d.ts +0 -0
  88. package/build/services/store/providers/postgres/types/zset.js +0 -0
package/types/provider.ts CHANGED
@@ -27,11 +27,10 @@ export type Providers = 'redis' | 'nats' | 'postgres' | 'ioredis';
27
27
  * execute as a single transaction.
28
28
  */
29
29
  export interface ProviderTransaction {
30
- //outside callers can execute the transaction, regardless of provider by calling this method
31
30
  exec(): Promise<any>;
32
31
 
33
- // All other transaction methods are provider specific
34
- [key: string]: any;
32
+ // Allows callable properties while avoiding conflicts with ProviderTransaction instances
33
+ [key: string]: ((...args: any[]) => Promise<any>) | undefined | any;
35
34
  }
36
35
 
37
36
  /**
@@ -69,3 +68,75 @@ export type ProviderConfig = {
69
68
  class: any;
70
69
  options: StringAnyType;
71
70
  };
71
+
72
+
73
+ export interface SetOptions {
74
+ nx?: boolean;
75
+ ex?: number; // Expiry time in seconds
76
+ }
77
+
78
+ export interface HSetOptions {
79
+ nx?: boolean;
80
+ ex?: number; // Expiry time in seconds
81
+ }
82
+
83
+ export interface ZAddOptions {
84
+ nx?: boolean;
85
+ }
86
+
87
+ export interface HScanResult {
88
+ cursor: string;
89
+ items: Record<string, string>;
90
+ }
91
+
92
+ export interface KVSQLProviderTransaction extends ProviderTransaction {
93
+ [key: string]: any;
94
+ exec(): Promise<any[]>;
95
+ set(key: string, value: string, options?: SetOptions): ProviderTransaction;
96
+ get(key: string): ProviderTransaction;
97
+ del(key: string): ProviderTransaction;
98
+ expire(key: string, seconds: number): ProviderTransaction;
99
+ hset(
100
+ key: string,
101
+ fields: Record<string, string>,
102
+ options?: HSetOptions
103
+ ): ProviderTransaction;
104
+ hget(key: string, field: string): ProviderTransaction;
105
+ hdel(key: string, fields: string[]): ProviderTransaction;
106
+ hmget(key: string, fields: string[]): ProviderTransaction;
107
+ hgetall(key: string): ProviderTransaction;
108
+ hincrbyfloat(
109
+ key: string,
110
+ field: string,
111
+ value: number
112
+ ): ProviderTransaction;
113
+ hscan(key: string, cursor: string, count?: number): ProviderTransaction;
114
+ lrange(key: string, start: number, end: number): ProviderTransaction;
115
+ rpush(key: string, value: string): ProviderTransaction;
116
+ lpush(key: string, value: string): ProviderTransaction;
117
+ lpop(key: string): ProviderTransaction;
118
+ lmove(
119
+ source: string,
120
+ destination: string,
121
+ srcPosition: 'LEFT' | 'RIGHT',
122
+ destPosition: 'LEFT' | 'RIGHT'
123
+ ): ProviderTransaction;
124
+ zadd(
125
+ key: string,
126
+ score: number,
127
+ member: string,
128
+ options?: ZAddOptions
129
+ ): ProviderTransaction;
130
+ zrange(key: string, start: number, stop: number): ProviderTransaction;
131
+ zrangebyscore(key: string, min: number, max: number): ProviderTransaction;
132
+ zrangebyscore_withscores(
133
+ key: string,
134
+ min: number,
135
+ max: number
136
+ ): ProviderTransaction;
137
+ zrem(key: string, member: string): ProviderTransaction;
138
+ zrank(key: string, member: string): ProviderTransaction;
139
+ scan(cursor: number, count?: number): ProviderTransaction;
140
+ rename(oldKey: string, newKey: string): ProviderTransaction;
141
+ // Add other methods as needed
142
+ }