@wazo/sdk 0.46.3 → 0.46.7

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/index.js CHANGED
@@ -96,7 +96,7 @@ __webpack_require__.d(__webpack_exports__, {
96
96
  setCurrentServer: ()=>setCurrentServer,
97
97
  parsePhoneNumber: ()=>parsePhoneNumber,
98
98
  SessionDescriptionHandler: ()=>lib_WazoSessionDescriptionHandler,
99
- default: ()=>src,
99
+ default: ()=>src_0,
100
100
  SFUNotAvailableError: ()=>SFUNotAvailableError,
101
101
  Incall: ()=>Incall,
102
102
  setApiToken: ()=>setApiToken,
@@ -1519,7 +1519,7 @@ class Voicemail {
1519
1519
  voicemail: item.voicemail ? {
1520
1520
  id: String(item.voicemail.id ?? ''),
1521
1521
  name: item.voicemail.name ?? '',
1522
- type: item.voicemail.type ?? ''
1522
+ accesstype: item.voicemail.accesstype ?? ''
1523
1523
  } : void 0
1524
1524
  }));
1525
1525
  }
@@ -1550,7 +1550,7 @@ class Voicemail {
1550
1550
  return this;
1551
1551
  }
1552
1552
  isPersonal() {
1553
- return !this.mailbox || this.mailbox?.type === 'personal';
1553
+ return !this.mailbox || this.mailbox?.accesstype === 'personal';
1554
1554
  }
