attlaz-client 1.12.0 → 1.12.2
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/Data/QueryString.d.ts +6 -0
- package/dist/Http/Data/QueryString.js +24 -2
- package/dist/Service/ChannelEndpoint.d.ts +4 -3
- package/dist/Service/ChannelEndpoint.js +13 -25
- package/dist/Service/Endpoint.d.ts +1 -3
- package/dist/Service/Endpoint.js +3 -15
- package/dist/Service/FlowRunEndpoint.js +4 -2
- package/dist/Service/LogEndpoint.js +4 -3
- package/dist/Service/ProjectEndpoint.d.ts +2 -1
- package/dist/Service/ProjectEndpoint.js +5 -6
- package/dist/Service/SourcesAccountEndpoint.d.ts +5 -4
- package/dist/Service/SourcesAccountEndpoint.js +17 -8
- package/dist/Service/WorkspaceMemberEndpoint.d.ts +2 -1
- package/dist/Service/WorkspaceMemberEndpoint.js +5 -3
- package/dist/main.d.ts +1 -0
- package/dist/main.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { CursorPagination } from '../../Model/Pagination/CursorPagination.js';
|
|
2
|
+
import { State } from '../../Model/State.js';
|
|
1
3
|
export declare class QueryString {
|
|
4
|
+
private readonly command;
|
|
2
5
|
private parameters;
|
|
6
|
+
constructor(command: string);
|
|
3
7
|
set(parameter: string, value: string | number | boolean | string[]): void;
|
|
8
|
+
addPagination(pagination: CursorPagination | null): void;
|
|
9
|
+
addStateFilter(states: State[] | null): void;
|
|
4
10
|
getParameters(): {
|
|
5
11
|
parameter: string;
|
|
6
12
|
value: string | number | boolean | string[];
|
|
@@ -1,14 +1,36 @@
|
|
|
1
1
|
export class QueryString {
|
|
2
|
+
command;
|
|
2
3
|
parameters = [];
|
|
4
|
+
constructor(command) {
|
|
5
|
+
this.command = command;
|
|
6
|
+
}
|
|
3
7
|
set(parameter, value) {
|
|
4
8
|
this.parameters.push({ parameter, value });
|
|
5
9
|
}
|
|
10
|
+
addPagination(pagination) {
|
|
11
|
+
if (pagination !== null && pagination !== undefined) {
|
|
12
|
+
if (pagination.limit !== null && pagination.limit !== undefined) {
|
|
13
|
+
this.set('limit', pagination.limit);
|
|
14
|
+
}
|
|
15
|
+
if (pagination.startingAfter !== null && pagination.startingAfter !== undefined && pagination.startingAfter !== '') {
|
|
16
|
+
this.set('starting_after', pagination.startingAfter);
|
|
17
|
+
}
|
|
18
|
+
if (pagination.endingBefore !== null && pagination.endingBefore !== undefined && pagination.endingBefore !== '') {
|
|
19
|
+
this.set('ending_before', pagination.endingBefore);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
addStateFilter(states) {
|
|
24
|
+
if (states !== null) {
|
|
25
|
+
this.set('state', states);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
6
28
|
getParameters() {
|
|
7
29
|
return this.parameters;
|
|
8
30
|
}
|
|
9
31
|
build() {
|
|
10
32
|
if (this.parameters.length === 0) {
|
|
11
|
-
return
|
|
33
|
+
return this.command;
|
|
12
34
|
}
|
|
13
35
|
const output = [];
|
|
14
36
|
for (const parameter of this.parameters) {
|
|
@@ -18,6 +40,6 @@ export class QueryString {
|
|
|
18
40
|
}
|
|
19
41
|
output.push(parameter.parameter + '=' + value);
|
|
20
42
|
}
|
|
21
|
-
return '?' + output.join('&');
|
|
43
|
+
return this.command + '?' + output.join('&');
|
|
22
44
|
}
|
|
23
45
|
}
|
|
@@ -2,11 +2,12 @@ import { Endpoint } from './Endpoint.js';
|
|
|
2
2
|
import { Channel } from '../Model/Messaging/Channel/Channel.js';
|
|
3
3
|
import { ChannelHistory } from '../Model/Messaging/ChannelHistory.js';
|
|
4
4
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
5
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
5
6
|
export declare class ChannelEndpoint extends Endpoint {
|
|
6
7
|
getById(channelId: string): Promise<Channel | null>;
|
|
7
|
-
getByWorkspace(workspaceId: string): Promise<CollectionResult<Channel>>;
|
|
8
|
-
getByOwner(): Promise<CollectionResult<Channel>>;
|
|
9
|
-
getMessages(channelId: string): Promise<CollectionResult<ChannelHistory>>;
|
|
8
|
+
getByWorkspace(workspaceId: string, pagination?: CursorPagination | null): Promise<CollectionResult<Channel>>;
|
|
9
|
+
getByOwner(pagination?: CursorPagination | null): Promise<CollectionResult<Channel>>;
|
|
10
|
+
getMessages(channelId: string, pagination?: CursorPagination | null): Promise<CollectionResult<ChannelHistory>>;
|
|
10
11
|
save(subscriberChannel: Channel): Promise<Channel>;
|
|
11
12
|
testChannel(subscriberChannel: Channel): Promise<boolean>;
|
|
12
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Endpoint } from './Endpoint.js';
|
|
2
2
|
import { Channel } from '../Model/Messaging/Channel/Channel.js';
|
|
3
3
|
import { ChannelHistory } from '../Model/Messaging/ChannelHistory.js';
|
|
4
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
4
5
|
export class ChannelEndpoint extends Endpoint {
|
|
5
6
|
async getById(channelId) {
|
|
6
7
|
try {
|
|
@@ -19,9 +20,11 @@ export class ChannelEndpoint extends Endpoint {
|
|
|
19
20
|
throw ex;
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
async getByWorkspace(workspaceId) {
|
|
23
|
+
async getByWorkspace(workspaceId, pagination = null) {
|
|
23
24
|
try {
|
|
24
|
-
const
|
|
25
|
+
const queryString = new QueryString('/workspaces/' + workspaceId + '/channels');
|
|
26
|
+
queryString.addPagination(pagination);
|
|
27
|
+
const result = await this.requestCollection(queryString, Channel.parse);
|
|
25
28
|
return result;
|
|
26
29
|
}
|
|
27
30
|
catch (ex) {
|
|
@@ -31,9 +34,11 @@ export class ChannelEndpoint extends Endpoint {
|
|
|
31
34
|
throw ex;
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
|
-
async getByOwner() {
|
|
37
|
+
async getByOwner(pagination = null) {
|
|
35
38
|
try {
|
|
36
|
-
const
|
|
39
|
+
const queryString = new QueryString('channels');
|
|
40
|
+
queryString.addPagination(pagination);
|
|
41
|
+
const result = await this.requestCollection(queryString, Channel.parse);
|
|
37
42
|
return result;
|
|
38
43
|
}
|
|
39
44
|
catch (ex) {
|
|
@@ -43,29 +48,12 @@ export class ChannelEndpoint extends Endpoint {
|
|
|
43
48
|
throw ex;
|
|
44
49
|
}
|
|
45
50
|
}
|
|
46
|
-
async getMessages(channelId) {
|
|
51
|
+
async getMessages(channelId, pagination = null) {
|
|
47
52
|
try {
|
|
48
|
-
const
|
|
53
|
+
const querystring = new QueryString('/channels/' + channelId + '/messages');
|
|
54
|
+
querystring.addPagination(pagination);
|
|
55
|
+
const result = await this.requestCollection(querystring, ChannelHistory.parse);
|
|
49
56
|
return result;
|
|
50
|
-
// const data: ChannelHistory[] = [];
|
|
51
|
-
//
|
|
52
|
-
// const resultData: any | null = rawChannelHistory.getData();
|
|
53
|
-
// if (resultData !== null) {
|
|
54
|
-
// const orig: ChannelHistory[] = resultData;
|
|
55
|
-
//
|
|
56
|
-
// for (const rawChannelMessage of orig) {
|
|
57
|
-
// data.push(ChannelHistory.parse(rawChannelMessage));
|
|
58
|
-
// }
|
|
59
|
-
// }
|
|
60
|
-
//
|
|
61
|
-
// rawChannelHistory.setData(data);
|
|
62
|
-
//
|
|
63
|
-
// return rawChannelHistory;
|
|
64
|
-
// let subscriberChannels: Channel[] = [];
|
|
65
|
-
// for (let rawChannel of rawChannels) {
|
|
66
|
-
// subscriberChannels.push(Channel.parse(rawChannel));
|
|
67
|
-
// }
|
|
68
|
-
// return subscriberChannels;
|
|
69
57
|
}
|
|
70
58
|
catch (ex) {
|
|
71
59
|
if (this.httpClient.isDebugEnabled()) {
|
|
@@ -2,16 +2,14 @@ import { OAuthClient } from '../Http/OAuthClient.js';
|
|
|
2
2
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
3
3
|
import { ObjectResult } from '../Model/Result/ObjectResult.js';
|
|
4
4
|
import { Parameters } from '../Http/Data/Parameters.js';
|
|
5
|
-
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
6
5
|
import { QueryString } from '../Http/Data/QueryString.js';
|
|
7
6
|
export declare abstract class Endpoint {
|
|
8
7
|
protected httpClient: OAuthClient;
|
|
9
8
|
constructor(httpClient: OAuthClient);
|
|
10
9
|
private formatParameters;
|
|
11
10
|
private formatKey;
|
|
12
|
-
requestCollection<T>(action: string, parser: (input: any) => T, parameters?: Parameters, method?: string, signWithOauthToken?: boolean): Promise<CollectionResult<T>>;
|
|
11
|
+
requestCollection<T>(action: string | QueryString, parser: (input: any) => T, parameters?: Parameters, method?: string, signWithOauthToken?: boolean): Promise<CollectionResult<T>>;
|
|
13
12
|
requestObject<T>(action: string, parameters: Parameters | undefined, parser: (input: any) => T, method?: string, signWithOauthToken?: boolean): Promise<ObjectResult<T>>;
|
|
14
13
|
parseCollection<T>(rawData: object[], parser: (input: any) => T): T[];
|
|
15
14
|
private parseObject;
|
|
16
|
-
protected buildQuery(pagination: CursorPagination | null): QueryString;
|
|
17
15
|
}
|
package/dist/Service/Endpoint.js
CHANGED
|
@@ -71,6 +71,9 @@ export class Endpoint {
|
|
|
71
71
|
}
|
|
72
72
|
async requestCollection(action, parser, parameters = null, method = 'GET', signWithOauthToken = true) {
|
|
73
73
|
parameters = this.formatParameters(parameters);
|
|
74
|
+
if (action instanceof QueryString) {
|
|
75
|
+
action = action.build();
|
|
76
|
+
}
|
|
74
77
|
const requestResponse = await this.httpClient.request(action, parameters, method, signWithOauthToken);
|
|
75
78
|
const result = new CollectionResult();
|
|
76
79
|
/**
|
|
@@ -151,19 +154,4 @@ export class Endpoint {
|
|
|
151
154
|
}
|
|
152
155
|
return null;
|
|
153
156
|
}
|
|
154
|
-
buildQuery(pagination) {
|
|
155
|
-
const queryString = new QueryString();
|
|
156
|
-
if (pagination !== null && pagination !== undefined) {
|
|
157
|
-
if (pagination.limit !== null && pagination.limit !== undefined) {
|
|
158
|
-
queryString.set('limit', pagination.limit);
|
|
159
|
-
}
|
|
160
|
-
if (pagination.startingAfter !== null && pagination.startingAfter !== undefined && pagination.startingAfter !== '') {
|
|
161
|
-
queryString.set('starting_after', pagination.startingAfter);
|
|
162
|
-
}
|
|
163
|
-
if (pagination.endingBefore !== null && pagination.endingBefore !== undefined && pagination.endingBefore !== '') {
|
|
164
|
-
queryString.set('ending_before', pagination.endingBefore);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return queryString;
|
|
168
|
-
}
|
|
169
157
|
}
|
|
@@ -4,6 +4,7 @@ import { HttpClient } from '../Http/HttpClient.js';
|
|
|
4
4
|
import { FlowRun } from '../Model/Flow/FlowRun.js';
|
|
5
5
|
import { FlowRunSummary } from '../Model/Flow/FlowRunSummary.js';
|
|
6
6
|
import { FlowRunHistory } from '../Model/Flow/FlowRunHistory.js';
|
|
7
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
7
8
|
export class FlowRunEndpoint extends Endpoint {
|
|
8
9
|
async getFlowRuns(flowId) {
|
|
9
10
|
const result = await this.requestCollection('/flows/' + flowId + '/runs', FlowRun.parse);
|
|
@@ -11,7 +12,8 @@ export class FlowRunEndpoint extends Endpoint {
|
|
|
11
12
|
}
|
|
12
13
|
async getFlowRunSummaries(flowId, flowRunStatuses = null, pagination = null, projectEnvironmentId = null) {
|
|
13
14
|
try {
|
|
14
|
-
const queryString =
|
|
15
|
+
const queryString = new QueryString('/flows/' + flowId + '/runsummaries');
|
|
16
|
+
queryString.addPagination(pagination);
|
|
15
17
|
// if (from !== null && from !== undefined) {
|
|
16
18
|
//
|
|
17
19
|
// params = {};
|
|
@@ -36,7 +38,7 @@ export class FlowRunEndpoint extends Endpoint {
|
|
|
36
38
|
// }
|
|
37
39
|
// params.statuses = flowRunStatuses;
|
|
38
40
|
// }
|
|
39
|
-
const result = await this.requestCollection(
|
|
41
|
+
const result = await this.requestCollection(queryString.build(), FlowRunSummary.parse);
|
|
40
42
|
return result;
|
|
41
43
|
}
|
|
42
44
|
catch (error) {
|
|
@@ -4,6 +4,7 @@ import { Utils } from '../Utils.js';
|
|
|
4
4
|
import { LogStreamId } from '../Model/Log/LogStreamId.js';
|
|
5
5
|
import { LogStreamInformation } from '../Model/Log/LogStreamInformation.js';
|
|
6
6
|
import { LogStream } from '../Model/Log/LogStream.js';
|
|
7
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
7
8
|
export class LogEndpoint extends Endpoint {
|
|
8
9
|
async getLogs(logQuery) {
|
|
9
10
|
const arrQuery = [];
|
|
@@ -41,7 +42,8 @@ export class LogEndpoint extends Endpoint {
|
|
|
41
42
|
return result;
|
|
42
43
|
}
|
|
43
44
|
async getCursoredLogEntries(logStreamId, pagination, filter) {
|
|
44
|
-
const queryString =
|
|
45
|
+
const queryString = new QueryString('/logstreams/' + Utils.base64encode(logStreamId.id) + '/logs');
|
|
46
|
+
queryString.addPagination(pagination);
|
|
45
47
|
if (filter !== null && filter !== undefined) {
|
|
46
48
|
if (filter.tags !== null && filter.tags.length > 0) {
|
|
47
49
|
const arrTags = [];
|
|
@@ -57,8 +59,7 @@ export class LogEndpoint extends Endpoint {
|
|
|
57
59
|
queryString.set('filter_log_levels', filter.logLevels.join(','));
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
|
-
const
|
|
61
|
-
const result = await this.requestCollection(cmd, Log.parse);
|
|
62
|
+
const result = await this.requestCollection(queryString, Log.parse);
|
|
62
63
|
return result;
|
|
63
64
|
}
|
|
64
65
|
async save(log) {
|
|
@@ -2,9 +2,10 @@ import { Endpoint } from './Endpoint.js';
|
|
|
2
2
|
import { Project } from '../Model/Project/Project.js';
|
|
3
3
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
4
4
|
import { State } from '../Model/State.js';
|
|
5
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
5
6
|
export declare class ProjectEndpoint extends Endpoint {
|
|
6
7
|
getAll(): Promise<CollectionResult<Project>>;
|
|
7
|
-
getByWorkspace(workspaceId: string, states?: State[] | null): Promise<CollectionResult<Project>>;
|
|
8
|
+
getByWorkspace(workspaceId: string, pagination?: CursorPagination | null, states?: State[] | null): Promise<CollectionResult<Project>>;
|
|
8
9
|
getById(projectId: string): Promise<Project | null>;
|
|
9
10
|
save(project: Project): Promise<Project>;
|
|
10
11
|
}
|
|
@@ -14,13 +14,12 @@ export class ProjectEndpoint extends Endpoint {
|
|
|
14
14
|
throw e;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
async getByWorkspace(workspaceId, states = null) {
|
|
17
|
+
async getByWorkspace(workspaceId, pagination = null, states = null) {
|
|
18
18
|
try {
|
|
19
|
-
const queryString = new QueryString();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const result = await this.requestCollection('workspaces/' + workspaceId + '/projects' + queryString.build(), Project.parse);
|
|
19
|
+
const queryString = new QueryString('workspaces/' + workspaceId + '/projects');
|
|
20
|
+
queryString.addPagination(pagination);
|
|
21
|
+
queryString.addStateFilter(states);
|
|
22
|
+
const result = await this.requestCollection(queryString, Project.parse);
|
|
24
23
|
return result;
|
|
25
24
|
}
|
|
26
25
|
catch (e) {
|
|
@@ -4,12 +4,13 @@ import { CodeSource } from '../Model/Deployment/CodeSource.js';
|
|
|
4
4
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
5
5
|
import { SourcesAccountRepository } from '../Model/Deployment/SourcesAccountRepository.js';
|
|
6
6
|
import { SourcesAccountRepositoryBranch } from '../Model/Deployment/SourcesAccountRepositoryBranch.js';
|
|
7
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
7
8
|
export declare class SourcesAccountEndpoint extends Endpoint {
|
|
8
|
-
getAllCodeSources(workspaceId: string): Promise<CollectionResult<CodeSource>>;
|
|
9
|
-
getAllCodeSourceAccounts(workspaceId: string): Promise<CollectionResult<CodeSourceAccount>>;
|
|
9
|
+
getAllCodeSources(workspaceId: string, pagination?: CursorPagination | null): Promise<CollectionResult<CodeSource>>;
|
|
10
|
+
getAllCodeSourceAccounts(workspaceId: string, pagination?: CursorPagination | null): Promise<CollectionResult<CodeSourceAccount>>;
|
|
10
11
|
getCodeSourceAccountById(id: string): Promise<CodeSourceAccount | null>;
|
|
11
12
|
getCodeSourceById(codeSourceId: string): Promise<CodeSource | null>;
|
|
12
|
-
getRepositories(codeSourceAccountId: string): Promise<CollectionResult<SourcesAccountRepository>>;
|
|
13
|
-
getRepositoryBranches(codeSourceAccountId: string, repositoryKey: string): Promise<CollectionResult<SourcesAccountRepositoryBranch>>;
|
|
13
|
+
getRepositories(codeSourceAccountId: string, pagination?: CursorPagination | null): Promise<CollectionResult<SourcesAccountRepository>>;
|
|
14
|
+
getRepositoryBranches(codeSourceAccountId: string, repositoryKey: string, pagination?: CursorPagination | null): Promise<CollectionResult<SourcesAccountRepositoryBranch>>;
|
|
14
15
|
saveCodeSource(codeSource: CodeSource): Promise<CodeSource>;
|
|
15
16
|
}
|
|
@@ -5,13 +5,18 @@ import { CodeSource } from '../Model/Deployment/CodeSource.js';
|
|
|
5
5
|
import { HttpClient } from '../Http/HttpClient.js';
|
|
6
6
|
import { SourcesAccountRepository } from '../Model/Deployment/SourcesAccountRepository.js';
|
|
7
7
|
import { SourcesAccountRepositoryBranch } from '../Model/Deployment/SourcesAccountRepositoryBranch.js';
|
|
8
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
8
9
|
export class SourcesAccountEndpoint extends Endpoint {
|
|
9
|
-
async getAllCodeSources(workspaceId) {
|
|
10
|
-
const
|
|
10
|
+
async getAllCodeSources(workspaceId, pagination = null) {
|
|
11
|
+
const queryString = new QueryString('workspaces/' + workspaceId + '/codesources');
|
|
12
|
+
queryString.addPagination(pagination);
|
|
13
|
+
const result = await this.requestCollection(queryString, CodeSource.parse);
|
|
11
14
|
return result;
|
|
12
15
|
}
|
|
13
|
-
async getAllCodeSourceAccounts(workspaceId) {
|
|
14
|
-
const
|
|
16
|
+
async getAllCodeSourceAccounts(workspaceId, pagination = null) {
|
|
17
|
+
const queryString = new QueryString('workspaces/' + workspaceId + '/codesourceaccounts');
|
|
18
|
+
queryString.addPagination(pagination);
|
|
19
|
+
const result = await this.requestCollection(queryString, CodeSourceAccount.parse);
|
|
15
20
|
return result;
|
|
16
21
|
}
|
|
17
22
|
async getCodeSourceAccountById(id) {
|
|
@@ -49,13 +54,17 @@ export class SourcesAccountEndpoint extends Endpoint {
|
|
|
49
54
|
throw error;
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
|
-
async getRepositories(codeSourceAccountId) {
|
|
53
|
-
const
|
|
57
|
+
async getRepositories(codeSourceAccountId, pagination = null) {
|
|
58
|
+
const queryString = new QueryString('codesourceaccounts/' + codeSourceAccountId + '/repositories');
|
|
59
|
+
queryString.addPagination(pagination);
|
|
60
|
+
const rawSourcesAccountRepositories = await this.requestCollection(queryString, SourcesAccountRepository.parse);
|
|
54
61
|
return rawSourcesAccountRepositories;
|
|
55
62
|
}
|
|
56
|
-
async getRepositoryBranches(codeSourceAccountId, repositoryKey) {
|
|
63
|
+
async getRepositoryBranches(codeSourceAccountId, repositoryKey, pagination = null) {
|
|
64
|
+
const queryString = new QueryString('codesourceaccounts/' + codeSourceAccountId + '/repositories/' + repositoryKey + '/branches');
|
|
65
|
+
queryString.addPagination(pagination);
|
|
57
66
|
repositoryKey = Utils.base64encode(repositoryKey);
|
|
58
|
-
const rawBranches = await this.requestCollection(
|
|
67
|
+
const rawBranches = await this.requestCollection(queryString, SourcesAccountRepositoryBranch.parse);
|
|
59
68
|
return rawBranches;
|
|
60
69
|
}
|
|
61
70
|
async saveCodeSource(codeSource) {
|
|
@@ -4,8 +4,9 @@ import { WorkspaceMember } from '../Model/Workspace/WorkspaceMember.js';
|
|
|
4
4
|
import { WorkspaceMemberInvite } from '../Model/Workspace/WorkspaceMemberInvite.js';
|
|
5
5
|
import { WorkspaceMemberInvite2 } from '../Model/Workspace/WorkspaceMemberInvite2.js';
|
|
6
6
|
import { CollectionResult } from '../Model/Result/CollectionResult.js';
|
|
7
|
+
import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
|
|
7
8
|
export declare class WorkspaceMemberEndpoint extends Endpoint {
|
|
8
|
-
getByWorkspace(workspaceId: string): Promise<CollectionResult<WorkspaceMember>>;
|
|
9
|
+
getByWorkspace(workspaceId: string, pagination?: CursorPagination | null): Promise<CollectionResult<WorkspaceMember>>;
|
|
9
10
|
invite(workspaceId: string, invites: WorkspaceMemberInvite[]): Promise<boolean>;
|
|
10
11
|
getWorkspaceInviteByCode(inviteCode: string): Promise<WorkspaceMemberInvite2 | null>;
|
|
11
12
|
getWorkspaceMemberEvents(workspaceId: string, memberId: string): Promise<CollectionResult<UserAction>>;
|
|
@@ -7,9 +7,11 @@ import { WorkspaceMember } from '../Model/Workspace/WorkspaceMember.js';
|
|
|
7
7
|
import { WorkspaceMemberRole } from '../Model/Workspace/WorkspaceMemberRole.js';
|
|
8
8
|
import { WorkspaceMemberInviteState } from '../Model/Workspace/WorkspaceMemberInviteState.js';
|
|
9
9
|
import { WorkspaceMemberInvite2 } from '../Model/Workspace/WorkspaceMemberInvite2.js';
|
|
10
|
+
import { QueryString } from '../Http/Data/QueryString.js';
|
|
10
11
|
export class WorkspaceMemberEndpoint extends Endpoint {
|
|
11
|
-
async getByWorkspace(workspaceId) {
|
|
12
|
-
const
|
|
12
|
+
async getByWorkspace(workspaceId, pagination = null) {
|
|
13
|
+
const queryString = new QueryString('workspaces/' + workspaceId + '/members');
|
|
14
|
+
queryString.addPagination(pagination);
|
|
13
15
|
const parser = (rawMember) => {
|
|
14
16
|
const member = new WorkspaceMember();
|
|
15
17
|
member.id = rawMember.id;
|
|
@@ -28,7 +30,7 @@ export class WorkspaceMemberEndpoint extends Endpoint {
|
|
|
28
30
|
}
|
|
29
31
|
return member;
|
|
30
32
|
};
|
|
31
|
-
const result = await this.requestCollection(
|
|
33
|
+
const result = await this.requestCollection(queryString, parser);
|
|
32
34
|
return result;
|
|
33
35
|
}
|
|
34
36
|
async invite(workspaceId, invites) {
|
package/dist/main.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|