@flowcore/sdk 1.18.0 → 1.19.1

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/esm/commands/index.d.ts +5 -0
  3. package/esm/commands/index.d.ts.map +1 -1
  4. package/esm/commands/index.js +6 -0
  5. package/esm/commands/security/pat.create.d.ts +37 -0
  6. package/esm/commands/security/pat.create.d.ts.map +1 -0
  7. package/esm/commands/security/pat.create.js +44 -0
  8. package/esm/commands/security/pat.delete.d.ts +37 -0
  9. package/esm/commands/security/pat.delete.d.ts.map +1 -0
  10. package/esm/commands/security/pat.delete.js +46 -0
  11. package/esm/commands/security/pat.exchange.d.ts +41 -0
  12. package/esm/commands/security/pat.exchange.d.ts.map +1 -0
  13. package/esm/commands/security/pat.exchange.js +51 -0
  14. package/esm/commands/security/pat.get.d.ts +35 -0
  15. package/esm/commands/security/pat.get.d.ts.map +1 -0
  16. package/esm/commands/security/pat.get.js +44 -0
  17. package/esm/commands/security/pat.list.d.ts +28 -0
  18. package/esm/commands/security/pat.list.d.ts.map +1 -0
  19. package/esm/commands/security/pat.list.js +45 -0
  20. package/esm/contracts/pat.d.ts +16 -0
  21. package/esm/contracts/pat.d.ts.map +1 -0
  22. package/esm/contracts/pat.js +11 -0
  23. package/package.json +1 -1
  24. package/script/commands/index.d.ts +5 -0
  25. package/script/commands/index.d.ts.map +1 -1
  26. package/script/commands/index.js +6 -0
  27. package/script/commands/security/pat.create.d.ts +37 -0
  28. package/script/commands/security/pat.create.d.ts.map +1 -0
  29. package/script/commands/security/pat.create.js +48 -0
  30. package/script/commands/security/pat.delete.d.ts +37 -0
  31. package/script/commands/security/pat.delete.d.ts.map +1 -0
  32. package/script/commands/security/pat.delete.js +50 -0
  33. package/script/commands/security/pat.exchange.d.ts +41 -0
  34. package/script/commands/security/pat.exchange.d.ts.map +1 -0
  35. package/script/commands/security/pat.exchange.js +55 -0
  36. package/script/commands/security/pat.get.d.ts +35 -0
  37. package/script/commands/security/pat.get.d.ts.map +1 -0
  38. package/script/commands/security/pat.get.js +48 -0
  39. package/script/commands/security/pat.list.d.ts +28 -0
  40. package/script/commands/security/pat.list.d.ts.map +1 -0
  41. package/script/commands/security/pat.list.js +49 -0
  42. package/script/contracts/pat.d.ts +16 -0
  43. package/script/contracts/pat.d.ts.map +1 -0
  44. package/script/contracts/pat.js +14 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.19.1](https://github.com/flowcore-io/flowcore-sdk/compare/v1.19.0...v1.19.1) (2025-03-17)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **security:** :art: update PATSchema to use optional description and add createdAt field ([389907f](https://github.com/flowcore-io/flowcore-sdk/commit/389907fec1e060a3cb99cc3231a6fe86696ff035))
9
+
10
+ ## [1.19.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.18.0...v1.19.0) (2025-03-17)
11
+
12
+
13
+ ### Features
14
+
15
+ * **security:** :sparkles: add commands for exchanging Personal Access Tokens (PAT) ([8b42470](https://github.com/flowcore-io/flowcore-sdk/commit/8b42470423d8904bd210e887f4377751f0b8981a))
16
+
3
17
  ## [1.18.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.17.0...v1.18.0) (2025-03-17)
4
18
 
5
19
 
@@ -43,4 +43,9 @@ export * from "./container-registry/container-registry.delete.js";
43
43
  export * from "./container-registry/container-registry.fetch.js";
44
44
  export * from "./container-registry/container-registry.list.js";
45
45
  export * from "./container-registry/container-registry.update.js";
46
+ export * from "./security/pat.create.js";
47
+ export * from "./security/pat.delete.js";
48
+ export * from "./security/pat.exchange.js";
49
+ export * from "./security/pat.get.js";
50
+ export * from "./security/pat.list.js";
46
51
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AACA,cAAc,0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D,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"}
@@ -52,3 +52,9 @@ export * from "./container-registry/container-registry.delete.js";
52
52
  export * from "./container-registry/container-registry.fetch.js";
53
53
  export * from "./container-registry/container-registry.list.js";
54
54
  export * from "./container-registry/container-registry.update.js";
55
+ // Security
56
+ export * from "./security/pat.create.js";
57
+ export * from "./security/pat.delete.js";
58
+ export * from "./security/pat.exchange.js";
59
+ export * from "./security/pat.get.js";
60
+ export * from "./security/pat.list.js";
@@ -0,0 +1,37 @@
1
+ import { Command } from "../../common/command.js";
2
+ import { type PAT } from "../../contracts/pat.js";
3
+ /**
4
+ * The input for the PAT create command
5
+ */
6
+ export interface SecurityCreatePAT {
7
+ /** The name of the PAT */
8
+ name: string;
9
+ /** The description of the PAT */
10
+ description?: string;
11
+ }
12
+ /**
13
+ * Create a Personal Access Token (PAT)
14
+ */
15
+ export declare class SecurityCreatePATCommand extends Command<SecurityCreatePAT, PAT> {
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): PAT;
36
+ }
37
+ //# sourceMappingURL=pat.create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.create.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,wBAAwB,CAAA;AAG5D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC;IAC3E;;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,GAAG;CAG5D"}
@@ -0,0 +1,44 @@
1
+ import { Command } from "../../common/command.js";
2
+ import { PATSchema } from "../../contracts/pat.js";
3
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
4
+ /**
5
+ * Create a Personal Access Token (PAT)
6
+ */
7
+ export class SecurityCreatePATCommand 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://security2.api.flowcore.io";
31
+ }
32
+ /**
33
+ * Get the path
34
+ */
35
+ getPath() {
36
+ return `/api/v1/pat`;
37
+ }
38
+ /**
39
+ * Parse the response
40
+ */
41
+ parseResponse(rawResponse) {
42
+ return parseResponseHelper(PATSchema, rawResponse);
43
+ }
44
+ }
@@ -0,0 +1,37 @@
1
+ import { Command } from "../../common/command.js";
2
+ /**
3
+ * The input for the PAT delete command
4
+ */
5
+ export interface SecurityDeletePAT {
6
+ /** The id of the PAT */
7
+ id: string;
8
+ }
9
+ export interface SecurityDeletePATResponse {
10
+ success: boolean;
11
+ }
12
+ /**
13
+ * Delete a Personal Access Token (PAT)
14
+ */
15
+ export declare class SecurityDeletePATCommand extends Command<SecurityDeletePAT, SecurityDeletePATResponse> {
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): SecurityDeletePATResponse;
36
+ }
37
+ //# sourceMappingURL=pat.delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;IACjG;;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,yBAAyB;CAQlF"}
@@ -0,0 +1,46 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { Command } from "../../common/command.js";
3
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
4
+ /**
5
+ * Delete a Personal Access Token (PAT)
6
+ */
7
+ export class SecurityDeletePATCommand 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 "DELETE";
25
+ }
26
+ /**
27
+ * Get the base url
28
+ */
29
+ getBaseUrl() {
30
+ return "https://security2.api.flowcore.io";
31
+ }
32
+ /**
33
+ * Get the path
34
+ */
35
+ getPath() {
36
+ return `/api/v1/pat/${this.input.id}`;
37
+ }
38
+ /**
39
+ * Parse the response
40
+ */
41
+ parseResponse(rawResponse) {
42
+ return parseResponseHelper(Type.Object({
43
+ success: Type.Boolean(),
44
+ }), rawResponse);
45
+ }
46
+ }
@@ -0,0 +1,41 @@
1
+ import { Command } from "../../common/command.js";
2
+ /**
3
+ * The input for the PAT create command
4
+ */
5
+ export interface SecurityExchangePAT {
6
+ /** The username of the user */
7
+ username: string;
8
+ /** The Personal Access Token */
9
+ pat: string;
10
+ }
11
+ export interface SecurityExchangePATResponse {
12
+ /** The token of the PAT */
13
+ accessToken: string;
14
+ }
15
+ /**
16
+ * Exchange a Personal Access Token (PAT) for an access token
17
+ */
18
+ export declare class SecurityExchangePATCommand extends Command<SecurityExchangePAT, SecurityExchangePATResponse> {
19
+ /**
20
+ * Whether the command should retry on failure
21
+ */
22
+ protected retryOnFailure: boolean;
23
+ /**
24
+ * Get the method
25
+ */
26
+ protected getMethod(): string;
27
+ /**
28
+ * Get the base url
29
+ */
30
+ protected getBaseUrl(): string;
31
+ protected getHeaders(): Record<string, string>;
32
+ /**
33
+ * Get the path
34
+ */
35
+ protected getPath(): string;
36
+ /**
37
+ * Parse the response
38
+ */
39
+ protected parseResponse(rawResponse: unknown): SecurityExchangePATResponse;
40
+ }
41
+ //# sourceMappingURL=pat.exchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.exchange.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.exchange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,2BAA2B;IAC1C,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,OAAO,CAAC,mBAAmB,EAAE,2BAA2B,CAAC;IACvG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;cAIpB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMvD;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,2BAA2B;CAKpF"}
@@ -0,0 +1,51 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { Command } from "../../common/command.js";
3
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
4
+ /**
5
+ * Exchange a Personal Access Token (PAT) for an access token
6
+ */
7
+ export class SecurityExchangePATCommand 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://security2.api.flowcore.io";
31
+ }
32
+ getHeaders() {
33
+ const headers = super.getHeaders();
34
+ headers["x-flowcore-pat"] = this.input.pat;
35
+ return headers;
36
+ }
37
+ /**
38
+ * Get the path
39
+ */
40
+ getPath() {
41
+ return `/api/v1/pat/exchange/${this.input.username}`;
42
+ }
43
+ /**
44
+ * Parse the response
45
+ */
46
+ parseResponse(rawResponse) {
47
+ return parseResponseHelper(Type.Object({
48
+ accessToken: Type.String(),
49
+ }), rawResponse);
50
+ }
51
+ }
@@ -0,0 +1,35 @@
1
+ import { Command } from "../../common/command.js";
2
+ import { type PAT } from "../../contracts/pat.js";
3
+ /**
4
+ * The input for the PAT get command
5
+ */
6
+ export interface SecurityGetPAT {
7
+ /** The id of the PAT */
8
+ id: string;
9
+ }
10
+ /**
11
+ * Get a Personal Access Token (PAT)
12
+ */
13
+ export declare class SecurityGetPATCommand extends Command<SecurityGetPAT, PAT> {
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): PAT;
34
+ }
35
+ //# sourceMappingURL=pat.get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.get.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,wBAAwB,CAAA;AAG5D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;IACrE;;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,GAAG;CAG5D"}
@@ -0,0 +1,44 @@
1
+ import { Command } from "../../common/command.js";
2
+ import { PATSchema } from "../../contracts/pat.js";
3
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
4
+ /**
5
+ * Get a Personal Access Token (PAT)
6
+ */
7
+ export class SecurityGetPATCommand 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://security2.api.flowcore.io";
31
+ }
32
+ /**
33
+ * Get the path
34
+ */
35
+ getPath() {
36
+ return `/api/v1/pat/${this.input.id}`;
37
+ }
38
+ /**
39
+ * Parse the response
40
+ */
41
+ parseResponse(rawResponse) {
42
+ return parseResponseHelper(PATSchema, rawResponse);
43
+ }
44
+ }
@@ -0,0 +1,28 @@
1
+ import { Command } from "../../common/command.js";
2
+ import { type PAT } from "../../contracts/pat.js";
3
+ /**
4
+ * List all your Personal Access Token (PAT)
5
+ */
6
+ export declare class SecurityListPATCommand extends Command<void, PAT[]> {
7
+ /**
8
+ * Whether the command should retry on failure
9
+ */
10
+ protected retryOnFailure: boolean;
11
+ /**
12
+ * Get the method
13
+ */
14
+ protected getMethod(): string;
15
+ /**
16
+ * Get the base url
17
+ */
18
+ protected getBaseUrl(): string;
19
+ /**
20
+ * Get the path
21
+ */
22
+ protected getPath(): string;
23
+ /**
24
+ * Parse the response
25
+ */
26
+ protected parseResponse(rawResponse: unknown): PAT[];
27
+ }
28
+ //# sourceMappingURL=pat.list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.list.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,wBAAwB,CAAA;AAG5D;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;IAC9D;;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,GAAG,EAAE;CAG9D"}
@@ -0,0 +1,45 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ import { Command } from "../../common/command.js";
3
+ import { PATSchema } from "../../contracts/pat.js";
4
+ import { parseResponseHelper } from "../../utils/parse-response-helper.js";
5
+ /**
6
+ * List all your Personal Access Token (PAT)
7
+ */
8
+ export class SecurityListPATCommand extends Command {
9
+ constructor() {
10
+ super(...arguments);
11
+ /**
12
+ * Whether the command should retry on failure
13
+ */
14
+ Object.defineProperty(this, "retryOnFailure", {
15
+ enumerable: true,
16
+ configurable: true,
17
+ writable: true,
18
+ value: false
19
+ });
20
+ }
21
+ /**
22
+ * Get the method
23
+ */
24
+ getMethod() {
25
+ return "GET";
26
+ }
27
+ /**
28
+ * Get the base url
29
+ */
30
+ getBaseUrl() {
31
+ return "https://security2.api.flowcore.io";
32
+ }
33
+ /**
34
+ * Get the path
35
+ */
36
+ getPath() {
37
+ return `/api/v1/pat`;
38
+ }
39
+ /**
40
+ * Parse the response
41
+ */
42
+ parseResponse(rawResponse) {
43
+ return parseResponseHelper(Type.Array(PATSchema), rawResponse);
44
+ }
45
+ }
@@ -0,0 +1,16 @@
1
+ import { type Static, type TObject, type TOptional, type TString } from "@sinclair/typebox";
2
+ /**
3
+ * The schema for a PAT (Personal Access Token)
4
+ */
5
+ export declare const PATSchema: TObject<{
6
+ id: TString;
7
+ name: TString;
8
+ description: TOptional<TString>;
9
+ token: TOptional<TString>;
10
+ createdAt: TString;
11
+ }>;
12
+ /**
13
+ * The type for a PAT
14
+ */
15
+ export type PAT = Static<typeof PATSchema>;
16
+ //# sourceMappingURL=pat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.d.ts","sourceRoot":"","sources":["../../src/contracts/pat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EAEb,MAAM,mBAAmB,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC;IAC9B,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC/B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;CACnB,CAMC,CAAA;AACF;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { Type } from "@sinclair/typebox";
2
+ /**
3
+ * The schema for a PAT (Personal Access Token)
4
+ */
5
+ export const PATSchema = Type.Object({
6
+ id: Type.String(),
7
+ name: Type.String(),
8
+ description: Type.Optional(Type.String()),
9
+ token: Type.Optional(Type.String()),
10
+ createdAt: Type.String(),
11
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowcore/sdk",
3
- "version": "1.18.0",
3
+ "version": "1.19.1",
4
4
  "description": "Flowcore SDK",
5
5
  "homepage": "https://github.com/flowcore-io/flowcore-sdk#readme",
6
6
  "repository": {
@@ -43,4 +43,9 @@ export * from "./container-registry/container-registry.delete.js";
43
43
  export * from "./container-registry/container-registry.fetch.js";
44
44
  export * from "./container-registry/container-registry.list.js";
45
45
  export * from "./container-registry/container-registry.update.js";
46
+ export * from "./security/pat.create.js";
47
+ export * from "./security/pat.delete.js";
48
+ export * from "./security/pat.exchange.js";
49
+ export * from "./security/pat.get.js";
50
+ export * from "./security/pat.list.js";
46
51
  //# 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;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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D,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;AACjD,cAAc,iCAAiC,CAAA;AAG/C,cAAc,gDAAgD,CAAA;AAC9D,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,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"}
@@ -68,3 +68,9 @@ __exportStar(require("./container-registry/container-registry.delete.js"), expor
68
68
  __exportStar(require("./container-registry/container-registry.fetch.js"), exports);
69
69
  __exportStar(require("./container-registry/container-registry.list.js"), exports);
70
70
  __exportStar(require("./container-registry/container-registry.update.js"), exports);
71
+ // Security
72
+ __exportStar(require("./security/pat.create.js"), exports);
73
+ __exportStar(require("./security/pat.delete.js"), exports);
74
+ __exportStar(require("./security/pat.exchange.js"), exports);
75
+ __exportStar(require("./security/pat.get.js"), exports);
76
+ __exportStar(require("./security/pat.list.js"), exports);
@@ -0,0 +1,37 @@
1
+ import { Command } from "../../common/command.js";
2
+ import { type PAT } from "../../contracts/pat.js";
3
+ /**
4
+ * The input for the PAT create command
5
+ */
6
+ export interface SecurityCreatePAT {
7
+ /** The name of the PAT */
8
+ name: string;
9
+ /** The description of the PAT */
10
+ description?: string;
11
+ }
12
+ /**
13
+ * Create a Personal Access Token (PAT)
14
+ */
15
+ export declare class SecurityCreatePATCommand extends Command<SecurityCreatePAT, PAT> {
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): PAT;
36
+ }
37
+ //# sourceMappingURL=pat.create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.create.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,wBAAwB,CAAA;AAG5D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC;IAC3E;;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,GAAG;CAG5D"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecurityCreatePATCommand = void 0;
4
+ const command_js_1 = require("../../common/command.js");
5
+ const pat_js_1 = require("../../contracts/pat.js");
6
+ const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
7
+ /**
8
+ * Create a Personal Access Token (PAT)
9
+ */
10
+ class SecurityCreatePATCommand extends command_js_1.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 "POST";
28
+ }
29
+ /**
30
+ * Get the base url
31
+ */
32
+ getBaseUrl() {
33
+ return "https://security2.api.flowcore.io";
34
+ }
35
+ /**
36
+ * Get the path
37
+ */
38
+ getPath() {
39
+ return `/api/v1/pat`;
40
+ }
41
+ /**
42
+ * Parse the response
43
+ */
44
+ parseResponse(rawResponse) {
45
+ return (0, parse_response_helper_js_1.parseResponseHelper)(pat_js_1.PATSchema, rawResponse);
46
+ }
47
+ }
48
+ exports.SecurityCreatePATCommand = SecurityCreatePATCommand;
@@ -0,0 +1,37 @@
1
+ import { Command } from "../../common/command.js";
2
+ /**
3
+ * The input for the PAT delete command
4
+ */
5
+ export interface SecurityDeletePAT {
6
+ /** The id of the PAT */
7
+ id: string;
8
+ }
9
+ export interface SecurityDeletePATResponse {
10
+ success: boolean;
11
+ }
12
+ /**
13
+ * Delete a Personal Access Token (PAT)
14
+ */
15
+ export declare class SecurityDeletePATCommand extends Command<SecurityDeletePAT, SecurityDeletePATResponse> {
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): SecurityDeletePATResponse;
36
+ }
37
+ //# sourceMappingURL=pat.delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.delete.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.delete.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,yBAAyB,CAAC;IACjG;;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,yBAAyB;CAQlF"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecurityDeletePATCommand = 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
+ /**
8
+ * Delete a Personal Access Token (PAT)
9
+ */
10
+ class SecurityDeletePATCommand extends command_js_1.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://security2.api.flowcore.io";
34
+ }
35
+ /**
36
+ * Get the path
37
+ */
38
+ getPath() {
39
+ return `/api/v1/pat/${this.input.id}`;
40
+ }
41
+ /**
42
+ * Parse the response
43
+ */
44
+ parseResponse(rawResponse) {
45
+ return (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Object({
46
+ success: typebox_1.Type.Boolean(),
47
+ }), rawResponse);
48
+ }
49
+ }
50
+ exports.SecurityDeletePATCommand = SecurityDeletePATCommand;
@@ -0,0 +1,41 @@
1
+ import { Command } from "../../common/command.js";
2
+ /**
3
+ * The input for the PAT create command
4
+ */
5
+ export interface SecurityExchangePAT {
6
+ /** The username of the user */
7
+ username: string;
8
+ /** The Personal Access Token */
9
+ pat: string;
10
+ }
11
+ export interface SecurityExchangePATResponse {
12
+ /** The token of the PAT */
13
+ accessToken: string;
14
+ }
15
+ /**
16
+ * Exchange a Personal Access Token (PAT) for an access token
17
+ */
18
+ export declare class SecurityExchangePATCommand extends Command<SecurityExchangePAT, SecurityExchangePATResponse> {
19
+ /**
20
+ * Whether the command should retry on failure
21
+ */
22
+ protected retryOnFailure: boolean;
23
+ /**
24
+ * Get the method
25
+ */
26
+ protected getMethod(): string;
27
+ /**
28
+ * Get the base url
29
+ */
30
+ protected getBaseUrl(): string;
31
+ protected getHeaders(): Record<string, string>;
32
+ /**
33
+ * Get the path
34
+ */
35
+ protected getPath(): string;
36
+ /**
37
+ * Parse the response
38
+ */
39
+ protected parseResponse(rawResponse: unknown): SecurityExchangePATResponse;
40
+ }
41
+ //# sourceMappingURL=pat.exchange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.exchange.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.exchange.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAGjD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,2BAA2B;IAC1C,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,OAAO,CAAC,mBAAmB,EAAE,2BAA2B,CAAC;IACvG;;OAEG;IACH,UAAmB,cAAc,EAAE,OAAO,CAAQ;IAElD;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;cAIpB,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMvD;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,2BAA2B;CAKpF"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecurityExchangePATCommand = 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
+ /**
8
+ * Exchange a Personal Access Token (PAT) for an access token
9
+ */
10
+ class SecurityExchangePATCommand extends command_js_1.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 "GET";
28
+ }
29
+ /**
30
+ * Get the base url
31
+ */
32
+ getBaseUrl() {
33
+ return "https://security2.api.flowcore.io";
34
+ }
35
+ getHeaders() {
36
+ const headers = super.getHeaders();
37
+ headers["x-flowcore-pat"] = this.input.pat;
38
+ return headers;
39
+ }
40
+ /**
41
+ * Get the path
42
+ */
43
+ getPath() {
44
+ return `/api/v1/pat/exchange/${this.input.username}`;
45
+ }
46
+ /**
47
+ * Parse the response
48
+ */
49
+ parseResponse(rawResponse) {
50
+ return (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Object({
51
+ accessToken: typebox_1.Type.String(),
52
+ }), rawResponse);
53
+ }
54
+ }
55
+ exports.SecurityExchangePATCommand = SecurityExchangePATCommand;
@@ -0,0 +1,35 @@
1
+ import { Command } from "../../common/command.js";
2
+ import { type PAT } from "../../contracts/pat.js";
3
+ /**
4
+ * The input for the PAT get command
5
+ */
6
+ export interface SecurityGetPAT {
7
+ /** The id of the PAT */
8
+ id: string;
9
+ }
10
+ /**
11
+ * Get a Personal Access Token (PAT)
12
+ */
13
+ export declare class SecurityGetPATCommand extends Command<SecurityGetPAT, PAT> {
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): PAT;
34
+ }
35
+ //# sourceMappingURL=pat.get.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.get.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,wBAAwB,CAAA;AAG5D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;IACrE;;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,GAAG;CAG5D"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecurityGetPATCommand = void 0;
4
+ const command_js_1 = require("../../common/command.js");
5
+ const pat_js_1 = require("../../contracts/pat.js");
6
+ const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
7
+ /**
8
+ * Get a Personal Access Token (PAT)
9
+ */
10
+ class SecurityGetPATCommand extends command_js_1.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 "GET";
28
+ }
29
+ /**
30
+ * Get the base url
31
+ */
32
+ getBaseUrl() {
33
+ return "https://security2.api.flowcore.io";
34
+ }
35
+ /**
36
+ * Get the path
37
+ */
38
+ getPath() {
39
+ return `/api/v1/pat/${this.input.id}`;
40
+ }
41
+ /**
42
+ * Parse the response
43
+ */
44
+ parseResponse(rawResponse) {
45
+ return (0, parse_response_helper_js_1.parseResponseHelper)(pat_js_1.PATSchema, rawResponse);
46
+ }
47
+ }
48
+ exports.SecurityGetPATCommand = SecurityGetPATCommand;
@@ -0,0 +1,28 @@
1
+ import { Command } from "../../common/command.js";
2
+ import { type PAT } from "../../contracts/pat.js";
3
+ /**
4
+ * List all your Personal Access Token (PAT)
5
+ */
6
+ export declare class SecurityListPATCommand extends Command<void, PAT[]> {
7
+ /**
8
+ * Whether the command should retry on failure
9
+ */
10
+ protected retryOnFailure: boolean;
11
+ /**
12
+ * Get the method
13
+ */
14
+ protected getMethod(): string;
15
+ /**
16
+ * Get the base url
17
+ */
18
+ protected getBaseUrl(): string;
19
+ /**
20
+ * Get the path
21
+ */
22
+ protected getPath(): string;
23
+ /**
24
+ * Parse the response
25
+ */
26
+ protected parseResponse(rawResponse: unknown): PAT[];
27
+ }
28
+ //# sourceMappingURL=pat.list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.list.d.ts","sourceRoot":"","sources":["../../../src/commands/security/pat.list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,wBAAwB,CAAA;AAG5D;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC;IAC9D;;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,GAAG,EAAE;CAG9D"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecurityListPATCommand = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ const command_js_1 = require("../../common/command.js");
6
+ const pat_js_1 = require("../../contracts/pat.js");
7
+ const parse_response_helper_js_1 = require("../../utils/parse-response-helper.js");
8
+ /**
9
+ * List all your Personal Access Token (PAT)
10
+ */
11
+ class SecurityListPATCommand extends command_js_1.Command {
12
+ constructor() {
13
+ super(...arguments);
14
+ /**
15
+ * Whether the command should retry on failure
16
+ */
17
+ Object.defineProperty(this, "retryOnFailure", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: false
22
+ });
23
+ }
24
+ /**
25
+ * Get the method
26
+ */
27
+ getMethod() {
28
+ return "GET";
29
+ }
30
+ /**
31
+ * Get the base url
32
+ */
33
+ getBaseUrl() {
34
+ return "https://security2.api.flowcore.io";
35
+ }
36
+ /**
37
+ * Get the path
38
+ */
39
+ getPath() {
40
+ return `/api/v1/pat`;
41
+ }
42
+ /**
43
+ * Parse the response
44
+ */
45
+ parseResponse(rawResponse) {
46
+ return (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Array(pat_js_1.PATSchema), rawResponse);
47
+ }
48
+ }
49
+ exports.SecurityListPATCommand = SecurityListPATCommand;
@@ -0,0 +1,16 @@
1
+ import { type Static, type TObject, type TOptional, type TString } from "@sinclair/typebox";
2
+ /**
3
+ * The schema for a PAT (Personal Access Token)
4
+ */
5
+ export declare const PATSchema: TObject<{
6
+ id: TString;
7
+ name: TString;
8
+ description: TOptional<TString>;
9
+ token: TOptional<TString>;
10
+ createdAt: TString;
11
+ }>;
12
+ /**
13
+ * The type for a PAT
14
+ */
15
+ export type PAT = Static<typeof PATSchema>;
16
+ //# sourceMappingURL=pat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pat.d.ts","sourceRoot":"","sources":["../../src/contracts/pat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EAEb,MAAM,mBAAmB,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC;IAC9B,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC/B,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;CACnB,CAMC,CAAA;AACF;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PATSchema = void 0;
4
+ const typebox_1 = require("@sinclair/typebox");
5
+ /**
6
+ * The schema for a PAT (Personal Access Token)
7
+ */
8
+ exports.PATSchema = typebox_1.Type.Object({
9
+ id: typebox_1.Type.String(),
10
+ name: typebox_1.Type.String(),
11
+ description: typebox_1.Type.Optional(typebox_1.Type.String()),
12
+ token: typebox_1.Type.Optional(typebox_1.Type.String()),
13
+ createdAt: typebox_1.Type.String(),
14
+ });