@crowdstrike/foundry-js 0.17.0 → 0.17.1

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
@@ -80,8 +80,11 @@ To call on-demand workflow:
80
80
  const record = await collection.read('test-key');
81
81
  // record.age === 42
82
82
 
83
- // search collection, `filter` uses FQL (Falcon Query Language)
84
- const searchResult = await collection.search({ filter: `name:'*'` });
83
+ // search collection, `filter` does NOT use FQL (Falcon Query Language). An exact match for the name has to be used in this example below
84
+ const searchResult = await collection.search({ filter: `name:'exact-name-value'` });
85
+
86
+ // list the object keys in the collection, pagination is supported using; `start`, `end` and `limit`.
87
+ const listResult = await collection.list({ start, end, limit });
85
88
 
86
89
  // deletes record
87
90
  const deleteResponse = await collection.delete('test-key');
@@ -13,6 +13,11 @@ interface CollectionSearchDefinition {
13
13
  sort: string;
14
14
  limit: number;
15
15
  }
16
+ interface CollectionListDefinition {
17
+ end: string;
18
+ limit: number;
19
+ start: string;
20
+ }
16
21
  export declare class Collection<DATA extends LocalData = LocalData> {
17
22
  private readonly falcon;
18
23
  private readonly definition;
@@ -46,5 +51,12 @@ export declare class Collection<DATA extends LocalData = LocalData> {
46
51
  * @returns
47
52
  */
48
53
  search({ filter, offset, sort, limit, }: CollectionSearchDefinition): Promise<unknown>;
54
+ /**
55
+ * lists the object keys in the specified collection
56
+ *
57
+ * @param searchDefinition
58
+ * @returns
59
+ */
60
+ list(options?: CollectionListDefinition): Promise<unknown>;
49
61
  }
50
62
  export {};
package/dist/index.js CHANGED
@@ -2811,6 +2811,24 @@ class Collection {
2811
2811
  },
2812
2812
  });
2813
2813
  }
2814
+ /**
2815
+ * lists the object keys in the specified collection
2816
+ *
2817
+ * @param searchDefinition
2818
+ * @returns
2819
+ */
2820
+ async list(options) {
2821
+ return this.falcon.bridge.postMessage({
2822
+ type: 'collection',
2823
+ payload: {
2824
+ type: 'list',
2825
+ collection: this.definition.collection,
2826
+ start: options?.start,
2827
+ end: options?.end,
2828
+ limit: options?.limit,
2829
+ },
2830
+ });
2831
+ }
2814
2832
  }
2815
2833
 
2816
2834
  class Logscale {