@dma-sdk/hubspot 1.0.15 → 1.0.17

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.d.ts CHANGED
@@ -6,5 +6,6 @@ export * from './constants/subscriptions';
6
6
  export * from './interfaces/input/subscriptions';
7
7
  export * from './interfaces/output/subscriptions';
8
8
  export * from './types/auth/hs-signature-data';
9
+ export * from './types/subscription/event';
9
10
  export * from './exceptions/conversion-error';
10
11
  export * from './utils/auth';
package/dist/index.js CHANGED
@@ -22,5 +22,6 @@ __exportStar(require("./constants/subscriptions"), exports);
22
22
  __exportStar(require("./interfaces/input/subscriptions"), exports);
23
23
  __exportStar(require("./interfaces/output/subscriptions"), exports);
24
24
  __exportStar(require("./types/auth/hs-signature-data"), exports);
25
+ __exportStar(require("./types/subscription/event"), exports);
25
26
  __exportStar(require("./exceptions/conversion-error"), exports);
26
27
  __exportStar(require("./utils/auth"), exports);
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export declare const subscriptionEventSchema: z.ZodObject<{
3
+ eventId: z.ZodNumber;
4
+ subscriptionId: z.ZodOptional<z.ZodNumber>;
5
+ portalId: z.ZodOptional<z.ZodNumber>;
6
+ appId: z.ZodNumber;
7
+ occurredAt: z.ZodOptional<z.ZodNumber>;
8
+ subscriptionType: z.ZodString;
9
+ attemptNumber: z.ZodOptional<z.ZodNumber>;
10
+ objectId: z.ZodNumber;
11
+ propertyName: z.ZodOptional<z.ZodString>;
12
+ propertyValue: z.ZodOptional<z.ZodString>;
13
+ changeSource: z.ZodOptional<z.ZodString>;
14
+ changeFlag: z.ZodOptional<z.ZodString>;
15
+ sourceId: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ export declare const subscriptionEventListSchema: z.ZodArray<z.ZodObject<{
18
+ eventId: z.ZodNumber;
19
+ subscriptionId: z.ZodOptional<z.ZodNumber>;
20
+ portalId: z.ZodOptional<z.ZodNumber>;
21
+ appId: z.ZodNumber;
22
+ occurredAt: z.ZodOptional<z.ZodNumber>;
23
+ subscriptionType: z.ZodString;
24
+ attemptNumber: z.ZodOptional<z.ZodNumber>;
25
+ objectId: z.ZodNumber;
26
+ propertyName: z.ZodOptional<z.ZodString>;
27
+ propertyValue: z.ZodOptional<z.ZodString>;
28
+ changeSource: z.ZodOptional<z.ZodString>;
29
+ changeFlag: z.ZodOptional<z.ZodString>;
30
+ sourceId: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>;
32
+ export type SubscriptionEvent = z.infer<typeof subscriptionEventSchema>;
33
+ export type SubscriptionEventList = z.infer<typeof subscriptionEventListSchema>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscriptionEventListSchema = exports.subscriptionEventSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.subscriptionEventSchema = zod_1.z.object({
6
+ eventId: zod_1.z.number(),
7
+ subscriptionId: zod_1.z.number().optional(),
8
+ portalId: zod_1.z.number().optional(),
9
+ appId: zod_1.z.number(),
10
+ occurredAt: zod_1.z.number().optional(),
11
+ subscriptionType: zod_1.z.string(),
12
+ attemptNumber: zod_1.z.number().optional(),
13
+ objectId: zod_1.z.number(),
14
+ propertyName: zod_1.z.string().optional(),
15
+ propertyValue: zod_1.z.string().optional(),
16
+ changeSource: zod_1.z.string().optional(),
17
+ changeFlag: zod_1.z.string().optional(),
18
+ sourceId: zod_1.z.string().optional(),
19
+ });
20
+ exports.subscriptionEventListSchema = zod_1.z.array(exports.subscriptionEventSchema);
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export declare const subscriptionEventSchema: z.ZodObject<{
3
+ eventId: z.ZodNumber;
4
+ subscriptionId: z.ZodOptional<z.ZodNumber>;
5
+ portalId: z.ZodOptional<z.ZodNumber>;
6
+ appId: z.ZodNumber;
7
+ occurredAt: z.ZodOptional<z.ZodNumber>;
8
+ subscriptionType: z.ZodString;
9
+ attemptNumber: z.ZodOptional<z.ZodNumber>;
10
+ objectId: z.ZodNumber;
11
+ propertyName: z.ZodOptional<z.ZodString>;
12
+ propertyValue: z.ZodOptional<z.ZodString>;
13
+ changeSource: z.ZodOptional<z.ZodString>;
14
+ changeFlag: z.ZodOptional<z.ZodString>;
15
+ sourceId: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strip>;
17
+ export declare const subscriptionEventListSchema: z.ZodArray<z.ZodObject<{
18
+ eventId: z.ZodNumber;
19
+ subscriptionId: z.ZodOptional<z.ZodNumber>;
20
+ portalId: z.ZodOptional<z.ZodNumber>;
21
+ appId: z.ZodNumber;
22
+ occurredAt: z.ZodOptional<z.ZodNumber>;
23
+ subscriptionType: z.ZodString;
24
+ attemptNumber: z.ZodOptional<z.ZodNumber>;
25
+ objectId: z.ZodNumber;
26
+ propertyName: z.ZodOptional<z.ZodString>;
27
+ propertyValue: z.ZodOptional<z.ZodString>;
28
+ changeSource: z.ZodOptional<z.ZodString>;
29
+ changeFlag: z.ZodOptional<z.ZodString>;
30
+ sourceId: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>;
32
+ export type SubscriptionEvent = z.infer<typeof subscriptionEventSchema>;
33
+ export type SubscriptionEventList = z.infer<typeof subscriptionEventListSchema>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscriptionEventListSchema = exports.subscriptionEventSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.subscriptionEventSchema = zod_1.z.object({
6
+ eventId: zod_1.z.number(),
7
+ subscriptionId: zod_1.z.number().optional(),
8
+ portalId: zod_1.z.number().optional(),
9
+ appId: zod_1.z.number(),
10
+ occurredAt: zod_1.z.number().optional(),
11
+ subscriptionType: zod_1.z.string(),
12
+ attemptNumber: zod_1.z.number().optional(),
13
+ objectId: zod_1.z.number(),
14
+ propertyName: zod_1.z.string().optional(),
15
+ propertyValue: zod_1.z.string().optional(),
16
+ changeSource: zod_1.z.string().optional(),
17
+ changeFlag: zod_1.z.string().optional(),
18
+ sourceId: zod_1.z.string().optional(),
19
+ });
20
+ exports.subscriptionEventListSchema = zod_1.z.array(exports.subscriptionEventSchema);
@@ -21,7 +21,7 @@ AuthUtils.extractHubSpotSignatureComponentsFromEvent = (params) => {
21
21
  qs: qs || {},
22
22
  body: body ?? '',
23
23
  };
24
- return utils_1.ValidationUtils.parse(input, hs_signature_data_1.hubspotSignatureDataSchema);
24
+ return utils_1.ValidationUtils.parseData(input, hs_signature_data_1.hubspotSignatureDataSchema);
25
25
  };
26
26
  AuthUtils.isHubSpotSignatureValid = async (params) => {
27
27
  try {
package/lib/index.ts CHANGED
@@ -6,5 +6,6 @@ export * from './constants/subscriptions';
6
6
  export * from './interfaces/input/subscriptions';
7
7
  export * from './interfaces/output/subscriptions';
8
8
  export * from './types/auth/hs-signature-data';
9
+ export * from './types/subscription/event';
9
10
  export * from './exceptions/conversion-error';
10
11
  export * from './utils/auth';
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+
3
+ export const subscriptionEventSchema = z.object({
4
+ eventId: z.number(),
5
+ subscriptionId: z.number().optional(),
6
+ portalId: z.number().optional(),
7
+ appId: z.number(),
8
+ occurredAt: z.number().optional(),
9
+ subscriptionType: z.string(),
10
+ attemptNumber: z.number().optional(),
11
+ objectId: z.number(),
12
+ propertyName: z.string().optional(),
13
+ propertyValue: z.string().optional(),
14
+ changeSource: z.string().optional(),
15
+ changeFlag: z.string().optional(),
16
+ sourceId: z.string().optional(),
17
+ });
18
+
19
+ export const subscriptionEventListSchema = z.array(subscriptionEventSchema);
20
+
21
+ export type SubscriptionEvent = z.infer<typeof subscriptionEventSchema>;
22
+ export type SubscriptionEventList = z.infer<typeof subscriptionEventListSchema>;
package/lib/utils/auth.ts CHANGED
@@ -26,7 +26,7 @@ export class AuthUtils {
26
26
  body: body ?? '',
27
27
  }
28
28
 
29
- return ValidationUtils.parse<HubspotSignatureData>(input, hubspotSignatureDataSchema)
29
+ return ValidationUtils.parseData(input, hubspotSignatureDataSchema)
30
30
  }
31
31
 
32
32
  static isHubSpotSignatureValid = async (params: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dma-sdk/hubspot",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "DMA SDK – Hubspot service",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -10,9 +10,9 @@
10
10
  "test": "node_modules/jest/bin/jest.js --runInBand --forceExit --coverage --detectOpenHandles --coverageProvider v8 --collectCoverageFrom=src/**/*.{ts,js} --config='./jest.config.js' __tests__"
11
11
  },
12
12
  "dependencies": {
13
- "@dma-sdk/utils": "^1.0.6",
13
+ "@dma-sdk/utils": "^1.0.8",
14
14
  "@hubspot/api-client": "^13.4.0",
15
- "zod": "^4.3.5"
15
+ "zod": "^4.3.6"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/jest": "^29.5.13",