attlaz-client 1.32.1 → 1.33.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.
@@ -1,5 +1,7 @@
1
1
  import { Configuration } from '../Model/Configuration/Configuration.js';
2
+ import { CollectionResult } from '../Model/Result/CollectionResult.js';
2
3
  import { Endpoint } from './Endpoint.js';
3
4
  export declare class ConfigurationEndpoint extends Endpoint {
4
- getConfiguration(scopeId: string, path: string): Promise<Configuration | null>;
5
+ getByPath(scopeId: string, path: string): Promise<Configuration | null>;
6
+ getByPathQuery(scopeId: string, pathQuery: string): Promise<CollectionResult<Configuration>>;
5
7
  }
@@ -2,7 +2,7 @@ import { QueryString } from '../Http/Data/QueryString.js';
2
2
  import { Configuration } from '../Model/Configuration/Configuration.js';
3
3
  import { Endpoint } from './Endpoint.js';
4
4
  export class ConfigurationEndpoint extends Endpoint {
5
- async getConfiguration(scopeId, path) {
5
+ async getByPath(scopeId, path) {
6
6
  try {
7
7
  const qs = new QueryString('/configurations/' + scopeId);
8
8
  qs.set('path', path);
@@ -11,7 +11,21 @@ export class ConfigurationEndpoint extends Endpoint {
11
11
  }
12
12
  catch (error) {
13
13
  if (this.httpClient.isDebugEnabled()) {
14
- console.error('Unable to load flow configuration', error);
14
+ console.error('Unable to load configuration', error);
15
+ }
16
+ throw error;
17
+ }
18
+ }
19
+ async getByPathQuery(scopeId, pathQuery) {
20
+ try {
21
+ const qs = new QueryString('/configurations/query/' + scopeId);
22
+ qs.set('query', pathQuery);
23
+ const result = await this.requestCollection(qs, Configuration.parse);
24
+ return result;
25
+ }
26
+ catch (error) {
27
+ if (this.httpClient.isDebugEnabled()) {
28
+ console.error('Unable to load configuration', error);
15
29
  }
16
30
  throw error;
17
31
  }
@@ -117,10 +117,9 @@ export class Endpoint {
117
117
  catch (error) {
118
118
  if (error.httpStatus === HttpStatus.HTTP_NOTFOUND) {
119
119
  result.setData(null);
120
+ return result;
120
121
  }
121
- else {
122
- throw this.toApiError(error);
123
- }
122
+ throw this.toApiError(error);
124
123
  }
125
124
  // TODO: add errors
126
125
  /**
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.32.0";
1
+ export declare const VERSION = "1.33.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.32.0";
1
+ export const VERSION = "1.33.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.32.1",
3
+ "version": "1.33.0",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",