attlaz-client 1.19.3 → 1.19.5
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/Http/OAuthClient.d.ts +3 -0
- package/dist/Http/OAuthClient.js +9 -1
- package/dist/Model/Project/PlatformLanguage.d.ts +2 -1
- package/dist/Model/Project/PlatformLanguage.js +2 -0
- package/dist/Service/PlatformLanguageEndpoint.d.ts +2 -2
- package/dist/Service/PlatformLanguageEndpoint.js +3 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -22,7 +22,10 @@ export declare class OAuthClient {
|
|
|
22
22
|
enableDebug(): void;
|
|
23
23
|
disableDebug(): void;
|
|
24
24
|
isDebugEnabled(): boolean;
|
|
25
|
+
private defaultHeaders;
|
|
25
26
|
getDefaultHeaders(): Headers;
|
|
27
|
+
private initDefaultHeaders;
|
|
28
|
+
addDefaultHeader(header: string, value: string): void;
|
|
26
29
|
private isNodeEnvironment;
|
|
27
30
|
private tokenToOauthClientToken;
|
|
28
31
|
private getApiEndpointUrl;
|
package/dist/Http/OAuthClient.js
CHANGED
|
@@ -14,6 +14,7 @@ export class OAuthClient {
|
|
|
14
14
|
refreshTokenPromise = null;
|
|
15
15
|
constructor(options) {
|
|
16
16
|
this.options = options;
|
|
17
|
+
this.initDefaultHeaders();
|
|
17
18
|
}
|
|
18
19
|
async authenticate(username = null, password = null) {
|
|
19
20
|
// TODO: should we encrypt the password in the client (or is https save enough)?
|
|
@@ -150,7 +151,11 @@ export class OAuthClient {
|
|
|
150
151
|
isDebugEnabled() {
|
|
151
152
|
return this.debug;
|
|
152
153
|
}
|
|
154
|
+
defaultHeaders = {};
|
|
153
155
|
getDefaultHeaders() {
|
|
156
|
+
return this.defaultHeaders;
|
|
157
|
+
}
|
|
158
|
+
initDefaultHeaders() {
|
|
154
159
|
const userAgentInfo = {
|
|
155
160
|
version: VERSION,
|
|
156
161
|
language: 'Javascript',
|
|
@@ -161,7 +166,10 @@ export class OAuthClient {
|
|
|
161
166
|
if (this.isNodeEnvironment()) {
|
|
162
167
|
headers['User-Agent'] = 'Attlaz Http/' + VERSION;
|
|
163
168
|
}
|
|
164
|
-
|
|
169
|
+
this.defaultHeaders = headers;
|
|
170
|
+
}
|
|
171
|
+
addDefaultHeader(header, value) {
|
|
172
|
+
this.defaultHeaders[header] = value;
|
|
165
173
|
}
|
|
166
174
|
isNodeEnvironment() {
|
|
167
175
|
return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
|
|
@@ -2,9 +2,10 @@ import { State } from '../State.js';
|
|
|
2
2
|
import { StateAware } from '../StateAware.js';
|
|
3
3
|
export declare class PlatformLanguage implements StateAware {
|
|
4
4
|
id: string;
|
|
5
|
+
key: string;
|
|
5
6
|
name: string;
|
|
6
7
|
description: string;
|
|
7
8
|
state: State;
|
|
8
9
|
constructor(id: string, name: string);
|
|
9
|
-
static parse(rawLanguage:
|
|
10
|
+
static parse(rawLanguage: Record<string, unknown>): PlatformLanguage;
|
|
10
11
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { State } from '../State.js';
|
|
2
2
|
export class PlatformLanguage {
|
|
3
3
|
id;
|
|
4
|
+
key;
|
|
4
5
|
name;
|
|
5
6
|
description = '';
|
|
6
7
|
state = State.Active;
|
|
@@ -10,6 +11,7 @@ export class PlatformLanguage {
|
|
|
10
11
|
}
|
|
11
12
|
static parse(rawLanguage) {
|
|
12
13
|
const language = new PlatformLanguage(rawLanguage.id, rawLanguage.name);
|
|
14
|
+
language.key = rawLanguage.key;
|
|
13
15
|
language.description = rawLanguage.description;
|
|
14
16
|
language.state = State.fromString(rawLanguage.state);
|
|
15
17
|
return language;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Endpoint } from './Endpoint.js';
|
|
2
1
|
import { PlatformLanguage } from '../Model/Project/PlatformLanguage.js';
|
|
3
2
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
3
|
+
import { Endpoint } from './Endpoint.js';
|
|
4
4
|
export declare class PlatformLanguageEndpoint extends Endpoint {
|
|
5
|
-
getAll(): Promise<CollectionResult<PlatformLanguage>>;
|
|
5
|
+
getAll(workspaceId: string): Promise<CollectionResult<PlatformLanguage>>;
|
|
6
6
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Endpoint } from './Endpoint.js';
|
|
2
1
|
import { PlatformLanguage } from '../Model/Project/PlatformLanguage.js';
|
|
2
|
+
import { Endpoint } from './Endpoint.js';
|
|
3
3
|
export class PlatformLanguageEndpoint extends Endpoint {
|
|
4
|
-
async getAll() {
|
|
5
|
-
|
|
6
|
-
return result;
|
|
4
|
+
async getAll(workspaceId) {
|
|
5
|
+
return await this.requestCollection('/workspaces/' + workspaceId + '/platforms/languages', PlatformLanguage.parse);
|
|
7
6
|
}
|
|
8
7
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.19.
|
|
1
|
+
export declare const VERSION = "1.19.5";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.19.
|
|
1
|
+
export const VERSION = "1.19.5";
|