@hotmeshio/hotmesh 0.0.56 → 0.0.57

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.
package/README.md CHANGED
@@ -301,7 +301,7 @@ Workflows and activities are run according to the rules you define, offering [Gr
301
301
  Refer to the [FAQ](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/faq.md) for terminology, definitions, and an exploration of how HotMesh facilitates orchestration use cases.
302
302
 
303
303
  ## Quick Start
304
- Refer to the [Quick Start](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/quickstart.md) for sample flows you can easily copy, paste, and modify to get started.
304
+ Refer to the [Quick Start](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/quickstart.md) for sample YAML workflows you can copy, paste, and modify to get started.
305
305
 
306
306
  ## Developer Guide
307
307
  For more details on the complete development process, including information about schemas, APIs, and deployment, consult the [Developer Guide](https://github.com/hotmeshio/sdk-typescript/tree/main/docs/developer_guide.md).
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,19 +28,18 @@ class Search {
28
28
  const schema = [];
29
29
  for (const [key, value] of Object.entries(search.schema)) {
30
30
  if (value.indexed !== false) {
31
- schema.push(`_${key}`);
32
- schema.push(value.type);
33
- if (value.sortable) {
34
- schema.push('SORTABLE');
35
- }
36
- if (value.sortable) {
37
- schema.push('SORTABLE');
38
- }
31
+ schema.push(value.fieldName ? `${value.fieldName.toString()}` : `_${key}`);
32
+ schema.push(value.type ? value.type : 'TEXT');
39
33
  if (value.noindex) {
40
34
  schema.push('NOINDEX');
41
35
  }
42
- if (value.nostem && value.type === 'TEXT') {
43
- schema.push('NOSTEM');
36
+ else {
37
+ if (value.nostem && value.type === 'TEXT') {
38
+ schema.push('NOSTEM');
39
+ }
40
+ if (value.sortable) {
41
+ schema.push('SORTABLE');
42
+ }
44
43
  }
45
44
  }
46
45
  }
@@ -41,6 +41,7 @@ type WorkflowSearchOptions = {
41
41
  required?: boolean;
42
42
  enum?: string[];
43
43
  pattern?: string;
44
+ fieldName?: string;
44
45
  }>;
45
46
  data?: StringStringType;
46
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotmeshio/hotmesh",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "Unbreakable Workflows",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
package/types/durable.ts CHANGED
@@ -118,7 +118,11 @@ type WorkflowSearchOptions = {
118
118
  prefix?: string[];
119
119
 
120
120
  /**
121
- * Schema mapping each field to a type with an optional sortable flag
121
+ * Schema mapping each field. Each field is a key-value pair where the key is the field name
122
+ * and the value is a record of field options. If the fieldName is provided,
123
+ * it will be used as the indexed field name. If not provided
124
+ * key will be used as the indexed field name with an underscore prefix.
125
+ *
122
126
  */
123
127
  schema?: Record<string, {
124
128
  /**
@@ -202,6 +206,11 @@ type WorkflowSearchOptions = {
202
206
  * @example '^[a-zA-Z0-9_]*$'
203
207
  */
204
208
  pattern?: string;
209
+
210
+ /**
211
+ * literal value to use for the indexed field name (without including the standard underscore (_) prefix isolate)
212
+ */
213
+ fieldName?: string;
205
214
  }>;
206
215
 
207
216
  /** Additional data as a key-value record */