1555
1555
  contains(query) {
1556
1556
  if (!query) return true;
@@ -2478,9 +2478,11 @@ const dird = (client, baseUrl)=>({
2478
2478
  fetchWazoSource: (context)=>client.get(`${baseUrl}/directories/${context}/sources`, {
2479
2479
  backend: 'wazo'
2480
2480
  }),
2481
- fetchWazoContacts: async (source, queryParams)=>{
2482
- if (!source) return Promise.resolve([]);
2483
- return client.get(`${baseUrl}/backends/wazo/sources/${source.uuid}/contacts`, queryParams).then((response)=>Contact.parseManyWazo(response.items, source));
2481
+ fetchWazoContacts: async (source, queryParams, options)=>{
2482
+ if (!source) return [];
2483
+ const defaultParser = (response, src)=>Contact.parseManyWazo(response.items, src);
2484
+ const parser = options?.parser ?? defaultParser;
2485
+ return client.get(`${baseUrl}/backends/wazo/sources/${source.uuid}/contacts`, queryParams).then((response)=>parser(response, source));
2484
2486
  },
2485
2487
  fetchGoogleSource: (context)=>client.get(`${baseUrl}/directories/${context}/sources`, {
2486
2488
  backend: 'google'
@@ -3017,7 +3019,9 @@ const agentd = (client, baseUrl)=>({
3017
3019
  staticPause: ()=>client.post(`${baseUrl}/users/me/agents/pause`, {
3018
3020
  reason: 'songbird_reason'
3019
3021
  }, null, ApiRequester.successResponseParser),
3020
- staticResume: ()=>client.post(`${baseUrl}/users/me/agents/unpause`, null, null, ApiRequester.successResponseParser)
3022
+ staticResume: ()=>client.post(`${baseUrl}/users/me/agents/unpause`, null, null, ApiRequester.successResponseParser),
3023
+ subscribeToQueue: (queueId)=>client.put(`${baseUrl}/users/me/agents/queues/${queueId}/subscribe`, null, null, ApiRequester.successResponseParser),
3024
+ unsubscribeFromQueue: (queueId)=>client.put(`${baseUrl}/users/me/agents/queues/${queueId}/unsubscribe`, null, null, ApiRequester.successResponseParser)
3021
3025
  });
3022
3026
  class Subscription {
3023
3027
  name;
@@ -10940,7 +10944,7 @@ const getCallableNumber = (number, country)=>{
10940
10944
  }
10941
10945
  };
10942
10946
  const { SOCKET_EVENTS: types_SOCKET_EVENTS, ...types_OTHER_EVENTS } = websocket_client_namespaceObject;
10943
- const src = simple;
10947
+ const src_0 = simple;
10944
10948
  var __webpack_export_target__ = exports;
10945
10949
  for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
10946
10950
  if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
package/dist/index.mjs CHANGED
@@ -1459,7 +1459,7 @@ class Voicemail {
1459
1459
  voicemail: item.voicemail ? {
1460
1460
  id: String(item.voicemail.id ?? ''),
1461
1461
  name: item.voicemail.name ?? '',
1462
- type: item.voicemail.type ?? ''
1462
+ accesstype: item.voicemail.accesstype ?? ''
1463
1463
  } : void 0
1464
1464
  }));
1465
1465
  }
@@ -1490,7 +1490,7 @@ class Voicemail {
1490
1490
  return this;
1491
1491
  }
1492
1492
  isPersonal() {
1493
- return !this.mailbox || this.mailbox?.type === 'personal';
1493
+ return !this.mailbox || this.mailbox?.accesstype === 'personal';
1494
1494
  }
1495
1495
  contains(query) {
1496
1496
  if (!query) return true;
@@ -2414,9 +2414,11 @@ const dird = (client, baseUrl)=>({
2414
2414
  fetchWazoSource: (context)=>client.get(`${baseUrl}/directories/${context}/sources`, {
2415
2415
  backend: 'wazo'
2416
2416
  }),
2417
- fetchWazoContacts: async (source, queryParams)=>{
2418
- if (!source) return Promise.resolve([]);
2419
- return client.get(`${baseUrl}/backends/wazo/sources/${source.uuid}/contacts`, queryParams).then((response)=>Contact.parseManyWazo(response.items, source));
2417
+ fetchWazoContacts: async (source, queryParams, options)=>{
2418
+ if (!source) return [];
2419
+ const defaultParser = (response, src)=>Contact.parseManyWazo(response.items, src);
2420
+ const parser = options?.parser ?? defaultParser;
2421
+ return client.get(`${baseUrl}/backends/wazo/sources/${source.uuid}/contacts`, queryParams).then((response)=>parser(response, source));
2420
2422
  },
2421
2423
  fetchGoogleSource: (context)=>client.get(`${baseUrl}/directories/${context}/sources`, {
2422
2424
  backend: 'google'
@@ -2953,7 +2955,9 @@ const agentd = (client, baseUrl)=>({
2953
2955
  staticPause: ()=>client.post(`${baseUrl}/users/me/agents/pause`, {
2954
2956
  reason: 'songbird_reason'
2955
2957
  }, null, ApiRequester.successResponseParser),
2956
- staticResume: ()=>client.post(`${baseUrl}/users/me/agents/unpause`, null, null, ApiRequester.successResponseParser)
2958
+ staticResume: ()=>client.post(`${baseUrl}/users/me/agents/unpause`, null, null, ApiRequester.successResponseParser),
2959
+ subscribeToQueue: (queueId)=>client.put(`${baseUrl}/users/me/agents/queues/${queueId}/subscribe`, null, null, ApiRequester.successResponseParser),
2960
+ unsubscribeFromQueue: (queueId)=>client.put(`${baseUrl}/users/me/agents/queues/${queueId}/unsubscribe`, null, null, ApiRequester.successResponseParser)
2957
2961
  });
2958
2962
  class Subscription {
2959
2963
  name;
@@ -10854,5 +10858,5 @@ const getCallableNumber = (number, country)=>{
10854
10858
  }
10855
10859
  };
10856
10860
  const { SOCKET_EVENTS: types_SOCKET_EVENTS, ...types_OTHER_EVENTS } = websocket_client_namespaceObject;
10857
- const src = simple;
10858
- export { AdHocAPIConference, domain_Agent as Agent, ApiRequester, BadResponse, BaseApiClient, Country as COUNTRIES, CTIPhone, Call, CallApi, CallLog, CallSession, CallerID, ChatMessage, ChatRoom, checker_Checker as Checker, Contact, DebugDevice, Emitter, ExternalApp, FORWARD_KEYS, domain_Features as Features, ForwardOption, Incall, IndirectTransfer, IssueReporter, LINE_STATE, Line, Meeting, MeetingAuthorization, MeetingStatus, NotificationOptions, STATE as PROFILE_STATE, Profile, RECORDING_STATE, Recording, domain_Relocation as Relocation, Room, SFUNotAvailableError, SOCKET_EVENTS, ServerError, Session, lib_WazoSessionDescriptionHandler as SessionDescriptionHandler, SipLine, domain_SwitchboardCall as SwitchboardCall, Voicemail, VoicemailFolder, ApiClient as WazoApiClient, WebRTCClient, WebRTCPhone, websocket_client as WebSocketClient, camelToUnderscore, src as default, service_getApiClient as getApiClient, getCallableNumber, getDisplayableNumber, guessParsePhoneNumber, obfuscateToken, parsePhoneNumber, setApiToken, setCurrentServer, setIsMobile, setOnRefreshToken, setOnRefreshTokenError };
10861
+ const src_0 = simple;
10862
+ export { AdHocAPIConference, domain_Agent as Agent, ApiRequester, BadResponse, BaseApiClient, Country as COUNTRIES, CTIPhone, Call, CallApi, CallLog, CallSession, CallerID, ChatMessage, ChatRoom, checker_Checker as Checker, Contact, DebugDevice, Emitter, ExternalApp, FORWARD_KEYS, domain_Features as Features, ForwardOption, Incall, IndirectTransfer, IssueReporter, LINE_STATE, Line, Meeting, MeetingAuthorization, MeetingStatus, NotificationOptions, STATE as PROFILE_STATE, Profile, RECORDING_STATE, Recording, domain_Relocation as Relocation, Room, SFUNotAvailableError, SOCKET_EVENTS, ServerError, Session, lib_WazoSessionDescriptionHandler as SessionDescriptionHandler, SipLine, domain_SwitchboardCall as SwitchboardCall, Voicemail, VoicemailFolder, ApiClient as WazoApiClient, WebRTCClient, WebRTCPhone, websocket_client as WebSocketClient, camelToUnderscore, src_0 as default, service_getApiClient as getApiClient, getCallableNumber, getDisplayableNumber, guessParsePhoneNumber, obfuscateToken, parsePhoneNumber, setApiToken, setCurrentServer, setIsMobile, setOnRefreshToken, setOnRefreshTokenError };
@@ -11,6 +11,8 @@ declare const _default: (client: ApiRequester, baseUrl: string) => {
11
11
  staticLogout: () => Promise<boolean>;
12
12
  staticPause: () => Promise<boolean>;
13
13
  staticResume: () => Promise<boolean>;
14
+ subscribeToQueue: (queueId: string) => Promise<boolean>;
15
+ unsubscribeFromQueue: (queueId: string) => Promise<boolean>;
14
16
  };
15
17
  export default _default;
16
18
  //# sourceMappingURL=agentd.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agentd.d.ts","sourceRoot":"","sources":["../../../src/api/agentd.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,MAAM,iBAAiB,CAAC;iCAEX,YAAY,WAAW,MAAM;wBAChC,MAAM,KAAG,OAAO,CAAC,KAAK,CAAC;yBAEtB,MAAM,WAAW,MAAM,aAAa,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;8BAKxD,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;0BAI7B,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;yBAE1B,MAAM,sBAA+B,OAAO,CAAC,OAAO,CAAC;0BAIpD,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;qBAEhC,OAAO,CAAC,KAAK,CAAC;wBAEX,OAAO,CAAC,OAAO,CAAC;uBAEjB,OAAO,CAAC,OAAO,CAAC;wBAIf,OAAO,CAAC,OAAO,CAAC;;AA5BpC,wBA6BI"}
1
+ {"version":3,"file":"agentd.d.ts","sourceRoot":"","sources":["../../../src/api/agentd.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,MAAM,iBAAiB,CAAC;iCAEX,YAAY,WAAW,MAAM;wBAChC,MAAM,KAAG,OAAO,CAAC,KAAK,CAAC;yBAEtB,MAAM,WAAW,MAAM,aAAa,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;8BAKxD,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;0BAI7B,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;yBAE1B,MAAM,sBAA+B,OAAO,CAAC,OAAO,CAAC;0BAIpD,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;qBAEhC,OAAO,CAAC,KAAK,CAAC;wBAEX,OAAO,CAAC,OAAO,CAAC;uBAEjB,OAAO,CAAC,OAAO,CAAC;wBAIf,OAAO,CAAC,OAAO,CAAC;gCAEN,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;oCAErB,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;;AAhC3D,wBAiCI"}
@@ -1,7 +1,7 @@
1
- import ApiRequester from '../utils/api-requester';
2
- import type { UuidSearchableQueryParams, SearchableQueryParams, PhonebookResponseItem, QueryParams, UUID } from '../domain/types';
1
+ import type { PhonebookResponseItem, QueryParams, SearchableQueryParams, UUID, UuidSearchableQueryParams } from '../domain/types';
2
+ import type { DirectorySource, DirectorySources, NewContact } from '../index';
3
3
  import { Contact } from '../index';
4
- import type { NewContact, DirectorySource, DirectorySources } from '../index';
4
+ import ApiRequester from '../utils/api-requester';
5
5
  declare const _default: (client: ApiRequester, baseUrl: string) => {
6
6
  search: (context: string, term: string, offset?: number, limit?: (number | null)) => Promise<Array<Contact>>;
7
7
  listPersonalContacts: (queryParams?: QueryParams) => Promise<Contact[]>;
@@ -16,7 +16,12 @@ declare const _default: (client: ApiRequester, baseUrl: string) => {
16
16
  fetchOffice365Source: (context: string) => Promise<DirectorySources>;
17
17
  fetchOffice365Contacts: (source: DirectorySource, queryParams?: SearchableQueryParams) => Promise<Contact[]>;
18
18
  fetchWazoSource: (context: string) => Promise<DirectorySources>;
19
- fetchWazoContacts: (source: DirectorySource, queryParams?: UuidSearchableQueryParams) => Promise<Contact[]>;
19
+ fetchWazoContacts: <T = Contact[]>(source: DirectorySource, queryParams?: UuidSearchableQueryParams, options?: {
20
+ parser?: (response: {
21
+ items: any[];
22
+ total: number;
23
+ }, source: DirectorySource) => T;
24
+ }) => Promise<T>;
20
25
  fetchGoogleSource: (context: string) => Promise<DirectorySources>;
21
26
  fetchGoogleContacts: (source: DirectorySource, queryParams?: SearchableQueryParams) => Promise<Contact[]>;
22
27
  fetchConferenceSource: (context: string) => Promise<DirectorySources>;
@@ -1 +1 @@
1
- {"version":3,"file":"dird.d.ts","sourceRoot":"","sources":["../../../src/api/dird.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAClI,OAAO,EAAE,OAAO,EAAoB,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;iCAarD,YAAY,WAAW,MAAM;sBAClC,MAAM,QAAQ,MAAM,2BAAqB,CAAC,MAAM,GAAG,IAAI,CAAC,KAAU,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;yCAItE,WAAW,KAAG,OAAO,CAAC,OAAO,EAAE,CAAC;wCAEjC,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;0BAEvC,UAAU,KAAG,OAAO,CAAC,OAAO,CAAC;2BAE5B,OAAO,KAAG,OAAO,CAAC,OAAO,CAAC;0BAErB,MAAM,KAAG,OAAO,CAAC,OAAO,EAAE,CAAC;iCAQ1B,IAAI,KAAG,OAAO,CAAC,IAAI,CAAC;6BAExB,MAAM,KAA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OAAO,CAAC,gBAAgB,CAAC;qCAEvC,eAAe,gBAAgB,WAAW,KAAG,OAAO,CAAC;QAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;sCAQtG,eAAe,gBAAgB,qBAAqB,KAAG,OAAO,CAAC,OAAO,EAAE,CAAC;4CASzE,MAAM,EAAE,WAAW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,OAAO,CAAC,OAAO,EAAE,CAAC;;AAnGrG,wBAgII"}
@@ -18,7 +18,7 @@ type MessageResponse = {
18
18
  export type VoicemailBox = {
19
19
  id: string;
20
20
  name: string;
21
- type: string;
21
+ accesstype: string;
22
22
  };
23
23
  export type Response = {
24
24
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Voicemail.d.ts","sourceRoot":"","sources":["../../../src/domain/Voicemail.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,eAAO,MAAM,eAAe;;;;;CAKlB,CAAC;AASX,MAAM,MAAM,mBAAmB,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAEvF,KAAK,eAAe,GAAG;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EA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IAKX,YAAY;IAKZ,UAAU,IAAI,OAAO;IAIrB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAQjC"}
package/dist/wazo-sdk.js CHANGED
@@ -34867,7 +34867,7 @@
34867
34867
  voicemail: item.voicemail ? {
34868
34868
  id: String(item.voicemail.id ?? ''),
34869
34869
  name: item.voicemail.name ?? '',
34870
- type: item.voicemail.type ?? ''
34870
+ accesstype: item.voicemail.accesstype ?? ''
34871
34871
  } : void 0
34872
34872
  }));
34873
34873
  }
@@ -34898,7 +34898,7 @@
34898
34898
  return this;
34899
34899
  }
34900
34900
  isPersonal() {
34901
- return !this.mailbox || this.mailbox?.type === 'personal';
34901
+ return !this.mailbox || this.mailbox?.accesstype === 'personal';
34902
34902
  }
34903
34903
  contains(query) {
34904
34904
  if (!query) return true;
@@ -35833,9 +35833,11 @@
35833
35833
  fetchWazoSource: (context)=>client.get(`${baseUrl}/directories/${context}/sources`, {
35834
35834
  backend: 'wazo'
35835
35835
  }),
35836
- fetchWazoContacts: async (source, queryParams)=>{
35837
- if (!source) return Promise.resolve([]);
35838
- return client.get(`${baseUrl}/backends/wazo/sources/${source.uuid}/contacts`, queryParams).then((response)=>Contact.parseManyWazo(response.items, source));
35836
+ fetchWazoContacts: async (source, queryParams, options)=>{
35837
+ if (!source) return [];
35838
+ const defaultParser = (response, src)=>Contact.parseManyWazo(response.items, src);
35839
+ const parser = options?.parser ?? defaultParser;
35840
+ return client.get(`${baseUrl}/backends/wazo/sources/${source.uuid}/contacts`, queryParams).then((response)=>parser(response, source));
35839
35841
  },
35840
35842
  fetchGoogleSource: (context)=>client.get(`${baseUrl}/directories/${context}/sources`, {
35841
35843
  backend: 'google'
@@ -36372,7 +36374,9 @@
36372
36374
  staticPause: ()=>client.post(`${baseUrl}/users/me/agents/pause`, {
36373
36375
  reason: 'songbird_reason'
36374
36376
  }, null, ApiRequester.successResponseParser),
36375
- staticResume: ()=>client.post(`${baseUrl}/users/me/agents/unpause`, null, null, ApiRequester.successResponseParser)
36377
+ staticResume: ()=>client.post(`${baseUrl}/users/me/agents/unpause`, null, null, ApiRequester.successResponseParser),
36378
+ subscribeToQueue: (queueId)=>client.put(`${baseUrl}/users/me/agents/queues/${queueId}/subscribe`, null, null, ApiRequester.successResponseParser),
36379
+ unsubscribeFromQueue: (queueId)=>client.put(`${baseUrl}/users/me/agents/queues/${queueId}/unsubscribe`, null, null, ApiRequester.successResponseParser)
36376
36380
  });
36377
36381
  class Subscription {
36378
36382
  name;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wazo/sdk",
3
- "version": "0.46.3",
3
+ "version": "0.46.7",
4
4
  "description": "Wazo's JavaScript Software Development Kit.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "url": "https://github.com/wazo-platform/wazo-js-sdk/issues"
31
31
  },
32
32
  "dependencies": {
33
- "@wazo/types": "^25.16.0",
33
+ "@wazo/types": "^25.16.1",
34
34
  "events": "^3.3.0",
35
35
  "fstream": "^1.0.12",
36
36
  "getstats": "wazo-platform/getStats#1.0.7",