@flowcore/sdk 1.15.0 → 1.17.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 +29 -0
- package/esm/commands/api-key/api-key.create.d.ts +1 -1
- package/esm/commands/api-key/api-key.create.d.ts.map +1 -1
- package/esm/commands/api-key/api-key.create.js +1 -1
- package/esm/commands/api-key/api-key.delete.d.ts +1 -1
- package/esm/commands/api-key/api-key.delete.d.ts.map +1 -1
- package/esm/commands/api-key/api-key.delete.js +1 -1
- package/esm/commands/api-key/api-key.list.d.ts +1 -1
- package/esm/commands/api-key/api-key.list.d.ts.map +1 -1
- package/esm/commands/api-key/api-key.list.js +1 -1
- package/esm/commands/container-registry/container-registry.delete.d.ts +1 -1
- package/esm/commands/container-registry/container-registry.delete.d.ts.map +1 -1
- package/esm/commands/container-registry/container-registry.delete.js +2 -1
- package/esm/commands/container-registry/container-registry.fetch.d.ts +1 -1
- package/esm/commands/container-registry/container-registry.fetch.d.ts.map +1 -1
- package/esm/commands/container-registry/container-registry.fetch.js +2 -1
- package/esm/commands/container-registry/container-registry.list.d.ts +1 -1
- package/esm/commands/container-registry/container-registry.list.d.ts.map +1 -1
- package/esm/commands/container-registry/container-registry.list.js +2 -1
- package/esm/commands/data-core/data-core.delete-request.d.ts +1 -1
- package/esm/commands/data-core/data-core.delete-request.d.ts.map +1 -1
- package/esm/commands/data-core/data-core.delete-request.js +1 -1
- package/esm/commands/data-core/data-core.fetch.d.ts +22 -5
- package/esm/commands/data-core/data-core.fetch.d.ts.map +1 -1
- package/esm/commands/data-core/data-core.fetch.js +32 -7
- package/esm/commands/event-type/event-type.delete-request.d.ts +1 -1
- package/esm/commands/event-type/event-type.delete-request.d.ts.map +1 -1
- package/esm/commands/event-type/event-type.delete-request.js +1 -1
- package/esm/commands/event-type/event-type.info.d.ts +35 -0
- package/esm/commands/event-type/event-type.info.d.ts.map +1 -0
- package/esm/commands/event-type/event-type.info.js +58 -0
- package/esm/commands/event-type/event-type.truncate-request.d.ts +1 -1
- package/esm/commands/event-type/event-type.truncate-request.d.ts.map +1 -1
- package/esm/commands/event-type/event-type.truncate-request.js +1 -1
- package/esm/commands/events/event.list.d.ts +62 -0
- package/esm/commands/events/event.list.d.ts.map +1 -0
- package/esm/commands/events/event.list.js +53 -0
- package/esm/commands/events/time-bucket.list.d.ts +49 -0
- package/esm/commands/events/time-bucket.list.d.ts.map +1 -0
- package/esm/commands/events/time-bucket.list.js +50 -0
- package/esm/commands/flow-type/flow-type.delete-request.d.ts +1 -1
- package/esm/commands/flow-type/flow-type.delete-request.d.ts.map +1 -1
- package/esm/commands/flow-type/flow-type.delete-request.js +1 -1
- package/esm/commands/index.d.ts +3 -1
- package/esm/commands/index.d.ts.map +1 -1
- package/esm/commands/index.js +4 -2
- package/esm/commands/secret/secret.create.d.ts +1 -1
- package/esm/commands/secret/secret.create.d.ts.map +1 -1
- package/esm/commands/secret/secret.create.js +1 -1
- package/esm/commands/secret/secret.delete.d.ts +1 -1
- package/esm/commands/secret/secret.delete.d.ts.map +1 -1
- package/esm/commands/secret/secret.delete.js +1 -1
- package/esm/commands/secret/secret.list.d.ts +1 -1
- package/esm/commands/secret/secret.list.d.ts.map +1 -1
- package/esm/commands/secret/secret.list.js +1 -1
- package/esm/commands/tenant/tenant.list.d.ts +1 -1
- package/esm/commands/tenant/tenant.list.d.ts.map +1 -1
- package/esm/commands/tenant/tenant.list.js +1 -1
- package/esm/commands/variable/variable.create.d.ts +1 -1
- package/esm/commands/variable/variable.create.d.ts.map +1 -1
- package/esm/commands/variable/variable.create.js +1 -1
- package/esm/commands/variable/variable.delete.d.ts +1 -1
- package/esm/commands/variable/variable.delete.d.ts.map +1 -1
- package/esm/commands/variable/variable.delete.js +1 -1
- package/esm/commands/variable/variable.list.d.ts +1 -1
- package/esm/commands/variable/variable.list.d.ts.map +1 -1
- package/esm/commands/variable/variable.list.js +1 -1
- package/esm/common/command-custom.d.ts +36 -0
- package/esm/common/command-custom.d.ts.map +1 -0
- package/esm/common/command-custom.js +28 -0
- package/esm/common/command-graphql.d.ts +19 -0
- package/esm/common/command-graphql.d.ts.map +1 -0
- package/esm/common/command-graphql.js +30 -0
- package/esm/common/command.d.ts +1 -17
- package/esm/common/command.d.ts.map +1 -1
- package/esm/common/command.js +0 -29
- package/esm/common/flowcore-client.d.ts.map +1 -1
- package/esm/common/flowcore-client.js +5 -2
- package/esm/common/notification-client.d.ts.map +1 -1
- package/esm/common/notification-client.js +4 -1
- package/esm/contracts/data-core.d.ts +2 -24
- package/esm/contracts/data-core.d.ts.map +1 -1
- package/esm/contracts/data-core.js +1 -29
- package/esm/contracts/event-type.d.ts +1 -19
- package/esm/contracts/event-type.d.ts.map +1 -1
- package/esm/contracts/event-type.js +1 -26
- package/esm/contracts/flow-type.d.ts +1 -18
- package/esm/contracts/flow-type.d.ts.map +1 -1
- package/esm/contracts/flow-type.js +1 -23
- package/esm/exceptions/client-error.d.ts +2 -1
- package/esm/exceptions/client-error.d.ts.map +1 -1
- package/esm/exceptions/client-error.js +8 -2
- package/esm/mod.d.ts +2 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +2 -0
- package/package.json +1 -1
- package/script/commands/api-key/api-key.create.d.ts +1 -1
- package/script/commands/api-key/api-key.create.d.ts.map +1 -1
- package/script/commands/api-key/api-key.create.js +2 -2
- package/script/commands/api-key/api-key.delete.d.ts +1 -1
- package/script/commands/api-key/api-key.delete.d.ts.map +1 -1
- package/script/commands/api-key/api-key.delete.js +2 -2
- package/script/commands/api-key/api-key.list.d.ts +1 -1
- package/script/commands/api-key/api-key.list.d.ts.map +1 -1
- package/script/commands/api-key/api-key.list.js +2 -2
- package/script/commands/container-registry/container-registry.delete.d.ts +1 -1
- package/script/commands/container-registry/container-registry.delete.d.ts.map +1 -1
- package/script/commands/container-registry/container-registry.delete.js +4 -3
- package/script/commands/container-registry/container-registry.fetch.d.ts +1 -1
- package/script/commands/container-registry/container-registry.fetch.d.ts.map +1 -1
- package/script/commands/container-registry/container-registry.fetch.js +4 -3
- package/script/commands/container-registry/container-registry.list.d.ts +1 -1
- package/script/commands/container-registry/container-registry.list.d.ts.map +1 -1
- package/script/commands/container-registry/container-registry.list.js +4 -3
- package/script/commands/data-core/data-core.delete-request.d.ts +1 -1
- package/script/commands/data-core/data-core.delete-request.d.ts.map +1 -1
- package/script/commands/data-core/data-core.delete-request.js +2 -2
- package/script/commands/data-core/data-core.fetch.d.ts +22 -5
- package/script/commands/data-core/data-core.fetch.d.ts.map +1 -1
- package/script/commands/data-core/data-core.fetch.js +32 -7
- package/script/commands/event-type/event-type.delete-request.d.ts +1 -1
- package/script/commands/event-type/event-type.delete-request.d.ts.map +1 -1
- package/script/commands/event-type/event-type.delete-request.js +2 -2
- package/script/commands/event-type/event-type.info.d.ts +35 -0
- package/script/commands/event-type/event-type.info.d.ts.map +1 -0
- package/script/commands/event-type/event-type.info.js +62 -0
- package/script/commands/event-type/event-type.truncate-request.d.ts +1 -1
- package/script/commands/event-type/event-type.truncate-request.d.ts.map +1 -1
- package/script/commands/event-type/event-type.truncate-request.js +2 -2
- package/script/commands/events/event.list.d.ts +62 -0
- package/script/commands/events/event.list.d.ts.map +1 -0
- package/script/commands/events/event.list.js +57 -0
- package/script/commands/events/time-bucket.list.d.ts +49 -0
- package/script/commands/events/time-bucket.list.d.ts.map +1 -0
- package/script/commands/events/time-bucket.list.js +54 -0
- package/script/commands/flow-type/flow-type.delete-request.d.ts +1 -1
- package/script/commands/flow-type/flow-type.delete-request.d.ts.map +1 -1
- package/script/commands/flow-type/flow-type.delete-request.js +2 -2
- package/script/commands/index.d.ts +3 -1
- package/script/commands/index.d.ts.map +1 -1
- package/script/commands/index.js +4 -2
- package/script/commands/secret/secret.create.d.ts +1 -1
- package/script/commands/secret/secret.create.d.ts.map +1 -1
- package/script/commands/secret/secret.create.js +2 -2
- package/script/commands/secret/secret.delete.d.ts +1 -1
- package/script/commands/secret/secret.delete.d.ts.map +1 -1
- package/script/commands/secret/secret.delete.js +2 -2
- package/script/commands/secret/secret.list.d.ts +1 -1
- package/script/commands/secret/secret.list.d.ts.map +1 -1
- package/script/commands/secret/secret.list.js +2 -2
- package/script/commands/tenant/tenant.list.d.ts +1 -1
- package/script/commands/tenant/tenant.list.d.ts.map +1 -1
- package/script/commands/tenant/tenant.list.js +2 -2
- package/script/commands/variable/variable.create.d.ts +1 -1
- package/script/commands/variable/variable.create.d.ts.map +1 -1
- package/script/commands/variable/variable.create.js +2 -2
- package/script/commands/variable/variable.delete.d.ts +1 -1
- package/script/commands/variable/variable.delete.d.ts.map +1 -1
- package/script/commands/variable/variable.delete.js +2 -2
- package/script/commands/variable/variable.list.d.ts +1 -1
- package/script/commands/variable/variable.list.d.ts.map +1 -1
- package/script/commands/variable/variable.list.js +2 -2
- package/script/common/command-custom.d.ts +36 -0
- package/script/common/command-custom.d.ts.map +1 -0
- package/script/common/command-custom.js +32 -0
- package/script/common/command-graphql.d.ts +19 -0
- package/script/common/command-graphql.d.ts.map +1 -0
- package/script/common/command-graphql.js +34 -0
- package/script/common/command.d.ts +1 -17
- package/script/common/command.d.ts.map +1 -1
- package/script/common/command.js +1 -31
- package/script/common/flowcore-client.d.ts.map +1 -1
- package/script/common/flowcore-client.js +5 -2
- package/script/common/notification-client.d.ts.map +1 -1
- package/script/common/notification-client.js +8 -5
- package/script/contracts/data-core.d.ts +2 -24
- package/script/contracts/data-core.d.ts.map +1 -1
- package/script/contracts/data-core.js +2 -31
- package/script/contracts/event-type.d.ts +1 -19
- package/script/contracts/event-type.d.ts.map +1 -1
- package/script/contracts/event-type.js +1 -27
- package/script/contracts/flow-type.d.ts +1 -18
- package/script/contracts/flow-type.d.ts.map +1 -1
- package/script/contracts/flow-type.js +1 -24
- package/script/exceptions/client-error.d.ts +2 -1
- package/script/exceptions/client-error.d.ts.map +1 -1
- package/script/exceptions/client-error.js +8 -2
- package/script/mod.d.ts +2 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +2 -0
- package/esm/commands/events/events.fetch-first-and-last-time-buckets.d.ts +0 -45
- package/esm/commands/events/events.fetch-first-and-last-time-buckets.d.ts.map +0 -1
- package/esm/commands/events/events.fetch-first-and-last-time-buckets.js +0 -40
- package/script/commands/events/events.fetch-first-and-last-time-buckets.d.ts +0 -45
- package/script/commands/events/events.fetch-first-and-last-time-buckets.d.ts.map +0 -1
- package/script/commands/events/events.fetch-first-and-last-time-buckets.js +0 -44
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.17.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.16.0...v1.17.0) (2025-03-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add tenant to dataCore schema and remove v0 schemas ([f710f14](https://github.com/flowcore-io/flowcore-sdk/commit/f710f1427f86b7730162e05f0935829ae139534d))
|
|
9
|
+
* add tenant to dataCore schema and remove v0 schemas ([91158d2](https://github.com/flowcore-io/flowcore-sdk/commit/91158d25cb5838072a8785051dbcc82d28a0aa26))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* add tenant arg to fetch datacore ([92b5e29](https://github.com/flowcore-io/flowcore-sdk/commit/92b5e296031d728c90b1f965033ee090bd8e06f2))
|
|
15
|
+
* fix tests ([ea249d4](https://github.com/flowcore-io/flowcore-sdk/commit/ea249d4c3d1076df4f4cba521bf97316a57769aa))
|
|
16
|
+
* fix tests ([99ffaf8](https://github.com/flowcore-io/flowcore-sdk/commit/99ffaf859040d6f057c522a27f2d53d6963b1fd0))
|
|
17
|
+
|
|
18
|
+
## [1.16.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.15.0...v1.16.0) (2025-03-06)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add custom command and bucket/event list commands ([ec37bc7](https://github.com/flowcore-io/flowcore-sdk/commit/ec37bc7125f85c03f3a5f3357d59e6fe11f145ae))
|
|
24
|
+
* add custom command and bucket/event list commands ([081c338](https://github.com/flowcore-io/flowcore-sdk/commit/081c3381db0a0b5d513fc9cc6fefce02fe071921))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **container-registry:** :bug: Update import statements for container registry commands ([802e15a](https://github.com/flowcore-io/flowcore-sdk/commit/802e15a05616b41da49032c579291940e9cd5057))
|
|
30
|
+
* fix imports ([e6cf6b9](https://github.com/flowcore-io/flowcore-sdk/commit/e6cf6b92596dbaad48938818e4d62180c508b401))
|
|
31
|
+
|
|
3
32
|
## [1.15.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.14.0...v1.15.0) (2025-03-05)
|
|
4
33
|
|
|
5
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key.create.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"api-key.create.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAIrE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAA;CACb;AA4BD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;IACpG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAC9B,WAAW,EAAE,OAAO,GACnB,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;IAiB7B;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAOrD;;OAEG;cACsB,eAAe,CACtC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GACnC,OAAO,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAevC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
3
3
|
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
4
|
import { ApiKeyListCommand } from "./api-key.list.js";
|
|
5
5
|
import { CommandError } from "../../exceptions/command-error.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"api-key.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAIhE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,QAAQ,EAAE,MAAM,CAAA;IAChB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAA;CACjB;AAyBD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACjF;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO;IAW/D;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMtD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
3
3
|
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
4
|
import { CommandError } from "../../exceptions/command-error.js";
|
|
5
5
|
const graphQlQueryById = `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key.list.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"api-key.list.d.ts","sourceRoot":"","sources":["../../../src/commands/api-key/api-key.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AA0BD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC9E;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE;IAKhE;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAMtD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
3
3
|
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
4
|
const graphQlQueryById = `
|
|
5
5
|
query FLOWCORE_SDK_API_KEY_LIST($tenantId: ID!) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
1
2
|
import { type ContainerRegistryDelete } from "../../contracts/container.js";
|
|
2
|
-
import { Command } from "../../mod.js";
|
|
3
3
|
export interface ContainerRegistryDeleteInput {
|
|
4
4
|
/** The id of the new container-registry */
|
|
5
5
|
containerId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-registry.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"container-registry.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,uBAAuB,EAAiC,MAAM,8BAA8B,CAAA;AAG1G,MAAM,WAAW,4BAA4B;IAC3C,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,4BAA4B,EAAE,uBAAuB,CAAC;cAC7F,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,uBAAuB;CAG7E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
1
2
|
import { ContainerRegistryDeleteSchema } from "../../contracts/container.js";
|
|
2
|
-
import {
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
3
4
|
export class ContainerRegistryDeleteCommand extends Command {
|
|
4
5
|
getMethod() {
|
|
5
6
|
return "DELETE";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-registry.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,8BAA8B,CAAA;AAC9F,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"container-registry.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAA2B,MAAM,8BAA8B,CAAA;AAC9F,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD,MAAM,WAAW,2BAA2B;IAC1C,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,qBAAa,6BAA8B,SAAQ,OAAO,CAAC,2BAA2B,EAAE,iBAAiB,CAAC;cACrF,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,iBAAiB;CAGvE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ContainerRegistrySchema } from "../../contracts/container.js";
|
|
2
|
-
import { Command
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
3
4
|
export class ContainerRegistryFetchCommand extends Command {
|
|
4
5
|
getMethod() {
|
|
5
6
|
return "GET";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-registry.list.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"container-registry.list.d.ts","sourceRoot":"","sources":["../../../src/commands/container-registry/container-registry.list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,qBAAqB,EAA+B,MAAM,8BAA8B,CAAA;AAGtG,MAAM,WAAW,iCAAiC;IAChD,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,0BAA2B,SAAQ,OAAO,CAAC,iCAAiC,EAAE,qBAAqB,CAAC;cAC5F,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,qBAAqB;CAG3E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
1
2
|
import { ContainerRegistryListSchema } from "../../contracts/container.js";
|
|
2
|
-
import {
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
3
4
|
export class ContainerRegistListCommand extends Command {
|
|
4
5
|
getMethod() {
|
|
5
6
|
return "GET";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-core.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"data-core.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAKhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAErE;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AA4BD;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,0BAA0B,EAAE,OAAO,CAAC;IACnG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;gBACS,KAAK,EAAE,0BAA0B;IAO7C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAW5D;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAOrD;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
3
3
|
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
4
|
import { CommandError } from "../../exceptions/command-error.js";
|
|
5
5
|
import { NotFoundException } from "../../exceptions/not-found.js";
|
|
@@ -7,17 +7,34 @@ import type { ClientError } from "../../exceptions/client-error.js";
|
|
|
7
7
|
export interface DataCoreFetchByIdInput {
|
|
8
8
|
/** The id of the data core */
|
|
9
9
|
dataCoreId: string;
|
|
10
|
-
/** The name of the data core */
|
|
11
|
-
dataCore?: never;
|
|
12
10
|
/** The tenant id */
|
|
13
11
|
tenantId?: never;
|
|
12
|
+
/** The tenant */
|
|
13
|
+
tenant?: never;
|
|
14
|
+
/** The name of the data core */
|
|
15
|
+
dataCore?: never;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
|
-
* The input for the data core fetch by name command
|
|
18
|
+
* The input for the data core fetch by name and tenant id command
|
|
17
19
|
*/
|
|
18
|
-
export interface
|
|
20
|
+
export interface DataCoreFetchByNameAndTenantIdInput {
|
|
19
21
|
/** The tenant id */
|
|
20
22
|
tenantId: string;
|
|
23
|
+
/** The tenant */
|
|
24
|
+
tenant?: never;
|
|
25
|
+
/** The name of the data core */
|
|
26
|
+
dataCore: string;
|
|
27
|
+
/** The id of the data core */
|
|
28
|
+
dataCoreId?: never;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The input for the data core fetch by name and tenant command
|
|
32
|
+
*/
|
|
33
|
+
export interface DataCoreFetchByNameAndTenantInput {
|
|
34
|
+
/** The tenant id */
|
|
35
|
+
tenantId?: never;
|
|
36
|
+
/** The tenant */
|
|
37
|
+
tenant: string;
|
|
21
38
|
/** The name of the data core */
|
|
22
39
|
dataCore: string;
|
|
23
40
|
/** The id of the data core */
|
|
@@ -26,7 +43,7 @@ export interface DataCoreFetchByNameInput {
|
|
|
26
43
|
/**
|
|
27
44
|
* The input for the data core fetch command
|
|
28
45
|
*/
|
|
29
|
-
export type DataCoreFetchInput = DataCoreFetchByIdInput |
|
|
46
|
+
export type DataCoreFetchInput = DataCoreFetchByIdInput | DataCoreFetchByNameAndTenantIdInput | DataCoreFetchByNameAndTenantInput;
|
|
30
47
|
/**
|
|
31
48
|
* Fetch a data core
|
|
32
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-core.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,
|
|
1
|
+
{"version":3,"file":"data-core.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/data-core/data-core.fetch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,8BAA8B,CAAA;AAG5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,iBAAiB;IACjB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,gCAAgC;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB;IACjB,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,oBAAoB;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAA;CACnB;AAgBD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,mCAAmC,GACnC,iCAAiC,CAAA;AAErC;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC7E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAepC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;IAgBhE;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;CAY/D"}
|
|
@@ -3,6 +3,15 @@ import { Command } from "../../common/command.js";
|
|
|
3
3
|
import { DataCoreSchema } from "../../contracts/data-core.js";
|
|
4
4
|
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
5
5
|
import { NotFoundException } from "../../exceptions/not-found.js";
|
|
6
|
+
function isDataCoreFetchByIdInput(input) {
|
|
7
|
+
return "dataCoreId" in input;
|
|
8
|
+
}
|
|
9
|
+
function isDataCoreFetchByNameAndTenantIdInput(input) {
|
|
10
|
+
return "tenantId" in input;
|
|
11
|
+
}
|
|
12
|
+
function isDataCoreFetchByNameAndTenantInput(input) {
|
|
13
|
+
return "tenant" in input;
|
|
14
|
+
}
|
|
6
15
|
/**
|
|
7
16
|
* Fetch a data core
|
|
8
17
|
*/
|
|
@@ -23,11 +32,16 @@ export class DataCoreFetchCommand extends Command {
|
|
|
23
32
|
* Get the path
|
|
24
33
|
*/
|
|
25
34
|
getPath() {
|
|
26
|
-
if (
|
|
35
|
+
if (isDataCoreFetchByIdInput(this.input)) {
|
|
27
36
|
return `/api/v1/data-cores/${this.input.dataCoreId}`;
|
|
28
37
|
}
|
|
29
38
|
const queryParams = new URLSearchParams();
|
|
30
|
-
|
|
39
|
+
if (isDataCoreFetchByNameAndTenantIdInput(this.input)) {
|
|
40
|
+
queryParams.set("tenantId", this.input.tenantId);
|
|
41
|
+
}
|
|
42
|
+
if (isDataCoreFetchByNameAndTenantInput(this.input)) {
|
|
43
|
+
queryParams.set("tenant", this.input.tenant);
|
|
44
|
+
}
|
|
31
45
|
queryParams.set("name", this.input.dataCore);
|
|
32
46
|
return `/api/v1/data-cores?${queryParams.toString()}`;
|
|
33
47
|
}
|
|
@@ -35,13 +49,18 @@ export class DataCoreFetchCommand extends Command {
|
|
|
35
49
|
* Parse the response
|
|
36
50
|
*/
|
|
37
51
|
parseResponse(rawResponse) {
|
|
38
|
-
if (
|
|
52
|
+
if (isDataCoreFetchByIdInput(this.input)) {
|
|
39
53
|
const response = parseResponseHelper(DataCoreSchema, rawResponse);
|
|
40
54
|
return response;
|
|
41
55
|
}
|
|
42
56
|
const response = parseResponseHelper(Type.Array(DataCoreSchema), rawResponse);
|
|
43
57
|
if (response.length === 0) {
|
|
44
|
-
|
|
58
|
+
if (isDataCoreFetchByNameAndTenantIdInput(this.input)) {
|
|
59
|
+
throw new NotFoundException("DataCore", { name: this.input.dataCore, tenantId: this.input.tenantId });
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
throw new NotFoundException("DataCore", { name: this.input.dataCore, tenant: this.input.tenant });
|
|
63
|
+
}
|
|
45
64
|
}
|
|
46
65
|
return response[0];
|
|
47
66
|
}
|
|
@@ -50,9 +69,15 @@ export class DataCoreFetchCommand extends Command {
|
|
|
50
69
|
*/
|
|
51
70
|
handleClientError(error) {
|
|
52
71
|
if (error.status === 404) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
72
|
+
if (isDataCoreFetchByIdInput(this.input)) {
|
|
73
|
+
throw new NotFoundException("DataCore", { id: this.input.dataCoreId });
|
|
74
|
+
}
|
|
75
|
+
else if (isDataCoreFetchByNameAndTenantIdInput(this.input)) {
|
|
76
|
+
throw new NotFoundException("DataCore", { name: this.input.dataCore, tenantId: this.input.tenantId });
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
throw new NotFoundException("DataCore", { name: this.input.dataCore, tenant: this.input.tenant });
|
|
80
|
+
}
|
|
56
81
|
}
|
|
57
82
|
throw error;
|
|
58
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"event-type.delete-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.delete-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAIhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AA+BD;;;GAGG;AACH,qBAAa,6BAA8B,SAAQ,cAAc,CAAC,2BAA2B,EAAE,OAAO,CAAC;IACrG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;gBACS,KAAK,EAAE,2BAA2B;IAO9C;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAW5D;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAQrD;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
3
3
|
import { CommandError } from "../../exceptions/command-error.js";
|
|
4
4
|
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
5
5
|
import { NotFoundException } from "../../exceptions/not-found.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CustomCommand } from "../../common/command-custom.js";
|
|
2
|
+
import type { FlowcoreClient } from "../../common/flowcore-client.js";
|
|
3
|
+
import type { FlowcoreEvent } from "../../contracts/event.js";
|
|
4
|
+
/**
|
|
5
|
+
* The input for the events fetch info command
|
|
6
|
+
*/
|
|
7
|
+
export interface EventTypeInfoInput {
|
|
8
|
+
/** the event type id or ids */
|
|
9
|
+
eventTypeId: [string, ...string[]] | string;
|
|
10
|
+
/** the limit for the number of last events to fetch (default is 5) */
|
|
11
|
+
limit?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The output for the events fetch info command
|
|
15
|
+
*/
|
|
16
|
+
export interface EventTypeInfoOutput {
|
|
17
|
+
/** the first time bucket */
|
|
18
|
+
firstTimeBucket?: string;
|
|
19
|
+
/** the last time bucket */
|
|
20
|
+
lastTimeBucket?: string;
|
|
21
|
+
/** the last events */
|
|
22
|
+
lastEvents: FlowcoreEvent[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fetch information about an event type
|
|
26
|
+
*
|
|
27
|
+
* contains the first and last time bucket and the last {limit} events
|
|
28
|
+
*/
|
|
29
|
+
export declare class EventTypeInfoCommand extends CustomCommand<EventTypeInfoInput, EventTypeInfoOutput> {
|
|
30
|
+
/**
|
|
31
|
+
* Custom execute method
|
|
32
|
+
*/
|
|
33
|
+
protected customExecute(client: FlowcoreClient): Promise<EventTypeInfoOutput>;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=event-type.info.d.ts.map
|
|
@@ -0,0 +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,+BAA+B;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,CAAA;IAC3C,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;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;CAmD7F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CustomCommand } from "../../common/command-custom.js";
|
|
2
|
+
import { EventListCommand } from "../events/event.list.js";
|
|
3
|
+
import { TimeBucketListCommand } from "../events/time-bucket.list.js";
|
|
4
|
+
/**
|
|
5
|
+
* Fetch information about an event type
|
|
6
|
+
*
|
|
7
|
+
* contains the first and last time bucket and the last {limit} events
|
|
8
|
+
*/
|
|
9
|
+
export class EventTypeInfoCommand extends CustomCommand {
|
|
10
|
+
/**
|
|
11
|
+
* Custom execute method
|
|
12
|
+
*/
|
|
13
|
+
async customExecute(client) {
|
|
14
|
+
const lastEventsLimit = this.input.limit ?? 5;
|
|
15
|
+
const firstTimeBucketCommand = new TimeBucketListCommand({
|
|
16
|
+
eventTypeId: this.input.eventTypeId,
|
|
17
|
+
order: "asc",
|
|
18
|
+
pageSize: 1,
|
|
19
|
+
});
|
|
20
|
+
const lastTimeBucketCommand = new TimeBucketListCommand({
|
|
21
|
+
eventTypeId: this.input.eventTypeId,
|
|
22
|
+
order: "desc",
|
|
23
|
+
pageSize: lastEventsLimit,
|
|
24
|
+
});
|
|
25
|
+
const [firstTimeBucketResponse, lastTimeBucketResponse] = await Promise.all([
|
|
26
|
+
client.execute(firstTimeBucketCommand),
|
|
27
|
+
client.execute(lastTimeBucketCommand),
|
|
28
|
+
]);
|
|
29
|
+
const firstTimeBucket = firstTimeBucketResponse.timeBuckets[0];
|
|
30
|
+
const lastTimeBucket = lastTimeBucketResponse.timeBuckets[0];
|
|
31
|
+
if (!firstTimeBucket || !lastTimeBucket) {
|
|
32
|
+
return {
|
|
33
|
+
firstTimeBucket: undefined,
|
|
34
|
+
lastTimeBucket: undefined,
|
|
35
|
+
lastEvents: [],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const lastEvents = [];
|
|
39
|
+
for (const timeBucket of lastTimeBucketResponse.timeBuckets) {
|
|
40
|
+
const eventListCommand = new EventListCommand({
|
|
41
|
+
eventTypeId: this.input.eventTypeId,
|
|
42
|
+
timeBucket,
|
|
43
|
+
pageSize: lastEventsLimit - lastEvents.length,
|
|
44
|
+
order: "desc",
|
|
45
|
+
});
|
|
46
|
+
const eventListResponse = await client.execute(eventListCommand);
|
|
47
|
+
lastEvents.push(...eventListResponse.events);
|
|
48
|
+
if (lastEvents.length >= lastEventsLimit) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
firstTimeBucket,
|
|
54
|
+
lastTimeBucket,
|
|
55
|
+
lastEvents,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-type.truncate-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.truncate-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"event-type.truncate-request.d.ts","sourceRoot":"","sources":["../../../src/commands/event-type/event-type.truncate-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAIhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAGrE;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IAEnB,8DAA8D;IAC9D,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AA+BD;;;GAGG;AACH,qBAAa,+BAAgC,SAAQ,cAAc,CAAC,6BAA6B,EAAE,OAAO,CAAC;IACzG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;gBACS,KAAK,EAAE,6BAA6B;IAOhD;;OAEG;cACgB,aAAa,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO;IAW5D;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAQrD;;OAEG;cACsB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;CAkBtG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Type } from "@sinclair/typebox";
|
|
2
|
-
import { GraphQlCommand } from "../../common/command.js";
|
|
2
|
+
import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
3
3
|
import { CommandError } from "../../exceptions/command-error.js";
|
|
4
4
|
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
5
5
|
import { NotFoundException } from "../../exceptions/not-found.js";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type FlowcoreEvent } from "../../contracts/event.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the events fetch indexes command
|
|
5
|
+
*/
|
|
6
|
+
export interface EventListInput {
|
|
7
|
+
/** the event type id or ids */
|
|
8
|
+
eventTypeId: [string, ...string[]] | string;
|
|
9
|
+
/** the time bucket */
|
|
10
|
+
timeBucket: string;
|
|
11
|
+
/** the paging cursor */
|
|
12
|
+
cursor?: string;
|
|
13
|
+
/** the page size (default is 10.000) */
|
|
14
|
+
pageSize?: number;
|
|
15
|
+
/** start from this event id */
|
|
16
|
+
fromEventId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* after this event id
|
|
19
|
+
*
|
|
20
|
+
* ⚠️ Not applicable if `fromEventId` is also defined
|
|
21
|
+
*/
|
|
22
|
+
afterEventId?: string;
|
|
23
|
+
/** end at this event id */
|
|
24
|
+
toEventId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* the order (default is asc)
|
|
27
|
+
*
|
|
28
|
+
* ⚠️ When using `desc` order, pagination and filters are not possible.
|
|
29
|
+
*/
|
|
30
|
+
order?: "asc" | "desc";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The output for the events fetch indexes command
|
|
34
|
+
*/
|
|
35
|
+
export interface EventListOutput {
|
|
36
|
+
/** the events */
|
|
37
|
+
events: FlowcoreEvent[];
|
|
38
|
+
/** the next page cursor */
|
|
39
|
+
nextCursor?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Fetch time buckets for an event type
|
|
43
|
+
*/
|
|
44
|
+
export declare class EventListCommand extends Command<EventListInput, EventListOutput> {
|
|
45
|
+
/**
|
|
46
|
+
* Get the method for the request
|
|
47
|
+
*/
|
|
48
|
+
protected getMethod(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Get the base url for the request
|
|
51
|
+
*/
|
|
52
|
+
protected getBaseUrl(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Get the path for the request
|
|
55
|
+
*/
|
|
56
|
+
protected getPath(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Parse the response
|
|
59
|
+
*/
|
|
60
|
+
protected parseResponse(rawResponse: unknown): EventListOutput;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=event.list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.list.d.ts","sourceRoot":"","sources":["../../../src/commands/events/event.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,0BAA0B,CAAA;AAElF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,GAAG,MAAM,CAAA;IAC3C,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iBAAiB;IACjB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAUD;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,cAAc,EAAE,eAAe,CAAC;IAC5E;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAgBpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,eAAe;CAIxE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
import { FlowcoreEventSchema } from "../../contracts/event.js";
|
|
5
|
+
/**
|
|
6
|
+
* The response schema for the events fetch command
|
|
7
|
+
*/
|
|
8
|
+
const responseSchema = Type.Object({
|
|
9
|
+
events: Type.Array(FlowcoreEventSchema),
|
|
10
|
+
nextCursor: Type.Optional(Type.String()),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Fetch time buckets for an event type
|
|
14
|
+
*/
|
|
15
|
+
export class EventListCommand extends Command {
|
|
16
|
+
/**
|
|
17
|
+
* Get the method for the request
|
|
18
|
+
*/
|
|
19
|
+
getMethod() {
|
|
20
|
+
return "GET";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the base url for the request
|
|
24
|
+
*/
|
|
25
|
+
getBaseUrl() {
|
|
26
|
+
return "https://event-source.api.flowcore.io";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the path for the request
|
|
30
|
+
*/
|
|
31
|
+
getPath() {
|
|
32
|
+
const query = new URLSearchParams();
|
|
33
|
+
const eventTypeIds = Array.isArray(this.input.eventTypeId) ? this.input.eventTypeId : [this.input.eventTypeId];
|
|
34
|
+
for (const eventTypeId of eventTypeIds) {
|
|
35
|
+
query.append("eventTypeId", eventTypeId);
|
|
36
|
+
}
|
|
37
|
+
query.set("timeBucket", this.input.timeBucket);
|
|
38
|
+
this.input.cursor && query.set("cursor", this.input.cursor.toString());
|
|
39
|
+
this.input.pageSize && query.set("pageSize", this.input.pageSize.toString());
|
|
40
|
+
this.input.fromEventId && query.set("fromEventId", this.input.fromEventId);
|
|
41
|
+
this.input.afterEventId && query.set("afterEventId", this.input.afterEventId);
|
|
42
|
+
this.input.toEventId && query.set("toEventId", this.input.toEventId);
|
|
43
|
+
this.input.order && query.set("order", this.input.order);
|
|
44
|
+
return `/api/v1/events?${query.toString()}`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse the response
|
|
48
|
+
*/
|
|
49
|
+
parseResponse(rawResponse) {
|
|
50
|
+
const response = parseResponseHelper(responseSchema, rawResponse);
|
|
51
|
+
return response;
|
|
52
|
+
}
|
|
53
|
+
}
|