@stack-spot/portal-network 0.4.0-beta.0 → 0.5.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.4.0...portal-network@v0.5.0) (2024-08-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * migrate environment client ([61b6671](https://github.com/stack-spot/portal-commons/commit/61b6671c5ab44141d90ebf1df2fa1e41fd18f9b1))
9
+
3
10
  ## [0.4.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.3.1...portal-network@v0.4.0) (2024-08-05)
4
11
 
5
12
 
package/dist/apis.json CHANGED
@@ -117,13 +117,5 @@
117
117
  "prd": "https://api-management-apigw.stackspot.com/api-management"
118
118
  },
119
119
  "docs": "/v3/api-docs"
120
- },
121
- "secrets": {
122
- "url": {
123
- "dev": "https://workspace-workspace-secrets-api.dev.stackspot.com",
124
- "stg": "https://workspace-workspace-secrets-api.stg.stackspot.com",
125
- "prd": "https://workspace-workspace-secrets-api.stg.stackspot.com"
126
- },
127
- "docs": "/v3/api-docs"
128
120
  }
129
121
  }
@@ -0,0 +1,35 @@
1
+ import { HttpError } from '@oazapfts/runtime';
2
+ import { StackspotAPIError } from '../error/StackspotAPIError.js';
3
+ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
4
+ declare class WorkspaceClient extends ReactQueryNetworkClient {
5
+ constructor();
6
+ protected buildStackSpotError(error: HttpError): StackspotAPIError;
7
+ /**
8
+ * Gets all environments
9
+ */
10
+ environments: import("../network/types.js").QueryObject<{
11
+ accountId?: string | undefined;
12
+ }, import("../api/workspace.js").EnvironmentReadResponse[]>;
13
+ /**
14
+ * Gets environment by Id
15
+ */
16
+ environment: import("../network/types.js").QueryObject<{
17
+ id: string;
18
+ }, import("../api/workspace.js").EnvironmentReadResponse>;
19
+ /**
20
+ * Creates an environment
21
+ */
22
+ createEnvironment: import("../network/types.js").MutationObject<{
23
+ environmentSaveRequest: import("../api/workspace.js").EnvironmentSaveRequest;
24
+ }, import("../api/workspace.js").IdResponse>;
25
+ /**
26
+ * Updates environment data
27
+ */
28
+ updateEnvironment: import("../network/types.js").MutationObject<{
29
+ id: string;
30
+ environmentUpdateRequest: import("../api/workspace.js").EnvironmentUpdateRequest;
31
+ }, import("../api/workspace.js").IdResponse>;
32
+ }
33
+ export declare const workspaceClient: WorkspaceClient;
34
+ export {};
35
+ //# sourceMappingURL=workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/client/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAQ7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,eAAgB,SAAQ,uBAAuB;;IAKnD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,YAAY;;6DAA8B;IAE1C;;OAEG;IACH,WAAW;;2DAA6B;IAExC;;OAEG;IACH,iBAAiB;;8CAAiC;IAElD;;OAEG;IACH,iBAAiB;;;8CAAmC;CAErD;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAA"}
@@ -0,0 +1,51 @@
1
+ import { defaults, getEnvironment, getEnvironments, save9 as saveEnvironment, update9 as updateEnvironment, } from '../api/workspace.js';
2
+ import apis from '../apis.json';
3
+ import { DefaultAPIError } from '../error/DefaultAPIError.js';
4
+ import { workspaceDictionary } from '../error/dictionary/workspace.js';
5
+ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
6
+ class WorkspaceClient extends ReactQueryNetworkClient {
7
+ constructor() {
8
+ super(apis.workspace.url, defaults);
9
+ /**
10
+ * Gets all environments
11
+ */
12
+ Object.defineProperty(this, "environments", {
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true,
16
+ value: this.query(getEnvironments)
17
+ });
18
+ /**
19
+ * Gets environment by Id
20
+ */
21
+ Object.defineProperty(this, "environment", {
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true,
25
+ value: this.query(getEnvironment)
26
+ });
27
+ /**
28
+ * Creates an environment
29
+ */
30
+ Object.defineProperty(this, "createEnvironment", {
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true,
34
+ value: this.mutation(saveEnvironment)
35
+ });
36
+ /**
37
+ * Updates environment data
38
+ */
39
+ Object.defineProperty(this, "updateEnvironment", {
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true,
43
+ value: this.mutation(updateEnvironment)
44
+ });
45
+ }
46
+ buildStackSpotError(error) {
47
+ return new DefaultAPIError(error.data, error.status, workspaceDictionary, error.headers);
48
+ }
49
+ }
50
+ export const workspaceClient = new WorkspaceClient();
51
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/client/workspace.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,IAAI,eAAe,EACnE,OAAO,IAAI,iBAAiB,GAC7B,MAAM,kBAAkB,CAAA;AACzB,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAEnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,MAAM,eAAgB,SAAQ,uBAAuB;IACnD;QACE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAOrC;;WAEG;QACH;;;;mBAAe,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;WAAA;QAE1C;;WAEG;QACH;;;;mBAAc,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;WAAA;QAExC;;WAEG;QACH;;;;mBAAoB,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;WAAA;QAElD;;WAEG;QACH;;;;mBAAoB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;WAAA;IAxBpD,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IAC1F,CAAC;CAsBF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { accountClient } from './client/account.js';
2
- export { secretsClient } from './client/secrets.js';
2
+ export { workspaceClient } from './client/workspace.js';
3
3
  export { DefaultAPIError } from './error/DefaultAPIError.js';
