@flowcore/sdk 1.13.0 → 1.15.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/esm/commands/events/events.fetch-first-and-last-time-buckets.d.ts +45 -0
- package/esm/commands/events/events.fetch-first-and-last-time-buckets.d.ts.map +1 -0
- package/esm/commands/events/events.fetch-first-and-last-time-buckets.js +40 -0
- package/esm/commands/index.d.ts +18 -16
- package/esm/commands/index.d.ts.map +1 -1
- package/esm/commands/index.js +18 -16
- package/esm/commands/tenant/tenant.translate-name-to-id.d.ts +44 -0
- package/esm/commands/tenant/tenant.translate-name-to-id.d.ts.map +1 -0
- package/esm/commands/tenant/tenant.translate-name-to-id.js +52 -0
- package/package.json +1 -1
- package/script/commands/events/events.fetch-first-and-last-time-buckets.d.ts +45 -0
- package/script/commands/events/events.fetch-first-and-last-time-buckets.d.ts.map +1 -0
- package/script/commands/events/events.fetch-first-and-last-time-buckets.js +44 -0
- package/script/commands/index.d.ts +18 -16
- package/script/commands/index.d.ts.map +1 -1
- package/script/commands/index.js +18 -16
- package/script/commands/tenant/tenant.translate-name-to-id.d.ts +44 -0
- package/script/commands/tenant/tenant.translate-name-to-id.d.ts.map +1 -0
- package/script/commands/tenant/tenant.translate-name-to-id.js +56 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.15.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.14.0...v1.15.0) (2025-03-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **commands:** :sparkles: Add fetch first and last timebuckets command ([f134e59](https://github.com/flowcore-io/flowcore-sdk/commit/f134e59e274740c6f460681944200082ab8fc69a))
|
|
9
|
+
|
|
10
|
+
## [1.14.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.13.0...v1.14.0) (2025-03-05)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **tenant:** :sparkles: Add tenant name to ID translation command ([7d16207](https://github.com/flowcore-io/flowcore-sdk/commit/7d1620762a5b99b9ae9cb9b25d07b9222fdd5e9f))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **tenant:** :art: Improve type definitions for tenant translate name to ID schema ([232c441](https://github.com/flowcore-io/flowcore-sdk/commit/232c4417b34b42130f093a10f0daf7657e011c32))
|
|
21
|
+
|
|
3
22
|
## [1.13.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.12.1...v1.13.0) (2025-03-05)
|
|
4
23
|
|
|
5
24
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the events fetch indexes command
|
|
4
|
+
*/
|
|
5
|
+
export interface EventsFetchFirstAndLastTimeBucketsInput {
|
|
6
|
+
/** the tenant name */
|
|
7
|
+
tenant: string;
|
|
8
|
+
/** the data core id */
|
|
9
|
+
dataCoreId: string;
|
|
10
|
+
/** the flow type name */
|
|
11
|
+
flowType: string;
|
|
12
|
+
/** the event type name */
|
|
13
|
+
eventType: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The output for the events fetch indexes command
|
|
17
|
+
*/
|
|
18
|
+
export interface EventsFetchFirstAndLastTimeBucketsOutput {
|
|
19
|
+
/** the first time bucket */
|
|
20
|
+
first?: string;
|
|
21
|
+
/** the last time bucket */
|
|
22
|
+
last?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fetch time buckets for an event type
|
|
26
|
+
*/
|
|
27
|
+
export declare class EventsFetchFirstAndLastTimeBucketsCommand extends Command<EventsFetchFirstAndLastTimeBucketsInput, EventsFetchFirstAndLastTimeBucketsOutput> {
|
|
28
|
+
/**
|
|
29
|
+
* Get the method for the request
|
|
30
|
+
*/
|
|
31
|
+
protected getMethod(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the base url for the request
|
|
34
|
+
*/
|
|
35
|
+
protected getBaseUrl(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the path for the request
|
|
38
|
+
*/
|
|
39
|
+
protected getPath(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Parse the response
|
|
42
|
+
*/
|
|
43
|
+
protected parseResponse(rawResponse: unknown): EventsFetchFirstAndLastTimeBucketsOutput;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=events.fetch-first-and-last-time-buckets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.fetch-first-and-last-time-buckets.d.ts","sourceRoot":"","sources":["../../../src/commands/events/events.fetch-first-and-last-time-buckets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,uCAAuC;IACtD,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAUD;;GAEG;AACH,qBAAa,yCAA0C,SAAQ,OAAO,CACpE,uCAAuC,EACvC,wCAAwC,CACzC;IACC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAGpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,wCAAwC;CAIjG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
3
|
+
import { Command } from "../../common/command.js";
|
|
4
|
+
/**
|
|
5
|
+
* The response schema for the events fetch time buckets by names command
|
|
6
|
+
*/
|
|
7
|
+
const responseSchema = Type.Object({
|
|
8
|
+
first: Type.Optional(Type.String()),
|
|
9
|
+
last: Type.Optional(Type.String()),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Fetch time buckets for an event type
|
|
13
|
+
*/
|
|
14
|
+
export class EventsFetchFirstAndLastTimeBucketsCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* Get the method for the request
|
|
17
|
+
*/
|
|
18
|
+
getMethod() {
|
|
19
|
+
return "GET";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the base url for the request
|
|
23
|
+
*/
|
|
24
|
+
getBaseUrl() {
|
|
25
|
+
return "https://event-source.api.flowcore.io";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the path for the request
|
|
29
|
+
*/
|
|
30
|
+
getPath() {
|
|
31
|
+
return `/api/v1/time-buckets/first-and-last/${this.input.tenant}/${this.input.dataCoreId}/${this.input.flowType}/${this.input.eventType}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parse the response
|
|
35
|
+
*/
|
|
36
|
+
parseResponse(rawResponse) {
|
|
37
|
+
const response = parseResponseHelper(responseSchema, rawResponse);
|
|
38
|
+
return response;
|
|
39
|
+
}
|
|
40
|
+
}
|
package/esm/commands/index.d.ts
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
export * from "./tenant/tenant.fetch.js";
|
|
2
2
|
export * from "./tenant/tenant.list.js";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./tenant/tenant.translate-name-to-id.js";
|
|
4
4
|
export * from "./api-key/api-key.create.js";
|
|
5
5
|
export * from "./api-key/api-key.delete.js";
|
|
6
|
-
export * from "./
|
|
6
|
+
export * from "./api-key/api-key.list.js";
|
|
7
7
|
export * from "./secret/secret.create.js";
|
|
8
8
|
export * from "./secret/secret.delete.js";
|
|
9
|
-
export * from "./
|
|
9
|
+
export * from "./secret/secret.list.js";
|
|
10
10
|
export * from "./variable/variable.create.js";
|
|
11
11
|
export * from "./variable/variable.delete.js";
|
|
12
|
+
export * from "./variable/variable.list.js";
|
|
13
|
+
export * from "./data-core/data-core.create.js";
|
|
14
|
+
export * from "./data-core/data-core.delete-request.js";
|
|
12
15
|
export * from "./data-core/data-core.exists.js";
|
|
13
16
|
export * from "./data-core/data-core.fetch.js";
|
|
14
17
|
export * from "./data-core/data-core.list.js";
|
|
15
|
-
export * from "./data-core/data-core.create.js";
|
|
16
|
-
export * from "./data-core/data-core.update.js";
|
|
17
|
-
export * from "./data-core/data-core.delete-request.js";
|
|
18
18
|
export * from "./data-core/data-core.request-delete.js";
|
|
19
|
+
export * from "./data-core/data-core.update.js";
|
|
20
|
+
export * from "./flow-type/flow-type.create.js";
|
|
21
|
+
export * from "./flow-type/flow-type.delete-request.js";
|
|
19
22
|
export * from "./flow-type/flow-type.exists.js";
|
|
20
23
|
export * from "./flow-type/flow-type.fetch.js";
|
|
21
24
|
export * from "./flow-type/flow-type.list.js";
|
|
22
|
-
export * from "./flow-type/flow-type.create.js";
|
|
23
|
-
export * from "./flow-type/flow-type.update.js";
|
|
24
|
-
export * from "./flow-type/flow-type.delete-request.js";
|
|
25
25
|
export * from "./flow-type/flow-type.request-delete.js";
|
|
26
|
+
export * from "./flow-type/flow-type.update.js";
|
|
27
|
+
export * from "./event-type/event-type.create.js";
|
|
28
|
+
export * from "./event-type/event-type.delete-request.js";
|
|
26
29
|
export * from "./event-type/event-type.exists.js";
|
|
27
30
|
export * from "./event-type/event-type.fetch.js";
|
|
28
31
|
export * from "./event-type/event-type.list.js";
|
|
29
|
-
export * from "./event-type/event-type.create.js";
|
|
30
|
-
export * from "./event-type/event-type.update.js";
|
|
31
|
-
export * from "./event-type/event-type.delete-request.js";
|
|
32
|
-
export * from "./event-type/event-type.truncate-request.js";
|
|
33
|
-
export * from "./event-type/event-type.request-truncate.js";
|
|
34
32
|
export * from "./event-type/event-type.request-delete.js";
|
|
35
|
-
export * from "./
|
|
33
|
+
export * from "./event-type/event-type.request-truncate.js";
|
|
34
|
+
export * from "./event-type/event-type.truncate-request.js";
|
|
35
|
+
export * from "./event-type/event-type.update.js";
|
|
36
36
|
export * from "./events/events.fetch-time-buckets-by-names.js";
|
|
37
|
+
export * from "./events/events.fetch-first-and-last-time-buckets.js";
|
|
38
|
+
export * from "./events/events.fetch.js";
|
|
37
39
|
export * from "./container-registry/container-registry.create.js";
|
|
40
|
+
export * from "./container-registry/container-registry.delete.js";
|
|
38
41
|
export * from "./container-registry/container-registry.fetch.js";
|
|
39
42
|
export * from "./container-registry/container-registry.list.js";
|
|
40
43
|
export * from "./container-registry/container-registry.update.js";
|
|
41
|
-
export * from "./container-registry/container-registry.delete.js";
|
|
42
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,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,yCAAyC,CAAA;AACvD,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,yCAAyC,CAAA;AACvD,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,2CAA2C,CAAA;AACzD,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,2CAA2C,CAAA;AACzD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,6CAA6C,CAAA;AAC3D,cAAc,mCAAmC,CAAA;AAGjD,cAAc,gDAAgD,CAAA;AAC9D,cAAc,sDAAsD,CAAA;AACpE,cAAc,0BAA0B,CAAA;AAGxC,cAAc,mDAAmD,CAAA;AACjE,cAAc,mDAAmD,CAAA;AACjE,cAAc,kDAAkD,CAAA;AAChE,cAAc,iDAAiD,CAAA;AAC/D,cAAc,mDAAmD,CAAA"}
|
package/esm/commands/index.js
CHANGED
|
@@ -1,50 +1,52 @@
|
|
|
1
1
|
// Tenant
|
|
2
2
|
export * from "./tenant/tenant.fetch.js";
|
|
3
3
|
export * from "./tenant/tenant.list.js";
|
|
4
|
+
export * from "./tenant/tenant.translate-name-to-id.js";
|
|
4
5
|
// Api Key
|
|
5
|
-
export * from "./api-key/api-key.list.js";
|
|
6
6
|
export * from "./api-key/api-key.create.js";
|
|
7
7
|
export * from "./api-key/api-key.delete.js";
|
|
8
|
+
export * from "./api-key/api-key.list.js";
|
|
8
9
|
// Secret
|
|
9
|
-
export * from "./secret/secret.list.js";
|
|
10
10
|
export * from "./secret/secret.create.js";
|
|
11
11
|
export * from "./secret/secret.delete.js";
|
|
12
|
+
export * from "./secret/secret.list.js";
|
|
12
13
|
// Variable
|
|
13
|
-
export * from "./variable/variable.list.js";
|
|
14
14
|
export * from "./variable/variable.create.js";
|
|
15
15
|
export * from "./variable/variable.delete.js";
|
|
16
|
+
export * from "./variable/variable.list.js";
|
|
16
17
|
// Data Core
|
|
18
|
+
export * from "./data-core/data-core.create.js";
|
|
19
|
+
export * from "./data-core/data-core.delete-request.js";
|
|
17
20
|
export * from "./data-core/data-core.exists.js";
|
|
18
21
|
export * from "./data-core/data-core.fetch.js";
|
|
19
22
|
export * from "./data-core/data-core.list.js";
|
|
20
|
-
export * from "./data-core/data-core.create.js";
|
|
21
|
-
export * from "./data-core/data-core.update.js";
|
|
22
|
-
export * from "./data-core/data-core.delete-request.js";
|
|
23
23
|
export * from "./data-core/data-core.request-delete.js";
|
|
24
|
+
export * from "./data-core/data-core.update.js";
|
|
24
25
|
// Flow Types
|
|
26
|
+
export * from "./flow-type/flow-type.create.js";
|
|
27
|
+
export * from "./flow-type/flow-type.delete-request.js";
|
|
25
28
|
export * from "./flow-type/flow-type.exists.js";
|
|
26
29
|
export * from "./flow-type/flow-type.fetch.js";
|
|
27
30
|
export * from "./flow-type/flow-type.list.js";
|
|
28
|
-
export * from "./flow-type/flow-type.create.js";
|
|
29
|
-
export * from "./flow-type/flow-type.update.js";
|
|
30
|
-
export * from "./flow-type/flow-type.delete-request.js";
|
|
31
31
|
export * from "./flow-type/flow-type.request-delete.js";
|
|
32
|
+
export * from "./flow-type/flow-type.update.js";
|
|
32
33
|
// Event Types
|
|
34
|
+
export * from "./event-type/event-type.create.js";
|
|
35
|
+
export * from "./event-type/event-type.delete-request.js";
|
|
33
36
|
export * from "./event-type/event-type.exists.js";
|
|
34
37
|
export * from "./event-type/event-type.fetch.js";
|
|
35
38
|
export * from "./event-type/event-type.list.js";
|
|
36
|
-
export * from "./event-type/event-type.create.js";
|
|
37
|
-
export * from "./event-type/event-type.update.js";
|
|
38
|
-
export * from "./event-type/event-type.delete-request.js";
|
|
39
|
-
export * from "./event-type/event-type.truncate-request.js";
|
|
40
|
-
export * from "./event-type/event-type.request-truncate.js";
|
|
41
39
|
export * from "./event-type/event-type.request-delete.js";
|
|
40
|
+
export * from "./event-type/event-type.request-truncate.js";
|
|
41
|
+
export * from "./event-type/event-type.truncate-request.js";
|
|
42
|
+
export * from "./event-type/event-type.update.js";
|
|
42
43
|
// Events
|
|
43
|
-
export * from "./events/events.fetch.js";
|
|
44
44
|
export * from "./events/events.fetch-time-buckets-by-names.js";
|
|
45
|
+
export * from "./events/events.fetch-first-and-last-time-buckets.js";
|
|
46
|
+
export * from "./events/events.fetch.js";
|
|
45
47
|
//Container
|
|
46
48
|
export * from "./container-registry/container-registry.create.js";
|
|
49
|
+
export * from "./container-registry/container-registry.delete.js";
|
|
47
50
|
export * from "./container-registry/container-registry.fetch.js";
|
|
48
51
|
export * from "./container-registry/container-registry.list.js";
|
|
49
52
|
export * from "./container-registry/container-registry.update.js";
|
|
50
|
-
export * from "./container-registry/container-registry.delete.js";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Static, type TObject, type TString } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import type { ClientError } from "../../exceptions/client-error.js";
|
|
4
|
+
/**
|
|
5
|
+
* The input for the tenant translate name to id command
|
|
6
|
+
*/
|
|
7
|
+
export interface TenantTranslateNameToIdInput {
|
|
8
|
+
/** The name of the tenant */
|
|
9
|
+
tenant: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The schema for the tenant translate name to id command
|
|
13
|
+
*/
|
|
14
|
+
export declare const TenantTranslateNameToIdSchema: TObject<{
|
|
15
|
+
id: TString;
|
|
16
|
+
name: TString;
|
|
17
|
+
}>;
|
|
18
|
+
export type TenantTranslateNameToId = Static<typeof TenantTranslateNameToIdSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Translate a tenant name to an tenant id
|
|
21
|
+
*/
|
|
22
|
+
export declare class TenantTranslateNameToIdCommand extends Command<TenantTranslateNameToIdInput, TenantTranslateNameToId> {
|
|
23
|
+
/**
|
|
24
|
+
* Get the method
|
|
25
|
+
*/
|
|
26
|
+
protected getMethod(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Get the base url
|
|
29
|
+
*/
|
|
30
|
+
protected getBaseUrl(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the path
|
|
33
|
+
*/
|
|
34
|
+
protected getPath(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Parse the response
|
|
37
|
+
*/
|
|
38
|
+
protected parseResponse(rawResponse: unknown): TenantTranslateNameToId;
|
|
39
|
+
/**
|
|
40
|
+
* Handle the client error
|
|
41
|
+
*/
|
|
42
|
+
protected handleClientError(error: ClientError): void;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=tenant.translate-name-to-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant.translate-name-to-id.d.ts","sourceRoot":"","sources":["../../../src/commands/tenant/tenant.translate-name-to-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAKnE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,OAAO,CAAC;IAClD,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;CACd,CAGC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAElF;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,4BAA4B,EAAE,uBAAuB,CAAC;IAChH;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,uBAAuB;IAK/E;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;CAQ/D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { NotFoundException } from "../../exceptions/not-found.js";
|
|
4
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
5
|
+
/**
|
|
6
|
+
* The schema for the tenant translate name to id command
|
|
7
|
+
*/
|
|
8
|
+
export const TenantTranslateNameToIdSchema = Type.Object({
|
|
9
|
+
id: Type.String(),
|
|
10
|
+
name: Type.String(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Translate a tenant name to an tenant id
|
|
14
|
+
*/
|
|
15
|
+
export class TenantTranslateNameToIdCommand extends Command {
|
|
16
|
+
/**
|
|
17
|
+
* Get the method
|
|
18
|
+
*/
|
|
19
|
+
getMethod() {
|
|
20
|
+
return "GET";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the base url
|
|
24
|
+
*/
|
|
25
|
+
getBaseUrl() {
|
|
26
|
+
return "https://tenant.api.flowcore.io";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the path
|
|
30
|
+
*/
|
|
31
|
+
getPath() {
|
|
32
|
+
return `/api/v1/tenants/translate-name-to-id/${this.input.tenant}`;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse the response
|
|
36
|
+
*/
|
|
37
|
+
parseResponse(rawResponse) {
|
|
38
|
+
const response = parseResponseHelper(TenantTranslateNameToIdSchema, rawResponse);
|
|
39
|
+
return response;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Handle the client error
|
|
43
|
+
*/
|
|
44
|
+
handleClientError(error) {
|
|
45
|
+
if (error.status === 404) {
|
|
46
|
+
throw new NotFoundException("Tenant", {
|
|
47
|
+
tenant: this.input.tenant,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
/**
|
|
3
|
+
* The input for the events fetch indexes command
|
|
4
|
+
*/
|
|
5
|
+
export interface EventsFetchFirstAndLastTimeBucketsInput {
|
|
6
|
+
/** the tenant name */
|
|
7
|
+
tenant: string;
|
|
8
|
+
/** the data core id */
|
|
9
|
+
dataCoreId: string;
|
|
10
|
+
/** the flow type name */
|
|
11
|
+
flowType: string;
|
|
12
|
+
/** the event type name */
|
|
13
|
+
eventType: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The output for the events fetch indexes command
|
|
17
|
+
*/
|
|
18
|
+
export interface EventsFetchFirstAndLastTimeBucketsOutput {
|
|
19
|
+
/** the first time bucket */
|
|
20
|
+
first?: string;
|
|
21
|
+
/** the last time bucket */
|
|
22
|
+
last?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Fetch time buckets for an event type
|
|
26
|
+
*/
|
|
27
|
+
export declare class EventsFetchFirstAndLastTimeBucketsCommand extends Command<EventsFetchFirstAndLastTimeBucketsInput, EventsFetchFirstAndLastTimeBucketsOutput> {
|
|
28
|
+
/**
|
|
29
|
+
* Get the method for the request
|
|
30
|
+
*/
|
|
31
|
+
protected getMethod(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the base url for the request
|
|
34
|
+
*/
|
|
35
|
+
protected getBaseUrl(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the path for the request
|
|
38
|
+
*/
|
|
39
|
+
protected getPath(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Parse the response
|
|
42
|
+
*/
|
|
43
|
+
protected parseResponse(rawResponse: unknown): EventsFetchFirstAndLastTimeBucketsOutput;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=events.fetch-first-and-last-time-buckets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.fetch-first-and-last-time-buckets.d.ts","sourceRoot":"","sources":["../../../src/commands/events/events.fetch-first-and-last-time-buckets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,uCAAuC;IACtD,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAUD;;GAEG;AACH,qBAAa,yCAA0C,SAAQ,OAAO,CACpE,uCAAuC,EACvC,wCAAwC,CACzC;IACC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAGvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAGpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,wCAAwC;CAIjG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventsFetchFirstAndLastTimeBucketsCommand = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
6
|
+
const command_js_1 = require("../../common/command.js");
|
|
7
|
+
/**
|
|
8
|
+
* The response schema for the events fetch time buckets by names command
|
|
9
|
+
*/
|
|
10
|
+
const responseSchema = typebox_1.Type.Object({
|
|
11
|
+
first: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
12
|
+
last: typebox_1.Type.Optional(typebox_1.Type.String()),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Fetch time buckets for an event type
|
|
16
|
+
*/
|
|
17
|
+
class EventsFetchFirstAndLastTimeBucketsCommand extends command_js_1.Command {
|
|
18
|
+
/**
|
|
19
|
+
* Get the method for the request
|
|
20
|
+
*/
|
|
21
|
+
getMethod() {
|
|
22
|
+
return "GET";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the base url for the request
|
|
26
|
+
*/
|
|
27
|
+
getBaseUrl() {
|
|
28
|
+
return "https://event-source.api.flowcore.io";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the path for the request
|
|
32
|
+
*/
|
|
33
|
+
getPath() {
|
|
34
|
+
return `/api/v1/time-buckets/first-and-last/${this.input.tenant}/${this.input.dataCoreId}/${this.input.flowType}/${this.input.eventType}`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
parseResponse(rawResponse) {
|
|
40
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, rawResponse);
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.EventsFetchFirstAndLastTimeBucketsCommand = EventsFetchFirstAndLastTimeBucketsCommand;
|
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
export * from "./tenant/tenant.fetch.js";
|
|
2
2
|
export * from "./tenant/tenant.list.js";
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./tenant/tenant.translate-name-to-id.js";
|
|
4
4
|
export * from "./api-key/api-key.create.js";
|
|
5
5
|
export * from "./api-key/api-key.delete.js";
|
|
6
|
-
export * from "./
|
|
6
|
+
export * from "./api-key/api-key.list.js";
|
|
7
7
|
export * from "./secret/secret.create.js";
|
|
8
8
|
export * from "./secret/secret.delete.js";
|
|
9
|
-
export * from "./
|
|
9
|
+
export * from "./secret/secret.list.js";
|
|
10
10
|
export * from "./variable/variable.create.js";
|
|
11
11
|
export * from "./variable/variable.delete.js";
|
|
12
|
+
export * from "./variable/variable.list.js";
|
|
13
|
+
export * from "./data-core/data-core.create.js";
|
|
14
|
+
export * from "./data-core/data-core.delete-request.js";
|
|
12
15
|
export * from "./data-core/data-core.exists.js";
|
|
13
16
|
export * from "./data-core/data-core.fetch.js";
|
|
14
17
|
export * from "./data-core/data-core.list.js";
|
|
15
|
-
export * from "./data-core/data-core.create.js";
|
|
16
|
-
export * from "./data-core/data-core.update.js";
|
|
17
|
-
export * from "./data-core/data-core.delete-request.js";
|
|
18
18
|
export * from "./data-core/data-core.request-delete.js";
|
|
19
|
+
export * from "./data-core/data-core.update.js";
|
|
20
|
+
export * from "./flow-type/flow-type.create.js";
|
|
21
|
+
export * from "./flow-type/flow-type.delete-request.js";
|
|
19
22
|
export * from "./flow-type/flow-type.exists.js";
|
|
20
23
|
export * from "./flow-type/flow-type.fetch.js";
|
|
21
24
|
export * from "./flow-type/flow-type.list.js";
|
|
22
|
-
export * from "./flow-type/flow-type.create.js";
|
|
23
|
-
export * from "./flow-type/flow-type.update.js";
|
|
24
|
-
export * from "./flow-type/flow-type.delete-request.js";
|
|
25
25
|
export * from "./flow-type/flow-type.request-delete.js";
|
|
26
|
+
export * from "./flow-type/flow-type.update.js";
|
|
27
|
+
export * from "./event-type/event-type.create.js";
|
|
28
|
+
export * from "./event-type/event-type.delete-request.js";
|
|
26
29
|
export * from "./event-type/event-type.exists.js";
|
|
27
30
|
export * from "./event-type/event-type.fetch.js";
|
|
28
31
|
export * from "./event-type/event-type.list.js";
|
|
29
|
-
export * from "./event-type/event-type.create.js";
|
|
30
|
-
export * from "./event-type/event-type.update.js";
|
|
31
|
-
export * from "./event-type/event-type.delete-request.js";
|
|
32
|
-
export * from "./event-type/event-type.truncate-request.js";
|
|
33
|
-
export * from "./event-type/event-type.request-truncate.js";
|
|
34
32
|
export * from "./event-type/event-type.request-delete.js";
|
|
35
|
-
export * from "./
|
|
33
|
+
export * from "./event-type/event-type.request-truncate.js";
|
|
34
|
+
export * from "./event-type/event-type.truncate-request.js";
|
|
35
|
+
export * from "./event-type/event-type.update.js";
|
|
36
36
|
export * from "./events/events.fetch-time-buckets-by-names.js";
|
|
37
|
+
export * from "./events/events.fetch-first-and-last-time-buckets.js";
|
|
38
|
+
export * from "./events/events.fetch.js";
|
|
37
39
|
export * from "./container-registry/container-registry.create.js";
|
|
40
|
+
export * from "./container-registry/container-registry.delete.js";
|
|
38
41
|
export * from "./container-registry/container-registry.fetch.js";
|
|
39
42
|
export * from "./container-registry/container-registry.list.js";
|
|
40
43
|
export * from "./container-registry/container-registry.update.js";
|
|
41
|
-
export * from "./container-registry/container-registry.delete.js";
|
|
42
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,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,yCAAyC,CAAA;AACvD,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,yCAAyC,CAAA;AACvD,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,2CAA2C,CAAA;AACzD,cAAc,mCAAmC,CAAA;AACjD,cAAc,kCAAkC,CAAA;AAChD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,2CAA2C,CAAA;AACzD,cAAc,6CAA6C,CAAA;AAC3D,cAAc,6CAA6C,CAAA;AAC3D,cAAc,mCAAmC,CAAA;AAGjD,cAAc,gDAAgD,CAAA;AAC9D,cAAc,sDAAsD,CAAA;AACpE,cAAc,0BAA0B,CAAA;AAGxC,cAAc,mDAAmD,CAAA;AACjE,cAAc,mDAAmD,CAAA;AACjE,cAAc,kDAAkD,CAAA;AAChE,cAAc,iDAAiD,CAAA;AAC/D,cAAc,mDAAmD,CAAA"}
|
package/script/commands/index.js
CHANGED
|
@@ -17,50 +17,52 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
// Tenant
|
|
18
18
|
__exportStar(require("./tenant/tenant.fetch.js"), exports);
|
|
19
19
|
__exportStar(require("./tenant/tenant.list.js"), exports);
|
|
20
|
+
__exportStar(require("./tenant/tenant.translate-name-to-id.js"), exports);
|
|
20
21
|
// Api Key
|
|
21
|
-
__exportStar(require("./api-key/api-key.list.js"), exports);
|
|
22
22
|
__exportStar(require("./api-key/api-key.create.js"), exports);
|
|
23
23
|
__exportStar(require("./api-key/api-key.delete.js"), exports);
|
|
24
|
+
__exportStar(require("./api-key/api-key.list.js"), exports);
|
|
24
25
|
// Secret
|
|
25
|
-
__exportStar(require("./secret/secret.list.js"), exports);
|
|
26
26
|
__exportStar(require("./secret/secret.create.js"), exports);
|
|
27
27
|
__exportStar(require("./secret/secret.delete.js"), exports);
|
|
28
|
+
__exportStar(require("./secret/secret.list.js"), exports);
|
|
28
29
|
// Variable
|
|
29
|
-
__exportStar(require("./variable/variable.list.js"), exports);
|
|
30
30
|
__exportStar(require("./variable/variable.create.js"), exports);
|
|
31
31
|
__exportStar(require("./variable/variable.delete.js"), exports);
|
|
32
|
+
__exportStar(require("./variable/variable.list.js"), exports);
|
|
32
33
|
// Data Core
|
|
34
|
+
__exportStar(require("./data-core/data-core.create.js"), exports);
|
|
35
|
+
__exportStar(require("./data-core/data-core.delete-request.js"), exports);
|
|
33
36
|
__exportStar(require("./data-core/data-core.exists.js"), exports);
|
|
34
37
|
__exportStar(require("./data-core/data-core.fetch.js"), exports);
|
|
35
38
|
__exportStar(require("./data-core/data-core.list.js"), exports);
|
|
36
|
-
__exportStar(require("./data-core/data-core.create.js"), exports);
|
|
37
|
-
__exportStar(require("./data-core/data-core.update.js"), exports);
|
|
38
|
-
__exportStar(require("./data-core/data-core.delete-request.js"), exports);
|
|
39
39
|
__exportStar(require("./data-core/data-core.request-delete.js"), exports);
|
|
40
|
+
__exportStar(require("./data-core/data-core.update.js"), exports);
|
|
40
41
|
// Flow Types
|
|
42
|
+
__exportStar(require("./flow-type/flow-type.create.js"), exports);
|
|
43
|
+
__exportStar(require("./flow-type/flow-type.delete-request.js"), exports);
|
|
41
44
|
__exportStar(require("./flow-type/flow-type.exists.js"), exports);
|
|
42
45
|
__exportStar(require("./flow-type/flow-type.fetch.js"), exports);
|
|
43
46
|
__exportStar(require("./flow-type/flow-type.list.js"), exports);
|
|
44
|
-
__exportStar(require("./flow-type/flow-type.create.js"), exports);
|
|
45
|
-
__exportStar(require("./flow-type/flow-type.update.js"), exports);
|
|
46
|
-
__exportStar(require("./flow-type/flow-type.delete-request.js"), exports);
|
|
47
47
|
__exportStar(require("./flow-type/flow-type.request-delete.js"), exports);
|
|
48
|
+
__exportStar(require("./flow-type/flow-type.update.js"), exports);
|
|
48
49
|
// Event Types
|
|
50
|
+
__exportStar(require("./event-type/event-type.create.js"), exports);
|
|
51
|
+
__exportStar(require("./event-type/event-type.delete-request.js"), exports);
|
|
49
52
|
__exportStar(require("./event-type/event-type.exists.js"), exports);
|
|
50
53
|
__exportStar(require("./event-type/event-type.fetch.js"), exports);
|
|
51
54
|
__exportStar(require("./event-type/event-type.list.js"), exports);
|
|
52
|
-
__exportStar(require("./event-type/event-type.create.js"), exports);
|
|
53
|
-
__exportStar(require("./event-type/event-type.update.js"), exports);
|
|
54
|
-
__exportStar(require("./event-type/event-type.delete-request.js"), exports);
|
|
55
|
-
__exportStar(require("./event-type/event-type.truncate-request.js"), exports);
|
|
56
|
-
__exportStar(require("./event-type/event-type.request-truncate.js"), exports);
|
|
57
55
|
__exportStar(require("./event-type/event-type.request-delete.js"), exports);
|
|
56
|
+
__exportStar(require("./event-type/event-type.request-truncate.js"), exports);
|
|
57
|
+
__exportStar(require("./event-type/event-type.truncate-request.js"), exports);
|
|
58
|
+
__exportStar(require("./event-type/event-type.update.js"), exports);
|
|
58
59
|
// Events
|
|
59
|
-
__exportStar(require("./events/events.fetch.js"), exports);
|
|
60
60
|
__exportStar(require("./events/events.fetch-time-buckets-by-names.js"), exports);
|
|
61
|
+
__exportStar(require("./events/events.fetch-first-and-last-time-buckets.js"), exports);
|
|
62
|
+
__exportStar(require("./events/events.fetch.js"), exports);
|
|
61
63
|
//Container
|
|
62
64
|
__exportStar(require("./container-registry/container-registry.create.js"), exports);
|
|
65
|
+
__exportStar(require("./container-registry/container-registry.delete.js"), exports);
|
|
63
66
|
__exportStar(require("./container-registry/container-registry.fetch.js"), exports);
|
|
64
67
|
__exportStar(require("./container-registry/container-registry.list.js"), exports);
|
|
65
68
|
__exportStar(require("./container-registry/container-registry.update.js"), exports);
|
|
66
|
-
__exportStar(require("./container-registry/container-registry.delete.js"), exports);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Static, type TObject, type TString } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import type { ClientError } from "../../exceptions/client-error.js";
|
|
4
|
+
/**
|
|
5
|
+
* The input for the tenant translate name to id command
|
|
6
|
+
*/
|
|
7
|
+
export interface TenantTranslateNameToIdInput {
|
|
8
|
+
/** The name of the tenant */
|
|
9
|
+
tenant: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The schema for the tenant translate name to id command
|
|
13
|
+
*/
|
|
14
|
+
export declare const TenantTranslateNameToIdSchema: TObject<{
|
|
15
|
+
id: TString;
|
|
16
|
+
name: TString;
|
|
17
|
+
}>;
|
|
18
|
+
export type TenantTranslateNameToId = Static<typeof TenantTranslateNameToIdSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Translate a tenant name to an tenant id
|
|
21
|
+
*/
|
|
22
|
+
export declare class TenantTranslateNameToIdCommand extends Command<TenantTranslateNameToIdInput, TenantTranslateNameToId> {
|
|
23
|
+
/**
|
|
24
|
+
* Get the method
|
|
25
|
+
*/
|
|
26
|
+
protected getMethod(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Get the base url
|
|
29
|
+
*/
|
|
30
|
+
protected getBaseUrl(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the path
|
|
33
|
+
*/
|
|
34
|
+
protected getPath(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Parse the response
|
|
37
|
+
*/
|
|
38
|
+
protected parseResponse(rawResponse: unknown): TenantTranslateNameToId;
|
|
39
|
+
/**
|
|
40
|
+
* Handle the client error
|
|
41
|
+
*/
|
|
42
|
+
protected handleClientError(error: ClientError): void;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=tenant.translate-name-to-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant.translate-name-to-id.d.ts","sourceRoot":"","sources":["../../../src/commands/tenant/tenant.translate-name-to-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAKnE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,OAAO,CAAC;IAClD,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;CACd,CAGC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAElF;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,OAAO,CAAC,4BAA4B,EAAE,uBAAuB,CAAC;IAChH;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,uBAAuB;IAK/E;;OAEG;cACgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;CAQ/D"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TenantTranslateNameToIdCommand = exports.TenantTranslateNameToIdSchema = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const not_found_js_1 = require("../../exceptions/not-found.js");
|
|
7
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
8
|
+
/**
|
|
9
|
+
* The schema for the tenant translate name to id command
|
|
10
|
+
*/
|
|
11
|
+
exports.TenantTranslateNameToIdSchema = typebox_1.Type.Object({
|
|
12
|
+
id: typebox_1.Type.String(),
|
|
13
|
+
name: typebox_1.Type.String(),
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Translate a tenant name to an tenant id
|
|
17
|
+
*/
|
|
18
|
+
class TenantTranslateNameToIdCommand extends command_js_1.Command {
|
|
19
|
+
/**
|
|
20
|
+
* Get the method
|
|
21
|
+
*/
|
|
22
|
+
getMethod() {
|
|
23
|
+
return "GET";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the base url
|
|
27
|
+
*/
|
|
28
|
+
getBaseUrl() {
|
|
29
|
+
return "https://tenant.api.flowcore.io";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get the path
|
|
33
|
+
*/
|
|
34
|
+
getPath() {
|
|
35
|
+
return `/api/v1/tenants/translate-name-to-id/${this.input.tenant}`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse the response
|
|
39
|
+
*/
|
|
40
|
+
parseResponse(rawResponse) {
|
|
41
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(exports.TenantTranslateNameToIdSchema, rawResponse);
|
|
42
|
+
return response;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Handle the client error
|
|
46
|
+
*/
|
|
47
|
+
handleClientError(error) {
|
|
48
|
+
if (error.status === 404) {
|
|
49
|
+
throw new not_found_js_1.NotFoundException("Tenant", {
|
|
50
|
+
tenant: this.input.tenant,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.TenantTranslateNameToIdCommand = TenantTranslateNameToIdCommand;
|