@oursprivacy/platform-sdk 1.39.0 → 1.41.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +7 -4
  7. package/client.js.map +1 -1
  8. package/client.mjs +7 -4
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/experiments.d.mts +189 -5
  12. package/resources/experiments.d.mts.map +1 -1
  13. package/resources/experiments.d.ts +189 -5
  14. package/resources/experiments.d.ts.map +1 -1
  15. package/resources/experiments.js +5 -3
  16. package/resources/experiments.js.map +1 -1
  17. package/resources/experiments.mjs +5 -3
  18. package/resources/experiments.mjs.map +1 -1
  19. package/resources/index.d.mts +1 -0
  20. package/resources/index.d.mts.map +1 -1
  21. package/resources/index.d.ts +1 -0
  22. package/resources/index.d.ts.map +1 -1
  23. package/resources/index.js +3 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs +1 -0
  26. package/resources/index.mjs.map +1 -1
  27. package/resources/short-links.d.mts +4 -0
  28. package/resources/short-links.d.mts.map +1 -0
  29. package/resources/short-links.d.ts +4 -0
  30. package/resources/short-links.d.ts.map +1 -0
  31. package/resources/short-links.js +9 -0
  32. package/resources/short-links.js.map +1 -0
  33. package/resources/short-links.mjs +5 -0
  34. package/resources/short-links.mjs.map +1 -0
  35. package/src/client.ts +31 -26
  36. package/src/resources/experiments.ts +241 -5
  37. package/src/resources/index.ts +1 -0
  38. package/src/resources/short-links.ts +5 -0
  39. package/src/version.ts +1 -1
  40. package/version.d.mts +1 -1
  41. package/version.d.ts +1 -1
  42. package/version.js +1 -1
  43. package/version.mjs +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"short-links.js","sourceRoot":"","sources":["../src/resources/short-links.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,MAAa,UAAW,SAAQ,sBAAW;CAAG;AAA9C,gCAA8C"}
@@ -0,0 +1,5 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ export class ShortLinks extends APIResource {
4
+ }
5
+ //# sourceMappingURL=short-links.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"short-links.mjs","sourceRoot":"","sources":["../src/resources/short-links.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,MAAM,OAAO,UAAW,SAAQ,WAAW;CAAG"}
package/src/client.ts CHANGED
@@ -206,6 +206,7 @@ import {
206
206
  ReplaySettingUpdateResponse,
207
207
  ReplaySettings,
208
208
  } from './resources/replay-settings';
