@flowcore/sdk 1.64.3 → 1.66.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 +24 -0
- package/esm/commands/index.d.ts +1 -0
- package/esm/commands/index.d.ts.map +1 -1
- package/esm/commands/index.js +1 -0
- package/esm/commands/user/user.delete.d.ts +41 -0
- package/esm/commands/user/user.delete.d.ts.map +1 -0
- package/esm/commands/user/user.delete.js +40 -0
- package/esm/commands/user/user.initialize-in-keycloak.d.ts +34 -10
- package/esm/commands/user/user.initialize-in-keycloak.d.ts.map +1 -1
- package/esm/commands/user/user.initialize-in-keycloak.js +41 -24
- package/package.json +1 -1
- package/script/commands/index.d.ts +1 -0
- package/script/commands/index.d.ts.map +1 -1
- package/script/commands/index.js +1 -0
- package/script/commands/user/user.delete.d.ts +41 -0
- package/script/commands/user/user.delete.d.ts.map +1 -0
- package/script/commands/user/user.delete.js +44 -0
- package/script/commands/user/user.initialize-in-keycloak.d.ts +34 -10
- package/script/commands/user/user.initialize-in-keycloak.d.ts.map +1 -1
- package/script/commands/user/user.initialize-in-keycloak.js +41 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.66.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.65.0...v1.66.0) (2026-01-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add UserDeleteCommand and corresponding tests for user deletion functionality ([85fc50e](https://github.com/flowcore-io/flowcore-sdk/commit/85fc50ed90d5df49267ae0b25ab171bcae5117b3))
|
|
9
|
+
* add UserDeleteCommand to handle deletion of the authenticated user ([a674ef8](https://github.com/flowcore-io/flowcore-sdk/commit/a674ef8a59bec94917dd8aefc6f31431afa9ffb2))
|
|
10
|
+
* add UserDeleteCommand to handle deletion of the authenticated user ([96c931b](https://github.com/flowcore-io/flowcore-sdk/commit/96c931b3ff0d16be6b157f0f09f9fb5fffb7d6ab))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* remove trailing slash from user deletion API endpoint and update corresponding test ([b1c1ea4](https://github.com/flowcore-io/flowcore-sdk/commit/b1c1ea467218ab97d2b4c6263ebe14eabe0eb94f))
|
|
16
|
+
* update UserDeleteInput type description to clarify it represents the input for deleting the current authenticated user ([2f092dd](https://github.com/flowcore-io/flowcore-sdk/commit/2f092ddb96ea7cdbf88b4862453dbb0508e381c6))
|
|
17
|
+
* update UserDeleteOutput type description to clarify it represents the output for deleting the authenticated user ([4c5ac23](https://github.com/flowcore-io/flowcore-sdk/commit/4c5ac23d29b178cbce56e75e60ca728db8a42598))
|
|
18
|
+
|
|
19
|
+
## [1.65.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.64.3...v1.65.0) (2026-01-09)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* update UserInitializeInKeycloakCommand to use new response stru… ([361d377](https://github.com/flowcore-io/flowcore-sdk/commit/361d37741c34ea2207ca9c9dc4431fb389df8ce6))
|
|
25
|
+
* update UserInitializeInKeycloakCommand to use new response structure and API endpoint ([0aa16a4](https://github.com/flowcore-io/flowcore-sdk/commit/0aa16a498c8ed20db881e1d227d5681410a9dfef))
|
|
26
|
+
|
|
3
27
|
## [1.64.3](https://github.com/flowcore-io/flowcore-sdk/compare/v1.64.2...v1.64.3) (2025-12-19)
|
|
4
28
|
|
|
5
29
|
|
package/esm/commands/index.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export * from "./security/pat.get.js";
|
|
|
62
62
|
export * from "./security/pat.list.js";
|
|
63
63
|
export * from "./security/permissions.list.js";
|
|
64
64
|
export * from "./user/user.initialize-in-keycloak.js";
|
|
65
|
+
export * from "./user/user.delete.js";
|
|
65
66
|
export * from "./scenario/scenario.create.js";
|
|
66
67
|
export * from "./scenario/scenario.delete.js";
|
|
67
68
|
export * from "./scenario/scenario.fetch.js";
|
|
@@ -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,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,4BAA4B,CAAA;AAG1C,cAAc,4BAA4B,CAAA;AAG1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AAGzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AAGvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,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;A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75,6 +75,7 @@ export * from "./security/pat.list.js";
|
|
|
75
75
|
export * from "./security/permissions.list.js";
|
|
76
76
|
// User
|
|
77
77
|
export * from "./user/user.initialize-in-keycloak.js";
|
|
78
|
+
export * from "./user/user.delete.js";
|
|
78
79
|
// Scenario
|
|
79
80
|
export * from "./scenario/scenario.create.js";
|
|
80
81
|
export * from "./scenario/scenario.delete.js";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import type { Static, TObject, TString } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The input for deleting the current authenticated user
|
|
5
|
+
* No input parameters needed - checks current authenticated user
|
|
6
|
+
*/
|
|
7
|
+
export type UserDeleteInput = Record<PropertyKey, never>;
|
|
8
|
+
/**
|
|
9
|
+
* The output for deleting the current authenticated user
|
|
10
|
+
*/
|
|
11
|
+
export type UserDeleteOutput = Static<typeof responseSchema>;
|
|
12
|
+
declare const responseSchema: TObject<{
|
|
13
|
+
id: TString;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Delete current authenticated user
|
|
17
|
+
*/
|
|
18
|
+
export declare class UserDeleteCommand extends Command<UserDeleteInput, UserDeleteOutput> {
|
|
19
|
+
/**
|
|
20
|
+
* The allowed modes for the command
|
|
21
|
+
*/
|
|
22
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
23
|
+
/**
|
|
24
|
+
* Get the base URL for the request
|
|
25
|
+
*/
|
|
26
|
+
protected getBaseUrl(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Get the method
|
|
29
|
+
*/
|
|
30
|
+
protected getMethod(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the path for the request
|
|
33
|
+
*/
|
|
34
|
+
protected getPath(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Parse the response
|
|
37
|
+
*/
|
|
38
|
+
protected parseResponse(rawResponse: unknown): UserDeleteOutput;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=user.delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/user/user.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEjE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAE5D,QAAA,MAAM,cAAc,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,OAAO,CAAA;CACZ,CAEC,CAAA;AAEF;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,OAAO,CAC5C,eAAe,EACf,gBAAgB,CACjB;IACC;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,gBAAgB;CAIzE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
const responseSchema = Type.Object({
|
|
5
|
+
id: Type.String(),
|
|
6
|
+
});
|
|
7
|
+
/**
|
|
8
|
+
* Delete current authenticated user
|
|
9
|
+
*/
|
|
10
|
+
export class UserDeleteCommand extends Command {
|
|
11
|
+
/**
|
|
12
|
+
* The allowed modes for the command
|
|
13
|
+
*/
|
|
14
|
+
allowedModes = ["bearer"];
|
|
15
|
+
/**
|
|
16
|
+
* Get the base URL for the request
|
|
17
|
+
*/
|
|
18
|
+
getBaseUrl() {
|
|
19
|
+
return "https://user-2.api.flowcore.io";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the method
|
|
23
|
+
*/
|
|
24
|
+
getMethod() {
|
|
25
|
+
return "DELETE";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the path for the request
|
|
29
|
+
*/
|
|
30
|
+
getPath() {
|
|
31
|
+
return `/api/users`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parse the response
|
|
35
|
+
*/
|
|
36
|
+
parseResponse(rawResponse) {
|
|
37
|
+
const response = parseResponseHelper(responseSchema, rawResponse);
|
|
38
|
+
return response;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import type { Static, TObject, TString } from "@sinclair/typebox";
|
|
2
3
|
/**
|
|
3
4
|
* The input for initializing user in Keycloak
|
|
4
5
|
* No input parameters needed - checks current authenticated user
|
|
@@ -6,19 +7,41 @@ import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
|
6
7
|
export type UserInitializeInKeycloakInput = Record<PropertyKey, never>;
|
|
7
8
|
/**
|
|
8
9
|
* The output for initializing user in Keycloak
|
|
10
|
+
* (matches the REST API response)
|
|
9
11
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export type UserInitializeInKeycloakOutput = Static<typeof responseSchema>;
|
|
13
|
+
declare const responseSchema: TObject<{
|
|
14
|
+
id: TString;
|
|
15
|
+
username: TString;
|
|
16
|
+
email: TString;
|
|
17
|
+
firstName: TString;
|
|
18
|
+
lastName: TString;
|
|
19
|
+
}>;
|
|
16
20
|
/**
|
|
17
|
-
*
|
|
21
|
+
* Finalize user initialization by setting Flowcore User ID in Keycloak.
|
|
22
|
+
*
|
|
23
|
+
* Calls `POST /api/users` on the user service with an empty JSON body.
|
|
24
|
+
* Requires a bearer token.
|
|
18
25
|
*/
|
|
19
|
-
export declare class UserInitializeInKeycloakCommand extends
|
|
26
|
+
export declare class UserInitializeInKeycloakCommand extends Command<UserInitializeInKeycloakInput, UserInitializeInKeycloakOutput> {
|
|
27
|
+
/**
|
|
28
|
+
* The allowed modes for the command
|
|
29
|
+
*/
|
|
30
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
31
|
+
/**
|
|
32
|
+
* Get the base URL for the request
|
|
33
|
+
*/
|
|
34
|
+
protected getBaseUrl(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Get the method
|
|
37
|
+
*/
|
|
38
|
+
protected getMethod(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Get the path for the request
|
|
41
|
+
*/
|
|
42
|
+
protected getPath(): string;
|
|
20
43
|
/**
|
|
21
|
-
* Get the body for the request
|
|
44
|
+
* Get the body for the request (must be an empty JSON object)
|
|
22
45
|
*/
|
|
23
46
|
protected getBody(): Record<string, unknown>;
|
|
24
47
|
/**
|
|
@@ -26,4 +49,5 @@ export declare class UserInitializeInKeycloakCommand extends GraphQlCommand<User
|
|
|
26
49
|
*/
|
|
27
50
|
protected parseResponse(rawResponse: unknown): UserInitializeInKeycloakOutput;
|
|
28
51
|
}
|
|
52
|
+
export {};
|
|
29
53
|
//# sourceMappingURL=user.initialize-in-keycloak.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.initialize-in-keycloak.d.ts","sourceRoot":"","sources":["../../../src/commands/user/user.initialize-in-keycloak.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.initialize-in-keycloak.d.ts","sourceRoot":"","sources":["../../../src/commands/user/user.initialize-in-keycloak.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEjE;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;AAEtE;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAE1E,QAAA,MAAM,cAAc,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAMC,CAAA;AAEF;;;;;GAKG;AACH,qBAAa,+BAAgC,SAAQ,OAAO,CAC1D,6BAA6B,EAC7B,8BAA8B,CAC/B;IACC;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,8BAA8B;CAIvF"}
|
|
@@ -1,38 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Type } from "@sinclair/typebox";
|
|
2
|
+
import { Command } from "../../common/command.js";
|
|
3
|
+
import { parseResponseHelper } from "../../utils/parse-response-helper.js";
|
|
4
|
+
const responseSchema = Type.Object({
|
|
5
|
+
id: Type.String(),
|
|
6
|
+
username: Type.String(),
|
|
7
|
+
email: Type.String(),
|
|
8
|
+
firstName: Type.String(),
|
|
9
|
+
lastName: Type.String(),
|
|
10
|
+
});
|
|
10
11
|
/**
|
|
11
|
-
*
|
|
12
|
+
* Finalize user initialization by setting Flowcore User ID in Keycloak.
|
|
13
|
+
*
|
|
14
|
+
* Calls `POST /api/users` on the user service with an empty JSON body.
|
|
15
|
+
* Requires a bearer token.
|
|
12
16
|
*/
|
|
13
|
-
export class UserInitializeInKeycloakCommand extends
|
|
17
|
+
export class UserInitializeInKeycloakCommand extends Command {
|
|
18
|
+
/**
|
|
19
|
+
* The allowed modes for the command
|
|
20
|
+
*/
|
|
21
|
+
allowedModes = ["bearer"];
|
|
22
|
+
/**
|
|
23
|
+
* Get the base URL for the request
|
|
24
|
+
*/
|
|
25
|
+
getBaseUrl() {
|
|
26
|
+
return "https://user-2.api.flowcore.io";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the method
|
|
30
|
+
*/
|
|
31
|
+
getMethod() {
|
|
32
|
+
return "POST";
|
|
33
|
+
}
|
|
14
34
|
/**
|
|
15
|
-
* Get the
|
|
35
|
+
* Get the path for the request
|
|
36
|
+
*/
|
|
37
|
+
getPath() {
|
|
38
|
+
return "/api/users";
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get the body for the request (must be an empty JSON object)
|
|
16
42
|
*/
|
|
17
43
|
getBody() {
|
|
18
44
|
return {
|
|
19
|
-
|
|
20
|
-
variables: {},
|
|
45
|
+
// intentionally empty
|
|
21
46
|
};
|
|
22
47
|
}
|
|
23
48
|
/**
|
|
24
49
|
* Parse the response
|
|
25
50
|
*/
|
|
26
51
|
parseResponse(rawResponse) {
|
|
27
|
-
const response = rawResponse;
|
|
28
|
-
|
|
29
|
-
throw new InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
30
|
-
}
|
|
31
|
-
// If me exists and is not null i.e. flowcore_user_id is not null, user is initialized
|
|
32
|
-
const isInitialized = response.data?.me !== null && response.data?.me !== undefined;
|
|
33
|
-
return {
|
|
34
|
-
isInitialized,
|
|
35
|
-
me: response.data?.me,
|
|
36
|
-
};
|
|
52
|
+
const response = parseResponseHelper(responseSchema, rawResponse);
|
|
53
|
+
return response;
|
|
37
54
|
}
|
|
38
55
|
}
|
package/package.json
CHANGED
|
@@ -62,6 +62,7 @@ export * from "./security/pat.get.js";
|
|
|
62
62
|
export * from "./security/pat.list.js";
|
|
63
63
|
export * from "./security/permissions.list.js";
|
|
64
64
|
export * from "./user/user.initialize-in-keycloak.js";
|
|
65
|
+
export * from "./user/user.delete.js";
|
|
65
66
|
export * from "./scenario/scenario.create.js";
|
|
66
67
|
export * from "./scenario/scenario.delete.js";
|
|
67
68
|
export * from "./scenario/scenario.fetch.js";
|
|
@@ -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,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,4BAA4B,CAAA;AAG1C,cAAc,4BAA4B,CAAA;AAG1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AAGzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AAGvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA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AE/D,cAAc,0CAA0C,CAAA;AACxD,cAAc,mDAAmD,CAAA;AACjE,cAAc,kDAAkD,CAAA;AAChE,cAAc,2CAA2C,CAAA;AACzD,cAAc,0CAA0C,CAAA;AACxD,cAAc,2CAA2C,CAAA;AACzD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,6CAA6C,CAAA;AAE3D,cAAc,4BAA4B,CAAA;AAC1C,cAAc,0BAA0B,CAAA;AACxC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAE7C,cAAc,gDAAgD,CAAA;AAE9D,cAAc,gCAAgC,CAAA;AAC9C,cAAc,iCAAiC,CAAA"}
|
package/script/commands/index.js
CHANGED
|
@@ -91,6 +91,7 @@ __exportStar(require("./security/pat.list.js"), exports);
|
|
|
91
91
|
__exportStar(require("./security/permissions.list.js"), exports);
|
|
92
92
|
// User
|
|
93
93
|
__exportStar(require("./user/user.initialize-in-keycloak.js"), exports);
|
|
94
|
+
__exportStar(require("./user/user.delete.js"), exports);
|
|
94
95
|
// Scenario
|
|
95
96
|
__exportStar(require("./scenario/scenario.create.js"), exports);
|
|
96
97
|
__exportStar(require("./scenario/scenario.delete.js"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import type { Static, TObject, TString } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The input for deleting the current authenticated user
|
|
5
|
+
* No input parameters needed - checks current authenticated user
|
|
6
|
+
*/
|
|
7
|
+
export type UserDeleteInput = Record<PropertyKey, never>;
|
|
8
|
+
/**
|
|
9
|
+
* The output for deleting the current authenticated user
|
|
10
|
+
*/
|
|
11
|
+
export type UserDeleteOutput = Static<typeof responseSchema>;
|
|
12
|
+
declare const responseSchema: TObject<{
|
|
13
|
+
id: TString;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Delete current authenticated user
|
|
17
|
+
*/
|
|
18
|
+
export declare class UserDeleteCommand extends Command<UserDeleteInput, UserDeleteOutput> {
|
|
19
|
+
/**
|
|
20
|
+
* The allowed modes for the command
|
|
21
|
+
*/
|
|
22
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
23
|
+
/**
|
|
24
|
+
* Get the base URL for the request
|
|
25
|
+
*/
|
|
26
|
+
protected getBaseUrl(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Get the method
|
|
29
|
+
*/
|
|
30
|
+
protected getMethod(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the path for the request
|
|
33
|
+
*/
|
|
34
|
+
protected getPath(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Parse the response
|
|
37
|
+
*/
|
|
38
|
+
protected parseResponse(rawResponse: unknown): UserDeleteOutput;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=user.delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/user/user.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEjE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAE5D,QAAA,MAAM,cAAc,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,OAAO,CAAA;CACZ,CAEC,CAAA;AAEF;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,OAAO,CAC5C,eAAe,EACf,gBAAgB,CACjB;IACC;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,gBAAgB;CAIzE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserDeleteCommand = void 0;
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
7
|
+
const responseSchema = typebox_1.Type.Object({
|
|
8
|
+
id: typebox_1.Type.String(),
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Delete current authenticated user
|
|
12
|
+
*/
|
|
13
|
+
class UserDeleteCommand extends command_js_1.Command {
|
|
14
|
+
/**
|
|
15
|
+
* The allowed modes for the command
|
|
16
|
+
*/
|
|
17
|
+
allowedModes = ["bearer"];
|
|
18
|
+
/**
|
|
19
|
+
* Get the base URL for the request
|
|
20
|
+
*/
|
|
21
|
+
getBaseUrl() {
|
|
22
|
+
return "https://user-2.api.flowcore.io";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the method
|
|
26
|
+
*/
|
|
27
|
+
getMethod() {
|
|
28
|
+
return "DELETE";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the path for the request
|
|
32
|
+
*/
|
|
33
|
+
getPath() {
|
|
34
|
+
return `/api/users`;
|
|
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.UserDeleteCommand = UserDeleteCommand;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Command } from "../../common/command.js";
|
|
2
|
+
import type { Static, TObject, TString } from "@sinclair/typebox";
|
|
2
3
|
/**
|
|
3
4
|
* The input for initializing user in Keycloak
|
|
4
5
|
* No input parameters needed - checks current authenticated user
|
|
@@ -6,19 +7,41 @@ import { GraphQlCommand } from "../../common/command-graphql.js";
|
|
|
6
7
|
export type UserInitializeInKeycloakInput = Record<PropertyKey, never>;
|
|
7
8
|
/**
|
|
8
9
|
* The output for initializing user in Keycloak
|
|
10
|
+
* (matches the REST API response)
|
|
9
11
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export type UserInitializeInKeycloakOutput = Static<typeof responseSchema>;
|
|
13
|
+
declare const responseSchema: TObject<{
|
|
14
|
+
id: TString;
|
|
15
|
+
username: TString;
|
|
16
|
+
email: TString;
|
|
17
|
+
firstName: TString;
|
|
18
|
+
lastName: TString;
|
|
19
|
+
}>;
|
|
16
20
|
/**
|
|
17
|
-
*
|
|
21
|
+
* Finalize user initialization by setting Flowcore User ID in Keycloak.
|
|
22
|
+
*
|
|
23
|
+
* Calls `POST /api/users` on the user service with an empty JSON body.
|
|
24
|
+
* Requires a bearer token.
|
|
18
25
|
*/
|
|
19
|
-
export declare class UserInitializeInKeycloakCommand extends
|
|
26
|
+
export declare class UserInitializeInKeycloakCommand extends Command<UserInitializeInKeycloakInput, UserInitializeInKeycloakOutput> {
|
|
27
|
+
/**
|
|
28
|
+
* The allowed modes for the command
|
|
29
|
+
*/
|
|
30
|
+
protected allowedModes: ("apiKey" | "bearer")[];
|
|
31
|
+
/**
|
|
32
|
+
* Get the base URL for the request
|
|
33
|
+
*/
|
|
34
|
+
protected getBaseUrl(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Get the method
|
|
37
|
+
*/
|
|
38
|
+
protected getMethod(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Get the path for the request
|
|
41
|
+
*/
|
|
42
|
+
protected getPath(): string;
|
|
20
43
|
/**
|
|
21
|
-
* Get the body for the request
|
|
44
|
+
* Get the body for the request (must be an empty JSON object)
|
|
22
45
|
*/
|
|
23
46
|
protected getBody(): Record<string, unknown>;
|
|
24
47
|
/**
|
|
@@ -26,4 +49,5 @@ export declare class UserInitializeInKeycloakCommand extends GraphQlCommand<User
|
|
|
26
49
|
*/
|
|
27
50
|
protected parseResponse(rawResponse: unknown): UserInitializeInKeycloakOutput;
|
|
28
51
|
}
|
|
52
|
+
export {};
|
|
29
53
|
//# sourceMappingURL=user.initialize-in-keycloak.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.initialize-in-keycloak.d.ts","sourceRoot":"","sources":["../../../src/commands/user/user.initialize-in-keycloak.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.initialize-in-keycloak.d.ts","sourceRoot":"","sources":["../../../src/commands/user/user.initialize-in-keycloak.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEjE;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;AAEtE;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAE1E,QAAA,MAAM,cAAc,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,OAAO,CAAA;IACd,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAMC,CAAA;AAEF;;;;;GAKG;AACH,qBAAa,+BAAgC,SAAQ,OAAO,CAC1D,6BAA6B,EAC7B,8BAA8B,CAC/B;IACC;;OAEG;IACH,UAAmB,YAAY,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAa;IAErE;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,8BAA8B;CAIvF"}
|
|
@@ -1,42 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserInitializeInKeycloakCommand = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
5
|
+
const command_js_1 = require("../../common/command.js");
|
|
6
|
+
const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
|
|
7
|
+
const responseSchema = typebox_1.Type.Object({
|
|
8
|
+
id: typebox_1.Type.String(),
|
|
9
|
+
username: typebox_1.Type.String(),
|
|
10
|
+
email: typebox_1.Type.String(),
|
|
11
|
+
firstName: typebox_1.Type.String(),
|
|
12
|
+
lastName: typebox_1.Type.String(),
|
|
13
|
+
});
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Finalize user initialization by setting Flowcore User ID in Keycloak.
|
|
16
|
+
*
|
|
17
|
+
* Calls `POST /api/users` on the user service with an empty JSON body.
|
|
18
|
+
* Requires a bearer token.
|
|
15
19
|
*/
|
|
16
|
-
class UserInitializeInKeycloakCommand extends
|
|
20
|
+
class UserInitializeInKeycloakCommand extends command_js_1.Command {
|
|
21
|
+
/**
|
|
22
|
+
* The allowed modes for the command
|
|
23
|
+
*/
|
|
24
|
+
allowedModes = ["bearer"];
|
|
25
|
+
/**
|
|
26
|
+
* Get the base URL for the request
|
|
27
|
+
*/
|
|
28
|
+
getBaseUrl() {
|
|
29
|
+
return "https://user-2.api.flowcore.io";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get the method
|
|
33
|
+
*/
|
|
34
|
+
getMethod() {
|
|
35
|
+
return "POST";
|
|
36
|
+
}
|
|
17
37
|
/**
|
|
18
|
-
* Get the
|
|
38
|
+
* Get the path for the request
|
|
39
|
+
*/
|
|
40
|
+
getPath() {
|
|
41
|
+
return "/api/users";
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the body for the request (must be an empty JSON object)
|
|
19
45
|
*/
|
|
20
46
|
getBody() {
|
|
21
47
|
return {
|
|
22
|
-
|
|
23
|
-
variables: {},
|
|
48
|
+
// intentionally empty
|
|
24
49
|
};
|
|
25
50
|
}
|
|
26
51
|
/**
|
|
27
52
|
* Parse the response
|
|
28
53
|
*/
|
|
29
54
|
parseResponse(rawResponse) {
|
|
30
|
-
const response = rawResponse;
|
|
31
|
-
|
|
32
|
-
throw new invalid_response_js_1.InvalidResponseException(response.errors.map((e) => e.message).join(", "), { graphql: response.errors.map((e) => e.message).join(", ") });
|
|
33
|
-
}
|
|
34
|
-
// If me exists and is not null i.e. flowcore_user_id is not null, user is initialized
|
|
35
|
-
const isInitialized = response.data?.me !== null && response.data?.me !== undefined;
|
|
36
|
-
return {
|
|
37
|
-
isInitialized,
|
|
38
|
-
me: response.data?.me,
|
|
39
|
-
};
|
|
55
|
+
const response = (0, parse_response_helper_js_1.parseResponseHelper)(responseSchema, rawResponse);
|
|
56
|
+
return response;
|
|
40
57
|
}
|
|
41
58
|
}
|
|
42
59
|
exports.UserInitializeInKeycloakCommand = UserInitializeInKeycloakCommand;
|