attlaz-client 1.9.63 → 1.9.65
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/README.md +4 -4
- package/dist/Client.d.ts +2 -0
- package/dist/Client.js +6 -1
- package/dist/Model/Search/SearchResult.d.ts +14 -0
- package/dist/Model/Search/SearchResult.js +47 -0
- package/dist/Service/SearchEndpoint.d.ts +6 -0
- package/dist/Service/SearchEndpoint.js +16 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10 -3
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ npm install attlaz-client
|
|
|
21
21
|
Getting Help
|
|
22
22
|
------------
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(
|
|
24
|
+
* [Issue Tracker](https://github.com/Attlaz-Platform) for questions, feature requests, bug reports and
|
|
25
|
+
general discussion related to these packages. Try searching before you create a new issue.
|
|
26
|
+
* Check the [Attlaz Documentation](https://docs.attlaz.com).
|
|
27
|
+
* [Email us](developers@attlaz.com) in Attlaz developer support: `developers@attlaz.com`
|
package/dist/Client.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { PlatformEndpoint } from './Service/PlatformEndpoint';
|
|
|
27
27
|
import { FlowRunStatsEndpoint } from './Service/FlowRunStatsEndpoint';
|
|
28
28
|
import { FirewallEndpoint } from './Service/FirewallEndpoint';
|
|
29
29
|
import { CodeSourceBuildStrategyEndpoint } from './Service/CodeSourceBuildStrategyEndpoint';
|
|
30
|
+
import { SearchEndpoint } from './Service/SearchEndpoint';
|
|
30
31
|
export declare class Client {
|
|
31
32
|
private readonly apiEndpoint;
|
|
32
33
|
private readonly clientId;
|
|
@@ -72,6 +73,7 @@ export declare class Client {
|
|
|
72
73
|
getQueueEndpoint(): QueueEndpoint;
|
|
73
74
|
getHealthAlertEndpoint(): HealthAlertEndpoint;
|
|
74
75
|
getCodeSourceBuildStrategyEndpoint(): CodeSourceBuildStrategyEndpoint;
|
|
76
|
+
getSearchEndpoint(): SearchEndpoint;
|
|
75
77
|
getFirewallEndpoint(): FirewallEndpoint;
|
|
76
78
|
private getEndpoint;
|
|
77
79
|
}
|
package/dist/Client.js
CHANGED
|
@@ -31,6 +31,7 @@ const FlowRunStatsEndpoint_1 = require("./Service/FlowRunStatsEndpoint");
|
|
|
31
31
|
const FirewallEndpoint_1 = require("./Service/FirewallEndpoint");
|
|
32
32
|
const version_1 = require("./version");
|
|
33
33
|
const CodeSourceBuildStrategyEndpoint_1 = require("./Service/CodeSourceBuildStrategyEndpoint");
|
|
34
|
+
const SearchEndpoint_1 = require("./Service/SearchEndpoint");
|
|
34
35
|
class Client {
|
|
35
36
|
constructor(apiEndpoint, clientId, clientSecret) {
|
|
36
37
|
this.apiEndpoint = apiEndpoint;
|
|
@@ -63,7 +64,8 @@ class Client {
|
|
|
63
64
|
PlatformEndpoint: PlatformEndpoint_1.PlatformEndpoint,
|
|
64
65
|
FlowRunStatsEndpoint: FlowRunStatsEndpoint_1.FlowRunStatsEndpoint,
|
|
65
66
|
CodeSourceBuildStrategyEndpoint: CodeSourceBuildStrategyEndpoint_1.CodeSourceBuildStrategyEndpoint,
|
|
66
|
-
FirewallEndpoint: FirewallEndpoint_1.FirewallEndpoint
|
|
67
|
+
FirewallEndpoint: FirewallEndpoint_1.FirewallEndpoint,
|
|
68
|
+
SearchEndpoint: SearchEndpoint_1.SearchEndpoint
|
|
67
69
|
};
|
|
68
70
|
const options = new OAuthClientOptions_1.OAuthClientOptions(apiEndpoint, clientId, clientSecret, this.getHeaders());
|
|
69
71
|
this.httpClient = new OAuthClient_1.OAuthClient(options);
|
|
@@ -201,6 +203,9 @@ class Client {
|
|
|
201
203
|
getCodeSourceBuildStrategyEndpoint() {
|
|
202
204
|
return this.getEndpoint('code-source-deploy-strategy', this.Store.CodeSourceBuildStrategyEndpoint);
|
|
203
205
|
}
|
|
206
|
+
getSearchEndpoint() {
|
|
207
|
+
return this.getEndpoint('search', this.Store.SearchEndpoint);
|
|
208
|
+
}
|
|
204
209
|
// TODO: this should be in a separate API?
|
|
205
210
|
getFirewallEndpoint() {
|
|
206
211
|
return this.getEndpoint('firewall', this.Store.FirewallEndpoint);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Workspace } from '../Workspace/Workspace';
|
|
2
|
+
import { Project } from '../Project/Project';
|
|
3
|
+
import { ProjectEnvironment } from '../Project/ProjectEnvironment';
|
|
4
|
+
import { Flow } from '../Flow/Flow';
|
|
5
|
+
import { FlowRun } from '../Flow/FlowRun';
|
|
6
|
+
import { Channel } from '../Messaging/Channel/Channel';
|
|
7
|
+
import { Adapter } from '../Adapter/Adapter';
|
|
8
|
+
export declare class SearchResult {
|
|
9
|
+
type: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
object: Workspace | Project | ProjectEnvironment | Flow | FlowRun | Channel | Adapter;
|
|
13
|
+
static parse(rawResult: any): SearchResult;
|
|
14
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchResult = void 0;
|
|
4
|
+
const Workspace_1 = require("../Workspace/Workspace");
|
|
5
|
+
const Project_1 = require("../Project/Project");
|
|
6
|
+
const ProjectEnvironment_1 = require("../Project/ProjectEnvironment");
|
|
7
|
+
const Flow_1 = require("../Flow/Flow");
|
|
8
|
+
const FlowRun_1 = require("../Flow/FlowRun");
|
|
9
|
+
const Adapter_1 = require("../Adapter/Adapter");
|
|
10
|
+
class SearchResult {
|
|
11
|
+
static parse(rawResult) {
|
|
12
|
+
const searchResult = new SearchResult();
|
|
13
|
+
searchResult.type = rawResult.type;
|
|
14
|
+
searchResult.object = rawResult.object;
|
|
15
|
+
searchResult.label = 'result';
|
|
16
|
+
searchResult.description = rawResult.description;
|
|
17
|
+
switch (rawResult.type) {
|
|
18
|
+
case 'workspace':
|
|
19
|
+
searchResult.object = Workspace_1.Workspace.parse(rawResult.object);
|
|
20
|
+
break;
|
|
21
|
+
case 'project':
|
|
22
|
+
searchResult.object = Project_1.Project.parse(rawResult.object);
|
|
23
|
+
searchResult.label = searchResult.object.name;
|
|
24
|
+
break;
|
|
25
|
+
case 'projectenvironment':
|
|
26
|
+
searchResult.object = ProjectEnvironment_1.ProjectEnvironment.parse(rawResult.object);
|
|
27
|
+
searchResult.label = searchResult.object.name;
|
|
28
|
+
break;
|
|
29
|
+
case 'flow':
|
|
30
|
+
searchResult.object = Flow_1.Flow.parse(rawResult.object);
|
|
31
|
+
searchResult.label = searchResult.object.name;
|
|
32
|
+
break;
|
|
33
|
+
case 'flowrun':
|
|
34
|
+
searchResult.object = FlowRun_1.FlowRun.parse(rawResult.object);
|
|
35
|
+
searchResult.label = searchResult.object.id;
|
|
36
|
+
break;
|
|
37
|
+
case 'adapter':
|
|
38
|
+
searchResult.object = Adapter_1.Adapter.parse(rawResult.object);
|
|
39
|
+
searchResult.label = searchResult.object.id;
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
throw new Error('Unknown search result type "' + rawResult.type + '"');
|
|
43
|
+
}
|
|
44
|
+
return searchResult;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.SearchResult = SearchResult;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Endpoint } from './Endpoint';
|
|
2
|
+
import { CollectionResult } from '../Model/Result/CollectionResult';
|
|
3
|
+
import { SearchResult } from '../Model/Search/SearchResult';
|
|
4
|
+
export declare class SearchEndpoint extends Endpoint {
|
|
5
|
+
search(query: string): Promise<CollectionResult<SearchResult>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const SearchResult_1 = require("../Model/Search/SearchResult");
|
|
6
|
+
class SearchEndpoint extends Endpoint_1.Endpoint {
|
|
7
|
+
async search(query) {
|
|
8
|
+
if (query.length > 512) {
|
|
9
|
+
query = query.substring(0, 512);
|
|
10
|
+
}
|
|
11
|
+
let cmd = 'search?q=' + query;
|
|
12
|
+
const result = await this.requestCollection(cmd, SearchResult_1.SearchResult.parse);
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.SearchEndpoint = SearchEndpoint;
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export { LogStatus } from './Model/Log/LogStatus';
|
|
|
25
25
|
export { LogStream } from './Model/Log/LogStream';
|
|
26
26
|
export { LogStreamId } from './Model/Log/LogStreamId';
|
|
27
27
|
export { LogStreamInformation } from './Model/Log/LogStreamInformation';
|
|
28
|
+
export { CursorPagination } from './Model/Pagination/CursorPagination';
|
|
28
29
|
/** Messaging **/
|
|
29
30
|
export { Channel } from './Model/Messaging/Channel/Channel';
|
|
30
31
|
export { ChannelData } from './Model/Messaging/Channel/ChannelData';
|
|
@@ -54,6 +55,8 @@ export { StorageInformation } from './Model/Storage/StorageInformation';
|
|
|
54
55
|
export { StorageType } from './Model/Storage/StorageType';
|
|
55
56
|
export { StorageItem } from './Model/Storage/StorageItem';
|
|
56
57
|
export { StorageItemInformation } from './Model/Storage/StorageItemInformation';
|
|
58
|
+
/** Queue **/
|
|
59
|
+
export { SearchResult } from './Model/Search/SearchResult';
|
|
57
60
|
/** Trigger **/
|
|
58
61
|
export { ApiTrigger } from './Model/Trigger/ApiTrigger';
|
|
59
62
|
export { ApiTriggerData } from './Model/Trigger/ApiTriggerData';
|
|
@@ -112,6 +115,7 @@ export { PlatformEndpoint } from './Service/PlatformEndpoint';
|
|
|
112
115
|
export { ProjectDeployEndpoint } from './Service/ProjectDeployEndpoint';
|
|
113
116
|
export { ProjectEnvironmentEndpoint } from './Service/ProjectEnvironmentEndpoint';
|
|
114
117
|
export { QueueEndpoint } from './Service/QueueEndpoint';
|
|
118
|
+
export { SearchEndpoint } from './Service/SearchEndpoint';
|
|
115
119
|
export { SourcesAccountEndpoint } from './Service/SourcesAccountEndpoint';
|
|
116
120
|
export { StorageEndpoint } from './Service/StorageEndpoint';
|
|
117
121
|
export { SubscriberEndpoint } from './Service/SubscriberEndpoint';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
5
|
-
exports.Utils = exports.Client = exports.HealthAlertEndpoint = exports.WorkerEndpoint = exports.WorkerConfigEndpoint = exports.UserEndpoint = exports.TriggerEndpoint = exports.WorkspaceEndpoint = exports.FlowRunStatsEndpoint = exports.FlowRunRequestEndpoint = exports.FlowRunEndpoint = exports.FlowEndpoint = exports.SubscriberEndpoint = void 0;
|
|
3
|
+
exports.ApiTriggerData = exports.ApiTrigger = exports.SearchResult = exports.StorageItemInformation = exports.StorageItem = exports.StorageType = exports.StorageInformation = exports.ResultError = exports.ObjectResult = exports.DataResult = exports.CollectionResult = exports.QueueStatus = exports.ProjectEnvironment = exports.ProjectDeployStatus = exports.ProjectDeployCommit = exports.ProjectDeploy = exports.Project = exports.PlatformLanguage = exports.ChannelHistory = exports.Subscriber = exports.WebhookChannelData = exports.SmsChannelData = exports.SlackChannelData = exports.PushChannelData = exports.EmailChannelData = exports.ChannelType = exports.ChannelData = exports.Channel = exports.CursorPagination = exports.LogStreamInformation = exports.LogStreamId = exports.LogStream = exports.LogStatus = exports.LogQuery = exports.LogLevel = exports.Log = exports.HealthTestType = exports.HealthAlertStatus = exports.HealthAlert = exports.EventType = exports.ClientError = exports.AdapterConnection = exports.AdapterConfiguration = exports.Adapter = exports.OAuthClientToken = exports.OAuthClientOptions = exports.OAuthClient = exports.HttpClientResponse = exports.HttpClientRequest = exports.HttpClient = void 0;
|
|
4
|
+
exports.QueueEndpoint = exports.ProjectEnvironmentEndpoint = exports.ProjectDeployEndpoint = exports.PlatformEndpoint = exports.NotificationsEndpoint = exports.WorkspaceMemberEndpoint = exports.LogEndpoint = exports.PlatformLanguageEndpoint = exports.ConfigEndpoint = exports.ProjectEndpoint = exports.ChannelEndpoint = exports.AdapterEndpoint = exports.Endpoint = exports.User = exports.FlowSummary = exports.FlowRunStats = exports.FlowRunSummary = exports.FlowRunStatus = exports.FlowRunResponse = exports.FlowRunHistory = exports.FlowRun = exports.Flow = exports.State = exports.Notification = exports.DataValue = exports.Config = exports.WorkspaceMemberRole = exports.WorkspaceMemberInviteState = exports.WorkspaceMemberInvite2 = exports.WorkspaceMemberInvite = exports.WorkspaceMember = exports.Workspace = exports.SourcesAccountRepositoryBranch = exports.SourcesAccountRepository = exports.CodeSourceAccount = exports.CodeSource = exports.WorkerState = exports.WorkerInstanceState = exports.WorkerInstance = exports.WorkerConfig = exports.Worker = exports.PlatformImage = exports.Platform = exports.WebhookTriggerData = exports.WebhookTrigger = exports.TriggerType = exports.TriggerData = exports.Trigger = exports.ScheduleTriggerData = exports.ScheduleTrigger = void 0;
|
|
5
|
+
exports.Utils = exports.Client = exports.HealthAlertEndpoint = exports.WorkerEndpoint = exports.WorkerConfigEndpoint = exports.UserEndpoint = exports.TriggerEndpoint = exports.WorkspaceEndpoint = exports.FlowRunStatsEndpoint = exports.FlowRunRequestEndpoint = exports.FlowRunEndpoint = exports.FlowEndpoint = exports.SubscriberEndpoint = exports.StorageEndpoint = exports.SourcesAccountEndpoint = exports.SearchEndpoint = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Http
|
|
8
8
|
*/
|
|
@@ -51,6 +51,8 @@ var LogStreamId_1 = require("./Model/Log/LogStreamId");
|
|
|
51
51
|
Object.defineProperty(exports, "LogStreamId", { enumerable: true, get: function () { return LogStreamId_1.LogStreamId; } });
|
|
52
52
|
var LogStreamInformation_1 = require("./Model/Log/LogStreamInformation");
|
|
53
53
|
Object.defineProperty(exports, "LogStreamInformation", { enumerable: true, get: function () { return LogStreamInformation_1.LogStreamInformation; } });
|
|
54
|
+
var CursorPagination_1 = require("./Model/Pagination/CursorPagination");
|
|
55
|
+
Object.defineProperty(exports, "CursorPagination", { enumerable: true, get: function () { return CursorPagination_1.CursorPagination; } });
|
|
54
56
|
/** Messaging **/
|
|
55
57
|
var Channel_1 = require("./Model/Messaging/Channel/Channel");
|
|
56
58
|
Object.defineProperty(exports, "Channel", { enumerable: true, get: function () { return Channel_1.Channel; } });
|
|
@@ -105,6 +107,9 @@ var StorageItem_1 = require("./Model/Storage/StorageItem");
|
|
|
105
107
|
Object.defineProperty(exports, "StorageItem", { enumerable: true, get: function () { return StorageItem_1.StorageItem; } });
|
|
106
108
|
var StorageItemInformation_1 = require("./Model/Storage/StorageItemInformation");
|
|
107
109
|
Object.defineProperty(exports, "StorageItemInformation", { enumerable: true, get: function () { return StorageItemInformation_1.StorageItemInformation; } });
|
|
110
|
+
/** Queue **/
|
|
111
|
+
var SearchResult_1 = require("./Model/Search/SearchResult");
|
|
112
|
+
Object.defineProperty(exports, "SearchResult", { enumerable: true, get: function () { return SearchResult_1.SearchResult; } });
|
|
108
113
|
/** Trigger **/
|
|
109
114
|
var ApiTrigger_1 = require("./Model/Trigger/ApiTrigger");
|
|
110
115
|
Object.defineProperty(exports, "ApiTrigger", { enumerable: true, get: function () { return ApiTrigger_1.ApiTrigger; } });
|
|
@@ -216,6 +221,8 @@ var ProjectEnvironmentEndpoint_1 = require("./Service/ProjectEnvironmentEndpoint
|
|
|
216
221
|
Object.defineProperty(exports, "ProjectEnvironmentEndpoint", { enumerable: true, get: function () { return ProjectEnvironmentEndpoint_1.ProjectEnvironmentEndpoint; } });
|
|
217
222
|
var QueueEndpoint_1 = require("./Service/QueueEndpoint");
|
|
218
223
|
Object.defineProperty(exports, "QueueEndpoint", { enumerable: true, get: function () { return QueueEndpoint_1.QueueEndpoint; } });
|
|
224
|
+
var SearchEndpoint_1 = require("./Service/SearchEndpoint");
|
|
225
|
+
Object.defineProperty(exports, "SearchEndpoint", { enumerable: true, get: function () { return SearchEndpoint_1.SearchEndpoint; } });
|
|
219
226
|
var SourcesAccountEndpoint_1 = require("./Service/SourcesAccountEndpoint");
|
|
220
227
|
Object.defineProperty(exports, "SourcesAccountEndpoint", { enumerable: true, get: function () { return SourcesAccountEndpoint_1.SourcesAccountEndpoint; } });
|
|
221
228
|
var StorageEndpoint_1 = require("./Service/StorageEndpoint");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "attlaz-client",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.65",
|
|
4
4
|
"description": "Javascript Client to access Attlaz API",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
"url": "git+https://bitbucket.org/attlaz/javascript-client.git"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://attlaz.com",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"attlaz",
|
|
14
|
+
"client",
|
|
15
|
+
"http",
|
|
16
|
+
"api"
|
|
17
|
+
],
|
|
12
18
|
"files": [
|
|
13
19
|
"dist/*"
|
|
14
20
|
],
|
|
@@ -33,7 +39,7 @@
|
|
|
33
39
|
"@types/jest": "^29.2.5",
|
|
34
40
|
"@types/node": "^18.7.2",
|
|
35
41
|
"jest": "^29.3.1",
|
|
36
|
-
"rimraf": "^
|
|
42
|
+
"rimraf": "^5.0.0",
|
|
37
43
|
"rollup-plugin-commonjs": "^10.1.0",
|
|
38
44
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
39
45
|
"rollup-plugin-typescript": "^1.0.1",
|