ad2app-lib 1.0.0 → 1.0.3

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.
@@ -5,12 +5,31 @@ interface DriverConfig {
5
5
  getHeaders?: () => HeadersInit;
6
6
  }
7
7
  export declare function configureApiDriver(config: DriverConfig): void;
8
- export declare function fetchCall<T, Q>(path: string, fetchParams?: FetchParams<Q>, method?: HttpMethod): Promise<T>;
8
+ type FetchCallArgs<Q> = [
9
+ path: string,
10
+ params?: FetchParams<Q>,
11
+ method?: HttpMethod,
12
+ headers?: HeadersInit,
13
+ transformers?: {
14
+ body?: (body: any) => BodyInit;
15
+ }
16
+ ];
17
+ export declare function fetchCall<T, Q>(...args: FetchCallArgs<Q>): Promise<T>;
9
18
  export declare function apiDriver(): {
10
- get: <T, Q>(path: string, params?: FetchParams<Q>) => Promise<T>;
11
- post: <T, Q>(path: string, params?: FetchParams<Q>) => Promise<T>;
12
- put: <T, Q>(path: string, params?: FetchParams<Q>) => Promise<T>;
13
- patch: <T, Q>(path: string, params?: FetchParams<Q>) => Promise<T>;
14
- delete: <T, Q>(path: string, params?: FetchParams<Q>) => Promise<T>;
19
+ get: <T, Q>(path: string, params?: FetchParams<Q>, method?: HttpMethod, headers?: HeadersInit, transformers?: {
20
+ body?: (body: any) => BodyInit;
21
+ }) => Promise<T>;
22
+ post: <T, Q>(path: string, params?: FetchParams<Q>, method?: HttpMethod, headers?: HeadersInit, transformers?: {
23
+ body?: (body: any) => BodyInit;
24
+ }) => Promise<T>;
25
+ put: <T, Q>(path: string, params?: FetchParams<Q>, method?: HttpMethod, headers?: HeadersInit, transformers?: {
26
+ body?: (body: any) => BodyInit;
27
+ }) => Promise<T>;
28
+ patch: <T, Q>(path: string, params?: FetchParams<Q>, method?: HttpMethod, headers?: HeadersInit, transformers?: {
29
+ body?: (body: any) => BodyInit;
30
+ }) => Promise<T>;
31
+ delete: <T, Q>(path: string, params?: FetchParams<Q>, method?: HttpMethod, headers?: HeadersInit, transformers?: {
32
+ body?: (body: any) => BodyInit;
33
+ }) => Promise<T>;
15
34
  };
16
35
  export {};
@@ -8,8 +8,12 @@ let CONFIG;
8
8
  function configureApiDriver(config) {
9
9
  CONFIG = config;
10
10
  }
