attlaz-client 1.46.3 → 1.47.1

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/Client.d.ts CHANGED
@@ -21,6 +21,7 @@ import { PlatformEndpoint } from './Service/PlatformEndpoint.js';
21
21
  import { PlatformLanguageEndpoint } from './Service/PlatformLanguageEndpoint.js';
22
22
  import { ProjectEndpoint } from './Service/ProjectEndpoint.js';
23
23
  import { ProjectEnvironmentEndpoint } from './Service/ProjectEnvironmentEndpoint.js';
24
+ import { ProviderTokenEndpoint } from './Service/ProviderTokenEndpoint.js';
24
25
  import { RunnerEndpoint } from './Service/RunnerEndpoint.js';
25
26
  import { RunnerPoolEndpoint } from './Service/RunnerPoolEndpoint.js';
26
27
  import { SearchEndpoint } from './Service/SearchEndpoint.js';
@@ -84,6 +85,7 @@ export declare class Client {
84
85
  getAccessTokenEndpoint(): AccessTokenEndpoint;
85
86
  getCollectionsEndpoint(): CollectionsEndpoint;
86
87
  getRunnerPoolEndpoint(): RunnerPoolEndpoint;
88
+ getProviderTokenEndpoint(): ProviderTokenEndpoint;
87
89
  getFirewallEndpoint(): FirewallEndpoint;
88
90
  private getEndpoint;
89
91
  getVersion(): string;
package/dist/Client.js CHANGED
@@ -22,6 +22,7 @@ import { PlatformEndpoint } from './Service/PlatformEndpoint.js';
22
22
  import { PlatformLanguageEndpoint } from './Service/PlatformLanguageEndpoint.js';
23
23
  import { ProjectEndpoint } from './Service/ProjectEndpoint.js';
24
24
  import { ProjectEnvironmentEndpoint } from './Service/ProjectEnvironmentEndpoint.js';
25
+ import { ProviderTokenEndpoint } from './Service/ProviderTokenEndpoint.js';
25
26
  import { RunnerEndpoint } from './Service/RunnerEndpoint.js';
26
27
  import { RunnerPoolEndpoint } from './Service/RunnerPoolEndpoint.js';
27
28
  import { SearchEndpoint } from './Service/SearchEndpoint.js';
@@ -69,7 +70,8 @@ export class Client {
69
70
  WorkspaceEndpoint,
70
71
  WorkspaceMemberEndpoint,
71
72
  CollectionsEndpoint,
72
- QueueSpecificationEndpoint: RunnerPoolEndpoint,
73
+ RunnerPoolEndpoint,
74
+ ProviderTokenEndpoint,
73
75
  };
74
76
  apiEndpoint = 'https://api.attlaz.com';
75
77
  parseConfig(config) {
@@ -220,7 +222,10 @@ export class Client {
220
222
  return this.getEndpoint('collections', this.Store.CollectionsEndpoint);
221
223
  }
222
224
  getRunnerPoolEndpoint() {
223
- return this.getEndpoint('runner_pool', this.Store.QueueSpecificationEndpoint);
225
+ return this.getEndpoint('runner_pool', this.Store.RunnerPoolEndpoint);
226
+ }
227
+ getProviderTokenEndpoint() {
228
+ return this.getEndpoint('provider_token', this.Store.ProviderTokenEndpoint);
224
229
  }
225
230
  // TODO: this should be in a separate API?
226
231
  getFirewallEndpoint() {
@@ -1,12 +1,13 @@
1
- import { State } from '../State.js';
2
- import { StateAware } from '../StateAware.js';
3
1
  import { MetaDataAware } from '../../Core/MetaDataAware.js';
4
2
  import { ApiRecord } from '../ApiRecord.js';
3
+ import { State } from '../State.js';
4
+ import { StateAware } from '../StateAware.js';
5
5
  export declare class CodeSourceAccount extends MetaDataAware implements StateAware {
6
6
  id: string;
7
7
  userId: string;
8
8
  workspaceId: string;
9
9
  type: string;
10
+ providerToken: string | null;
10
11
  state: State;
11
12
  static parse(rawSourcesAccount: ApiRecord): CodeSourceAccount;
12
13
  }
@@ -1,10 +1,11 @@
1
- import { State } from '../State.js';
2
1
  import { MetaDataAware } from '../../Core/MetaDataAware.js';
2
+ import { State } from '../State.js';
3
3
  export class CodeSourceAccount extends MetaDataAware {
4
4
  id;
5
5
  userId;
6
6
  workspaceId;
7
7
  type;
8
+ providerToken;
8
9
  // public access_token: string;
9
10
  // public refresh_token: string;
10
11
  // public scopes: string;
@@ -14,6 +15,7 @@ export class CodeSourceAccount extends MetaDataAware {
14
15
  sourcesAccount.userId = rawSourcesAccount.user;
15
16
  sourcesAccount.workspaceId = rawSourcesAccount.workspace;
16
17
  sourcesAccount.type = rawSourcesAccount.type;
18
+ sourcesAccount.providerToken = rawSourcesAccount.provider_token;
17
19
  // sourcesAccount.access_token = rawSourcesAccount.access_token;
18
20
  // sourcesAccount.refresh_token = rawSourcesAccount.refresh_token;
19
21
  // sourcesAccount.scopes = rawSourcesAccount.scopes;
@@ -0,0 +1,11 @@
1
+ import { ApiRecord } from './ApiRecord.js';
2
+ export declare class ProviderToken {
3
+ id: string;
4
+ state: string;
5
+ details: {
6
+ name: string;
7
+ id: string;
8
+ icon: string | null;
9
+ } | null;
10
+ static parse(rawAdapter: ApiRecord): ProviderToken;
11
+ }
@@ -0,0 +1,24 @@
1
+ export class ProviderToken {
2
+ id;
3
+ state;
4
+ details;
5
+ static parse(rawAdapter) {
6
+ // const adapter: Adapter = MetaDataWithIconAware.parseMetaData(new Adapter(), rawAdapter);
7
+ //
8
+ // // adapter.id = rawAdapter.id as string;
9
+ // // adapter.name = rawAdapter.name as string;
10
+ // // adapter.description = rawAdapter.description as string;
11
+ // adapter.vendor = rawAdapter.vendor as string;
12
+ //
13
+ // adapter.longDescription = rawAdapter.long_description as string | null;
14
+ // adapter.capabilities = rawAdapter.capabilities as unknown as string[];
15
+ //
16
+ // // adapter.icon = rawAdapter.icon as string;
17
+ // adapter.logo = MetaDataWithIconAware.parseIcon(rawAdapter.logo);
18
+ // adapter.type = rawAdapter.type as string;
19
+ // adapter.categoryIds = rawAdapter.categories as unknown as string[];
20
+ // adapter.docs = rawAdapter.docs as string | null;
21
+ // adapter.website = rawAdapter.website as string | null;
22
+ return rawAdapter;
23
+ }
24
+ }
@@ -0,0 +1,6 @@
1
+ import { ProviderToken } from '../Model/ProviderToken.js';
2
+ import { Endpoint } from './Endpoint.js';
3
+ export declare class ProviderTokenEndpoint extends Endpoint {
4
+ getProviderToken(providerTokenId: string): Promise<ProviderToken | null>;
5
+ getProviderTokenAccessToken(providerTokenId: string): Promise<ProviderToken | null>;
6
+ }
@@ -0,0 +1,16 @@
1
+ import { QueryString } from '../Http/Data/QueryString.js';
2
+ import { ProviderToken } from '../Model/ProviderToken.js';
3
+ import { Endpoint } from './Endpoint.js';
4
+ export class ProviderTokenEndpoint extends Endpoint {
5
+ async getProviderToken(providerTokenId) {
6
+ const queryString = new QueryString('/provider-tokens/' + providerTokenId);
7
+ const result = await this.requestObject(queryString, null, ProviderToken.parse);
8
+ return result.getData();
9
+ }
10
+ async getProviderTokenAccessToken(providerTokenId) {
11
+ // TODO: further implement this
12
+ const queryString = new QueryString('/provider-tokens/' + providerTokenId + '/access-token');
13
+ const result = await this.requestObject(queryString, null, ProviderToken.parse);
14
+ return result.getData();
15
+ }
16
+ }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.46.2";
1
+ export declare const VERSION = "1.47.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.46.2";
1
+ export const VERSION = "1.47.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.46.3",
3
+ "version": "1.47.1",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",