Skip to content

Commit

Permalink
Typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chkp-haimk committed Mar 4, 2024
1 parent 80007d7 commit a37c81c
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chkp/harmony-endpoint-management-sdk",
"version": "1.1.40",
"version": "1.1.43",
"description": "The official Harmony Endpoint management SDK for JavaScript ecosystem",
"main": "dist/index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions resources/typescript-axios/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import { Guid } from 'guid-typescript';
import { Configuration } from "./configuration";
{{! TEMPLATE EDIT: import session object type }}
import { HarmonyError, HarmonyErrorScope, SDKConnectionState, InfinityPortalAuth, HarmonyRequestOptions, HarmonyResponse, HarmonyEndpointOptions, HarmonyEndpointSDKInfo } from "../../../inerfaces/infta";
import { HarmonyError, HarmonyErrorScope, SDKConnectionState, InfinityPortalAuth, HarmonyRequestOptions, HarmonyResponse, HarmonyEndpointOptions, HarmonyEndpointSDKInfo } from "../../../interfaces/infra";
import { SessionManager } from "../../../core/session.manager";
import { JobManager } from "../../../core/jobs.management";
import { logger, errorLogger, networkLogger } from "../../../core/debug.logger";
import { RUNNING_ENV } from "../../../core/sdk.platform";
import { parseFetchError } from "../../../core/common";
import { HarmonyRequestSession } from "../../../inerfaces/core";
import { HarmonyRequestSession } from "../../../interfaces/core";
const swagger = require('../swagger.json');
const packageJson = require('../../../../package.json');
Expand Down
4 changes: 2 additions & 2 deletions src/core/common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Duration } from 'unitsnet-js';
import { HarmonyError, HarmonyErrorScope } from '../inerfaces/infta';
import { HarmonyError, HarmonyErrorScope } from '../interfaces/infra';
import { networkLogger, errorLogger } from './debug.logger';
import { HarmonyRequestSession } from '../inerfaces/core';
import { HarmonyRequestSession } from '../interfaces/core';

export async function sleep(duration: Duration) {
return new Promise<void>((resolve) => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/harmony.endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { HarmonyEndpointBase as HarmonyEndpointCloudBase } from '../generated/cl
// TODO: Open when on-premise will be release to public
// import { HarmonyEndpointBase as HarmonyEndpointPremiseBase } from '../generated/premise/swagger/api';
import { HarmonyEndpointBase as HarmonyEndpointSaasBase } from '../generated/saas/swagger/api';
import { HarmonyEndpointSaaSOptions, InfinityPortalAuth } from '../inerfaces/infta';
import { HarmonyEndpointSaaSOptions, InfinityPortalAuth } from '../interfaces/infra';

export class HarmonyEndpoint extends HarmonyEndpointCloudBase {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/core/jobs.management.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Duration, DurationUnits } from 'unitsnet-js';
// eslint-disable-next-line import/no-cycle
import { JobStatus } from '../generated/cloud/swagger/api'; // DO NOT IMPORT LOGICAL VARS!!! - This is a cycle import, and it works only due to importing TS interface only, that has no affect on runtime.
import { HarmonyError, HarmonyErrorScope, HarmonyResponse } from '../inerfaces/infta';
import { HarmonyError, HarmonyErrorScope, HarmonyResponse } from '../interfaces/infra';
import { sleep } from './common';
import { JOBS_PULLING_INTERVAL, MAX_FAILED_PULLING_ATTEMPTS } from './sdk.platform';
import { errorLogger, logger } from './debug.logger';
Expand Down
2 changes: 1 addition & 1 deletion src/core/sdk.platform.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Duration } from 'unitsnet-js';
import { InfinityPortalRegion } from '../inerfaces/infta';
import { InfinityPortalRegion } from '../interfaces/infra';

type ENV = 'STG' | 'PROD';

Expand Down
4 changes: 2 additions & 2 deletions src/core/session.manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import {
HarmonyErrorScope,
OnPremisePortalAuth,
HarmonyEndpointSaaSOptions,
} from '../inerfaces/infta';
} from '../interfaces/infra';
import { errorLogger, logger } from './debug.logger';
import { parseFetchError } from './common';
import { ISessionManager } from '../inerfaces/core';
import { ISessionManager } from '../interfaces/core';

const CI_APPLICATION_PATH = '/app/endpoint-web-mgmt';
const EXTERNAL_API_BASE_PATH = '/harmony/endpoint/api';
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { HarmonyEndpoint, HarmonyEndpointSaaS } from './core/harmony.endpoint';
export * from './inerfaces/infta';
export * from './interfaces/infra';
export * as EndpointInterfaces from './generated/cloud/swagger/api';
// TODO: Open when on-premise will be release to public
// export * as EndpointPremiseInterfaces from './generated/premise/swagger/api';
Expand Down
13 changes: 13 additions & 0 deletions src/interfaces/core.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Agent } from 'https';
import { HarmonySession } from './infra';

export interface ISessionManager {
baseURL: string;
httpAgent: Agent | undefined;
getHarmonySession: () => HarmonySession | undefined;
}

export interface HarmonyRequestSession {
requestId: string;
sessionManager: ISessionManager;
}
83 changes: 83 additions & 0 deletions src/interfaces/infra.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { Duration } from 'unitsnet-js';

export interface HarmonyEndpointSDKInfo {
sdkVersion: string;
sdkBuild: string;
releasedOn: string;
spec: string;
specVersion: string;
}

export enum InfinityPortalRegion {
EU_IRELAND = 'eu-west-1',
US_NORTH_VIRGINIA = 'us-east-1',
AP_AUSTRALIA = 'ap-southeast-2',
}

export interface HarmonySession {
infinityToken?: string;
sessionId: string;
harmonyToken?: string;
}

export enum HarmonyErrorScope {
NETWORKING = 'NETWORKING',
SERVICE = 'SERVICE',
SESSION = 'SESSION',
INVALID_PARAMS = 'INVALID_PARAMS',
}

export interface HarmonyError {
errorScope: HarmonyErrorScope;
requestId: string;
message?: string;
url?: string;
statusCode?: number;
statusText?: string;
payloadError?: any;
networkError?: any;
}

export enum SDKConnectionState {
CONNECTED = 'CONNECTED',
DISCONNECTED = 'DISCONNECTED',
CONNECTION_ISSUE = 'CONNECTION_ISSUE',
}

export class HarmonyResponse<T> {
payload!: T;

httpResponse: Response;

isJob: boolean;

duration?: Duration;

requestId: string;

jobId?: string;
}

export interface HarmonyEndpointSaaSOptions {
activateMssPSession: boolean;
}

export interface InfinityPortalAuth {
clientId: string;
accessKey: string;
region?: InfinityPortalRegion;
gateway?: string;
}

export interface OnPremisePortalAuth {
username: string;
password: string;
url: string;
disableTLSChainValidation?: boolean;
}

export interface HarmonyRequestOptions {
doNotAwaitForJobs?: boolean;
}

export interface HarmonyEndpointOptions extends HarmonyRequestOptions {}

0 comments on commit a37c81c

Please sign in to comment.