209
+ import { ShortLinks } from './resources/short-links';
209
210
  import {
210
211
  SourceCreateParams,
211
212
  SourceCreateResponse,
@@ -1076,6 +1077,7 @@ export class OursPrivacyPlatform {
1076
1077
  static toFile = Uploads.toFile;
1077
1078
 
1078
1079
  allowedEvents: API.AllowedEvents = new API.AllowedEvents(this);
1080
+ attribution: API.Attribution = new API.Attribution(this);
1079
1081
  consentAnalytics: API.ConsentAnalytics = new API.ConsentAnalytics(this);
1080
1082
  consentSettings: API.ConsentSettings = new API.ConsentSettings(this);
1081
1083
  dataGovernance: API.DataGovernance = new API.DataGovernance(this);
@@ -1084,10 +1086,12 @@ export class OursPrivacyPlatform {
1084
1086
  experimentSettings: API.ExperimentSettings = new API.ExperimentSettings(this);
1085
1087
  experimentVariants: API.ExperimentVariants = new API.ExperimentVariants(this);
1086
1088
  experiments: API.Experiments = new API.Experiments(this);
1089
+ funnels: API.Funnels = new API.Funnels(this);
1087
1090
  heatmapPages: API.HeatmapPages = new API.HeatmapPages(this);
1088
1091
  locations: API.Locations = new API.Locations(this);
1089
1092
  mappings: API.Mappings = new API.Mappings(this);
1090
1093
  replaySettings: API.ReplaySettings = new API.ReplaySettings(this);
1094
+ shortLinks: API.ShortLinks = new API.ShortLinks(this);
1091
1095
  sources: API.Sources = new API.Sources(this);
1092
1096
  tagManagers: API.TagManagers = new API.TagManagers(this);
1093
1097
  tagManagerTags: API.TagManagerTags = new API.TagManagerTags(this);
@@ -1098,11 +1102,10 @@ export class OursPrivacyPlatform {
1098
1102
  versions: API.Versions = new API.Versions(this);
1099
1103
  webScannerRules: API.WebScannerRules = new API.WebScannerRules(this);
1100
1104
  webScanners: API.WebScanners = new API.WebScanners(this);
1101
- attribution: API.Attribution = new API.Attribution(this);
1102
- funnels: API.Funnels = new API.Funnels(this);
1103
1105
  }
1104
1106
 
1105
1107
  OursPrivacyPlatform.AllowedEvents = AllowedEvents;
1108
+ OursPrivacyPlatform.Attribution = Attribution;
1106
1109
  OursPrivacyPlatform.ConsentAnalytics = ConsentAnalytics;
1107
1110
  OursPrivacyPlatform.ConsentSettings = ConsentSettings;
1108
1111
  OursPrivacyPlatform.DataGovernance = DataGovernance;
@@ -1111,10 +1114,12 @@ OursPrivacyPlatform.Destinations = Destinations;
1111
1114
  OursPrivacyPlatform.ExperimentSettings = ExperimentSettings;
1112
1115
  OursPrivacyPlatform.ExperimentVariants = ExperimentVariants;
1113
1116
  OursPrivacyPlatform.Experiments = Experiments;
1117
+ OursPrivacyPlatform.Funnels = Funnels;
1114
1118
  OursPrivacyPlatform.HeatmapPages = HeatmapPages;
1115
1119
  OursPrivacyPlatform.Locations = Locations;
1116
1120
  OursPrivacyPlatform.Mappings = Mappings;
1117
1121
  OursPrivacyPlatform.ReplaySettings = ReplaySettings;
1122
+ OursPrivacyPlatform.ShortLinks = ShortLinks;
1118
1123
  OursPrivacyPlatform.Sources = Sources;
1119
1124
  OursPrivacyPlatform.TagManagers = TagManagers;
1120
1125
  OursPrivacyPlatform.TagManagerTags = TagManagerTags;
@@ -1125,8 +1130,6 @@ OursPrivacyPlatform.TagManagerAssetFolders = TagManagerAssetFolders;
1125
1130
  OursPrivacyPlatform.Versions = Versions;
1126
1131
  OursPrivacyPlatform.WebScannerRules = WebScannerRules;
1127
1132
  OursPrivacyPlatform.WebScanners = WebScanners;
1128
- OursPrivacyPlatform.Attribution = Attribution;
1129
- OursPrivacyPlatform.Funnels = Funnels;
1130
1133
 
1131
1134
  export declare namespace OursPrivacyPlatform {
1132
1135
  export type RequestOptions = Opts.RequestOptions;
@@ -1145,6 +1148,20 @@ export declare namespace OursPrivacyPlatform {
1145
1148
  type AllowedEventUpdateParams as AllowedEventUpdateParams,
1146
1149
  };
1147
1150
 
1151
+ export {
1152
+ Attribution as Attribution,
1153
+ type AttributionInitialResponse as AttributionInitialResponse,
1154
+ type AttributionLastTouchResponse as AttributionLastTouchResponse,
1155
+ type AttributionConversionResponse as AttributionConversionResponse,
1156
+ type AttributionAudienceConversionResponse as AttributionAudienceConversionResponse,
1157
+ type AttributionUtmComparisonResponse as AttributionUtmComparisonResponse,
1158
+ type AttributionInitialParams as AttributionInitialParams,
1159
+ type AttributionLastTouchParams as AttributionLastTouchParams,
1160
+ type AttributionConversionParams as AttributionConversionParams,
1161
+ type AttributionAudienceConversionParams as AttributionAudienceConversionParams,
1162
+ type AttributionUtmComparisonParams as AttributionUtmComparisonParams,
1163
+ };
1164
+
1148
1165
  export {
1149
1166
  ConsentAnalytics as ConsentAnalytics,
1150
1167
  type ConsentAnalyticsListResponse as ConsentAnalyticsListResponse,
@@ -1261,6 +1278,14 @@ export declare namespace OursPrivacyPlatform {
1261
1278
  type ExperimentSessionReplaysParams as ExperimentSessionReplaysParams,
1262
1279
  };
1263
1280
 
1281
+ export {
1282
+ Funnels as Funnels,
1283
+ type FunnelListResponse as FunnelListResponse,
1284
+ type FunnelRetrieveResponse as FunnelRetrieveResponse,
1285
+ type FunnelResultsResponse as FunnelResultsResponse,
1286
+ type FunnelResultsParams as FunnelResultsParams,
1287
+ };
1288
+
1264
1289
  export {
1265
1290
  HeatmapPages as HeatmapPages,
1266
1291
  type HeatmapPageListResponse as HeatmapPageListResponse,
@@ -1314,6 +1339,8 @@ export declare namespace OursPrivacyPlatform {
1314
1339
  type ReplaySettingUpdateParams as ReplaySettingUpdateParams,
1315
1340
  };
1316
1341
 
1342
+ export { ShortLinks as ShortLinks };
1343
+
1317
1344
  export {
1318
1345
  Sources as Sources,
1319
1346
  type SourceListResponse as SourceListResponse,
@@ -1448,26 +1475,4 @@ export declare namespace OursPrivacyPlatform {
1448
1475
  type WebScannerCookiesParams as WebScannerCookiesParams,
1449
1476
  type WebScannerSummaryParams as WebScannerSummaryParams,
1450
1477
  };
1451
-
1452
- export {
1453
- Attribution as Attribution,
1454
- type AttributionInitialResponse as AttributionInitialResponse,
1455
- type AttributionLastTouchResponse as AttributionLastTouchResponse,
1456
- type AttributionConversionResponse as AttributionConversionResponse,
1457
- type AttributionAudienceConversionResponse as AttributionAudienceConversionResponse,
1458
- type AttributionUtmComparisonResponse as AttributionUtmComparisonResponse,
1459
- type AttributionInitialParams as AttributionInitialParams,
1460
- type AttributionLastTouchParams as AttributionLastTouchParams,
1461
- type AttributionConversionParams as AttributionConversionParams,
1462
- type AttributionAudienceConversionParams as AttributionAudienceConversionParams,
1463
- type AttributionUtmComparisonParams as AttributionUtmComparisonParams,
1464
- };
1465
-
1466
- export {
1467
- Funnels as Funnels,
1468
- type FunnelListResponse as FunnelListResponse,
1469
- type FunnelRetrieveResponse as FunnelRetrieveResponse,
1470
- type FunnelResultsResponse as FunnelResultsResponse,
1471
- type FunnelResultsParams as FunnelResultsParams,
1472
- };
1473
1478
  }
@@ -8,9 +8,11 @@ import { path } from '../internal/utils/path';
8
8
 
9
9
  export class Experiments extends APIResource {
10
10
  /**
11
- * List experiments for this account. Supports cursor pagination and filtering by
12
- * `status`, `type`, and free-text `search` matched against experiment id, name,
13
- * and description. Combine filters with AND semantics. Requires scope:
11
+ * List experiments for this account. Each experiment includes its full `variants`
12
+ * array (redirect URLs and DOM modifications), so a single paginated call returns
13
+ * a complete client-side experiment config. Supports cursor pagination and
14
+ * filtering by `status`, `type`, and free-text `search` matched against experiment
15
+ * id, name, and description. Combine filters with AND semantics. Requires scope:
14
16
  * experiment:list
15
17
  *
16
18
  * @example
@@ -328,6 +330,14 @@ export interface ExperimentListResponse {
328
330
  */
329
331
  trafficAllocation: number;
330
332
 
333
+ /**
334
+ * All persisted variants for this experiment, including the control variant. A
335
+ * non-personalization experiment needs at least two variants before it can be
336
+ * started. Reading variants requires the `experiment:find` scope in addition to
337
+ * `experiment:list`; an API key without it receives an empty array here.
338
+ */
339
+ variants: Array<ExperimentListResponse.Variant>;
340
+
331
341
  /**
332
342
  * Optional human-readable hypothesis or summary. In GraphQL this is backed by the
333
343
  * experiment hypothesis field.
@@ -392,6 +402,114 @@ export interface ExperimentListResponse {
392
402
  }
393
403
 
394
404
  export namespace ExperimentListResponse {
405
+ export interface Variant {
406
+ /**
407
+ * Unique identifier for this experiment variant.
408
+ */
409
+ id: string;
410
+
411
+ /**
412
+ * Parent experiment ID this variant belongs to.
413
+ */
414
+ experimentId: string;
415
+
416
+ /**
417
+ * Whether this is the baseline control variant.
418
+ */
419
+ isControl: boolean;
420
+
421
+ /**
422
+ * Human-readable variant name shown in the dashboard and results.
423
+ */
424
+ name: string;
425
+
426
+ /**
427
+ * Relative traffic weight used when assigning visitors among variants in an active
428
+ * experiment.
429
+ */
430
+ weight: number;
431
+
432
+ /**
433
+ * Ordered list of declarative DOM mutations applied when this variant is assigned.
434
+ */
435
+ domModifications?: Array<Variant.DomModification> | null;
436
+
437
+ /**
438
+ * Target URL for redirect variants. Use either a site-relative path such as
439
+ * `/pricing-v2` or an absolute `https://` URL. Cross-origin `http://` URLs are
440
+ * rejected. Omit for DOM modification variants.
441
+ */
442
+ redirectUrl?: string | null;
443
+
444
+ /**
445
+ * How this variant changes the user experience. `dom_modifications` for on-page
446
+ * changes or `redirect` for redirect tests.
447
+ */
448
+ variantType?: string | null;
449
+ }
450
+
451
+ export namespace Variant {
452
+ export interface DomModification {
453
+ /**
454
+ * Mutation to apply when the selector matches. Use `redirectUrl` instead of DOM
455
+ * modifications for redirect variants.
456
+ */
457
+ action:
458
+ | 'customCss'
459
+ | 'customJs'
460
+ | 'insertAfter'
461
+ | 'insertBefore'
462
+ | 'remove'
463
+ | 'setAttribute'
464
+ | 'setHtml'
465
+ | 'setImage'
466
+ | 'setStyle'
467
+ | 'setText';
468
+
469
+ /**
470
+ * CSS selector used to find the element to modify on the page at runtime.
471
+ */
472
+ selector: string;
473
+
474
+ /**
475
+ * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
476
+ * `setImage` / `insertBefore` / `insertAfter` this is the literal
477
+ * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
478
+ * `{key: value}` object — prefer the structured `styles` / `attribute` fields
479
+ * below to avoid manual JSON encoding.
480
+ */
481
+ value: string;
482
+
483
+ /**
484
+ * Populated on read for `setAttribute` modifications, parsed from `value`.
485
+ * Customers may also send this field instead of a JSON-stringified `value` on
486
+ * write — see `domModificationInputSchema`.
487
+ */
488
+ attribute?: unknown | null;
489
+
490
+ /**
491
+ * Populated on read for `setStyle` modifications, parsed from `value`. Customers
492
+ * may also send this field instead of a JSON-stringified `value` on write — see
493
+ * `domModificationInputSchema`.
494
+ */
495
+ styles?: Array<DomModification.Style> | null;
496
+ }
497
+
498
+ export namespace DomModification {
499
+ export interface Style {
500
+ /**
501
+ * CSS property name in camelCase or kebab-case.
502
+ */
503
+ property: string;
504
+
505
+ /**
506
+ * CSS value to assign to the property.
507
+ */
508
+ value: string;
509
+ }
510
+ }
511
+ }
512
+
395
513
  /**
396
514
  * Configured success metrics. The read shape mirrors the write shape — `metrics`
397
515
  * from a GET response can be PATCHed back without modification.
@@ -528,7 +646,8 @@ export interface ExperimentCreateResponse {
528
646
  /**
529
647
  * All persisted variants for this experiment, including the control variant. A
530
648
  * non-personalization experiment needs at least two variants before it can be
531
- * started.
649
+ * started. Reading variants requires the `experiment:find` scope in addition to
650
+ * `experiment:list`; an API key without it receives an empty array here.
532
651
  */
533
652
  variants: Array<ExperimentCreateResponse.Variant>;
534
653
 
@@ -840,7 +959,8 @@ export interface ExperimentRetrieveResponse {
840
959
  /**
841
960
  * All persisted variants for this experiment, including the control variant. A
842
961
  * non-personalization experiment needs at least two variants before it can be
843
- * started.
962
+ * started. Reading variants requires the `experiment:find` scope in addition to
963
+ * `experiment:list`; an API key without it receives an empty array here.
844
964
  */
845
965
  variants: Array<ExperimentRetrieveResponse.Variant>;
846
966
 
@@ -1149,6 +1269,14 @@ export interface ExperimentUpdateResponse {
1149
1269
  */
1150
1270
  trafficAllocation: number;
1151
1271
 
1272
+ /**
1273
+ * All persisted variants for this experiment, including the control variant. A
1274
+ * non-personalization experiment needs at least two variants before it can be
1275
+ * started. Reading variants requires the `experiment:find` scope in addition to
1276
+ * `experiment:list`; an API key without it receives an empty array here.
1277
+ */
1278
+ variants: Array<ExperimentUpdateResponse.Variant>;
1279
+
1152
1280
  /**
1153
1281
  * Optional human-readable hypothesis or summary. In GraphQL this is backed by the
1154
1282
  * experiment hypothesis field.
@@ -1213,6 +1341,114 @@ export interface ExperimentUpdateResponse {
1213
1341
  }
1214
1342
 
1215
1343
  export namespace ExperimentUpdateResponse {
1344
+ export interface Variant {
1345
+ /**
1346
+ * Unique identifier for this experiment variant.
1347
+ */
1348
+ id: string;
1349
+
1350
+ /**
1351
+ * Parent experiment ID this variant belongs to.
1352
+ */
1353
+ experimentId: string;
1354
+
1355
+ /**
1356
+ * Whether this is the baseline control variant.
1357
+ */
1358
+ isControl: boolean;
1359
+
1360
+ /**
1361
+ * Human-readable variant name shown in the dashboard and results.
1362
+ */
1363
+ name: string;
1364
+
1365
+ /**
1366
+ * Relative traffic weight used when assigning visitors among variants in an active
1367
+ * experiment.
1368
+ */
1369
+ weight: number;
1370
+
1371
+ /**
1372
+ * Ordered list of declarative DOM mutations applied when this variant is assigned.
1373
+ */
1374
+ domModifications?: Array<Variant.DomModification> | null;
1375
+
1376
+ /**
1377
+ * Target URL for redirect variants. Use either a site-relative path such as
1378
+ * `/pricing-v2` or an absolute `https://` URL. Cross-origin `http://` URLs are
1379
+ * rejected. Omit for DOM modification variants.
1380
+ */
1381
+ redirectUrl?: string | null;
1382
+
1383
+ /**
1384
+ * How this variant changes the user experience. `dom_modifications` for on-page
1385
+ * changes or `redirect` for redirect tests.
1386
+ */
1387
+ variantType?: string | null;
1388
+ }
1389
+
1390
+ export namespace Variant {
1391
+ export interface DomModification {
1392
+ /**
1393
+ * Mutation to apply when the selector matches. Use `redirectUrl` instead of DOM
1394
+ * modifications for redirect variants.
1395
+ */
1396
+ action:
1397
+ | 'customCss'
1398
+ | 'customJs'
1399
+ | 'insertAfter'
1400
+ | 'insertBefore'
1401
+ | 'remove'
1402
+ | 'setAttribute'
1403
+ | 'setHtml'
1404
+ | 'setImage'
1405
+ | 'setStyle'
1406
+ | 'setText';
1407
+
1408
+ /**
1409
+ * CSS selector used to find the element to modify on the page at runtime.
1410
+ */
1411
+ selector: string;
1412
+
1413
+ /**
1414
+ * Canonical action payload. For `setText` / `setHtml` / `customCss` / `customJs` /
1415
+ * `setImage` / `insertBefore` / `insertAfter` this is the literal
1416
+ * text/HTML/CSS/JS/URL. For `setStyle` and `setAttribute` it is a JSON-stringified
1417
+ * `{key: value}` object — prefer the structured `styles` / `attribute` fields
1418
+ * below to avoid manual JSON encoding.
1419
+ */
1420
+ value: string;
1421
+
1422
+ /**
1423
+ * Populated on read for `setAttribute` modifications, parsed from `value`.
1424
+ * Customers may also send this field instead of a JSON-stringified `value` on
1425
+ * write — see `domModificationInputSchema`.
1426
+ */
1427
+ attribute?: unknown | null;
1428
+
1429
+ /**
1430
+ * Populated on read for `setStyle` modifications, parsed from `value`. Customers
1431
+ * may also send this field instead of a JSON-stringified `value` on write — see
1432
+ * `domModificationInputSchema`.
1433
+ */
1434
+ styles?: Array<DomModification.Style> | null;
1435
+ }
1436
+
1437
+ export namespace DomModification {
1438
+ export interface Style {
1439
+ /**
1440
+ * CSS property name in camelCase or kebab-case.
1441
+ */
1442
+ property: string;
1443
+
1444
+ /**
1445
+ * CSS value to assign to the property.
1446
+ */
1447
+ value: string;
1448
+ }
1449
+ }
1450
+ }
1451
+
1216
1452
  /**
1217
1453
  * Configured success metrics. The read shape mirrors the write shape — `metrics`
1218
1454
  * from a GET response can be PATCHed back without modification.
@@ -187,6 +187,7 @@ export {
187
187
  type ReplaySettingUpdateParams,
188
188
  type ReplaySettingListResponsesCursor,
189
189
  } from './replay-settings';
190
+ export { ShortLinks } from './short-links';
190
191
  export {
191
192
  Sources,
192
193
  type SourceListResponse,
@@ -0,0 +1,5 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+
5
+ export class ShortLinks extends APIResource {}
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.39.0'; // x-release-please-version
1
+ export const VERSION = '1.41.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.39.0";
1
+ export declare const VERSION = "1.41.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.39.0";
1
+ export declare const VERSION = "1.41.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.39.0'; // x-release-please-version
4
+ exports.VERSION = '1.41.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.39.0'; // x-release-please-version
1
+ export const VERSION = '1.41.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map