@flowcore/sdk 1.46.1 → 1.47.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/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.47.1](https://github.com/flowcore-io/flowcore-sdk/compare/v1.47.0...v1.47.1) (2025-05-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **deno.lock:** :sparkles: update Deno version to 5 and add latest sdk-oidc-client ([e9e97d4](https://github.com/flowcore-io/flowcore-sdk/commit/e9e97d43d8520ea5f4168613df15daade6bc2d0b))
9
+ * **event-type:** :art: improve formatting of minimum last event limit calculation ([f1d95fa](https://github.com/flowcore-io/flowcore-sdk/commit/f1d95fa77d4a7624121f6ace79902f7246d99993))
10
+ * **event-type:** :bug: adjust minimum last event limit calculation ([5b46856](https://github.com/flowcore-io/flowcore-sdk/commit/5b46856b6f7ae5104f219ee95bd5c0f97a17e6ec))
11
+
12
+ ## [1.47.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.46.1...v1.47.0) (2025-05-07)
13
+
14
+
15
+ ### Features
16
+
17
+ * **event-type:** :sparkles: implement pagination for event list retrieval ([21f9800](https://github.com/flowcore-io/flowcore-sdk/commit/21f9800cc4b3c6202496932bab110f1c20c31394))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **event-type:** :art: improve formatting and type imports in event-type.info.ts ([665a28f](https://github.com/flowcore-io/flowcore-sdk/commit/665a28f0bc1181cdeb0204e63145ae9219dd41ea))
23
+
3
24
  ## [1.46.1](https://github.com/flowcore-io/flowcore-sdk/compare/v1.46.0...v1.46.1) (2025-05-07)
4
25
 
5
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"event-type.info.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KA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AM,CAAA;IACd,6BAA6B;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sBAAsB;IACtB,UAAU,EAAE,aAAa,EAAE,CAAA;CAC5B;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IAC9F;;OAEG;cACsB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAqE7F"}
@@ -38,21 +38,30 @@ export class EventTypeInfoCommand extends CustomCommand {
38
38
  };
39
39
  }
40
40
  const lastEvents = [];
41
+ const minLastEventLimit = Math.max(lastEventsLimit, lastEventsLimit * 3);
41
42
  for (const timeBucket of lastTimeBucketResponse.timeBuckets) {
42
- const eventListCommand = new EventListCommand({
43
- eventTypeId: this.input.eventTypeId,
44
- timeBucket,
45
- pageSize: lastEventsLimit - lastEvents.length,
46
- order: "desc",
47
- tenant: this.input.tenant,
48
- ...(this.input.includeSensitiveData && { includeSensitiveData: true }),
49
- });
50
- const eventListResponse = await client.execute(eventListCommand);
51
- lastEvents.push(...eventListResponse.events);
43
+ let cursor = undefined;
44
+ do {
45
+ const eventListResponse = await client.execute(new EventListCommand({
46
+ eventTypeId: this.input.eventTypeId,
47
+ timeBucket,
48
+ pageSize: minLastEventLimit - lastEvents.length,
49
+ order: "desc",
50
+ tenant: this.input.tenant,
51
+ ...(cursor && { cursor }),
52
+ ...(this.input.includeSensitiveData && { includeSensitiveData: true }),
53
+ }));
54
+ lastEvents.push(...eventListResponse.events);
55
+ cursor = eventListResponse.nextCursor;
56
+ } while (cursor && lastEvents.length < lastEventsLimit);
52
57
  if (lastEvents.length >= lastEventsLimit) {
53
58
  break;
54
59
  }
55
60
  }
61
+ // Trim to max limit if we went over
62
+ if (lastEvents.length > lastEventsLimit) {
63
+ lastEvents.length = lastEventsLimit;
64
+ }
56
65
  return {
57
66
  firstTimeBucket,
58
67
  lastTimeBucket,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowcore/sdk",
3
- "version": "1.46.1",
3
+ "version": "1.47.1",
4
4
  "description": "Flowcore SDK",
5
5
  "homepage": "https://github.com/flowcore-io/flowcore-sdk#readme",
6
6
  "repository": {
@@ -1 +1 @@
1
- {"version":3,"file":"event-type.info.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI7D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,CAAA;IAC3C,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sBAAsB;IACtB,UAAU,EAAE,aAAa,EAAE,CAAA;CAC5B;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IAC9F;;OAEG;cACsB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAuD7F"}
1
+ {"version":3,"file":"event-type.info.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI7D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,CAAA;IAC3C,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6BAA6B;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,2BAA2B;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,sBAAsB;IACtB,UAAU,EAAE,aAAa,EAAE,CAAA;CAC5B;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,aAAa,CAAC,kBAAkB,EAAE,mBAAmB,CAAC;IAC9F;;OAEG;cACsB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAqE7F"}
@@ -41,21 +41,30 @@ class EventTypeInfoCommand extends command_custom_js_1.CustomCommand {
41
41
  };
42
42
  }
43
43
  const lastEvents = [];
44
+ const minLastEventLimit = Math.max(lastEventsLimit, lastEventsLimit * 3);
44
45
  for (const timeBucket of lastTimeBucketResponse.timeBuckets) {
45
- const eventListCommand = new event_list_js_1.EventListCommand({
46
- eventTypeId: this.input.eventTypeId,
47
- timeBucket,
48
- pageSize: lastEventsLimit - lastEvents.length,
49
- order: "desc",
50
- tenant: this.input.tenant,
51
- ...(this.input.includeSensitiveData && { includeSensitiveData: true }),
52
- });
53
- const eventListResponse = await client.execute(eventListCommand);
54
- lastEvents.push(...eventListResponse.events);
46
+ let cursor = undefined;
47
+ do {
48
+ const eventListResponse = await client.execute(new event_list_js_1.EventListCommand({
49
+ eventTypeId: this.input.eventTypeId,
50
+ timeBucket,
51
+ pageSize: minLastEventLimit - lastEvents.length,
52
+ order: "desc",
53
+ tenant: this.input.tenant,
54
+ ...(cursor && { cursor }),
55
+ ...(this.input.includeSensitiveData && { includeSensitiveData: true }),
56
+ }));
57
+ lastEvents.push(...eventListResponse.events);
58
+ cursor = eventListResponse.nextCursor;
59
+ } while (cursor && lastEvents.length < lastEventsLimit);
55
60
  if (lastEvents.length >= lastEventsLimit) {
56
61
  break;
57
62
  }
58
63
  }
64
+ // Trim to max limit if we went over
65
+ if (lastEvents.length > lastEventsLimit) {
66
+ lastEvents.length = lastEventsLimit;
67
+ }
59
68
  return {
60
69
  firstTimeBucket,
61
70
  lastTimeBucket,