@flowcore/sdk 1.46.0 → 1.47.0

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,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.47.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.46.1...v1.47.0) (2025-05-07)
4
+
5
+
6
+ ### Features
7
+
8
+ * **event-type:** :sparkles: implement pagination for event list retrieval ([21f9800](https://github.com/flowcore-io/flowcore-sdk/commit/21f9800cc4b3c6202496932bab110f1c20c31394))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **event-type:** :art: improve formatting and type imports in event-type.info.ts ([665a28f](https://github.com/flowcore-io/flowcore-sdk/commit/665a28f0bc1181cdeb0204e63145ae9219dd41ea))
14
+
15
+ ## [1.46.1](https://github.com/flowcore-io/flowcore-sdk/compare/v1.46.0...v1.46.1) (2025-05-07)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **ingestion:** :art: remove unused Buffer import from ingest.event.ts ([be523af](https://github.com/flowcore-io/flowcore-sdk/commit/be523aff5613f6a209403ae14f29998a9e418075))
21
+ * **ingestion:** :bug: encode metadata as base64 in ingestion commands and tests ([4e1937e](https://github.com/flowcore-io/flowcore-sdk/commit/4e1937e414f6c424d4cf65aae1b1b54f76522992))
22
+
3
23
  ## [1.46.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.45.0...v1.46.0) (2025-05-07)
4
24
 
5
25
 
@@ -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;CAoE7F"}
@@ -39,20 +39,28 @@ export class EventTypeInfoCommand extends CustomCommand {
39
39
  }
40
40
  const lastEvents = [];
41
41
  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);
42
+ let cursor = undefined;
43
+ do {
44
+ const eventListResponse = await client.execute(new EventListCommand({
45
+ eventTypeId: this.input.eventTypeId,
46
+ timeBucket,
47
+ pageSize: lastEventsLimit - lastEvents.length,
48
+ order: "desc",
49
+ tenant: this.input.tenant,
50
+ ...(cursor && { cursor }),
51
+ ...(this.input.includeSensitiveData && { includeSensitiveData: true }),
52
+ }));
53
+ lastEvents.push(...eventListResponse.events);
54
+ cursor = eventListResponse.nextCursor;
55
+ } while (cursor && lastEvents.length < lastEventsLimit);
52
56
  if (lastEvents.length >= lastEventsLimit) {
53
57
  break;
54
58
  }
55
59
  }
60
+ // Trim to max limit if we went over
61
+ if (lastEvents.length > lastEventsLimit) {
62
+ lastEvents.length = lastEventsLimit;
63
+ }
56
64
  return {
57
65
  firstTimeBucket,
58
66
  lastTimeBucket,
@@ -55,7 +55,7 @@ export class IngestBatchCommand extends Command {
55
55
  return {
56
56
  "Content-Type": "application/json",
57
57
  ...(this.input.flowcoreManaged && { "X-Flowcore-Managed": "true" }),
58
- ...(metadata && { "x-flowcore-metadata-json": JSON.stringify(metadata) }),
58
+ ...(metadata && { "x-flowcore-metadata-json": btoa(JSON.stringify(metadata)) }),
59
59
  ...(this.input.eventTime && { "x-flowcore-event-time": this.input.eventTime }),
60
60
  ...(this.input.validTime && { "x-flowcore-valid-time": this.input.validTime }),
61
61
  ...(authHeader && { "Authorization": authHeader }),
@@ -55,7 +55,7 @@ export class IngestEventCommand extends Command {
55
55
  return {
56
56
  "Content-Type": "application/json",
57
57
  ...(this.input.flowcoreManaged && { "X-Flowcore-Managed": "true" }),
58
- ...(metadata && { "x-flowcore-metadata-json": JSON.stringify(metadata) }),
58
+ ...(metadata && { "x-flowcore-metadata-json": btoa(JSON.stringify(metadata)) }),
59
59
  ...(this.input.eventTime && { "x-flowcore-event-time": this.input.eventTime }),
60
60
  ...(this.input.validTime && { "x-flowcore-valid-time": this.input.validTime }),
61
61
  ...(authHeader && { "Authorization": authHeader }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowcore/sdk",
3
- "version": "1.46.0",
3
+ "version": "1.47.0",
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;CAoE7F"}
@@ -42,20 +42,28 @@ class EventTypeInfoCommand extends command_custom_js_1.CustomCommand {
42
42
  }
43
43
  const lastEvents = [];
44
44
  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);
45
+ let cursor = undefined;
46
+ do {
47
+ const eventListResponse = await client.execute(new event_list_js_1.EventListCommand({
48
+ eventTypeId: this.input.eventTypeId,
49
+ timeBucket,
50
+ pageSize: lastEventsLimit - lastEvents.length,
51
+ order: "desc",
52
+ tenant: this.input.tenant,
53
+ ...(cursor && { cursor }),
54
+ ...(this.input.includeSensitiveData && { includeSensitiveData: true }),
55
+ }));
56
+ lastEvents.push(...eventListResponse.events);
57
+ cursor = eventListResponse.nextCursor;
58
+ } while (cursor && lastEvents.length < lastEventsLimit);
55
59
  if (lastEvents.length >= lastEventsLimit) {
56
60
  break;
57
61
  }
58
62
  }
63
+ // Trim to max limit if we went over
64
+ if (lastEvents.length > lastEventsLimit) {
65
+ lastEvents.length = lastEventsLimit;
66
+ }
59
67
  return {
60
68
  firstTimeBucket,
61
69
  lastTimeBucket,
@@ -58,7 +58,7 @@ class IngestBatchCommand extends command_js_1.Command {
58
58
  return {
59
59
  "Content-Type": "application/json",
60
60
  ...(this.input.flowcoreManaged && { "X-Flowcore-Managed": "true" }),
61
- ...(metadata && { "x-flowcore-metadata-json": JSON.stringify(metadata) }),
61
+ ...(metadata && { "x-flowcore-metadata-json": btoa(JSON.stringify(metadata)) }),
62
62
  ...(this.input.eventTime && { "x-flowcore-event-time": this.input.eventTime }),
63
63
  ...(this.input.validTime && { "x-flowcore-valid-time": this.input.validTime }),
64
64
  ...(authHeader && { "Authorization": authHeader }),
@@ -58,7 +58,7 @@ class IngestEventCommand extends command_js_1.Command {
58
58
  return {
59
59
  "Content-Type": "application/json",
60
60
  ...(this.input.flowcoreManaged && { "X-Flowcore-Managed": "true" }),
61
- ...(metadata && { "x-flowcore-metadata-json": JSON.stringify(metadata) }),
61
+ ...(metadata && { "x-flowcore-metadata-json": btoa(JSON.stringify(metadata)) }),
62
62
  ...(this.input.eventTime && { "x-flowcore-event-time": this.input.eventTime }),
63
63
  ...(this.input.validTime && { "x-flowcore-valid-time": this.input.validTime }),
64
64
  ...(authHeader && { "Authorization": authHeader }),