attlaz-client 1.21.11 → 1.21.12
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.
|
@@ -7,7 +7,7 @@ export declare class Adapter {
|
|
|
7
7
|
logo: string;
|
|
8
8
|
type: string;
|
|
9
9
|
categoryIds: string[];
|
|
10
|
-
docs: string;
|
|
11
|
-
website: string;
|
|
12
|
-
static parse(rawAdapter: Record<string,
|
|
10
|
+
docs: string | null;
|
|
11
|
+
website: string | null;
|
|
12
|
+
static parse(rawAdapter: Record<string, unknown>): Adapter;
|
|
13
13
|
}
|
|
@@ -14,6 +14,7 @@ export declare class SearchResult {
|
|
|
14
14
|
type: EntityType;
|
|
15
15
|
label: string;
|
|
16
16
|
description: string;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
entity: Workspace | WorkspaceMember | Project | ProjectEnvironment | Flow | FlowRun | Trigger | Channel | Subscriber | Adapter | AdapterConnection;
|
|
18
|
+
score: number;
|
|
19
|
+
static parse(rawResult: Record<string, unknown>): SearchResult;
|
|
19
20
|
}
|
|
@@ -14,50 +14,52 @@ export class SearchResult {
|
|
|
14
14
|
type;
|
|
15
15
|
label;
|
|
16
16
|
description;
|
|
17
|
-
|
|
17
|
+
entity;
|
|
18
|
+
score;
|
|
18
19
|
static parse(rawResult) {
|
|
19
20
|
const searchResult = new SearchResult();
|
|
20
|
-
searchResult.type = EntityType.fromString(rawResult.
|
|
21
|
-
searchResult.
|
|
21
|
+
searchResult.type = EntityType.fromString(rawResult.entity_type);
|
|
22
|
+
// searchResult.entity = rawResult.entity;
|
|
22
23
|
searchResult.label = rawResult.label;
|
|
23
24
|
searchResult.description = rawResult.description;
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
searchResult.score = rawResult.score;
|
|
26
|
+
const rawEntity = rawResult.entity;
|
|
27
|
+
switch (searchResult.type) {
|
|
26
28
|
case EntityType.Workspace:
|
|
27
|
-
searchResult.
|
|
29
|
+
searchResult.entity = Workspace.parse(rawEntity);
|
|
28
30
|
break;
|
|
29
31
|
case EntityType.Project:
|
|
30
|
-
searchResult.
|
|
32
|
+
searchResult.entity = Project.parse(rawEntity);
|
|
31
33
|
break;
|
|
32
34
|
case EntityType.ProjectEnvironment:
|
|
33
|
-
searchResult.
|
|
35
|
+
searchResult.entity = ProjectEnvironment.parse(rawEntity);
|
|
34
36
|
break;
|
|
35
37
|
case EntityType.Flow:
|
|
36
|
-
searchResult.
|
|
38
|
+
searchResult.entity = Flow.parse(rawEntity);
|
|
37
39
|
break;
|
|
38
40
|
case EntityType.FlowRun:
|
|
39
|
-
searchResult.
|
|
41
|
+
searchResult.entity = FlowRun.parse(rawEntity);
|
|
40
42
|
break;
|
|
41
43
|
case EntityType.WorkspaceMember:
|
|
42
|
-
searchResult.
|
|
44
|
+
searchResult.entity = WorkspaceMember.parse(rawEntity);
|
|
43
45
|
break;
|
|
44
46
|
case EntityType.Adapter:
|
|
45
|
-
searchResult.
|
|
47
|
+
searchResult.entity = Adapter.parse(rawEntity);
|
|
46
48
|
break;
|
|
47
49
|
case EntityType.AdapterConnection:
|
|
48
|
-
searchResult.
|
|
50
|
+
searchResult.entity = AdapterConnection.parse(rawEntity);
|
|
49
51
|
break;
|
|
50
52
|
case EntityType.Channel:
|
|
51
|
-
searchResult.
|
|
53
|
+
searchResult.entity = Channel.parse(rawEntity);
|
|
52
54
|
break;
|
|
53
55
|
case EntityType.ChannelSubscriber:
|
|
54
|
-
searchResult.
|
|
56
|
+
searchResult.entity = Subscriber.parseRaw(rawEntity);
|
|
55
57
|
break;
|
|
56
58
|
case EntityType.Trigger:
|
|
57
|
-
searchResult.
|
|
59
|
+
searchResult.entity = Trigger.parse(rawEntity);
|
|
58
60
|
break;
|
|
59
61
|
default:
|
|
60
|
-
throw new Error('Unknown search result type "' +
|
|
62
|
+
throw new Error('Unknown search result type "' + searchResult.type + '"');
|
|
61
63
|
}
|
|
62
64
|
return searchResult;
|
|
63
65
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { SearchResult } from '../Model/Search/SearchResult.js';
|
|
2
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
2
3
|
import { Endpoint } from './Endpoint.js';
|
|
3
4
|
export class SearchEndpoint extends Endpoint {
|
|
4
5
|
async search(query) {
|
|
5
6
|
if (query.length > 512) {
|
|
6
7
|
query = query.substring(0, 512);
|
|
7
8
|
}
|
|
8
|
-
const
|
|
9
|
-
|
|
9
|
+
const qs = new QueryString('search');
|
|
10
|
+
qs.set('q', query);
|
|
11
|
+
const result = await this.requestCollection(qs, SearchResult.parse);
|
|
10
12
|
return result;
|
|
11
13
|
}
|
|
12
14
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.21.
|
|
1
|
+
export declare const VERSION = "1.21.11";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.21.
|
|
1
|
+
export const VERSION = "1.21.11";
|