@flowcore/sdk 1.47.0 → 1.48.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 +19 -0
- package/README.md +114 -0
- package/esm/commands/event-type/event-type.info.d.ts.map +1 -1
- package/esm/commands/event-type/event-type.info.js +2 -1
- package/esm/commands/index.d.ts +5 -0
- package/esm/commands/index.d.ts.map +1 -1
- package/esm/commands/index.js +6 -0
- package/esm/commands/scenario/scenario.create.d.ts +41 -0
- package/esm/commands/scenario/scenario.create.d.ts.map +1 -0
- package/esm/commands/scenario/scenario.create.js +44 -0
- package/esm/commands/scenario/scenario.delete.d.ts +37 -0
- package/esm/commands/scenario/scenario.delete.d.ts.map +1 -0
- package/esm/commands/scenario/scenario.delete.js +47 -0
- package/esm/commands/scenario/scenario.fetch.d.ts +35 -0
- package/esm/commands/scenario/scenario.fetch.d.ts.map +1 -0
- package/esm/commands/scenario/scenario.fetch.js +44 -0
- package/esm/commands/scenario/scenario.list.d.ts +44 -0
- package/esm/commands/scenario/scenario.list.d.ts.map +1 -0
- package/esm/commands/scenario/scenario.list.js +49 -0
- package/esm/commands/scenario/scenario.update.d.ts +41 -0
- package/esm/commands/scenario/scenario.update.d.ts.map +1 -0
- package/esm/commands/scenario/scenario.update.js +44 -0
- package/esm/contracts/scenario.d.ts +18 -0
- package/esm/contracts/scenario.d.ts.map +1 -0
- package/esm/contracts/scenario.js +20 -0
- package/package.json +1 -1
- package/script/commands/event-type/event-type.info.d.ts.map +1 -1
- package/script/commands/event-type/event-type.info.js +2 -1
- package/script/commands/index.d.ts +5 -0
- package/script/commands/index.d.ts.map +1 -1
- package/script/commands/index.js +6 -0
- package/script/commands/scenario/scenario.create.d.ts +41 -0
- package/script/commands/scenario/scenario.create.d.ts.map +1 -0
- package/script/commands/scenario/scenario.create.js +48 -0
- package/script/commands/scenario/scenario.delete.d.ts +37 -0
- package/script/commands/scenario/scenario.delete.d.ts.map +1 -0
- package/script/commands/scenario/scenario.delete.js +51 -0
- package/script/commands/scenario/scenario.fetch.d.ts +35 -0
- package/script/commands/scenario/scenario.fetch.d.ts.map +1 -0
- package/script/commands/scenario/scenario.fetch.js +48 -0
- package/script/commands/scenario/scenario.list.d.ts +44 -0
- package/script/commands/scenario/scenario.list.d.ts.map +1 -0
- package/script/commands/scenario/scenario.list.js +53 -0
- package/script/commands/scenario/scenario.update.d.ts +41 -0
- package/script/commands/scenario/scenario.update.d.ts.map +1 -0
- package/script/commands/scenario/scenario.update.js +48 -0
- package/script/contracts/scenario.d.ts +18 -0
- package/script/contracts/scenario.d.ts.map +1 -0
- package/script/contracts/scenario.js +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.48.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.47.1...v1.48.0) (2025-05-14)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **scenario:** :tada: add create and list scenario commands with schema ([3b6433e](https://github.com/flowcore-io/flowcore-sdk/commit/3b6433ebb7b85caffc8eae8d99d60a4adc1b96a1))
|
|
9
|
+
* **scenario:** :tada: add delete and update scenario commands with schemas ([452a88c](https://github.com/flowcore-io/flowcore-sdk/commit/452a88c96cb71069580bbee23dd1f472b69a6439))
|
|
10
|
+
* **scenario:** :tada: add fetch scenario command with input and output interfaces ([84a2bba](https://github.com/flowcore-io/flowcore-sdk/commit/84a2bba15dc2ee446c003e2454db928d452afbc5))
|
|
11
|
+
* **scenario:** :tada: add scenario commands for create, fetch, list, and update ([034d1dd](https://github.com/flowcore-io/flowcore-sdk/commit/034d1ddd6e04f5071b76e932120c7ba24f3c00ba))
|
|
12
|
+
|
|
13
|
+
## [1.47.1](https://github.com/flowcore-io/flowcore-sdk/compare/v1.47.0...v1.47.1) (2025-05-07)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* **deno.lock:** :sparkles: update Deno version to 5 and add latest sdk-oidc-client ([e9e97d4](https://github.com/flowcore-io/flowcore-sdk/commit/e9e97d43d8520ea5f4168613df15daade6bc2d0b))
|
|
19
|
+
* **event-type:** :art: improve formatting of minimum last event limit calculation ([f1d95fa](https://github.com/flowcore-io/flowcore-sdk/commit/f1d95fa77d4a7624121f6ace79902f7246d99993))
|
|
20
|
+
* **event-type:** :bug: adjust minimum last event limit calculation ([5b46856](https://github.com/flowcore-io/flowcore-sdk/commit/5b46856b6f7ae5104f219ee95bd5c0f97a17e6ec))
|
|
21
|
+
|
|
3
22
|
## [1.47.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.46.1...v1.47.0) (2025-05-07)
|
|
4
23
|
|
|
5
24
|
|
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ This is the Flowcore SDK, a TypeScript library for interacting with the Flowcore
|
|
|
15
15
|
- [Data Core Operations](#data-core-operations)
|
|
16
16
|
- [Flow Type Operations](#flow-type-operations)
|
|
17
17
|
- [Event Type Operations](#event-type-operations)
|
|
18
|
+
- [Scenario Operations](#scenario-operations)
|
|
18
19
|
- [Notifications](#notifications)
|
|
19
20
|
|
|
20
21
|
## Installation
|
|
@@ -655,6 +656,119 @@ const result = await client.execute(command)
|
|
|
655
656
|
> **Note**: If `waitForDelete` or `waitForTruncate` is set to `true`, the command will wait up to 25 seconds for the operation to complete.
|
|
656
657
|
> **Important**: Event Type deletion and truncation operations require bearer token authentication.
|
|
657
658
|
|
|
659
|
+
#### Remove Sensitive Data from an Event Type
|
|
660
|
+
|
|
661
|
+
```typescript
|
|
662
|
+
import { EventTypeRemoveSensitiveDataCommand, FlowcoreClient } from "@flowcore/sdk"
|
|
663
|
+
|
|
664
|
+
const command = new EventTypeRemoveSensitiveDataCommand({
|
|
665
|
+
eventTypeId: "your-event-type-id",
|
|
666
|
+
application: "my-application-name",
|
|
667
|
+
parentKey: "user",
|
|
668
|
+
key: "email",
|
|
669
|
+
type: "scramble" // or "remove"
|
|
670
|
+
})
|
|
671
|
+
|
|
672
|
+
const result = await client.execute(command)
|
|
673
|
+
// Returns:
|
|
674
|
+
// {
|
|
675
|
+
// success: boolean; // Whether the operation was successful
|
|
676
|
+
// id: string; // ID of the sensitive data removal record
|
|
677
|
+
// }
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
> **Note**: The `type` parameter determines how sensitive data is handled. Use `scramble` to replace the data with a masked version, or `remove` to completely delete it.
|
|
681
|
+
> **Important**: Sensitive data removal operations require bearer token authentication.
|
|
682
|
+
> **WARNING**: This operation is NON-REVERSIBLE. Once sensitive data has been removed or scrambled, it cannot be recovered. Make sure you have backups before proceeding, as this action permanently alters your data.
|
|
683
|
+
|
|
684
|
+
### Scenario Operations
|
|
685
|
+
|
|
686
|
+
Scenario operations allow you to manage scenarios in your Flowcore tenant.
|
|
687
|
+
|
|
688
|
+
> **Important**: Scenario operations require bearer token authentication and cannot be performed using API key authentication.
|
|
689
|
+
|
|
690
|
+
#### Create a Scenario
|
|
691
|
+
|
|
692
|
+
```typescript
|
|
693
|
+
import { ScenarioCreateCommand, FlowcoreClient } from "@flowcore/sdk"
|
|
694
|
+
|
|
695
|
+
const command = new ScenarioCreateCommand({
|
|
696
|
+
tenantId: "your-tenant-id",
|
|
697
|
+
name: "my-scenario",
|
|
698
|
+
description: "A test scenario", // Optional
|
|
699
|
+
displayName: "My Test Scenario" // Optional
|
|
700
|
+
})
|
|
701
|
+
|
|
702
|
+
const result = await client.execute(command)
|
|
703
|
+
// Returns the created Scenario object:
|
|
704
|
+
// {
|
|
705
|
+
// id: string;
|
|
706
|
+
// tenantId: string;
|
|
707
|
+
// name: string;
|
|
708
|
+
// displayName?: string;
|
|
709
|
+
// description?: string;
|
|
710
|
+
// createdAt: string;
|
|
711
|
+
// updatedAt: string;
|
|
712
|
+
// }
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
#### Fetch a Scenario
|
|
716
|
+
|
|
717
|
+
```typescript
|
|
718
|
+
import { ScenarioFetchCommand, FlowcoreClient } from "@flowcore/sdk"
|
|
719
|
+
|
|
720
|
+
const command = new ScenarioFetchCommand({
|
|
721
|
+
scenarioId: "your-scenario-id"
|
|
722
|
+
})
|
|
723
|
+
|
|
724
|
+
const scenario = await client.execute(command)
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
#### List Scenarios
|
|
728
|
+
|
|
729
|
+
```typescript
|
|
730
|
+
import { ScenarioListCommand, FlowcoreClient } from "@flowcore/sdk"
|
|
731
|
+
|
|
732
|
+
const command = new ScenarioListCommand({
|
|
733
|
+
tenantId: "your-tenant-id"
|
|
734
|
+
})
|
|
735
|
+
|
|
736
|
+
const result = await client.execute(command)
|
|
737
|
+
// Returns:
|
|
738
|
+
// {
|
|
739
|
+
// id: string; // The tenant ID
|
|
740
|
+
// scenarios: Scenario[]; // Array of scenario objects
|
|
741
|
+
// }
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
#### Update a Scenario
|
|
745
|
+
|
|
746
|
+
```typescript
|
|
747
|
+
import { ScenarioUpdateCommand, FlowcoreClient } from "@flowcore/sdk"
|
|
748
|
+
|
|
749
|
+
const command = new ScenarioUpdateCommand({
|
|
750
|
+
tenantId: "your-tenant-id",
|
|
751
|
+
scenarioId: "your-scenario-id",
|
|
752
|
+
description: "Updated description", // Optional
|
|
753
|
+
displayName: "Updated Display Name" // Optional
|
|
754
|
+
})
|
|
755
|
+
|
|
756
|
+
const updatedScenario = await client.execute(command)
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
#### Delete a Scenario
|
|
760
|
+
|
|
761
|
+
```typescript
|
|
762
|
+
import { ScenarioDeleteCommand, FlowcoreClient } from "@flowcore/sdk"
|
|
763
|
+
|
|
764
|
+
const command = new ScenarioDeleteCommand({
|
|
765
|
+
scenarioId: "your-scenario-id"
|
|
766
|
+
})
|
|
767
|
+
|
|
768
|
+
const result = await client.execute(command)
|
|
769
|
+
// Returns: { success: boolean }
|
|
770
|
+
```
|
|
771
|
+
|
|
658
772
|
### Event Ingestion Operations
|
|
659
773
|
|
|
660
774
|
The SDK provides commands for ingesting events into Flowcore event types.
|
|
@@ -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;
|
|
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"}
|
|
@@ -38,13 +38,14 @@ 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
43
|
let cursor = undefined;
|
|
43
44
|
do {
|
|
44
45
|
const eventListResponse = await client.execute(new EventListCommand({
|
|
45
46
|
eventTypeId: this.input.eventTypeId,
|
|
46
47
|
timeBucket,
|
|
47
|
-
pageSize:
|
|
48
|
+
pageSize: minLastEventLimit - lastEvents.length,
|
|
48
49
|
order: "desc",
|
|
49
50
|
tenant: this.input.tenant,
|
|
50
51
|
...(cursor && { cursor }),
|
package/esm/commands/index.d.ts
CHANGED
|
@@ -58,4 +58,9 @@ export * from "./security/pat.exchange.js";
|
|
|
58
58
|
export * from "./security/pat.get.js";
|
|
59
59
|
export * from "./security/pat.list.js";
|
|
60
60
|
export * from "./security/permissions.list.js";
|
|
61
|
+
export * from "./scenario/scenario.create.js";
|
|
62
|
+
export * from "./scenario/scenario.delete.js";
|
|
63
|
+
export * from "./scenario/scenario.fetch.js";
|
|
64
|
+
export * from "./scenario/scenario.list.js";
|
|
65
|
+
export * from "./scenario/scenario.update.js";
|
|
61
66
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,2CAA2C,CAAA;AACzD,cAAc,0CAA0C,CAAA;AACxD,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yCAAyC,CAAA;AAGvD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AAGzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AAGvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAG3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAG/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAG/C,cAAc,mCAAmC,CAAA;AACjD,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wDAAwD,CAAA;AACtE,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kDAAkD,CAAA;AAChE,cAAc,2CAA2C,CAAA;AACzD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,mCAAmC,CAAA;AAGjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAG3C,cAAc,0CAA0C,CAAA;AACxD,cAAc,0CAA0C,CAAA;AACxD,cAAc,wCAAwC,CAAA;AACtD,cAAc,oBAAoB,CAAA;AAClC,cAAc,uCAAuC,CAAA;AACrD,cAAc,uCAAuC,CAAA;AACrD,cAAc,qCAAqC,CAAA;AAGnD,cAAc,wBAAwB,CAAA;AACtC,cAAc,gDAAgD,CAAA;AAC9D,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAG5C,cAAc,mDAAmD,CAAA;AACjE,cAAc,mDAAmD,CAAA;AACjE,cAAc,kDAAkD,CAAA;AAChE,cAAc,iDAAiD,CAAA;AAC/D,cAAc,mDAAmD,CAAA;AAGjE,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,2CAA2C,CAAA;AACzD,cAAc,0CAA0C,CAAA;AACxD,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yCAAyC,CAAA;AAGvD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AAGzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AAGvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAG3C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAG/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yCAAyC,CAAA;AACvD,cAAc,iCAAiC,CAAA;AAG/C,cAAc,mCAAmC,CAAA;AACjD,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wDAAwD,CAAA;AACtE,cAAc,iCAAiC,CAAA;AAC/C,cAAc,kDAAkD,CAAA;AAChE,cAAc,2CAA2C,CAAA;AACzD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,mCAAmC,CAAA;AAGjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAG3C,cAAc,0CAA0C,CAAA;AACxD,cAAc,0CAA0C,CAAA;AACxD,cAAc,wCAAwC,CAAA;AACtD,cAAc,oBAAoB,CAAA;AAClC,cAAc,uCAAuC,CAAA;AACrD,cAAc,uCAAuC,CAAA;AACrD,cAAc,qCAAqC,CAAA;AAGnD,cAAc,wBAAwB,CAAA;AACtC,cAAc,gDAAgD,CAAA;AAC9D,cAAc,0BAA0B,CAAA;AACxC,cAAc,8BAA8B,CAAA;AAG5C,cAAc,mDAAmD,CAAA;AACjE,cAAc,mDAAmD,CAAA;AACjE,cAAc,kDAAkD,CAAA;AAChE,cAAc,iDAAiD,CAAA;AAC/D,cAAc,mDAAmD,CAAA;AAGjE,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAG9C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,+BAA+B,CAAA"}
|
package/esm/commands/index.js
CHANGED
|
@@ -70,3 +70,9 @@ export * from "./security/pat.exchange.js";
|
|
|
70
70
|
export * from "./security/pat.get.js";
|
|
71
71
|
export * from "./security/pat.list.js";
|
|
72
72
|
export * from "./security/permissions.list.js";
|
|
73
|
+
// Scenario
|
|
74
|
+
export * from "./scenario/scenario.create.js";
|
|
75
|
+
export * from "./scenario/scenario.delete.js";
|
|
76
|
+
export * from "./scenario/scenario.fetch.js";
|
|
77
|
+
export * from "./scenario/scenario.list.js";
|
|
78
|
+
export * from "./scenario/scenario.update.js";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type Scenario } from "../../contracts/scenario.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the scenario create command
|
|
5
|
+
*/
|
|
6
|
+
export interface ScenarioCreateInput {
|
|
7
|
+
/** The tenant id */
|
|
8
|
+
tenantId: string;
|
|
9
|
+
/** The name of the scenario */
|
|
10
|
+
name: string;
|
|
11
|
+
/** The description of the scenario */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** The display name of the scenario */
|
|
14
|
+
displayName?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a scenario
|
|
18
|
+
*/
|
|
19
|
+
export declare class ScenarioCreateCommand extends Command<ScenarioCreateInput, Scenario> {
|
|
20
|
+
/**
|
|
21
|
+
* Whether the command should retry on failure
|
|
22
|
+
*/
|
|
23
|
+
protected retryOnFailure: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Get the method
|
|
26
|
+
*/
|
|
27
|
+
protected getMethod(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the base url
|
|
30
|
+
*/
|
|
31
|
+
protected getBaseUrl(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the path
|
|
34
|
+
*/
|
|
35
|
+
protected getPath(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
protected parseResponse(rawResponse: unknown): Scenario;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=scenario.create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.create.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,6BAA6B,CAAA;AAG3E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/E;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { ScenarioSchema } from "../../contracts/scenario.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
/**
|
|
5
|
+
* Create a scenario
|
|
6
|
+
*/
|
|
7
|
+
export class ScenarioCreateCommand extends Command {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
/**
|
|
11
|
+
* Whether the command should retry on failure
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(this, "retryOnFailure", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: false
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
getMethod() {
|
|
24
|
+
return "POST";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the base url
|
|
28
|
+
*/
|
|
29
|
+
getBaseUrl() {
|
|
30
|
+
return "https://scenario-2.api.flowcore.io";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the path
|
|
34
|
+
*/
|
|
35
|
+
getPath() {
|
|
36
|
+
return `/api/v1/scenarios`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse the response
|
|
40
|
+
*/
|
|
41
|
+
parseResponse(rawResponse) {
|
|
42
|
+
return parseResponseHelper(ScenarioSchema, rawResponse);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the scenario delete command
|
|
4
|
+
*/
|
|
5
|
+
export interface ScenarioDeleteInput {
|
|
6
|
+
/** The scenario id */
|
|
7
|
+
scenarioId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ScenarioDeleteOutput {
|
|
10
|
+
success: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Delete a scenario
|
|
14
|
+
*/
|
|
15
|
+
export declare class ScenarioDeleteCommand extends Command<ScenarioDeleteInput, ScenarioDeleteOutput> {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the command should retry on failure
|
|
18
|
+
*/
|
|
19
|
+
protected retryOnFailure: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
protected getMethod(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the base url
|
|
26
|
+
*/
|
|
27
|
+
protected getBaseUrl(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the path
|
|
30
|
+
*/
|
|
31
|
+
protected getPath(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Parse the response
|
|
34
|
+
*/
|
|
35
|
+
protected parseResponse(rawResponse: unknown): ScenarioDeleteOutput;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=scenario.delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAA;CACjB;AAMD;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;IAC3F;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,oBAAoB;CAG7E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
const ScenarioDeleteOutputSchema = Type.Object({
|
|
5
|
+
success: Type.Boolean(),
|
|
6
|
+
});
|
|
7
|
+
/**
|
|
8
|
+
* Delete a scenario
|
|
9
|
+
*/
|
|
10
|
+
export class ScenarioDeleteCommand extends Command {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* Whether the command should retry on failure
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(this, "retryOnFailure", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: false
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get the method
|
|
25
|
+
*/
|
|
26
|
+
getMethod() {
|
|
27
|
+
return "DELETE";
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the base url
|
|
31
|
+
*/
|
|
32
|
+
getBaseUrl() {
|
|
33
|
+
return "https://scenario-2.api.flowcore.io";
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get the path
|
|
37
|
+
*/
|
|
38
|
+
getPath() {
|
|
39
|
+
return `/api/v1/scenarios/${this.input.scenarioId}`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parse the response
|
|
43
|
+
*/
|
|
44
|
+
parseResponse(rawResponse) {
|
|
45
|
+
return parseResponseHelper(ScenarioDeleteOutputSchema, rawResponse);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type Scenario } from "../../contracts/scenario.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the scenario fetch command
|
|
5
|
+
*/
|
|
6
|
+
export interface ScenarioFetchInput {
|
|
7
|
+
/** The scenario id */
|
|
8
|
+
scenarioId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* fetch a scenario
|
|
12
|
+
*/
|
|
13
|
+
export declare class ScenarioFetchCommand extends Command<ScenarioFetchInput, Scenario> {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the command should retry on failure
|
|
16
|
+
*/
|
|
17
|
+
protected retryOnFailure: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Get the method
|
|
20
|
+
*/
|
|
21
|
+
protected getMethod(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the base url
|
|
24
|
+
*/
|
|
25
|
+
protected getBaseUrl(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get the path
|
|
28
|
+
*/
|
|
29
|
+
protected getPath(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Parse the response
|
|
32
|
+
*/
|
|
33
|
+
protected parseResponse(rawResponse: unknown): Scenario;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=scenario.fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.fetch.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,6BAA6B,CAAA;AAG3E;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC7E;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { ScenarioSchema } from "../../contracts/scenario.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
/**
|
|
5
|
+
* fetch a scenario
|
|
6
|
+
*/
|
|
7
|
+
export class ScenarioFetchCommand extends Command {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
/**
|
|
11
|
+
* Whether the command should retry on failure
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(this, "retryOnFailure", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: false
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
getMethod() {
|
|
24
|
+
return "GET";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the base url
|
|
28
|
+
*/
|
|
29
|
+
getBaseUrl() {
|
|
30
|
+
return "https://scenario-2.api.flowcore.io";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the path
|
|
34
|
+
*/
|
|
35
|
+
getPath() {
|
|
36
|
+
return `/api/v1/scenarios/${this.input.scenarioId}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse the response
|
|
40
|
+
*/
|
|
41
|
+
parseResponse(rawResponse) {
|
|
42
|
+
return parseResponseHelper(ScenarioSchema, rawResponse);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type Scenario } from "../../contracts/scenario.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the scenario create command
|
|
5
|
+
*/
|
|
6
|
+
export interface ScenarioListInput {
|
|
7
|
+
/** The tenant id */
|
|
8
|
+
tenantId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The output for the scenario list command
|
|
12
|
+
*/
|
|
13
|
+
export interface ScenarioListOutput {
|
|
14
|
+
/** The tenant id */
|
|
15
|
+
id: string;
|
|
16
|
+
/** the scenarios in that tenant */
|
|
17
|
+
scenarios: Scenario[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* list all scenarios
|
|
21
|
+
*/
|
|
22
|
+
export declare class ScenarioListCommand extends Command<ScenarioListInput, ScenarioListOutput> {
|
|
23
|
+
/**
|
|
24
|
+
* Whether the command should retry on failure
|
|
25
|
+
*/
|
|
26
|
+
protected retryOnFailure: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get the method
|
|
29
|
+
*/
|
|
30
|
+
protected getMethod(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the base url
|
|
33
|
+
*/
|
|
34
|
+
protected getBaseUrl(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Get the path
|
|
37
|
+
*/
|
|
38
|
+
protected getPath(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Parse the response
|
|
41
|
+
*/
|
|
42
|
+
protected parseResponse(rawResponse: unknown): ScenarioListOutput;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=scenario.list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.list.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,6BAA6B,CAAA;AAG3E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,mCAAmC;IACnC,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB;AAOD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;IACrF;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,kBAAkB;CAG3E"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { ScenarioSchema } from "../../contracts/scenario.js";
|
|
4
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
5
|
+
const ScenarioListOutputSchema = Type.Object({
|
|
6
|
+
id: Type.String(),
|
|
7
|
+
scenarios: Type.Array(ScenarioSchema),
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* list all scenarios
|
|
11
|
+
*/
|
|
12
|
+
export class ScenarioListCommand extends Command {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
/**
|
|
16
|
+
* Whether the command should retry on failure
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(this, "retryOnFailure", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: false
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the method
|
|
27
|
+
*/
|
|
28
|
+
getMethod() {
|
|
29
|
+
return "GET";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get the base url
|
|
33
|
+
*/
|
|
34
|
+
getBaseUrl() {
|
|
35
|
+
return "https://scenario-2.api.flowcore.io";
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the path
|
|
39
|
+
*/
|
|
40
|
+
getPath() {
|
|
41
|
+
return `/api/v1/scenarios/tenant/${this.input.tenantId}`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parse the response
|
|
45
|
+
*/
|
|
46
|
+
parseResponse(rawResponse) {
|
|
47
|
+
return parseResponseHelper(ScenarioListOutputSchema, rawResponse);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { type Scenario } from "../../contracts/scenario.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the scenario update command
|
|
5
|
+
*/
|
|
6
|
+
export interface ScenarioUpdateInput {
|
|
7
|
+
/** The tenant id */
|
|
8
|
+
tenantId: string;
|
|
9
|
+
/** The scenario id */
|
|
10
|
+
scenarioId: string;
|
|
11
|
+
/** The description of the scenario */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** The display name of the scenario */
|
|
14
|
+
displayName?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Update a scenario
|
|
18
|
+
*/
|
|
19
|
+
export declare class ScenarioUpdateCommand extends Command<ScenarioUpdateInput, Scenario> {
|
|
20
|
+
/**
|
|
21
|
+
* Whether the command should retry on failure
|
|
22
|
+
*/
|
|
23
|
+
protected retryOnFailure: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Get the method
|
|
26
|
+
*/
|
|
27
|
+
protected getMethod(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the base url
|
|
30
|
+
*/
|
|
31
|
+
protected getBaseUrl(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the path
|
|
34
|
+
*/
|
|
35
|
+
protected getPath(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
protected parseResponse(rawResponse: unknown): Scenario;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=scenario.update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.update.d.ts","sourceRoot":"","sources":["../../../src/commands/scenario/scenario.update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,6BAA6B,CAAA;AAG3E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC;IAC/E;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,QAAQ;CAGjE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import { ScenarioSchema } from "../../contracts/scenario.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
/**
|
|
5
|
+
* Update a scenario
|
|
6
|
+
*/
|
|
7
|
+
export class ScenarioUpdateCommand extends Command {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
/**
|
|
11
|
+
* Whether the command should retry on failure
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(this, "retryOnFailure", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: false
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
getMethod() {
|
|
24
|
+
return "PATCH";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the base url
|
|
28
|
+
*/
|
|
29
|
+
getBaseUrl() {
|
|
30
|
+
return "https://scenario-2.api.flowcore.io";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the path
|
|
34
|
+
*/
|
|
35
|
+
getPath() {
|
|
36
|
+
return `/api/v1/scenarios/${this.input.scenarioId}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse the response
|
|
40
|
+
*/
|
|
41
|
+
parseResponse(rawResponse) {
|
|
42
|
+
return parseResponseHelper(ScenarioSchema, rawResponse);
|
|
43
|
+
}
|
|
44
|
+
}
|