@adhese/sdk-devtools 0.2.0 → 0.4.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/es/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { lazy } from "react";
2
2
  async function createDevtools(context) {
3
- const devtools = await import("./devtools.js");
3
+ const main = await import("./devtools.js").then((n) => n.m);
4
4
  const wrapperElement = document.createElement("div");
5
5
  document.body.appendChild(wrapperElement);
6
- const unmount = devtools.createAdheseDevtools(wrapperElement, context);
6
+ const unmount = main.createAdheseDevtools(wrapperElement, context);
7
7
  return () => {
8
8
  unmount();
9
9
  wrapperElement.outerHTML = "";
10
10
  };
11
11
  }
12
- const Devtools = lazy(() => import("./devtools.js").then((module) => ({ default: module.Devtools })));
12
+ const Devtools = lazy(() => import("./devtools.js").then((n) => n.D).then((module) => ({ default: module.Devtools })));
13
13
  export {
14
14
  Devtools,
15
15
  createDevtools
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import type { AdheseContext } from '@adhese/sdk';\nimport { lazy } from 'react';\n\nexport async function createDevtools(context: AdheseContext): Promise<() => void> {\n const devtools = await import('@devtools');\n\n const wrapperElement = document.createElement('div');\n document.body.appendChild(wrapperElement);\n\n const unmount = devtools.createAdheseDevtools(wrapperElement, context);\n\n return () => {\n unmount();\n wrapperElement.outerHTML = '';\n };\n}\n\n// eslint-disable-next-line ts/naming-convention\nexport const Devtools = lazy(() => import('@devtools').then(module => ({ default: module.Devtools })));\n"],"names":[],"mappings":";AAGA,eAAsB,eAAe,SAA6C;AAC1E,QAAA,WAAW,MAAM,OAAO,eAAW;AAEnC,QAAA,iBAAiB,SAAS,cAAc,KAAK;AAC1C,WAAA,KAAK,YAAY,cAAc;AAExC,QAAM,UAAU,SAAS,qBAAqB,gBAAgB,OAAO;AAErE,SAAO,MAAM;AACH;AACR,mBAAe,YAAY;AAAA,EAAA;AAE/B;AAGO,MAAM,WAAW,KAAK,MAAM,OAAO,eAAW,EAAE,KAAK,CAAA,YAAW,EAAE,SAAS,OAAO,WAAW,CAAC;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import type { AdheseContext } from '@adhese/sdk';\nimport { lazy } from 'react';\n\nexport async function createDevtools(context: AdheseContext): Promise<() => void> {\n const main = await import('./main');\n\n const wrapperElement = document.createElement('div');\n document.body.appendChild(wrapperElement);\n\n const unmount = main.createAdheseDevtools(wrapperElement, context);\n\n return () => {\n unmount();\n wrapperElement.outerHTML = '';\n };\n}\n\n// eslint-disable-next-line ts/naming-convention\nexport const Devtools = lazy(() => import('./Devtools').then(module => ({ default: module.Devtools })));\n"],"names":[],"mappings":";AAGA,eAAsB,eAAe,SAA6C;AAC1E,QAAA,OAAO,MAAM,OAAO,eAAQ;AAE5B,QAAA,iBAAiB,SAAS,cAAc,KAAK;AAC1C,WAAA,KAAK,YAAY,cAAc;AAExC,QAAM,UAAU,KAAK,qBAAqB,gBAAgB,OAAO;AAEjE,SAAO,MAAM;AACH;AACR,mBAAe,YAAY;AAAA,EAAA;AAE/B;AAGO,MAAM,WAAW,KAAK,MAAM,OAAO,eAAY,EAAA,KAAA,OAAA,EAAA,CAAA,EAAE,KAAK,CAAA,YAAW,EAAE,SAAS,OAAO,WAAW,CAAC;"}
package/dist/index.d.ts CHANGED
@@ -88,13 +88,8 @@ type SlotManagerOptions = {
88
88
  context: AdheseContext;
89
89
  };
90
90
 
91
- declare const baseAdResponseScheme: zod.ZodObject<{
91
+ declare const baseSchema: zod.ZodObject<{
92
92
  adDuration: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
93
- adDuration2nd: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
94
- adDuration3rd: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
95
- adDuration4th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
96
- adDuration5th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
97
- adDuration6th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
98
93
  adFormat: zod.ZodOptional<zod.ZodString>;
99
94
  adType: zod.ZodString;
100
95
  additionalCreativeTracker: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
@@ -112,7 +107,6 @@ declare const baseAdResponseScheme: zod.ZodObject<{
112
107
  creativeName: zod.ZodOptional<zod.ZodString>;
113
108
  deliveryGroupId: zod.ZodOptional<zod.ZodString>;
114
109
  deliveryMultiples: zod.ZodOptional<zod.ZodString>;
115
- dm: zod.ZodOptional<zod.ZodString>;
116
110
  ext: zod.ZodOptional<zod.ZodString>;
117
111
  extension: zod.ZodOptional<zod.ZodObject<{
118
112
  mediaType: zod.ZodString;
@@ -124,22 +118,16 @@ declare const baseAdResponseScheme: zod.ZodObject<{
124
118
  mediaType: string;
125
119
  prebid?: unknown;
126
120
  }>>;
127
- extraField1: zod.ZodOptional<zod.ZodString>;
128
- extraField2: zod.ZodOptional<zod.ZodString>;
129
121
  height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
130
- height3rd: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
131
- height4th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
132
- height5th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
133
- height6th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
134
- heightLarge: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
135
122
  id: zod.ZodOptional<zod.ZodString>;
136
123
  impressionCounter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
137
124
  libId: zod.ZodOptional<zod.ZodString>;
138
125
  orderId: zod.ZodOptional<zod.ZodString>;
139
126
  orderName: zod.ZodOptional<zod.ZodString>;
140
127
  orderProperty: zod.ZodOptional<zod.ZodString>;
141
- origin: zod.ZodOptional<zod.ZodString>;
128
+ origin: zod.ZodUnion<[zod.ZodLiteral<"JERLICIA">, zod.ZodLiteral<"DALE">]>;
142
129
  originData: zod.ZodOptional<zod.ZodUnknown>;
130
+ originInstance: zod.ZodOptional<zod.ZodString>;
143
131
  poolPath: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
144
132
  preview: zod.ZodOptional<zod.ZodUnion<[zod.ZodBoolean, zod.ZodLiteral<"">]>>;
145
133
  priority: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
@@ -147,12 +135,7 @@ declare const baseAdResponseScheme: zod.ZodObject<{
147
135
  slotID: zod.ZodString;
148
136
  slotName: zod.ZodString;
149
137
  swfSrc: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
150
- swfSrc2nd: zod.ZodOptional<zod.ZodString>;
151
- swfSrc3rd: zod.ZodOptional<zod.ZodString>;
152
- swfSrc4th: zod.ZodOptional<zod.ZodString>;
153
- swfSrc5th: zod.ZodOptional<zod.ZodString>;
154
- swfSrc6th: zod.ZodOptional<zod.ZodString>;
155
- tag: zod.ZodString;
138
+ tag: zod.ZodOptional<zod.ZodString>;
156
139
  tagUrl: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
157
140
  timeStamp: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, Date | undefined, string>>;
158
141
  trackedImpressionCounter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
@@ -161,22 +144,13 @@ declare const baseAdResponseScheme: zod.ZodObject<{
161
144
  url: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
162
145
  viewableImpressionCounter: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, URL | undefined, string>>;
163
146
  width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
164
- width3rd: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
165
- width4th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
166
- width5th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
167
- width6th: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
168
147
  widthLarge: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodLiteral<"">]>, number | undefined, string>>;
169
148
  }, "strip", zod.ZodTypeAny, {
170
149
  adType: string;
150
+ origin: "JERLICIA" | "DALE";
171
151
  slotID: string;
172
152
  slotName: string;
173
- tag: string;
174
153
  adDuration?: number | undefined;
175
- adDuration2nd?: number | undefined;
176
- adDuration3rd?: number | undefined;
177
- adDuration4th?: number | undefined;
178
- adDuration5th?: number | undefined;
179
- adDuration6th?: number | undefined;
180
154
  adFormat?: string | undefined;
181
155
  additionalCreativeTracker?: URL | undefined;
182
156
  additionalViewableTracker?: string | undefined;
@@ -193,38 +167,26 @@ declare const baseAdResponseScheme: zod.ZodObject<{
193
167
  creativeName?: string | undefined;
194
168
  deliveryGroupId?: string | undefined;
195
169
  deliveryMultiples?: string | undefined;
196
- dm?: string | undefined;
197
170
  ext?: string | undefined;
198
171
  extension?: {
199
172
  mediaType: string;
200
173
  prebid?: unknown;
201
174
  } | undefined;
202
- extraField1?: string | undefined;
203
- extraField2?: string | undefined;
204
175
  height?: number | undefined;
205
- height3rd?: number | undefined;
206
- height4th?: number | undefined;
207
- height5th?: number | undefined;
208
- height6th?: number | undefined;
209
- heightLarge?: number | undefined;
210
176
  id?: string | undefined;
211
177
  impressionCounter?: URL | undefined;
212
178
  libId?: string | undefined;
213
179
  orderId?: string | undefined;
214
180
  orderName?: string | undefined;
215
181
  orderProperty?: string | undefined;
216
- origin?: string | undefined;
217
182
  originData?: unknown;
183
+ originInstance?: string | undefined;
218
184
  poolPath?: URL | undefined;
219
185
  preview?: boolean | "" | undefined;
220
186
  priority?: number | undefined;
221
187
  share?: string | undefined;
222
188
  swfSrc?: URL | undefined;
223
- swfSrc2nd?: string | undefined;
224
- swfSrc3rd?: string | undefined;
225
- swfSrc4th?: string | undefined;
226
- swfSrc5th?: string | undefined;
227
- swfSrc6th?: string | undefined;
189
+ tag?: string | undefined;
228
190
  tagUrl?: URL | undefined;
229
191
  timeStamp?: Date | undefined;
230
192
  trackedImpressionCounter?: URL | undefined;
@@ -233,22 +195,13 @@ declare const baseAdResponseScheme: zod.ZodObject<{
233
195
  url?: URL | undefined;
234
196
  viewableImpressionCounter?: URL | undefined;
235
197
  width?: number | undefined;
236
- width3rd?: number | undefined;
237
- width4th?: number | undefined;
238
- width5th?: number | undefined;
239
- width6th?: number | undefined;
240
198
  widthLarge?: number | undefined;
241
199
  }, {
242
200
  adType: string;
201
+ origin: "JERLICIA" | "DALE";
243
202
  slotID: string;
244
203
  slotName: string;
245
- tag: string;
246
204
  adDuration?: string | undefined;
247
- adDuration2nd?: string | undefined;
248
- adDuration3rd?: string | undefined;
249
- adDuration4th?: string | undefined;
250
- adDuration5th?: string | undefined;
251
- adDuration6th?: string | undefined;
252
205
  adFormat?: string | undefined;
253
206
  additionalCreativeTracker?: string | undefined;
254
207
  additionalViewableTracker?: string | undefined;
@@ -265,38 +218,26 @@ declare const baseAdResponseScheme: zod.ZodObject<{
265
218
  creativeName?: string | undefined;
266
219
  deliveryGroupId?: string | undefined;
267
220
  deliveryMultiples?: string | undefined;
268
- dm?: string | undefined;
269
221
  ext?: string | undefined;
270
222
  extension?: {
271
223
  mediaType: string;
272
224
  prebid?: unknown;
273
225
  } | undefined;
274
- extraField1?: string | undefined;
275
- extraField2?: string | undefined;
276
226
  height?: string | undefined;
277
- height3rd?: string | undefined;
278
- height4th?: string | undefined;
279
- height5th?: string | undefined;
280
- height6th?: string | undefined;
281
- heightLarge?: string | undefined;
282
227
  id?: string | undefined;
283
228
  impressionCounter?: string | undefined;
284
229
  libId?: string | undefined;
285
230
  orderId?: string | undefined;
286
231
  orderName?: string | undefined;
287
232
  orderProperty?: string | undefined;
288
- origin?: string | undefined;
289
233
  originData?: unknown;
234
+ originInstance?: string | undefined;
290
235
  poolPath?: string | undefined;
291
236
  preview?: boolean | "" | undefined;
292
237
  priority?: string | undefined;
293
238
  share?: string | undefined;
294
239
  swfSrc?: string | undefined;
295
- swfSrc2nd?: string | undefined;
296
- swfSrc3rd?: string | undefined;
297
- swfSrc4th?: string | undefined;
298
- swfSrc5th?: string | undefined;
299
- swfSrc6th?: string | undefined;
240
+ tag?: string | undefined;
300
241
  tagUrl?: string | undefined;
301
242
  timeStamp?: string | undefined;
302
243
  trackedImpressionCounter?: string | undefined;
@@ -305,18 +246,17 @@ declare const baseAdResponseScheme: zod.ZodObject<{
305
246
  url?: string | undefined;
306
247
  viewableImpressionCounter?: string | undefined;
307
248
  width?: string | undefined;
308
- width3rd?: string | undefined;
309
- width4th?: string | undefined;
310
- width5th?: string | undefined;
311
- width6th?: string | undefined;
312
249
  widthLarge?: string | undefined;
313
250
  }>;
314
- type AdResponse = TypeOf<typeof baseAdResponseScheme> & {
251
+ type AdResponse = (TypeOf<typeof baseSchema> & {
315
252
  additionalCreatives?: ReadonlyArray<AdResponse> | string;
316
- };
253
+ });
317
254
  declare const adResponseSchema: ZodType<AdResponse>;
318
- type Ad = TypeOf<typeof adResponseSchema> & {
319
- additionalCreatives?: ReadonlyArray<Ad> | string;
255
+ type PreParsedAd = TypeOf<typeof adResponseSchema> & {
256
+ additionalCreatives?: ReadonlyArray<PreParsedAd> | string;
257
+ };
258
+ type Ad = Omit<PreParsedAd, 'tag'> & {
259
+ tag: string;
320
260
  };
321
261
 
322
262
  type RenderMode = 'iframe' | 'inline';