@eway-crm/connector 1.0.100 → 1.0.101

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.
@@ -1,6 +1,7 @@
1
- import { ISessionHandler, TLoginResponse } from './ISessionHandler';
1
+ import { ISessionHandler } from './ISessionHandler';
2
2
  import { ApiConnection } from './ApiConnection';
3
3
  import { TUnionError } from './exceptions/HttpRequestError';
4
+ import { IApiLoginResponse } from './data/IApiLoginResponse';
4
5
  export declare class CredentialsSessionHandler implements ISessionHandler {
5
6
  private readonly username;
6
7
  private readonly passwordHash;
@@ -8,7 +9,7 @@ export declare class CredentialsSessionHandler implements ISessionHandler {
8
9
  private readonly clientMachineIdentifier;
9
10
  private readonly clientMachineName;
10
11
  private readonly errorCallback;
11
- loginResponse?: TLoginResponse;
12
+ lastSuccessfulLoginResponse?: IApiLoginResponse;
12
13
  constructor(username: string, passwordHash: string, appVersion: string, clientMachineIdentifier: string, clientMachineName: string, errorCallback?: (error: TUnionError) => void);
13
14
  readonly invalidateSessionId: (_: string, callback: () => void) => void;
14
15
  readonly getSessionId: (connection: ApiConnection, callback: (sessionId: string) => void) => void;
@@ -20,7 +20,7 @@ var CredentialsSessionHandler = /** @class */ (function () {
20
20
  clientMachineName: _this.clientMachineName,
21
21
  createSessionCookie: connection.supportsGetItemPreviewMethod
22
22
  }, function (result) {
23
- _this.loginResponse = result;
23
+ _this.lastSuccessfulLoginResponse = result;
24
24
  var newSessionId = result.SessionId;
25
25
  if (!newSessionId) {
26
26
  var error = new Error('Successful login but no session came.');
@@ -1,13 +1,7 @@
1
1
  import { ApiConnection } from './ApiConnection';
2
- import { IApiResult } from './data/IApiResult';
3
- export declare type TLoginResponse = IApiResult & {
4
- SessionId: string | null;
5
- UserItemGuid: string | null;
6
- IsAdmin: boolean | null;
7
- WcfVersion: string;
8
- };
2
+ import { IApiLoginResponse } from './data/IApiLoginResponse';
9
3
  export interface ISessionHandler {
10
4
  invalidateSessionId(sessionId: string, callback: () => void): void;
11
5
  getSessionId(connection: ApiConnection, callback: (sessionId: string) => void): void;
12
- loginResponse?: TLoginResponse;
6
+ lastSuccessfulLoginResponse?: IApiLoginResponse;
13
7
  }
@@ -1,7 +1,8 @@
1
- import { ISessionHandler, TLoginResponse } from './ISessionHandler';
1
+ import { ISessionHandler } from './ISessionHandler';
2
2
  import { ApiConnection } from './ApiConnection';
3
3
  import { ITokenData } from './interfaces/ITokenData';
4
4
  import { TUnionError } from './exceptions/HttpRequestError';
5
+ import { IApiLoginResponse } from './data/IApiLoginResponse';
5
6
  export declare class OAuthSessionHandler implements ISessionHandler {
6
7
  private readonly username;
7
8
  private readonly refreshToken;
@@ -10,7 +11,7 @@ export declare class OAuthSessionHandler implements ISessionHandler {
10
11
  private readonly clientSecret;
11
12
  private readonly errorCallback;
12
13
  private readonly refreshTokenCallback?;
13
- loginResponse?: TLoginResponse;
14
+ lastSuccessfulLoginResponse?: IApiLoginResponse;
14
15
  private accessToken;
15
16
  constructor(username: string, clientId: string, clientSecret: string, refreshToken: string, accessToken: string, appVersion: string, errorCallback?: (error: TUnionError) => void, refreshTokenCallback?: (tokenData: ITokenData) => void);
16
17
  readonly invalidateSessionId: (_: string, callback: () => void) => void;
@@ -18,7 +18,7 @@ var OAuthSessionHandler = /** @class */ (function () {
18
18
  appVersion: _this.appVersion,
19
19
  createSessionCookie: connection.supportsGetItemPreviewMethod
20
20
  }, function (result) {
21
- _this.loginResponse = result;
21
+ _this.lastSuccessfulLoginResponse = result;
22
22
  var newSessionId = result.SessionId;
23
23
  if (!newSessionId) {
24
24
  var error = new Error('Successful login but no session came.');
@@ -24,6 +24,7 @@ declare class GlobalSettingsNames {
24
24
  static enableContactsSyncIntoMobileDevice: string;
25
25
  static enableLeadsSyncIntoMobileDeviceContacts: string;
26
26
  static enableUsersSyncIntoMobileDeviceContacts: string;
27
+ static emailsActiveProjectsLeadsFilter: string;
27
28
  static exchangeRatesAdminGroupName: string;
28
29
  static forcedEmailTrackingGroups: string;
29
30
  static groupsForAllUnpaidInvoicesNotification: string;
@@ -28,6 +28,7 @@ var GlobalSettingsNames = /** @class */ (function () {
28
28
  GlobalSettingsNames.enableContactsSyncIntoMobileDevice = 'EnableContactsSyncIntoMobileDevice';
29
29
  GlobalSettingsNames.enableLeadsSyncIntoMobileDeviceContacts = 'EnableLeadsSyncIntoMobileDeviceContacts';
30
30
  GlobalSettingsNames.enableUsersSyncIntoMobileDeviceContacts = 'EnableUsersSyncIntoMobileDeviceContacts';
31
+ GlobalSettingsNames.emailsActiveProjectsLeadsFilter = 'EmailsActiveProjectsLeadsFilter';
31
32
  GlobalSettingsNames.exchangeRatesAdminGroupName = 'ExchangeRatesAdminGroupName';
32
33
  GlobalSettingsNames.forcedEmailTrackingGroups = 'ForcedEmailTrackingGroups';
33
34
  GlobalSettingsNames.groupsForAllUnpaidInvoicesNotification = 'GroupsForAllUnpaidInvoicesNotification';
@@ -0,0 +1,7 @@
1
+ import { IApiResult } from './IApiResult';
2
+ export interface IApiLoginResponse extends IApiResult {
3
+ SessionId: string | null;
4
+ UserItemGuid: string | null;
5
+ IsAdmin: boolean | null;
6
+ WcfVersion: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/lib/index.d.ts CHANGED
@@ -58,6 +58,7 @@ export * from './data/IApiLead';
58
58
  export * from './data/IApiLicense';
59
59
  export * from './data/IApiLicenseBundleBase';
60
60
  export * from './data/IApiLocalizedLicenseBundle';
61
+ export * from './data/IApiLoginResponse';
61
62
  export * from './data/IApiMarketingList';
62
63
  export * from './data/IApiModulePermission';
63
64
  export * from './data/IApiObjectType';
package/lib/index.js CHANGED
@@ -95,6 +95,7 @@ __exportStar(require("./data/IApiLead"), exports);
95
95
  __exportStar(require("./data/IApiLicense"), exports);
96
96
  __exportStar(require("./data/IApiLicenseBundleBase"), exports);
97
97
  __exportStar(require("./data/IApiLocalizedLicenseBundle"), exports);
98
+ __exportStar(require("./data/IApiLoginResponse"), exports);
98
99
  __exportStar(require("./data/IApiMarketingList"), exports);
99
100
  __exportStar(require("./data/IApiModulePermission"), exports);
100
101
  __exportStar(require("./data/IApiObjectType"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eway-crm/connector",
3
- "version": "1.0.100",
3
+ "version": "1.0.101",
4
4
  "description": "eWay-CRM API JavaScript connector library.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",