11
- async function fetchCall(path, fetchParams, method = 'get') {
12
- const headers = CONFIG.getHeaders?.() || {};
11
+ async function fetchCall(...args) {
12
+ let [path, fetchParams, method, headers, transformers] = args;
13
+ headers = {
14
+ ...CONFIG.getHeaders?.(),
15
+ ...headers,
16
+ };
13
17
  const query = {};
14
18
  Object.entries(fetchParams?.query || {}).forEach(([key, val]) => {
15
19
  query[key] = Array.isArray(val) ? JSON.stringify(val) : val;
@@ -21,7 +25,11 @@ async function fetchCall(path, fetchParams, method = 'get') {
21
25
  headers,
22
26
  };
23
27
  if (fetchParams?.body) {
28
+ // if (transformers?.body) {
29
+ // init.body = transformers.body(fetchParams.body);
30
+ // } else {
24
31
  init.body = JSON.stringify(fetchParams.body);
32
+ // }
25
33
  headers['Content-Type'] = 'application/json';
26
34
  }
27
35
  const res = await fetch(fullPath, init);
@@ -31,10 +39,10 @@ async function fetchCall(path, fetchParams, method = 'get') {
31
39
  }
32
40
  function apiDriver() {
33
41
  return {
34
- get: (path, params) => fetchCall(path, params, 'get'),
35
- post: (path, params) => fetchCall(path, params, 'post'),
36
- put: (path, params) => fetchCall(path, params, 'put'),
37
- patch: (path, params) => fetchCall(path, params, 'patch'),
38
- delete: (path, params) => fetchCall(path, params, 'delete'),
42
+ get: (...args) => fetchCall(args[0], args[1], 'get', args[3], args[4]),
43
+ post: (...args) => fetchCall(args[0], args[1], 'post', args[3], args[4]),
44
+ put: (...args) => fetchCall(args[0], args[1], 'put', args[3], args[4]),
45
+ patch: (...args) => fetchCall(args[0], args[1], 'patch', args[3], args[4]),
46
+ delete: (...args) => fetchCall(args[0], args[1], 'delete', args[3], args[4]),
39
47
  };
40
48
  }
@@ -1,5 +1,5 @@
1
- import { I_Offer } from "./I_Offer";
2
- import { I_User } from "./I_User";
1
+ import { I_Offer } from './I_Offer';
2
+ import { I_User } from './I_User';
3
3
  export declare class I_Agency {
4
4
  id: string;
5
5
  name: string;
@@ -0,0 +1,35 @@
1
+ import { I_Offer } from './I_Offer';
2
+ export declare class I_Collaboration {
3
+ id: string;
4
+ offer: I_Offer;
5
+ media: [];
6
+ }
7
+ export declare class I_GetCampaignCollaborationsDTO {
8
+ campaignId: string;
9
+ constructor(data?: Partial<I_GetCampaignCollaborationsDTO>);
10
+ }
11
+ export declare class I_GetCollaborationDTO {
12
+ collaborationId: string;
13
+ constructor(data?: Partial<I_GetCollaborationDTO>);
14
+ }
15
+ export declare class I_GetCollaborationByOfferDTO {
16
+ offerId: string;
17
+ constructor(data?: Partial<I_GetCollaborationByOfferDTO>);
18
+ }
19
+ export declare class I_GetCollaborationsDTO {
20
+ userId: string;
21
+ constructor(data?: Partial<I_GetCollaborationsDTO>);
22
+ }
23
+ export declare class I_FindUserCollaborationsDTO {
24
+ userId: string;
25
+ constructor(data?: Partial<I_FindUserCollaborationsDTO>);
26
+ }
27
+ export declare class I_CreateCollaborationDTO {
28
+ offerId: string;
29
+ constructor(data?: Partial<I_CreateCollaborationDTO>);
30
+ }
31
+ export declare class I_UploadFirstMediaVersionDTO {
32
+ collaborationId: string;
33
+ file: string;
34
+ fileName: string;
35
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.I_UploadFirstMediaVersionDTO = exports.I_CreateCollaborationDTO = exports.I_Collaboration = void 0;
4
+ class I_Collaboration {
5
+ }
6
+ exports.I_Collaboration = I_Collaboration;
7
+ class I_CreateCollaborationDTO {
8
+ constructor(data) {
9
+ this.offerId = data?.offerId ?? null;
10
+ }
11
+ }
12
+ exports.I_CreateCollaborationDTO = I_CreateCollaborationDTO;
13
+ class I_UploadFirstMediaVersionDTO {
14
+ }
15
+ exports.I_UploadFirstMediaVersionDTO = I_UploadFirstMediaVersionDTO;
@@ -0,0 +1,21 @@
1
+ export declare enum I_MediaStage {
2
+ UPLOADED = "uploaded",
3
+ ADJUSTMENT_REQUIRED = "adjustmentRequired",
4
+ REJECTED = "rejected",
5
+ ACCEPTED = "accepted"
6
+ }
7
+ export declare class I_Media {
8
+ id: string;
9
+ url: string;
10
+ fileName: string;
11
+ type: I_MediaStage;
12
+ }
13
+ export declare class I_GetCollaborationMediaDTO {
14
+ collaborationId: string;
15
+ }
16
+ export declare class I_CreateMediaDTO {
17
+ collaborationId: string;
18
+ fileName: string;
19
+ type: I_MediaStage;
20
+ file: string;
21
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.I_Media = exports.I_MediaStage = void 0;
4
+ var I_MediaStage;
5
+ (function (I_MediaStage) {
6
+ I_MediaStage["UPLOADED"] = "uploaded";
7
+ I_MediaStage["ADJUSTMENT_REQUIRED"] = "adjustmentRequired";
8
+ I_MediaStage["REJECTED"] = "rejected";
9
+ I_MediaStage["ACCEPTED"] = "accepted";
10
+ })(I_MediaStage || (exports.I_MediaStage = I_MediaStage = {}));
11
+ class I_Media {
12
+ }
13
+ exports.I_Media = I_Media;
@@ -1,6 +1,6 @@
1
- import { I_Agency } from "./I_Agency";
2
- import { I_Campaign } from "./I_Campaign";
3
- import { I_Influencer } from "./I_Influencer";
1
+ import { I_Agency } from './I_Agency';
2
+ import { I_Campaign } from './I_Campaign';
3
+ import { I_Influencer } from './I_Influencer';
4
4
  export declare class I_Offer {
5
5
  id?: string;
6
6
  agency?: I_Agency;
@@ -8,9 +8,10 @@ export declare class I_Offer {
8
8
  price?: number;
9
9
  status?: I_OfferStatus;
10
10
  action?: OfferActions;
11
+ campaign: I_Campaign;
11
12
  constructor(data?: I_Offer);
12
13
  }
13
- export type OfferActions = "create" | "delete" | "confirm" | "reject" | "negotiate" | "accept";
14
+ export type OfferActions = 'create' | 'delete' | 'confirm' | 'reject' | 'negotiate' | 'accept';
14
15
  export declare enum I_OfferStatus {
15
16
  DRAFT = "draft",
16
17
  SENT = "sent",
@@ -28,7 +29,6 @@ export declare class I_OfferGetDTO {
28
29
  }
29
30
  export declare class I_GetOffersDTO {
30
31
  campaignId?: string;
31
- influencerId?: string;
32
32
  }
33
33
  export declare class I_OfferRemoveDTO {
34
34
  id: number;
@@ -41,23 +41,27 @@ export declare class I_OfferEditDTO {
41
41
  }
42
42
  export declare class I_SendOfferDTO {
43
43
  price: number;
44
- offerId: I_Offer["id"];
44
+ offerId: I_Offer['id'];
45
45
  constructor(data?: Partial<I_SendOfferDTO>);
46
46
  }
47
+ export declare class I_NegotiateOfferDTO {
48
+ price: number;
49
+ offerId: I_Offer['id'];
50
+ }
47
51
  export declare class I_CreateDraftOfferDTO {
48
- influencerId: I_Influencer["id"];
49
- campaignId: I_Campaign["id"];
52
+ influencerId: I_Influencer['id'];
53
+ campaignId: I_Campaign['id'];
50
54
  constructor(data: I_CreateDraftOfferDTO);
51
55
  }
52
56
  export declare class I_RejectOfferDTO {
53
- offerId: I_Offer["id"];
57
+ offerId: I_Offer['id'];
54
58
  constructor(data?: Partial<I_RejectOfferDTO>);
55
59
  }
56
60
  export declare class I_AcceptOfferDTO {
57
- offerId: I_Offer["id"];
61
+ offerId: I_Offer['id'];
58
62
  constructor(data?: Partial<I_AcceptOfferDTO>);
59
63
  }
60
64
  export declare class I_ConfirmOfferDTO {
61
- offerId: I_Offer["id"];
65
+ offerId: I_Offer['id'];
62
66
  constructor(data?: Partial<I_ConfirmOfferDTO>);
63
67
  }
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.I_ConfirmOfferDTO = exports.I_AcceptOfferDTO = exports.I_RejectOfferDTO = exports.I_CreateDraftOfferDTO = exports.I_SendOfferDTO = exports.I_GetOffersDTO = exports.I_OfferStatus = exports.I_Offer = void 0;
12
+ exports.I_ConfirmOfferDTO = exports.I_AcceptOfferDTO = exports.I_RejectOfferDTO = exports.I_CreateDraftOfferDTO = exports.I_NegotiateOfferDTO = exports.I_SendOfferDTO = exports.I_GetOffersDTO = exports.I_OfferStatus = exports.I_Offer = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  class I_Offer {
15
15
  constructor(data) {
@@ -19,6 +19,7 @@ class I_Offer {
19
19
  this.price = data?.price ?? null;
20
20
  this.status = data?.status ?? null;
21
21
  this.action = data?.action ?? null;
22
+ this.campaign = data?.campaign ?? null;
22
23
  }
23
24
  }
24
25
  exports.I_Offer = I_Offer;
@@ -41,10 +42,6 @@ __decorate([
41
42
  (0, class_validator_1.IsOptional)(),
42
43
  __metadata("design:type", String)
43
44
  ], I_GetOffersDTO.prototype, "campaignId", void 0);
44
- __decorate([
45
- (0, class_validator_1.IsOptional)(),
46
- __metadata("design:type", String)
47
- ], I_GetOffersDTO.prototype, "influencerId", void 0);
48
45
  class I_SendOfferDTO {
49
46
  constructor(data) {
50
47
  this.price = data?.price ?? null;
@@ -52,6 +49,9 @@ class I_SendOfferDTO {
52
49
  }
53
50
  }
54
51
  exports.I_SendOfferDTO = I_SendOfferDTO;
52
+ class I_NegotiateOfferDTO {
53
+ }
54
+ exports.I_NegotiateOfferDTO = I_NegotiateOfferDTO;
55
55
  class I_CreateDraftOfferDTO {
56
56
  constructor(data) {
57
57
  this.influencerId = data.influencerId;
@@ -1,31 +1,33 @@
1
- export * from "./I_TikTokUser";
2
- export * from "./I_Queue";
3
- export * from "./I_Campaign";
4
- export * from "./I_Influencer";
5
- export * from "./I_InfluencersLists";
6
- export * from "./I_InfluencersCategories";
7
- export * from "./I_InfluencersProperties";
8
- export * from "./I_Item";
9
- export * from "./I_List";
10
- export * from "./I_PaginatedList";
11
- export * from "./I_Pagination";
12
- export * from "./I_TIkTokRaports";
13
- export * from "./I_Tag";
14
- export * from "./I_TikTokPost";
15
- export * from "./I_User";
16
- export * from "./I_UserTikTokStatistic";
17
- export * from "./I_ScrappingAccount";
18
- export * from "./global";
19
- export * from "./I_Scrappers";
20
- export * from "./I_ScrappingServiceMessages";
21
- export * from "./I_ScrappingMachine";
22
- export * from "./I_ScrappingMachineProcess";
23
- export * from "./T_FetchStatus";
24
- export * from "./I_ResponseMessage";
25
- export * from "./I_ScrapperLog";
26
- export * from "./I_CampaignGoal";
27
- export * from "./I_CampaignCollaborationMethod";
28
- export * from "./I_TikTokReport";
29
- export * from "./I_Offer";
30
- export * from "./I_CampaignDeadline";
31
- export * from "./I_Agency";
1
+ export * from './I_TikTokUser';
2
+ export * from './I_Queue';
3
+ export * from './I_Campaign';
4
+ export * from './I_Influencer';
5
+ export * from './I_InfluencersLists';
6
+ export * from './I_InfluencersCategories';
7
+ export * from './I_InfluencersProperties';
8
+ export * from './I_Item';
9
+ export * from './I_List';
10
+ export * from './I_PaginatedList';
11
+ export * from './I_Pagination';
12
+ export * from './I_TIkTokRaports';
13
+ export * from './I_Tag';
14
+ export * from './I_TikTokPost';
15
+ export * from './I_User';
16
+ export * from './I_UserTikTokStatistic';
17
+ export * from './I_ScrappingAccount';
18
+ export * from './global';
19
+ export * from './I_Scrappers';
20
+ export * from './I_ScrappingServiceMessages';
21
+ export * from './I_ScrappingMachine';
22
+ export * from './I_ScrappingMachineProcess';
23
+ export * from './T_FetchStatus';
24
+ export * from './I_ResponseMessage';
25
+ export * from './I_ScrapperLog';
26
+ export * from './I_CampaignGoal';
27
+ export * from './I_CampaignCollaborationMethod';
28
+ export * from './I_TikTokReport';
29
+ export * from './I_Offer';
30
+ export * from './I_CampaignDeadline';
31
+ export * from './I_Agency';
32
+ export * from './I_Media';
33
+ export * from './I_Collaboration';
@@ -45,3 +45,5 @@ __exportStar(require("./I_TikTokReport"), exports);
45
45
  __exportStar(require("./I_Offer"), exports);
46
46
  __exportStar(require("./I_CampaignDeadline"), exports);
47
47
  __exportStar(require("./I_Agency"), exports);
48
+ __exportStar(require("./I_Media"), exports);
49
+ __exportStar(require("./I_Collaboration"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ad2app-lib",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "commonjs",
@@ -14,12 +14,23 @@ export function configureApiDriver(config: DriverConfig) {
14
14
  CONFIG = config;
15
15
  }
16
16
 
17
- export async function fetchCall<T, Q>(
17
+ type FetchCallArgs<Q> = [
18
18
  path: string,
19
- fetchParams?: FetchParams<Q>,
20
- method: HttpMethod = 'get'
21
- ): Promise<T> {
22
- const headers: HeadersInit = CONFIG.getHeaders?.() || {};
19
+ params?: FetchParams<Q>,
20
+ method?: HttpMethod,
21
+ headers?: HeadersInit,
22
+ transformers?: {
23
+ body?: (body: any) => BodyInit;
24
+ }
25
+ ];
26
+
27
+ export async function fetchCall<T, Q>(...args: FetchCallArgs<Q>): Promise<T> {
28
+ let [path, fetchParams, method, headers, transformers] = args;
29
+
30
+ headers = {
31
+ ...CONFIG.getHeaders?.(),
32
+ ...headers,
33
+ };
23
34
 
24
35
  const query: Q = {} as Q;
25
36
  Object.entries(fetchParams?.query || {}).forEach(([key, val]) => {
@@ -38,7 +49,12 @@ export async function fetchCall<T, Q>(
38
49
  };
39
50
 
40
51
  if (fetchParams?.body) {
52
+ // if (transformers?.body) {
53
+ // init.body = transformers.body(fetchParams.body);
54
+ // } else {
41
55
  init.body = JSON.stringify(fetchParams.body);
56
+ // }
57
+
42
58
  headers['Content-Type'] = 'application/json';
43
59
  }
44
60
 
@@ -51,15 +67,15 @@ export async function fetchCall<T, Q>(
51
67
 
52
68
  export function apiDriver() {
53
69
  return {
54
- get: <T, Q>(path: string, params?: FetchParams<Q>) =>
55
- fetchCall<T, Q>(path, params, 'get'),
56
- post: <T, Q>(path: string, params?: FetchParams<Q>) =>
57
- fetchCall<T, Q>(path, params, 'post'),
58
- put: <T, Q>(path: string, params?: FetchParams<Q>) =>
59
- fetchCall<T, Q>(path, params, 'put'),
60
- patch: <T, Q>(path: string, params?: FetchParams<Q>) =>
61
- fetchCall<T, Q>(path, params, 'patch'),
62
- delete: <T, Q>(path: string, params?: FetchParams<Q>) =>
63
- fetchCall<T, Q>(path, params, 'delete'),
70
+ get: <T, Q>(...args: FetchCallArgs<Q>) =>
71
+ fetchCall<T, Q>(args[0], args[1], 'get', args[3], args[4]),
72
+ post: <T, Q>(...args: FetchCallArgs<Q>) =>
73
+ fetchCall<T, Q>(args[0], args[1], 'post', args[3], args[4]),
74
+ put: <T, Q>(...args: FetchCallArgs<Q>) =>
75
+ fetchCall<T, Q>(args[0], args[1], 'put', args[3], args[4]),
76
+ patch: <T, Q>(...args: FetchCallArgs<Q>) =>
77
+ fetchCall<T, Q>(args[0], args[1], 'patch', args[3], args[4]),
78
+ delete: <T, Q>(...args: FetchCallArgs<Q>) =>
79
+ fetchCall<T, Q>(args[0], args[1], 'delete', args[3], args[4]),
64
80
  };
65
81
  }
@@ -1,5 +1,5 @@
1
- import { I_Offer } from "./I_Offer";
2
- import { I_User } from "./I_User";
1
+ import { I_Offer } from './I_Offer';
2
+ import { I_User } from './I_User';
3
3
 
4
4
  export class I_Agency {
5
5
  id: string;
@@ -0,0 +1,47 @@
1
+ import { I_Media } from './I_Media';
2
+ import { I_Offer } from './I_Offer';
3
+
4
+ export class I_Collaboration {
5
+ id: string;
6
+ offer: I_Offer;
7
+ media: [];
8
+ }
9
+
10
+ export declare class I_GetCampaignCollaborationsDTO {
11
+ campaignId: string;
12
+ constructor(data?: Partial<I_GetCampaignCollaborationsDTO>);
13
+ }
14
+
15
+ export declare class I_GetCollaborationDTO {
16
+ collaborationId: string;
17
+ constructor(data?: Partial<I_GetCollaborationDTO>);
18
+ }
19
+
20
+ export declare class I_GetCollaborationByOfferDTO {
21
+ offerId: string;
22
+ constructor(data?: Partial<I_GetCollaborationByOfferDTO>);
23
+ }
24
+
25
+ export declare class I_GetCollaborationsDTO {
26
+ userId: string;
27
+ constructor(data?: Partial<I_GetCollaborationsDTO>);
28
+ }
29
+
30
+ export declare class I_FindUserCollaborationsDTO {
31
+ userId: string;
32
+ constructor(data?: Partial<I_FindUserCollaborationsDTO>);
33
+ }
34
+
35
+ export class I_CreateCollaborationDTO {
36
+ offerId: string;
37
+
38
+ constructor(data?: Partial<I_CreateCollaborationDTO>) {
39
+ this.offerId = data?.offerId ?? null;
40
+ }
41
+ }
42
+
43
+ export class I_UploadFirstMediaVersionDTO {
44
+ collaborationId: string;
45
+ file: string;
46
+ fileName: string;
47
+ }
@@ -0,0 +1,24 @@
1
+ export enum I_MediaStage {
2
+ UPLOADED = 'uploaded',
3
+ ADJUSTMENT_REQUIRED = 'adjustmentRequired',
4
+ REJECTED = 'rejected',
5
+ ACCEPTED = 'accepted',
6
+ }
7
+
8
+ export class I_Media {
9
+ id: string;
10
+ url: string;
11
+ fileName: string;
12
+ type: I_MediaStage;
13
+ }
14
+
15
+ export declare class I_GetCollaborationMediaDTO {
16
+ collaborationId: string;
17
+ }
18
+
19
+ export declare class I_CreateMediaDTO {
20
+ collaborationId: string;
21
+ fileName: string;
22
+ type: I_MediaStage;
23
+ file: string;
24
+ }
@@ -1,7 +1,7 @@
1
- import { IsOptional } from "class-validator";
2
- import { I_Agency } from "./I_Agency";
3
- import { I_Campaign } from "./I_Campaign";
4
- import { I_Influencer } from "./I_Influencer";
1
+ import { IsOptional } from 'class-validator';
2
+ import { I_Agency } from './I_Agency';
3
+ import { I_Campaign } from './I_Campaign';
4
+ import { I_Influencer } from './I_Influencer';
5
5
 
6
6
  export class I_Offer {
7
7
  id?: string;
@@ -10,6 +10,7 @@ export class I_Offer {
10
10
  price?: number;
11
11
  status?: I_OfferStatus;
12
12
  action?: OfferActions;
13
+ campaign: I_Campaign;
13
14
 
14
15
  constructor(data?: I_Offer) {
15
16
  this.agency = data?.agency ?? null;
@@ -18,27 +19,28 @@ export class I_Offer {
18
19
  this.price = data?.price ?? null;
19
20
  this.status = data?.status ?? null;
20
21
  this.action = data?.action ?? null;
22
+ this.campaign = data?.campaign ?? null;
21
23
  }
22
24
  }
23
25
 
24
26
  export type OfferActions =
25
- | "create"
26
- | "delete"
27
- | "confirm"
28
- | "reject"
29
- | "negotiate"
30
- | "accept";
27
+ | 'create'
28
+ | 'delete'
29
+ | 'confirm'
30
+ | 'reject'
31
+ | 'negotiate'
32
+ | 'accept';
31
33
 
32
34
  export enum I_OfferStatus {
33
- DRAFT = "draft",
34
- SENT = "sent",
35
- DELETED = "deleted",
36
- ACCEPTED = "accepted",
37
- REJECTED = "rejected",
38
- INFLUENCER_NEGOTIATED = "influencerNegotiated",
39
- AGENCY_NEGOTIATED = "agencyNegotiated",
40
- CONFIRMED = "confirmed",
41
- ALTERNATIVE_SUGGESTED = "alternativeSuggested",
35
+ DRAFT = 'draft',
36
+ SENT = 'sent',
37
+ DELETED = 'deleted',
38
+ ACCEPTED = 'accepted',
39
+ REJECTED = 'rejected',
40
+ INFLUENCER_NEGOTIATED = 'influencerNegotiated',
41
+ AGENCY_NEGOTIATED = 'agencyNegotiated',
42
+ CONFIRMED = 'confirmed',
43
+ ALTERNATIVE_SUGGESTED = 'alternativeSuggested',
42
44
  }
43
45
 
44
46
  export declare class I_OfferGetDTO {
@@ -49,9 +51,6 @@ export declare class I_OfferGetDTO {
49
51
  export class I_GetOffersDTO {
50
52
  @IsOptional()
51
53
  campaignId?: string;
52
-
53
- @IsOptional()
54
- influencerId?: string;
55
54
  }
56
55
 
57
56
  export declare class I_OfferRemoveDTO {
@@ -66,16 +65,21 @@ export declare class I_OfferEditDTO {
66
65
 
67
66
  export class I_SendOfferDTO {
68
67
  price: number;
69
- offerId: I_Offer["id"];
68
+ offerId: I_Offer['id'];
70
69
  constructor(data?: Partial<I_SendOfferDTO>) {
71
70
  this.price = data?.price ?? null;
72
71
  this.offerId = data?.offerId ?? null;
73
72
  }
74
73
  }
75
74
 
75
+ export class I_NegotiateOfferDTO {
76
+ price: number;
77
+ offerId: I_Offer['id'];
78
+ }
79
+
76
80
  export class I_CreateDraftOfferDTO {
77
- influencerId: I_Influencer["id"];
78
- campaignId: I_Campaign["id"];
81
+ influencerId: I_Influencer['id'];
82
+ campaignId: I_Campaign['id'];
79
83
 
80
84
  constructor(data: I_CreateDraftOfferDTO) {
81
85
  this.influencerId = data.influencerId;
@@ -84,21 +88,21 @@ export class I_CreateDraftOfferDTO {
84
88
  }
85
89
 
86
90
  export class I_RejectOfferDTO {
87
- offerId: I_Offer["id"];
91
+ offerId: I_Offer['id'];
88
92
  constructor(data?: Partial<I_RejectOfferDTO>) {
89
93
  this.offerId = data?.offerId ?? null;
90
94
  }
91
95
  }
92
96
 
93
97
  export class I_AcceptOfferDTO {
94
- offerId: I_Offer["id"];
98
+ offerId: I_Offer['id'];
95
99
  constructor(data?: Partial<I_AcceptOfferDTO>) {
96
100
  this.offerId = data?.offerId ?? null;
97
101
  }
98
102
  }
99
103
 
100
104
  export class I_ConfirmOfferDTO {
101
- offerId: I_Offer["id"];
105
+ offerId: I_Offer['id'];
102
106
  constructor(data?: Partial<I_ConfirmOfferDTO>) {
103
107
  this.offerId = data?.offerId ?? null;
104
108
  }
@@ -1,31 +1,33 @@
1
- export * from "./I_TikTokUser";
2
- export * from "./I_Queue";
3
- export * from "./I_Campaign";
4
- export * from "./I_Influencer";
5
- export * from "./I_InfluencersLists";
6
- export * from "./I_InfluencersCategories";
7
- export * from "./I_InfluencersProperties";
8
- export * from "./I_Item";
9
- export * from "./I_List";
10
- export * from "./I_PaginatedList";
11
- export * from "./I_Pagination";
12
- export * from "./I_TIkTokRaports";
13
- export * from "./I_Tag";
14
- export * from "./I_TikTokPost";
15
- export * from "./I_User";
16
- export * from "./I_UserTikTokStatistic";
17
- export * from "./I_ScrappingAccount";
18
- export * from "./global";
19
- export * from "./I_Scrappers";
20
- export * from "./I_ScrappingServiceMessages";
21
- export * from "./I_ScrappingMachine";
22
- export * from "./I_ScrappingMachineProcess";
23
- export * from "./T_FetchStatus";
24
- export * from "./I_ResponseMessage";
25
- export * from "./I_ScrapperLog";
26
- export * from "./I_CampaignGoal";
27
- export * from "./I_CampaignCollaborationMethod";
28
- export * from "./I_TikTokReport";
29
- export * from "./I_Offer";
30
- export * from "./I_CampaignDeadline";
31
- export * from "./I_Agency";
1
+ export * from './I_TikTokUser';
2
+ export * from './I_Queue';
3
+ export * from './I_Campaign';
4
+ export * from './I_Influencer';
5
+ export * from './I_InfluencersLists';
6
+ export * from './I_InfluencersCategories';
7
+ export * from './I_InfluencersProperties';
8
+ export * from './I_Item';
9
+ export * from './I_List';
10
+ export * from './I_PaginatedList';
11
+ export * from './I_Pagination';
12
+ export * from './I_TIkTokRaports';
13
+ export * from './I_Tag';
14
+ export * from './I_TikTokPost';
15
+ export * from './I_User';
16
+ export * from './I_UserTikTokStatistic';
17
+ export * from './I_ScrappingAccount';
18
+ export * from './global';
19
+ export * from './I_Scrappers';
20
+ export * from './I_ScrappingServiceMessages';
21
+ export * from './I_ScrappingMachine';
22
+ export * from './I_ScrappingMachineProcess';
23
+ export * from './T_FetchStatus';
24
+ export * from './I_ResponseMessage';
25
+ export * from './I_ScrapperLog';
26
+ export * from './I_CampaignGoal';
27
+ export * from './I_CampaignCollaborationMethod';
28
+ export * from './I_TikTokReport';
29
+ export * from './I_Offer';
30
+ export * from './I_CampaignDeadline';
31
+ export * from './I_Agency';
32
+ export * from './I_Media';
33
+ export * from './I_Collaboration';