4
4
  export { StackspotAPIError } from './error/StackspotAPIError.js';
5
5
  export { NetworkClient } from './network/NetworkClient.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { accountClient } from './client/account.js';
2
- export { secretsClient } from './client/secrets.js';
2
+ export { workspaceClient } from './client/workspace.js';
3
3
  export { DefaultAPIError } from './error/DefaultAPIError.js';
4
4
  export { StackspotAPIError } from './error/StackspotAPIError.js';
5
5
  export { NetworkClient } from './network/NetworkClient.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-network",
3
- "version": "0.4.0-beta.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -51,6 +51,7 @@
51
51
  "typescript": "^5.2.2"
52
52
  },
53
53
  "dependencies": {
54
- "@oazapfts/runtime": "^1.0.3"
54
+ "@oazapfts/runtime": "^1.0.3",
55
+ "lodash": "^4.17.21"
55
56
  }
56
57
  }
package/src/apis.json CHANGED
@@ -117,13 +117,5 @@
117
117
  "prd": "https://api-management-apigw.stackspot.com/api-management"
118
118
  },
119
119
  "docs": "/v3/api-docs"
120
- },
121
- "secrets": {
122
- "url": {
123
- "dev": "https://workspace-workspace-secrets-api.dev.stackspot.com",
124
- "stg": "https://workspace-workspace-secrets-api.stg.stackspot.com",
125
- "prd": "https://workspace-workspace-secrets-api.stg.stackspot.com"
126
- },
127
- "docs": "/v3/api-docs"
128
120
  }
129
121
  }
@@ -0,0 +1,43 @@
1
+ import { HttpError } from '@oazapfts/runtime'
2
+ import {
3
+ defaults, getEnvironment, getEnvironments, save9 as saveEnvironment,
4
+ update9 as updateEnvironment,
5
+ } from '../api/workspace'
6
+ import apis from '../apis.json'
7
+ import { DefaultAPIError } from '../error/DefaultAPIError'
8
+ import { workspaceDictionary } from '../error/dictionary/workspace'
9
+ import { StackspotAPIError } from '../error/StackspotAPIError'
10
+ import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
11
+
12
+ class WorkspaceClient extends ReactQueryNetworkClient {
13
+ constructor() {
14
+ super(apis.workspace.url, defaults)
15
+ }
16
+
17
+ protected buildStackSpotError(error: HttpError): StackspotAPIError {
18
+ return new DefaultAPIError(error.data, error.status, workspaceDictionary, error.headers)
19
+ }
20
+
21
+ /**
22
+ * Gets all environments
23
+ */
24
+ environments = this.query(getEnvironments)
25
+
26
+ /**
27
+ * Gets environment by Id
28
+ */
29
+ environment = this.query(getEnvironment)
30
+
31
+ /**
32
+ * Creates an environment
33
+ */
34
+ createEnvironment = this.mutation(saveEnvironment)
35
+
36
+ /**
37
+ * Updates environment data
38
+ */
39
+ updateEnvironment = this.mutation(updateEnvironment)
40
+
41
+ }
42
+
43
+ export const workspaceClient = new WorkspaceClient()
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { accountClient } from './client/account'
2
- export { secretsClient } from './client/secrets'
2
+ export { workspaceClient } from './client/workspace'
3
3
  export { DefaultAPIError } from './error/DefaultAPIError'
4
4
  export { StackspotAPIError } from './error/StackspotAPIError'
