attlaz-client 1.37.10 → 1.38.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.
@@ -11,7 +11,7 @@ export class DataValueCollection extends JsonSerializable {
11
11
  return new DataValueCollection();
12
12
  }
13
13
  if (!Utils.isIterable(rawValues)) {
14
- throw new Error('Raw values is not iterable: ' + JSON.stringify(rawValues));
14
+ throw new Error('Unable to parse data value collection: values are not iterable: ' + JSON.stringify(rawValues));
15
15
  }
16
16
  const result = new DataValueCollection();
17
17
  for (const rawValue of rawValues) {
@@ -18,6 +18,10 @@ export class Endpoint {
18
18
  if (data === null || data === undefined) {
19
19
  return null;
20
20
  }
21
+ if (typeof data === 'object' && '_formatted' in data) {
22
+ // TODO: unset _formatted
23
+ return data;
24
+ }
21
25
  if (Array.isArray(data)) {
22
26
  const result = [];
23
27
  for (const value of data) {
@@ -1,10 +1,10 @@
1
- import { Endpoint } from './Endpoint.js';
1
+ import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
2
+ import { CollectionResult } from '../Model/Result/CollectionResult.js';
2
3
  import { WorkspaceMember } from '../Model/Workspace/WorkspaceMember.js';
3
4
  import { WorkspaceMemberInvite } from '../Model/Workspace/WorkspaceMemberInvite.js';
4
5
  import { WorkspaceMemberInvite2 } from '../Model/Workspace/WorkspaceMemberInvite2.js';
5
- import { CollectionResult } from '../Model/Result/CollectionResult.js';
6
- import { CursorPagination } from '../Model/Pagination/CursorPagination.js';
7
6
  import { WorkspaceMemberRole } from '../Model/Workspace/WorkspaceMemberRole.js';
7
+ import { Endpoint } from './Endpoint.js';
8
8
  export declare class WorkspaceMemberEndpoint extends Endpoint {
9
9
  getByWorkspace(workspaceId: string, pagination?: CursorPagination | null): Promise<CollectionResult<WorkspaceMember>>;
10
10
  invite(workspaceId: string, invites: WorkspaceMemberInvite[]): Promise<boolean>;
@@ -1,8 +1,8 @@
1
- import { Endpoint } from './Endpoint.js';
1
+ import { QueryString } from '../Http/Data/QueryString.js';
2
2
  import { WorkspaceMember } from '../Model/Workspace/WorkspaceMember.js';
3
3
  import { WorkspaceMemberInvite2 } from '../Model/Workspace/WorkspaceMemberInvite2.js';
4
- import { QueryString } from '../Http/Data/QueryString.js';
5
4
  import { WorkspaceMemberRole } from '../Model/Workspace/WorkspaceMemberRole.js';
5
+ import { Endpoint } from './Endpoint.js';
6
6
  export class WorkspaceMemberEndpoint extends Endpoint {
7
7
  async getByWorkspace(workspaceId, pagination = null) {
8
8
  const queryString = new QueryString('workspaces/' + workspaceId + '/members');
@@ -18,6 +18,7 @@ export class WorkspaceMemberEndpoint extends Endpoint {
18
18
  }
19
19
  try {
20
20
  const parser = (raw) => raw;
21
+ // The result is actually a collection with shape {email:string;invited:boolean}[]
21
22
  const result = await this.requestObject(cmd, { invites: rawInvites }, parser, 'POST');
22
23
  const re = result.getData();
23
24
  if (re === null) {
@@ -38,7 +39,7 @@ export class WorkspaceMemberEndpoint extends Endpoint {
38
39
  }
39
40
  }
40
41
  async getWorkspaceInviteByCode(inviteCode) {
41
- const cmd = '/workspaces/invites/' + inviteCode;
42
+ const cmd = '/workspaces/invites/' + encodeURIComponent(inviteCode);
42
43
  const rawInvite = await this.requestObject(cmd, null, WorkspaceMemberInvite2.parse, 'GET', false);
43
44
  if (rawInvite !== null) {
44
45
  return rawInvite.getData();
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.37.9";
1
+ export declare const VERSION = "1.38.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.37.9";
1
+ export const VERSION = "1.38.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.37.10",
3
+ "version": "1.38.1",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",