attlaz-client 1.9.32 → 1.9.34
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/dist/Model/Deployment/CodeSource.d.ts +4 -1
- package/dist/Model/Deployment/CodeSource.js +5 -0
- package/dist/Model/{SourcesAccountRepository.d.ts → Deployment/SourcesAccountRepository.d.ts} +0 -0
- package/dist/Model/{SourcesAccountRepository.js → Deployment/SourcesAccountRepository.js} +0 -0
- package/dist/Model/Deployment/SourcesAccountRepositoryBranch.d.ts +4 -0
- package/dist/Model/Deployment/SourcesAccountRepositoryBranch.js +11 -0
- package/dist/Service/SourcesAccountEndpoint.d.ts +4 -4
- package/dist/Service/SourcesAccountEndpoint.js +20 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.js +6 -4
- package/package.json +4 -4
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { StateAware } from '../StateAware';
|
|
2
|
+
import { State } from '../State';
|
|
3
|
+
export declare class CodeSource implements StateAware {
|
|
2
4
|
id: string;
|
|
3
5
|
codeSourceAccountId: string;
|
|
4
6
|
repository: string;
|
|
5
7
|
branch: string;
|
|
6
8
|
platformId: string;
|
|
7
9
|
buildStrategyId: string;
|
|
10
|
+
state: State;
|
|
8
11
|
static parse(rawCodeSource: any): CodeSource;
|
|
9
12
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CodeSource = void 0;
|
|
4
|
+
const State_1 = require("../State");
|
|
4
5
|
class CodeSource {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.state = State_1.State.Active;
|
|
8
|
+
}
|
|
5
9
|
static parse(rawCodeSource) {
|
|
6
10
|
let codeSource = new CodeSource();
|
|
7
11
|
codeSource.id = rawCodeSource.id;
|
|
@@ -10,6 +14,7 @@ class CodeSource {
|
|
|
10
14
|
codeSource.branch = rawCodeSource.branch;
|
|
11
15
|
codeSource.platformId = rawCodeSource.platform;
|
|
12
16
|
codeSource.buildStrategyId = rawCodeSource.build_strategy;
|
|
17
|
+
codeSource.state = State_1.State.fromString(rawCodeSource.state);
|
|
13
18
|
return codeSource;
|
|
14
19
|
}
|
|
15
20
|
}
|
package/dist/Model/{SourcesAccountRepository.d.ts → Deployment/SourcesAccountRepository.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourcesAccountRepositoryBranch = void 0;
|
|
4
|
+
class SourcesAccountRepositoryBranch {
|
|
5
|
+
static parse(raw) {
|
|
6
|
+
let sourcesAccountRepositoryBranch = new SourcesAccountRepositoryBranch();
|
|
7
|
+
sourcesAccountRepositoryBranch.key = raw.key;
|
|
8
|
+
return sourcesAccountRepositoryBranch;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.SourcesAccountRepositoryBranch = SourcesAccountRepositoryBranch;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Endpoint } from './Endpoint';
|
|
2
|
-
import { SourcesAccountRepository } from '../Model/SourcesAccountRepository';
|
|
3
2
|
import { CodeSourceAccount } from '../Model/Deployment/CodeSourceAccount';
|
|
4
3
|
import { CodeSource } from '../Model/Deployment/CodeSource';
|
|
5
4
|
import { CollectionResult } from '../Model/Result/CollectionResult';
|
|
5
|
+
import { SourcesAccountRepository } from '../Model/Deployment/SourcesAccountRepository';
|
|
6
|
+
import { SourcesAccountRepositoryBranch } from '../Model/Deployment/SourcesAccountRepositoryBranch';
|
|
6
7
|
export declare class SourcesAccountEndpoint extends Endpoint {
|
|
7
8
|
getAllCodeSourceAccounts(): Promise<CollectionResult<CodeSourceAccount>>;
|
|
8
9
|
getCodeSourceAccountById(id: string): Promise<CodeSourceAccount | null>;
|
|
9
10
|
getCodeSourceById(codeSourceId: string): Promise<CodeSource | null>;
|
|
10
11
|
getRepositories(codeSourceAccountId: string): Promise<CollectionResult<SourcesAccountRepository>>;
|
|
11
|
-
getRepositoryBranches(codeSourceAccountId: string, repositoryKey: string): Promise<CollectionResult<
|
|
12
|
-
|
|
13
|
-
}>>;
|
|
12
|
+
getRepositoryBranches(codeSourceAccountId: string, repositoryKey: string): Promise<CollectionResult<SourcesAccountRepositoryBranch>>;
|
|
13
|
+
saveCodeSource(codeSource: CodeSource): Promise<CodeSource>;
|
|
14
14
|
}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SourcesAccountEndpoint = void 0;
|
|
4
4
|
const Endpoint_1 = require("./Endpoint");
|
|
5
|
-
const SourcesAccountRepository_1 = require("../Model/SourcesAccountRepository");
|
|
6
5
|
const Utils_1 = require("../Utils");
|
|
7
6
|
const CodeSourceAccount_1 = require("../Model/Deployment/CodeSourceAccount");
|
|
8
7
|
const CodeSource_1 = require("../Model/Deployment/CodeSource");
|
|
9
8
|
const HttpClient_1 = require("../Http/HttpClient");
|
|
9
|
+
const SourcesAccountRepository_1 = require("../Model/Deployment/SourcesAccountRepository");
|
|
10
|
+
const SourcesAccountRepositoryBranch_1 = require("../Model/Deployment/SourcesAccountRepositoryBranch");
|
|
10
11
|
class SourcesAccountEndpoint extends Endpoint_1.Endpoint {
|
|
11
12
|
async getAllCodeSourceAccounts() {
|
|
12
13
|
const result = await this.requestCollection('codesourceaccounts', null, CodeSourceAccount_1.CodeSourceAccount.parse);
|
|
@@ -53,11 +54,25 @@ class SourcesAccountEndpoint extends Endpoint_1.Endpoint {
|
|
|
53
54
|
}
|
|
54
55
|
async getRepositoryBranches(codeSourceAccountId, repositoryKey) {
|
|
55
56
|
repositoryKey = Utils_1.Utils.base64encode(repositoryKey);
|
|
56
|
-
const
|
|
57
|
-
return { key: raw.key };
|
|
58
|
-
};
|
|
59
|
-
const rawBranches = await this.requestCollection('codesourceaccounts/' + codeSourceAccountId + '/repositories/' + repositoryKey + '/branches', null, parser);
|
|
57
|
+
const rawBranches = await this.requestCollection('codesourceaccounts/' + codeSourceAccountId + '/repositories/' + repositoryKey + '/branches', null, SourcesAccountRepositoryBranch_1.SourcesAccountRepositoryBranch.parse);
|
|
60
58
|
return rawBranches;
|
|
61
59
|
}
|
|
60
|
+
async saveCodeSource(codeSource) {
|
|
61
|
+
try {
|
|
62
|
+
let url = '/codesources/';
|
|
63
|
+
const result = await this.requestObject(url, codeSource, CodeSource_1.CodeSource.parse, 'POST');
|
|
64
|
+
const updatedCodeSource = result.getData();
|
|
65
|
+
if (updatedCodeSource === null) {
|
|
66
|
+
throw new Error('Unable to update code source: wrong response from API');
|
|
67
|
+
}
|
|
68
|
+
return updatedCodeSource;
|
|
69
|
+
}
|
|
70
|
+
catch (ex) {
|
|
71
|
+
if (this.httpClient.isDebugEnabled()) {
|
|
72
|
+
console.error('Failed to save code source: ', ex);
|
|
73
|
+
}
|
|
74
|
+
throw ex;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
62
77
|
}
|
|
63
78
|
exports.SourcesAccountEndpoint = SourcesAccountEndpoint;
|
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,8 @@ export { WorkerState } from './Model/Worker/WorkerState';
|
|
|
75
75
|
/** Deployment **/
|
|
76
76
|
export { CodeSource } from './Model/Deployment/CodeSource';
|
|
77
77
|
export { CodeSourceAccount } from './Model/Deployment/CodeSourceAccount';
|
|
78
|
+
export { SourcesAccountRepository } from './Model/Deployment/SourcesAccountRepository';
|
|
79
|
+
export { SourcesAccountRepositoryBranch } from './Model/Deployment/SourcesAccountRepositoryBranch';
|
|
78
80
|
/** Workspace **/
|
|
79
81
|
export { Workspace } from './Model/Workspace/Workspace';
|
|
80
82
|
export { WorkspaceMember } from './Model/Workspace/WorkspaceMember';
|
|
@@ -86,7 +88,6 @@ export { WorkspaceMemberRole } from './Model/Workspace/WorkspaceMemberRole';
|
|
|
86
88
|
export { Config } from './Model/Config';
|
|
87
89
|
export { DataValue, DataValueValue } from './Model/DataValue';
|
|
88
90
|
export { Notification } from './Model/Notification';
|
|
89
|
-
export { SourcesAccountRepository } from './Model/SourcesAccountRepository';
|
|
90
91
|
export { State } from './Model/State';
|
|
91
92
|
/** Flow **/
|
|
92
93
|
export { Flow } from './Model/Flow/Flow';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ScheduleTriggerData = exports.ScheduleTrigger = exports.ApiTriggerData = exports.ApiTrigger = 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.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.
|
|
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 = void 0;
|
|
4
|
+
exports.StorageEndpoint = exports.SourcesAccountEndpoint = 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 = 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 = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* Http
|
|
8
8
|
*/
|
|
@@ -144,6 +144,10 @@ var CodeSource_1 = require("./Model/Deployment/CodeSource");
|
|
|
144
144
|
Object.defineProperty(exports, "CodeSource", { enumerable: true, get: function () { return CodeSource_1.CodeSource; } });
|
|
145
145
|
var CodeSourceAccount_1 = require("./Model/Deployment/CodeSourceAccount");
|
|
146
146
|
Object.defineProperty(exports, "CodeSourceAccount", { enumerable: true, get: function () { return CodeSourceAccount_1.CodeSourceAccount; } });
|
|
147
|
+
var SourcesAccountRepository_1 = require("./Model/Deployment/SourcesAccountRepository");
|
|
148
|
+
Object.defineProperty(exports, "SourcesAccountRepository", { enumerable: true, get: function () { return SourcesAccountRepository_1.SourcesAccountRepository; } });
|
|
149
|
+
var SourcesAccountRepositoryBranch_1 = require("./Model/Deployment/SourcesAccountRepositoryBranch");
|
|
150
|
+
Object.defineProperty(exports, "SourcesAccountRepositoryBranch", { enumerable: true, get: function () { return SourcesAccountRepositoryBranch_1.SourcesAccountRepositoryBranch; } });
|
|
147
151
|
/** Workspace **/
|
|
148
152
|
var Workspace_1 = require("./Model/Workspace/Workspace");
|
|
149
153
|
Object.defineProperty(exports, "Workspace", { enumerable: true, get: function () { return Workspace_1.Workspace; } });
|
|
@@ -164,8 +168,6 @@ var DataValue_1 = require("./Model/DataValue");
|
|
|
164
168
|
Object.defineProperty(exports, "DataValue", { enumerable: true, get: function () { return DataValue_1.DataValue; } });
|
|
165
169
|
var Notification_1 = require("./Model/Notification");
|
|
166
170
|
Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return Notification_1.Notification; } });
|
|
167
|
-
var SourcesAccountRepository_1 = require("./Model/SourcesAccountRepository");
|
|
168
|
-
Object.defineProperty(exports, "SourcesAccountRepository", { enumerable: true, get: function () { return SourcesAccountRepository_1.SourcesAccountRepository; } });
|
|
169
171
|
var State_1 = require("./Model/State");
|
|
170
172
|
Object.defineProperty(exports, "State", { enumerable: true, get: function () { return State_1.State; } });
|
|
171
173
|
/** Flow **/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "attlaz-client",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.34",
|
|
4
4
|
"description": "Javascript Client to access Attlaz API",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"prepare": "npm run clean && tsc --project tsconfig.production.json",
|
|
20
20
|
"build": "npm run clean && tsc",
|
|
21
21
|
"clean": "rimraf dist",
|
|
22
|
-
"test": "
|
|
22
|
+
"test": "jest"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"cache": "~/.npm",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/jest": "^29.2.5",
|
|
34
34
|
"@types/node": "^18.7.2",
|
|
35
|
-
"jest": "^
|
|
35
|
+
"jest": "^29.3.1",
|
|
36
36
|
"rimraf": "^4.0.4",
|
|
37
37
|
"rollup-plugin-commonjs": "^10.1.0",
|
|
38
38
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
39
39
|
"rollup-plugin-typescript": "^1.0.1",
|
|
40
|
-
"ts-jest": "^
|
|
40
|
+
"ts-jest": "^29.0.5",
|
|
41
41
|
"typescript": "^4.7.4",
|
|
42
42
|
"dotenv": "^16.0.1"
|
|
43
43
|
},
|