5
5
  export { NetworkClient } from './network/NetworkClient'
@@ -1,100 +0,0 @@
1
- /**
2
- * Workspace Secrets API
3
- * v1.0.0
4
- * DO NOT MODIFY - This file has been generated using oazapfts.
5
- * See https://www.npmjs.com/package/oazapfts
6
- */
7
- import * as Oazapfts from "@oazapfts/runtime";
8
- export declare const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders>;
9
- export declare const servers: {
10
- generatedServerUrl: string;
11
- };
12
- export type SecretValueResponse = {
13
- key: string;
14
- description: string;
15
- value: string;
16
- };
17
- export type ValidationDetails = {
18
- code: string;
19
- field?: string;
20
- details?: string;
21
- values?: string[];
22
- };
23
- export type ErrorResponse = {
24
- code: string;
25
- status: number;
26
- details: string;
27
- validationDetails?: ValidationDetails[];
28
- };
29
- export type UpdateSecretValueRequest = {
30
- value: string;
31
- };
32
- export type EditKeyRequest = {
33
- description: string;
34
- };
35
- export type SecretKeyResponse = {
36
- key: string;
37
- description: string;
38
- };
39
- export type CreateKeyRequest = {
40
- key: string;
41
- description: string;
42
- };
43
- export type SecretAvailabilityResponse = {
44
- definedKeys: string[];
45
- undefinedKeys: string[];
46
- };
47
- /**
48
- * Get a Secret Key value.
49
- */
50
- export declare function getSecretValue({ key, executionId }: {
51
- key: string;
52
- executionId?: string;
53
- }, opts?: Oazapfts.RequestOpts): Promise<SecretValueResponse>;
54
- /**
55
- * Edit a Secret Key value.
56
- */
57
- export declare function updateSecretValue({ key, updateSecretValueRequest }: {
58
- key: string;
59
- updateSecretValueRequest: UpdateSecretValueRequest;
60
- }, opts?: Oazapfts.RequestOpts): Promise<unknown>;
61
- /**
62
- * Delete a Secret Key value.
63
- */
64
- export declare function deleteSecretValue({ key }: {
65
- key: string;
66
- }, opts?: Oazapfts.RequestOpts): Promise<unknown>;
67
- /**
68
- * Edit a Secret Key.
69
- */
70
- export declare function editKey({ key, editKeyRequest }: {
71
- key: string;
72
- editKeyRequest: EditKeyRequest;
73
- }, opts?: Oazapfts.RequestOpts): Promise<unknown>;
74
- /**
75
- * Delete a Secret Key.
76
- */
77
- export declare function deleteKey({ key }: {
78
- key: string;
79
- }, opts?: Oazapfts.RequestOpts): Promise<unknown>;
80
- /**
81
- * List all Secret Keys.
82
- */
83
- export declare function getAll1(opts?: Oazapfts.RequestOpts): Promise<SecretKeyResponse[]>;
84
- /**
85
- * Create a new Secret Key.
86
- */
87
- export declare function createKey({ createKeyRequest }: {
88
- createKeyRequest: CreateKeyRequest;
89
- }, opts?: Oazapfts.RequestOpts): Promise<unknown>;
90
- /**
91
- * List all configured Secret Keys values.
92
- */
93
- export declare function getAll({ executionId }: {
94
- executionId?: string;
95
- }, opts?: Oazapfts.RequestOpts): Promise<SecretValueResponse[]>;
96
- /**
97
- * List all defined and not defined secret keys by the user.
98
- */
99
- export declare function getAvailability(opts?: Oazapfts.RequestOpts): Promise<SecretAvailabilityResponse>;
100
- //# sourceMappingURL=secrets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/api/secrets.ts"],"names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B;AACD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,uCAgB1D"}
@@ -1,101 +0,0 @@
1
- /**
2
- * Workspace Secrets API
3
- * v1.0.0
4
- * DO NOT MODIFY - This file has been generated using oazapfts.
5
- * See https://www.npmjs.com/package/oazapfts
6
- */
7
- import * as Oazapfts from "@oazapfts/runtime";
8
- import * as QS from "@oazapfts/runtime/query";
9
- export const defaults = {
10
- headers: {},
11
- baseUrl: "https://workspace-workspace-secrets-api.dev.stackspot.com",
12
- };
13
- const oazapfts = Oazapfts.runtime(defaults);
14
- export const servers = {
15
- generatedServerUrl: "https://workspace-workspace-secrets-api.dev.stackspot.com"
16
- };
17
- /**
18
- * Get a Secret Key value.
19
- */
20
- export function getSecretValue({ key, executionId }, opts) {
21
- return oazapfts.ok(oazapfts.fetchJson(`/v1/secrets/values/${encodeURIComponent(key)}${QS.query(QS.explode({
22
- executionId
23
- }))}`, {
24
- ...opts
25
- }));
26
- }
27
- /**
28
- * Edit a Secret Key value.
29
- */
30
- export function updateSecretValue({ key, updateSecretValueRequest }, opts) {
31
- return oazapfts.ok(oazapfts.fetchJson(`/v1/secrets/values/${encodeURIComponent(key)}`, oazapfts.json({
32
- ...opts,
33
- method: "PUT",
34
- body: updateSecretValueRequest
35
- })));
36
- }
37
- /**
38
- * Delete a Secret Key value.
39
- */
40
- export function deleteSecretValue({ key }, opts) {
41
- return oazapfts.ok(oazapfts.fetchJson(`/v1/secrets/values/${encodeURIComponent(key)}`, {
42
- ...opts,
43
- method: "DELETE"
44
- }));
45
- }
46
- /**
47
- * Edit a Secret Key.
48
- */
49
- export function editKey({ key, editKeyRequest }, opts) {
50
- return oazapfts.ok(oazapfts.fetchJson(`/v1/secrets/keys/${encodeURIComponent(key)}`, oazapfts.json({
51
- ...opts,
52
- method: "PUT",
53
- body: editKeyRequest
54
- })));
55
- }
56
- /**
57
- * Delete a Secret Key.
58
- */
59
- export function deleteKey({ key }, opts) {
60
- return oazapfts.ok(oazapfts.fetchJson(`/v1/secrets/keys/${encodeURIComponent(key)}`, {
61
- ...opts,
62
- method: "DELETE"
63
- }));
64
- }
65
- /**
66
- * List all Secret Keys.
67
- */
68
- export function getAll1(opts) {
69
- return oazapfts.ok(oazapfts.fetchJson("/v1/secrets/keys", {
70
- ...opts
71
- }));
72
- }
73
- /**
74
- * Create a new Secret Key.
75
- */
76
- export function createKey({ createKeyRequest }, opts) {
77
- return oazapfts.ok(oazapfts.fetchJson("/v1/secrets/keys", oazapfts.json({
78
- ...opts,
79
- method: "POST",
80
- body: createKeyRequest
81
- })));
82
- }
83
- /**
84
- * List all configured Secret Keys values.
85
- */
86
- export function getAll({ executionId }, opts) {
87
- return oazapfts.ok(oazapfts.fetchJson(`/v1/secrets/values${QS.query(QS.explode({
88
- executionId
89
- }))}`, {
90
- ...opts
91
- }));
92
- }
93
- /**
94
- * List all defined and not defined secret keys by the user.
95
- */
96
- export function getAvailability(opts) {
97
- return oazapfts.ok(oazapfts.fetchJson("/v1/secrets/availability", {
98
- ...opts
99
- }));
100
- }
101
- //# sourceMappingURL=secrets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/api/secrets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC9C,MAAM,CAAC,MAAM,QAAQ,GAA8C;IAC/D,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,2DAA2D;CACvE,CAAC;AACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,kBAAkB,EAAE,2DAA2D;CAClF,CAAC;AAoCF;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,GAAG,EAAE,WAAW,EAGhD,EAAE,IAA2B;IA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Client } from '../network/ReactQueryNetworkClient.js';
4
- declare class SecretClient extends ReactQueryNetworkClient {
5
- constructor();
6
- protected buildStackSpotError(error: HttpError): StackspotAPIError;
7
- /**
8
- * Create a key
9
- */
10
- createKey: import("../network/types.js").MutationObject<{
11
- createKeyRequest: import("../api/secrets.js").CreateKeyRequest;
12
- }, unknown>;
13
- /**
14
- * Get all keys
15
- */
16
- getAllKeys: import("../network/types.js").QueryObject<void, import("../api/secrets.js").SecretKeyResponse[]>;
17
- /**
18
- * Delete a key
19
- */
20
- deleteKey: import("../network/types.js").MutationObject<{
21
- key: string;
22
- }, unknown>;
23
- /**
24
- * Update a key's description
25
- */
26
- updateKey: import("../network/types.js").MutationObject<{
27
- key: string;
28
- editKeyRequest: import("../api/secrets.js").EditKeyRequest;
29
- }, unknown>;
30
- /**
31
- * Get which secrets are defined or undefined for a user
32
- */
33
- getAvailability: import("../network/types.js").QueryObject<void, import("../api/secrets.js").SecretAvailabilityResponse>;
34
- /**
35
- * Update a secret's value
36
- */
37
- updateSecretValue: import("../network/types.js").MutationObject<{
38
- key: string;
39
- updateSecretValueRequest: import("../api/secrets.js").UpdateSecretValueRequest;
40
- }, unknown>;
41
- /**
42
- * Delete a secret's value
43
- */
44
- deleteSecretValue: import("../network/types.js").MutationObject<{
45
- key: string;
46
- }, unknown>;
47
- }
48
- export declare const secretsClient: SecretClient;
49
- export {};
50
- //# sourceMappingURL=secrets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/client/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAM7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,YAAa,SAAQ,uBAAuB;;IAKhD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAIlE;;OAEG;IACH,SAAS;;gBAA2B;IAEpC;;OAEG;IACH,UAAU,6FAAsB;IAEhC;;OAEG;IACH,SAAS;;gBAA2B;IAEpC;;OAEG;IACH,SAAS;;;gBAAyB;IAElC;;OAEG;IACH,eAAe,oGAA8B;IAE7C;;OAEG;IACH,iBAAiB;;;gBAAmC;IAEpD;;OAEG;IACH,iBAAiB;;gBAAmC;CAErD;AAED,eAAO,MAAM,aAAa,cAAqB,CAAA"}
@@ -1,78 +0,0 @@
1
- import { createKey, defaults, deleteKey, deleteSecretValue, editKey, getAll1, getAvailability, updateSecretValue } from '../api/secrets.js';
2
- import apis from '../apis.json';
3
- import { DefaultAPIError } from '../error/DefaultAPIError.js';
4
- import { secretsDictionary } from '../error/dictionary/secrets.js';
5
- import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
6
- class SecretClient extends ReactQueryNetworkClient {
7
- constructor() {
8
- super(apis.secrets.url, defaults);
9
- /**
10
- * Create a key
11
- */
12
- Object.defineProperty(this, "createKey", {
13
- enumerable: true,
14
- configurable: true,
15
- writable: true,
16
- value: this.mutation(createKey)
17
- });
18
- /**
19
- * Get all keys
20
- */
21
- Object.defineProperty(this, "getAllKeys", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: this.query(getAll1)
26
- });
27
- /**
28
- * Delete a key
29
- */
30
- Object.defineProperty(this, "deleteKey", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: this.mutation(deleteKey)
35
- });
36
- /**
37
- * Update a key's description
38
- */
39
- Object.defineProperty(this, "updateKey", {
40
- enumerable: true,
41
- configurable: true,
42
- writable: true,
43
- value: this.mutation(editKey)
44
- });
45
- /**
46
- * Get which secrets are defined or undefined for a user
47
- */
48
- Object.defineProperty(this, "getAvailability", {
49
- enumerable: true,
50
- configurable: true,
51
- writable: true,
52
- value: this.query(getAvailability)
53
- });
54
- /**
55
- * Update a secret's value
56
- */
57
- Object.defineProperty(this, "updateSecretValue", {
58
- enumerable: true,
59
- configurable: true,
60
- writable: true,
61
- value: this.mutation(updateSecretValue)
62
- });
63
- /**
64
- * Delete a secret's value
65
- */
66
- Object.defineProperty(this, "deleteSecretValue", {
67
- enumerable: true,
68
- configurable: true,
69
- writable: true,
70
- value: this.mutation(deleteSecretValue)
71
- });
72
- }
73
- buildStackSpotError(error) {
74
- return new DefaultAPIError(error.data, error.status, secretsDictionary, error.headers);
75
- }
76
- }
77
- export const secretsClient = new SecretClient();
78
- //# sourceMappingURL=secrets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/client/secrets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACxI,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAE/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,MAAM,YAAa,SAAQ,uBAAuB;IAChD;QACE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAOnC;;WAEG;QACH;;;;mBAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;WAAA;QAEpC;;WAEG;QACH;;;;mBAAa,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;WAAA;QAEhC;;WAEG;QACH;;;;mBAAY,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;WAAA;QAEpC;;WAEG;QACH;;;;mBAAY,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;WAAA;QAElC;;WAEG;QACH;;;;mBAAkB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;WAAA;QAE7C;;WAEG;QACH;;;;mBAAoB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;WAAA;QAEpD;;WAEG;QACH;;;;mBAAoB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;WAAA;IAvCpD,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IACxF,CAAC;CAqCF;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,YAAY,EAAE,CAAA"}
@@ -1,13 +0,0 @@
1
- export declare const secretsDictionary: {
2
- en: {
3
- WSA_SECRET_KEY_ALREADY_EXISTS: string;
4
- WSA_SECRET_KEY_NOT_FOUND: string;
5
- WSA_SECRET_VALUE_NOT_FOUND: string;
6
- };
7
- pt: {
8
- WSA_SECRET_KEY_ALREADY_EXISTS: string;
9
- WSA_SECRET_KEY_NOT_FOUND: string;
10
- WSA_SECRET_VALUE_NOT_FOUND: string;
11
- };
12
- };
13
- //# sourceMappingURL=secrets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../src/error/dictionary/secrets.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;;;;;;;;;CAWR,CAAA"}
@@ -1,13 +0,0 @@
1
- export const secretsDictionary = {
2
- en: {
3
- WSA_SECRET_KEY_ALREADY_EXISTS: 'Secret Key already exists.',
4
- WSA_SECRET_KEY_NOT_FOUND: 'Secret Key not found.',
5
- WSA_SECRET_VALUE_NOT_FOUND: 'Secret Value not found.',
6
- },
7
- pt: {
8
- WSA_SECRET_KEY_ALREADY_EXISTS: 'Secret Key já existe.',
9
- WSA_SECRET_KEY_NOT_FOUND: 'Secret Key não encontrada.',
10
- WSA_SECRET_VALUE_NOT_FOUND: 'Valor da Secret não encontrado.',
11
- },
12
- };
13
- //# sourceMappingURL=secrets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../../src/error/dictionary/secrets.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,EAAE,EAAE;QACF,6BAA6B,EAAE,4BAA4B;QAC3D,wBAAwB,EAAE,uBAAuB;QACjD,0BAA0B,EAAE,yBAAyB;KACtD;IACD,EAAE,EAAE;QACF,6BAA6B,EAAE,uBAAuB;QACtD,wBAAwB,EAAE,4BAA4B;QACtD,0BAA0B,EAAE,iCAAiC;KAC9D;CACmB,CAAA"}
@@ -1,279 +0,0 @@
1
- /**
2
- * Workspace Secrets API
3
- * v1.0.0
4
- * DO NOT MODIFY - This file has been generated using oazapfts.
5
- * See https://www.npmjs.com/package/oazapfts
6
- */
7
- import * as Oazapfts from "@oazapfts/runtime";
8
- import * as QS from "@oazapfts/runtime/query";
9
- export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
10
- headers: {},
11
- baseUrl: "https://workspace-workspace-secrets-api.dev.stackspot.com",
12
- };
13
- const oazapfts = Oazapfts.runtime(defaults);
14
- export const servers = {
15
- generatedServerUrl: "https://workspace-workspace-secrets-api.dev.stackspot.com"
16
- };
17
- export type SecretValueResponse = {
18
- key: string;
19
- description: string;
20
- value: string;
21
- };
22
- export type ValidationDetails = {
23
- code: string;
24
- field?: string;
25
- details?: string;
26
- values?: string[];
27
- };
28
- export type ErrorResponse = {
29
- code: string;
30
- status: number;
31
- details: string;
32
- validationDetails?: ValidationDetails[];
33
- };
34
- export type UpdateSecretValueRequest = {
35
- value: string;
36
- };
37
- export type EditKeyRequest = {
38
- description: string;
39
- };
40
- export type SecretKeyResponse = {
41
- key: string;
42
- description: string;
43
- };
44
- export type CreateKeyRequest = {
45
- key: string;
46
- description: string;
47
- };
48
- export type SecretAvailabilityResponse = {
49
- definedKeys: string[];
50
- undefinedKeys: string[];
51
- };
52
- /**
53
- * Get a Secret Key value.
54
- */
55
- export function getSecretValue({ key, executionId }: {
56
- key: string;
57
- executionId?: string;
58
- }, opts?: Oazapfts.RequestOpts) {
59
- return oazapfts.ok(oazapfts.fetchJson<{
60
- status: 200;
61
- data: SecretValueResponse;
62
- } | {
63
- status: 400;
64
- data: ErrorResponse;
65
- } | {
66
- status: 403;
67
- data: ErrorResponse;
68
- } | {
69
- status: 422;
70
- data: ErrorResponse;
71
- } | {
72
- status: 500;
73
- data: ErrorResponse;
74
- }>(`/v1/secrets/values/${encodeURIComponent(key)}${QS.query(QS.explode({
75
- executionId
76
- }))}`, {
77
- ...opts
78
- }));
79
- }
80
- /**
81
- * Edit a Secret Key value.
82
- */
83
- export function updateSecretValue({ key, updateSecretValueRequest }: {
84
- key: string;
85
- updateSecretValueRequest: UpdateSecretValueRequest;
86
- }, opts?: Oazapfts.RequestOpts) {
87
- return oazapfts.ok(oazapfts.fetchJson<{
88
- status: 204;
89
- } | {
90
- status: 400;
91
- data: ErrorResponse;
92
- } | {
93
- status: 403;
94
- data: ErrorResponse;
95
- } | {
96
- status: 422;
97
- data: ErrorResponse;
98
- } | {
99
- status: 500;
100
- data: ErrorResponse;
101
- }>(`/v1/secrets/values/${encodeURIComponent(key)}`, oazapfts.json({
102
- ...opts,
103
- method: "PUT",
104
- body: updateSecretValueRequest
105
- })));
106
- }
107
- /**
108
- * Delete a Secret Key value.
109
- */
110
- export function deleteSecretValue({ key }: {
111
- key: string;
112
- }, opts?: Oazapfts.RequestOpts) {
113
- return oazapfts.ok(oazapfts.fetchJson<{
114
- status: 204;
115
- } | {
116
- status: 400;
117
- data: ErrorResponse;
118
- } | {
119
- status: 403;
120
- data: ErrorResponse;
121
- } | {
122
- status: 422;
123
- data: ErrorResponse;
124
- } | {
125
- status: 500;
126
- data: ErrorResponse;
127
- }>(`/v1/secrets/values/${encodeURIComponent(key)}`, {
128
- ...opts,
129
- method: "DELETE"
130
- }));
131
- }
132
- /**
133
- * Edit a Secret Key.
134
- */
135
- export function editKey({ key, editKeyRequest }: {
136
- key: string;
137
- editKeyRequest: EditKeyRequest;
138
- }, opts?: Oazapfts.RequestOpts) {
139
- return oazapfts.ok(oazapfts.fetchJson<{
140
- status: 200;
141
- } | {
142
- status: 400;
143
- data: ErrorResponse;
144
- } | {
145
- status: 403;
146
- data: ErrorResponse;
147
- } | {
148
- status: 422;
149
- data: ErrorResponse;
150
- } | {
151
- status: 500;
152
- data: ErrorResponse;
153
- }>(`/v1/secrets/keys/${encodeURIComponent(key)}`, oazapfts.json({
154
- ...opts,
155
- method: "PUT",
156
- body: editKeyRequest
157
- })));
158
- }
159
- /**
160
- * Delete a Secret Key.
161
- */
162
- export function deleteKey({ key }: {
163
- key: string;
164
- }, opts?: Oazapfts.RequestOpts) {
165
- return oazapfts.ok(oazapfts.fetchJson<{
166
- status: 204;
167
- } | {
168
- status: 400;
169
- data: ErrorResponse;
170
- } | {
171
- status: 403;
172
- data: ErrorResponse;
173
- } | {
174
- status: 422;
175
- data: ErrorResponse;
176
- } | {
177
- status: 500;
178
- data: ErrorResponse;
179
- }>(`/v1/secrets/keys/${encodeURIComponent(key)}`, {
180
- ...opts,
181
- method: "DELETE"
182
- }));
183
- }
184
- /**
185
- * List all Secret Keys.
186
- */
187
- export function getAll1(opts?: Oazapfts.RequestOpts) {
188
- return oazapfts.ok(oazapfts.fetchJson<{
189
- status: 200;
190
- data: SecretKeyResponse[];
191
- } | {
192
- status: 400;
193
- data: ErrorResponse;
194
- } | {
195
- status: 403;
196
- data: ErrorResponse;
197
- } | {
198
- status: 422;
199
- data: ErrorResponse;
200
- } | {
201
- status: 500;
202
- data: ErrorResponse;
203
- }>("/v1/secrets/keys", {
204
- ...opts
205
- }));
206
- }
207
- /**
208
- * Create a new Secret Key.
209
- */
210
- export function createKey({ createKeyRequest }: {
211
- createKeyRequest: CreateKeyRequest;
212
- }, opts?: Oazapfts.RequestOpts) {
213
- return oazapfts.ok(oazapfts.fetchJson<{
214
- status: 201;
215
- } | {
216
- status: 400;
217
- data: ErrorResponse;
218
- } | {
219
- status: 403;
220
- data: ErrorResponse;
221
- } | {
222
- status: 422;
223
- data: ErrorResponse;
224
- } | {
225
- status: 500;
226
- data: ErrorResponse;
227
- }>("/v1/secrets/keys", oazapfts.json({
228
- ...opts,
229
- method: "POST",
230
- body: createKeyRequest
231
- })));
232
- }
233
- /**
234
- * List all configured Secret Keys values.
235
- */
236
- export function getAll({ executionId }: {
237
- executionId?: string;
238
- }, opts?: Oazapfts.RequestOpts) {
239
- return oazapfts.ok(oazapfts.fetchJson<{
240
- status: 200;
241
- data: SecretValueResponse[];
242
- } | {
243
- status: 400;
244
- data: ErrorResponse;
245
- } | {
246
- status: 403;
247
- data: ErrorResponse;
248
- } | {
249
- status: 422;
250
- data: ErrorResponse;
251
- } | {
252
- status: 500;
253
- data: ErrorResponse;
254
- }>(`/v1/secrets/values${QS.query(QS.explode({
255
- executionId
256
- }))}`, {
257
- ...opts
258
- }));
259
- }
260
- /**
261
- * List all defined and not defined secret keys by the user.
262
- */
263
- export function getAvailability(opts?: Oazapfts.RequestOpts) {
264
- return oazapfts.ok(oazapfts.fetchJson<{
265
- status: 200;
266
- data: SecretAvailabilityResponse;
267
- } | {
268
- status: 400;
269
- data: ErrorResponse;
270
- } | {
271
- status: 403;
272
- data: ErrorResponse;
273
- } | {
274
- status: 500;
275
- data: ErrorResponse;
276
- }>("/v1/secrets/availability", {
277
- ...opts
278
- }));
279
- }
@@ -1,56 +0,0 @@
1
- import { HttpError } from '@oazapfts/runtime'
2
-
3
- import { createKey, defaults, deleteKey, deleteSecretValue, editKey, getAll1, getAvailability, updateSecretValue } from '../api/secrets'
4
- import apis from '../apis.json'
5
- import { DefaultAPIError } from '../error/DefaultAPIError'
6
- import { secretsDictionary } from '../error/dictionary/secrets'
7
- import { StackspotAPIError } from '../error/StackspotAPIError'
8
- import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
9
-
10
- class SecretClient extends ReactQueryNetworkClient {
11
- constructor() {
12
- super(apis.secrets.url, defaults)
13
- }
14
-
15
- protected buildStackSpotError(error: HttpError): StackspotAPIError {
16
- return new DefaultAPIError(error.data, error.status, secretsDictionary, error.headers)
17
- }
18
-
19
- /**
20
- * Create a key
21
- */
22
- createKey = this.mutation(createKey)
23
-
24
- /**
25
- * Get all keys
26
- */
27
- getAllKeys = this.query(getAll1)
28
-
29
- /**
30
- * Delete a key
31
- */
32
- deleteKey = this.mutation(deleteKey)
33
-
34
- /**
35
- * Update a key's description
36
- */
37
- updateKey = this.mutation(editKey)
38
-
39
- /**
40
- * Get which secrets are defined or undefined for a user
41
- */
42
- getAvailability = this.query(getAvailability)
43
-
44
- /**
45
- * Update a secret's value
46
- */
47
- updateSecretValue = this.mutation(updateSecretValue)
48
-
49
- /**
50
- * Delete a secret's value
51
- */
52
- deleteSecretValue = this.mutation(deleteSecretValue)
53
-
54
- }
55
-
56
- export const secretsClient = new SecretClient()
@@ -1,14 +0,0 @@
1
- import { Dictionary } from '@stack-spot/portal-translate'
2
-
3
- export const secretsDictionary = {
4
- en: {
5
- WSA_SECRET_KEY_ALREADY_EXISTS: 'Secret Key already exists.',
6
- WSA_SECRET_KEY_NOT_FOUND: 'Secret Key not found.',
7
- WSA_SECRET_VALUE_NOT_FOUND: 'Secret Value not found.',
8
- },
9
- pt: {
10
- WSA_SECRET_KEY_ALREADY_EXISTS: 'Secret Key já existe.',
11
- WSA_SECRET_KEY_NOT_FOUND: 'Secret Key não encontrada.',
12
- WSA_SECRET_VALUE_NOT_FOUND: 'Valor da Secret não encontrado.',
13
- },
14
- } satisfies Dictionary