Skip to content

Commit 5c27708

Browse files
committed
updating types export and placing in src dir
1 parent 203c7f4 commit 5c27708

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

src/properties.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { hubspotClient } from "./auth";
1212

1313
import { Request } from "express";
1414

15-
import { PropertyCache } from "default";
15+
import { PropertyCache } from "./types/common";
1616
import handleError from "./utils/error";
1717
import {
1818
PropertyCreateFieldTypeEnum,
@@ -388,7 +388,7 @@ export const checkForPropertyOrGroup = async (
388388
}
389389
} catch(error:unknown) {
390390
// The current client throws a 404 error so we need to catch errors and check for the 404 code
391-
let errorCode: any = (error instanceof Error && "code" in error) ? error?.code : error;
391+
const errorCode: any = (error instanceof Error && "code" in error) ? error?.code : error;
392392
if (errorCode == 404) {
393393
// 404: property or group doesn't exist, and we should create it
394394
propertyOrGroupExists = false;

types/common.d.ts renamed to src/types/common.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare module "default" {
1+
22
interface Property {
33
name: string;
44
label?: string | null;
@@ -94,4 +94,3 @@ type LogLevel = 'Info' | 'Warning' | 'Error';
9494
modificationMetadata: ModificationMetadata;
9595
formField: boolean;
9696
}
97-
}

src/utils/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { logger } from "./logger";
22
import shutdown from "./shutdown";
3-
import { LogObject } from "../../types/common";
3+
import { LogObject } from "../types/common";
44

55
function isHubSpotApiError(error: any): boolean {
66
// Check for presence of typical HubSpot headers

src/utils/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LogObject } from "default";
1+
import { LogObject } from "../types/common";
22

33
class Logger {
44
private log(message: LogObject): void {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
88
"skipLibCheck": true, /* Skip type checking of declaration files. */
99
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
10-
"typeRoots": ["./types"],
10+
"typeRoots": ["src/types"],
1111
"experimentalDecorators": true,
1212
"emitDecoratorMetadata": true,
1313
"types": ["jest", "node"],

0 commit comments

Comments
 (0)