@adhese/sdk 0.5.2 → 0.6.0

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
@@ -1,6 +1,6 @@
1
- import { ComputedRef, Ref, MaybeRef } from '@vue/runtime-core';
2
1
  import * as zod from 'zod';
3
2
  import { TypeOf, ZodType } from 'zod';
3
+ import { ComputedRef, Ref, MaybeRef } from '@vue/runtime-core';
4
4
 
5
5
  /**
6
6
  * Merge two types together. The resulting type will have all properties of both types, but if a property is present in
@@ -55,6 +55,72 @@ type EventManager<Events extends Record<string, unknown>> = {
55
55
  */
56
56
  declare function createEventManager<Events extends Record<Name, unknown>, Name extends Readonly<string | number | symbol> = keyof Events>(): EventManager<Events>;
57
57
 
58
+ declare class Config {
59
+ auto?: boolean;
60
+ debug?: boolean;
61
+ renderFile?: string;
62
+ cdn?: string;
63
+ msgFile?: string;
64
+ root?: string;
65
+ to?: number;
66
+ constructor(options?: {
67
+ auto?: boolean;
68
+ debug?: boolean;
69
+ renderFile?: string;
70
+ cdn?: string;
71
+ msgFile?: string;
72
+ root?: string;
73
+ to?: number;
74
+ });
75
+ }
76
+ declare class Position {
77
+ html: string;
78
+ id: string;
79
+ src: string;
80
+ meta?: Record<string, unknown>;
81
+ config?: Record<string, unknown>;
82
+ constructor(config: {
83
+ id: string;
84
+ src?: string;
85
+ html: string;
86
+ config?: PosConfig;
87
+ });
88
+ }
89
+ declare class PosConfig {
90
+ id: string;
91
+ dest: string;
92
+ constructor(posIDorObj: string | {
93
+ bg?: string;
94
+ css?: string;
95
+ dest?: string;
96
+ h?: number;
97
+ id?: string;
98
+ size?: string;
99
+ tgt?: string;
100
+ w?: number;
101
+ z?: number;
102
+ supports?: Record<string, unknown>;
103
+ }, destID?: string, baseConf?: {
104
+ bg?: string;
105
+ css?: string;
106
+ dest?: string;
107
+ h?: number;
108
+ id?: string;
109
+ size?: string;
110
+ tgt?: string;
111
+ w?: number;
112
+ z?: number;
113
+ supports?: Record<string, unknown>;
114
+ });
115
+ }
116
+
117
+ type SafeFrame = {
118
+ config: Config;
119
+ addPosition(positions: Ad, element: HTMLElement): Position;
120
+ render(position: Position): Promise<void>;
121
+ dispose(): void;
122
+ };
123
+
58
124
  type SlotManager = {
59
125
  /**
60
126
  * Returns all slots that are currently registered and rendered.
@@ -117,8 +183,8 @@ declare const baseSchema: zod.ZodObject<{
117
183
  mediaType: string;
118
184
  prebid?: unknown;
119
185
  }>>;
120
- height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">, zod.ZodNumber]>, string | undefined, string | number>>;
121
- id: zod.ZodOptional<zod.ZodString>;
186
+ height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
187
+ id: zod.ZodString;
122
188
  impressionCounter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
123
189
  libId: zod.ZodOptional<zod.ZodString>;
124
190
  orderId: zod.ZodOptional<zod.ZodString>;
@@ -130,6 +196,7 @@ declare const baseSchema: zod.ZodObject<{
130
196
  poolPath: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
131
197
  preview: zod.ZodOptional<zod.ZodUnion<[zod.ZodBoolean, zod.ZodLiteral<"">]>>;
132
198
  priority: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
199
+ sfSrc: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
133
200
  share: zod.ZodOptional<zod.ZodString>;
134
201
  slotID: zod.ZodString;
135
202
  slotName: zod.ZodString;
@@ -142,9 +209,10 @@ declare const baseSchema: zod.ZodObject<{
142
209
  trackingUrl: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
143
210
  url: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
144
211
  viewableImpressionCounter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
145
- width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">, zod.ZodNumber]>, string | undefined, string | number>>;
212
+ width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
146
213
  widthLarge: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">, zod.ZodNumber]>, string | undefined, string | number>>;
147
214
  }, "strip", zod.ZodTypeAny, {
215
+ id: string;
148
216
  origin: "JERLICIA" | "DALE";
149
217
  adType: string;
150
218
  slotID: string;
@@ -171,8 +239,7 @@ declare const baseSchema: zod.ZodObject<{
171
239
  mediaType: string;
172
240
  prebid?: unknown;
173
241
  } | undefined;
174
- height?: string | undefined;
175
- id?: string | undefined;
242
+ height?: number | undefined;
176
243
  impressionCounter?: URL | undefined;
177
244
  libId?: string | undefined;
178
245
  orderId?: string | undefined;
@@ -183,6 +250,7 @@ declare const baseSchema: zod.ZodObject<{
183
250
  poolPath?: URL | undefined;
184
251
  preview?: boolean | "" | undefined;
185
252
  priority?: number | undefined;
253
+ sfSrc?: URL | undefined;
186
254
  share?: string | undefined;
187
255
  swfSrc?: URL | undefined;
188
256
  tag?: string | Record<string, unknown> | readonly unknown[] | undefined;
@@ -193,9 +261,10 @@ declare const baseSchema: zod.ZodObject<{
193
261
  trackingUrl?: URL | undefined;
194
262
  url?: URL | undefined;
195
263
  viewableImpressionCounter?: URL | undefined;
196
- width?: string | undefined;
264
+ width?: number | undefined;
197
265
  widthLarge?: string | undefined;
198
266
  }, {
267
+ id: string;
199
268
  origin: "JERLICIA" | "DALE";
200
269
  adType: string;
201
270
  slotID: string;
@@ -222,8 +291,7 @@ declare const baseSchema: zod.ZodObject<{
222
291
  mediaType: string;
223
292
  prebid?: unknown;
224
293
  } | undefined;
225
- height?: string | number | undefined;
226
- id?: string | undefined;
294
+ height?: string | undefined;
227
295
  impressionCounter?: string | undefined;
228
296
  libId?: string | undefined;
229
297
  orderId?: string | undefined;
@@ -234,6 +302,7 @@ declare const baseSchema: zod.ZodObject<{
234
302
  poolPath?: string | undefined;
235
303
  preview?: boolean | "" | undefined;
236
304
  priority?: string | undefined;
305
+ sfSrc?: string | undefined;
237
306
  share?: string | undefined;
238
307
  swfSrc?: string | undefined;
239
308
  tag?: string | undefined;
@@ -244,7 +313,7 @@ declare const baseSchema: zod.ZodObject<{
244
313
  trackingUrl?: string | undefined;
245
314
  url?: string | undefined;
246
315
  viewableImpressionCounter?: string | undefined;
247
- width?: string | number | undefined;
316
+ width?: string | undefined;
248
317
  widthLarge?: string | number | undefined;
249
318
  }>;
250
319
  type AdResponse = (TypeOf<typeof baseSchema> & {
@@ -532,6 +601,7 @@ type AdheseOptions = {
532
601
  * The query detector options for the Adhese instance.
533
602
  */
534
603
  queries?: Record<string, string>;
604
+ safeFrame?: boolean;
535
605
  } & ({
536
606
  viewabilityTracking?: true;
537
607
  /**
@@ -628,6 +698,7 @@ type AdheseContext = Partial<Pick<Adhese, 'events' | 'getAll' | 'get' | 'paramet
628
698
  options: Readonly<MergedOptions>;
629
699
  logger: typeof logger;
630
700
  debug: boolean;
701
+ safeFrame?: SafeFrame;
631
702
  };
632
703
 
633
704
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@adhese/sdk",
3
3
  "type": "module",
4
- "version": "0.5.2",
4
+ "version": "0.6.0",
5
5
  "description": "Adhese SDK",
6
6
  "license": "GPL-3.0",
7
7
  "repository": {
@@ -25,9 +25,10 @@
25
25
  "prepareRelease": "npm run build"
26
26
  },
27
27
  "dependencies": {
28
- "@adhese/sdk-devtools": "^0.5.2",
28
+ "@adhese/sdk-devtools": "^0.6.0",
29
29
  "@vue/runtime-core": "^3.4.21",
30
30
  "lodash-es": "^4.17.21",
31
+ "safeframe": "^1.1.3",
31
32
  "zod": "^3.22.4"
32
33
  }
33
34
  }