shred-api-client 1.10.11 → 1.11.1

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.
@@ -0,0 +1,9 @@
1
+ import Environment from "../model/Env";
2
+ import { Track, TrackAPISchema } from "../model/Track.schema";
3
+ declare class TrackAPI implements TrackAPISchema {
4
+ private env;
5
+ private clientHTTP;
6
+ constructor(env: Environment);
7
+ send(t: Track): Promise<boolean>;
8
+ }
9
+ export default TrackAPI;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const HTTPClient_1 = __importDefault(require("../util/HTTPClient"));
7
+ const Track_schema_1 = require("../model/Track.schema");
8
+ class TrackAPI {
9
+ constructor(env) {
10
+ this.env = env;
11
+ this.clientHTTP = new HTTPClient_1.default();
12
+ }
13
+ async send(t) {
14
+ const endpointInfo = Track_schema_1.TrackEndpoints.Track;
15
+ const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}`, endpointInfo.method, t);
16
+ return data;
17
+ }
18
+ }
19
+ exports.default = TrackAPI;
@@ -7,6 +7,7 @@ import { EmailAPISchema } from "./Email.schema";
7
7
  import { TenantAPISchema } from "./Tenant.schema";
8
8
  import { ProjectAPISchema } from "./Project.schema";
9
9
  import { APPConfigSchema } from "./AppConfig.schema";
10
+ import { TrackAPISchema } from "./Track.schema";
10
11
  export declare class ShredAPI {
11
12
  user: UserAPISchema;
12
13
  subscription: SubscriptionAPISchema;
@@ -16,5 +17,6 @@ export declare class ShredAPI {
16
17
  tenant: TenantAPISchema;
17
18
  app: APPConfigSchema;
18
19
  project: ProjectAPISchema;
20
+ track: TrackAPISchema;
19
21
  constructor(env: Environment);
20
22
  }
package/dist/model/Api.js CHANGED
@@ -12,6 +12,7 @@ const User_api_1 = __importDefault(require("../api/User.api"));
12
12
  const Email_api_1 = __importDefault(require("../api/Email.api"));
13
13
  const Project_api_1 = __importDefault(require("../api/Project.api"));
14
14
  const AppConfig_api_1 = __importDefault(require("../api/AppConfig.api"));
15
+ const Track_api_1 = __importDefault(require("../api/Track.api"));
15
16
  class ShredAPI {
16
17
  constructor(env) {
17
18
  this.user = new User_api_1.default(env);
@@ -22,6 +23,7 @@ class ShredAPI {
22
23
  this.tenant = new Tenant_api_1.default(env);
23
24
  this.project = new Project_api_1.default(env);
24
25
  this.app = new AppConfig_api_1.default(env);
26
+ this.track = new Track_api_1.default(env);
25
27
  }
26
28
  }
27
29
  exports.ShredAPI = ShredAPI;
@@ -0,0 +1,20 @@
1
+ interface TrackAPISchema {
2
+ send: (t: Track) => Promise<boolean>;
3
+ }
4
+ declare const TrackEndpoints: {
5
+ Track: {
6
+ uri: string;
7
+ method: string;
8
+ };
9
+ };
10
+ type TrackParam = {
11
+ name: string;
12
+ value: string | number;
13
+ };
14
+ type Track = {
15
+ category: string;
16
+ label: string;
17
+ action: string;
18
+ params?: TrackParam[];
19
+ };
20
+ export { Track, TrackEndpoints, TrackAPISchema };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TrackEndpoints = void 0;
4
+ const TrackEndpoints = {
5
+ Track: {
6
+ uri: "/track/public/send/",
7
+ method: "POST",
8
+ },
9
+ };
10
+ exports.TrackEndpoints = TrackEndpoints;
@@ -5,6 +5,7 @@ import { Email as TEmail } from "./model/Email.schema";
5
5
  import { Asset as TAsset } from "./model/Asset.schema";
6
6
  import { Project as TProject } from "./model/Project.schema";
7
7
  import { Tenant as TTenant } from "./model/Tenant.schema";
8
+ import { Track as TTrack } from "./model/Track.schema";
8
9
  import { Prompt as TPrompt, Script as TScript, Category as TCategory } from "./model/Prompt.schema";
9
10
  export declare namespace Permissions {
10
11
  type Role = TRole;
@@ -19,6 +20,7 @@ export declare namespace Shred {
19
20
  type System = TSystem;
20
21
  type Project = TProject;
21
22
  type Asset = TAsset;
23
+ type Track = TTrack;
22
24
  namespace PromptTypes {
23
25
  type Prompt = TPrompt;
24
26
  type Script = TScript;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shred-api-client",
3
- "version": "1.10.11",
3
+ "version": "1.11.1",
4
4
  "description": "API Client for Shred",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",