@oursprivacy/platform-sdk 1.19.0 → 1.21.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 (205) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +8 -12
  3. package/api-promise.d.mts +1 -0
  4. package/api-promise.d.mts.map +1 -1
  5. package/api-promise.d.ts +1 -0
  6. package/api-promise.d.ts.map +1 -1
  7. package/api-promise.mjs +1 -0
  8. package/api-promise.mjs.map +1 -1
  9. package/client.d.mts +21 -6
  10. package/client.d.mts.map +1 -1
  11. package/client.d.ts +21 -6
  12. package/client.d.ts.map +1 -1
  13. package/client.js +17 -2
  14. package/client.js.map +1 -1
  15. package/client.mjs +17 -2
  16. package/client.mjs.map +1 -1
  17. package/core/api-promise.d.mts.map +1 -1
  18. package/core/api-promise.d.ts.map +1 -1
  19. package/core/api-promise.mjs.map +1 -1
  20. package/core/error.mjs.map +1 -1
  21. package/core/pagination.d.mts.map +1 -1
  22. package/core/pagination.d.ts.map +1 -1
  23. package/core/pagination.mjs.map +1 -1
  24. package/core/resource.d.mts.map +1 -1
  25. package/core/resource.d.ts.map +1 -1
  26. package/core/uploads.d.mts.map +1 -1
  27. package/core/uploads.d.ts.map +1 -1
  28. package/core/uploads.mjs.map +1 -1
  29. package/error.d.mts +1 -0
  30. package/error.d.mts.map +1 -1
  31. package/error.d.ts +1 -0
  32. package/error.d.ts.map +1 -1
  33. package/error.mjs +1 -0
  34. package/error.mjs.map +1 -1
  35. package/index.d.mts.map +1 -1
  36. package/index.d.ts.map +1 -1
  37. package/index.mjs.map +1 -1
  38. package/internal/detect-platform.mjs.map +1 -1
  39. package/internal/headers.mjs.map +1 -1
  40. package/internal/parse.d.mts.map +1 -1
  41. package/internal/parse.d.ts.map +1 -1
  42. package/internal/parse.mjs.map +1 -1
  43. package/internal/request-options.d.mts.map +1 -1
  44. package/internal/request-options.d.ts.map +1 -1
  45. package/internal/shims.d.mts +6 -0
  46. package/internal/shims.d.mts.map +1 -1
  47. package/internal/shims.d.ts +6 -0
  48. package/internal/shims.d.ts.map +1 -1
  49. package/internal/to-file.d.mts.map +1 -1
  50. package/internal/to-file.d.ts.map +1 -1
  51. package/internal/to-file.mjs.map +1 -1
  52. package/internal/types.d.mts +4 -4
  53. package/internal/types.d.mts.map +1 -1
  54. package/internal/types.d.ts +4 -4
  55. package/internal/types.d.ts.map +1 -1
  56. package/internal/uploads.d.mts.map +1 -1
  57. package/internal/uploads.d.ts.map +1 -1
  58. package/internal/uploads.mjs.map +1 -1
  59. package/internal/utils/base64.mjs.map +1 -1
  60. package/internal/utils/log.d.mts.map +1 -1
  61. package/internal/utils/log.d.ts.map +1 -1
  62. package/internal/utils/log.mjs.map +1 -1
  63. package/internal/utils/path.mjs.map +1 -1
  64. package/internal/utils/query.mjs.map +1 -1
  65. package/internal/utils/values.mjs.map +1 -1
  66. package/internal/utils.d.mts.map +1 -1
  67. package/internal/utils.d.ts.map +1 -1
  68. package/internal/utils.mjs.map +1 -1
  69. package/package.json +1 -1
  70. package/pagination.d.mts +1 -0
  71. package/pagination.d.mts.map +1 -1
  72. package/pagination.d.ts +1 -0
  73. package/pagination.d.ts.map +1 -1
  74. package/pagination.mjs +1 -0
  75. package/pagination.mjs.map +1 -1
  76. package/resource.d.mts +1 -0
  77. package/resource.d.mts.map +1 -1
  78. package/resource.d.ts +1 -0
  79. package/resource.d.ts.map +1 -1
  80. package/resource.mjs +1 -0
  81. package/resource.mjs.map +1 -1
  82. package/resources/allowed-events.d.mts.map +1 -1
  83. package/resources/allowed-events.d.ts.map +1 -1
  84. package/resources/allowed-events.mjs.map +1 -1
  85. package/resources/consent-settings.d.mts.map +1 -1
  86. package/resources/consent-settings.d.ts.map +1 -1
  87. package/resources/consent-settings.mjs.map +1 -1
  88. package/resources/default-mappings.d.mts +140 -0
  89. package/resources/default-mappings.d.mts.map +1 -0
  90. package/resources/default-mappings.d.ts +140 -0
  91. package/resources/default-mappings.d.ts.map +1 -0
  92. package/resources/default-mappings.js +38 -0
  93. package/resources/default-mappings.js.map +1 -0
  94. package/resources/default-mappings.mjs +34 -0
  95. package/resources/default-mappings.mjs.map +1 -0
  96. package/resources/destination-types.d.mts +21 -13
  97. package/resources/destination-types.d.mts.map +1 -1
  98. package/resources/destination-types.d.ts +21 -13
  99. package/resources/destination-types.d.ts.map +1 -1
  100. package/resources/destination-types.js.map +1 -1
  101. package/resources/destination-types.mjs.map +1 -1
  102. package/resources/destinations.d.mts +61 -98
  103. package/resources/destinations.d.mts.map +1 -1
  104. package/resources/destinations.d.ts +61 -98
  105. package/resources/destinations.d.ts.map +1 -1
  106. package/resources/destinations.js +11 -13
  107. package/resources/destinations.js.map +1 -1
  108. package/resources/destinations.mjs +11 -13
  109. package/resources/destinations.mjs.map +1 -1
  110. package/resources/experiment-settings.d.mts.map +1 -1
  111. package/resources/experiment-settings.d.ts.map +1 -1
  112. package/resources/experiment-settings.mjs.map +1 -1
  113. package/resources/experiment-variants.d.mts.map +1 -1
  114. package/resources/experiment-variants.d.ts.map +1 -1
  115. package/resources/experiment-variants.mjs.map +1 -1
  116. package/resources/experiments.d.mts.map +1 -1
  117. package/resources/experiments.d.ts.map +1 -1
  118. package/resources/experiments.mjs.map +1 -1
  119. package/resources/global-dispatch-centers.d.mts.map +1 -1
  120. package/resources/global-dispatch-centers.d.ts.map +1 -1
  121. package/resources/global-dispatch-centers.mjs.map +1 -1
  122. package/resources/heatmap-pages.d.mts.map +1 -1
  123. package/resources/heatmap-pages.d.ts.map +1 -1
  124. package/resources/heatmap-pages.mjs.map +1 -1
  125. package/resources/index.d.mts +7 -2
  126. package/resources/index.d.mts.map +1 -1
  127. package/resources/index.d.ts +7 -2
  128. package/resources/index.d.ts.map +1 -1
  129. package/resources/index.js +11 -1
  130. package/resources/index.js.map +1 -1
  131. package/resources/index.mjs +5 -0
  132. package/resources/index.mjs.map +1 -1
  133. package/resources/locations.d.mts +270 -0
  134. package/resources/locations.d.mts.map +1 -0
  135. package/resources/locations.d.ts +270 -0
  136. package/resources/locations.d.ts.map +1 -0
  137. package/resources/locations.js +48 -0
  138. package/resources/locations.js.map +1 -0
  139. package/resources/locations.mjs +44 -0
  140. package/resources/locations.mjs.map +1 -0
  141. package/resources/mapping-templates.d.mts +101 -0
  142. package/resources/mapping-templates.d.mts.map +1 -0
  143. package/resources/mapping-templates.d.ts +101 -0
  144. package/resources/mapping-templates.d.ts.map +1 -0
  145. package/resources/mapping-templates.js +22 -0
  146. package/resources/mapping-templates.js.map +1 -0
  147. package/resources/mapping-templates.mjs +18 -0
  148. package/resources/mapping-templates.mjs.map +1 -0
  149. package/resources/mappings.d.mts +186 -6
  150. package/resources/mappings.d.mts.map +1 -1
  151. package/resources/mappings.d.ts +186 -6
  152. package/resources/mappings.d.ts.map +1 -1
  153. package/resources/mappings.js +26 -3
  154. package/resources/mappings.js.map +1 -1
  155. package/resources/mappings.mjs +26 -3
  156. package/resources/mappings.mjs.map +1 -1
  157. package/resources/replay-settings.d.mts.map +1 -1
  158. package/resources/replay-settings.d.ts.map +1 -1
  159. package/resources/replay-settings.mjs.map +1 -1
  160. package/resources/sources.d.mts.map +1 -1
  161. package/resources/sources.d.ts.map +1 -1
  162. package/resources/sources.mjs.map +1 -1
  163. package/resources/versions.d.mts.map +1 -1
  164. package/resources/versions.d.ts.map +1 -1
  165. package/resources/versions.mjs.map +1 -1
  166. package/resources/web-scanner-rules.d.mts +195 -0
  167. package/resources/web-scanner-rules.d.mts.map +1 -0
  168. package/resources/web-scanner-rules.d.ts +195 -0
  169. package/resources/web-scanner-rules.d.ts.map +1 -0
  170. package/resources/web-scanner-rules.js +48 -0
  171. package/resources/web-scanner-rules.js.map +1 -0
  172. package/resources/web-scanner-rules.mjs +44 -0
  173. package/resources/web-scanner-rules.mjs.map +1 -0
  174. package/resources/web-scanners.d.mts +199 -0
  175. package/resources/web-scanners.d.mts.map +1 -0
  176. package/resources/web-scanners.d.ts +199 -0
  177. package/resources/web-scanners.d.ts.map +1 -0
  178. package/resources/web-scanners.js +67 -0
  179. package/resources/web-scanners.js.map +1 -0
  180. package/resources/web-scanners.mjs +63 -0
  181. package/resources/web-scanners.mjs.map +1 -0
  182. package/resources.d.mts.map +1 -1
  183. package/resources.d.ts.map +1 -1
  184. package/resources.mjs.map +1 -1
  185. package/src/client.ts +116 -5
  186. package/src/resources/default-mappings.ts +332 -0
  187. package/src/resources/destination-types.ts +117 -202
  188. package/src/resources/destinations.ts +227 -212
  189. package/src/resources/index.ts +48 -0
  190. package/src/resources/locations.ts +463 -0
  191. package/src/resources/mapping-templates.ts +203 -0
  192. package/src/resources/mappings.ts +320 -5
  193. package/src/resources/web-scanner-rules.ts +304 -0
  194. package/src/resources/web-scanners.ts +333 -0
  195. package/src/version.ts +1 -1
  196. package/uploads.d.mts +1 -0
  197. package/uploads.d.mts.map +1 -1
  198. package/uploads.d.ts +1 -0
  199. package/uploads.d.ts.map +1 -1
  200. package/uploads.mjs +1 -0
  201. package/uploads.mjs.map +1 -1
  202. package/version.d.mts +1 -1
  203. package/version.d.ts +1 -1
  204. package/version.js +1 -1
  205. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -38,6 +38,13 @@ import {
38
38
  ConsentSettingUpdateResponse,
39
39
  ConsentSettings,
40
40
  } from './resources/consent-settings';
41
+ import {
42
+ DefaultMappingListResponse,
43
+ DefaultMappingReplaceParams,
44
+ DefaultMappingReplaceResponse,
45
+ DefaultMappingRetrieveResponse,
46
+ DefaultMappings,
47
+ } from './resources/default-mappings';
41
48
  import {
42
49
  DestinationTypeListResponse,
43
50
  DestinationTypeRetrieveResponse,
@@ -47,7 +54,9 @@ import {
47
54
  DestinationCreateParams,
48
55
  DestinationCreateResponse,
49
56
  DestinationDeleteResponse,
57
+ DestinationListParams,
50
58
  DestinationListResponse,
59
+ DestinationListResponsesCursor,
51
60
  DestinationRetrieveResponse,
52
61
  DestinationUpdateParams,
53
62
  DestinationUpdateResponse,
@@ -121,6 +130,21 @@ import {
121
130
  HeatmapPageSummaryResponse,
122
131
  HeatmapPages,
123
132
  } from './resources/heatmap-pages';
133
+ import {
134
+ LocationCreateParams,
135
+ LocationCreateResponse,
136
+ LocationEmbedCodeParams,
137
+ LocationEmbedCodeResponse,
138
+ LocationListResponse,
139
+ LocationUpdateParams,
140
+ LocationUpdateResponse,
141
+ Locations,
142
+ } from './resources/locations';
143
+ import {
144
+ MappingTemplateListParams,
145
+ MappingTemplateListResponse,
146
+ MappingTemplates,
147
+ } from './resources/mapping-templates';
124
148
  import {
125
149
  MappingCreateParams,
126
150
  MappingCreateResponse,
@@ -128,6 +152,8 @@ import {
128
152
  MappingListParams,
129
153
  MappingListResponse,
130
154
  MappingListResponsesCursor,
155
+ MappingReorderParams,
156
+ MappingReorderResponse,
131
157
  MappingRetrieveResponse,
132
158
  MappingUpdateParams,
133
159
  MappingUpdateResponse,
@@ -171,6 +197,28 @@ import {
171
197
  VersionUpdateResponse,
172
198
  Versions,
173
199
  } from './resources/versions';
200
+ import {
201
+ WebScannerRuleCreateParams,
202
+ WebScannerRuleCreateResponse,
203
+ WebScannerRuleDeleteResponse,
204
+ WebScannerRuleListParams,
205
+ WebScannerRuleListResponse,
206
+ WebScannerRuleRetrieveResponse,
207
+ WebScannerRuleUpdateParams,
208
+ WebScannerRuleUpdateResponse,
209
+ WebScannerRules,
210
+ } from './resources/web-scanner-rules';
211
+ import {
212
+ WebScannerCreateParams,
213
+ WebScannerCreateResponse,
214
+ WebScannerDeleteResponse,
215
+ WebScannerListResponse,
216
+ WebScannerRetrieveResponse,
217
+ WebScannerTriggerResponse,
218
+ WebScannerUpdateParams,
219
+ WebScannerUpdateResponse,
220
+ WebScanners,
221
+ } from './resources/web-scanners';
174
222
  import { type Fetch } from './internal/builtin-types';
175
223
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
176
224
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -909,32 +957,42 @@ export class OursPrivacyPlatform {
909
957
 
910
958
  allowedEvents: API.AllowedEvents = new API.AllowedEvents(this);
911
959
  consentSettings: API.ConsentSettings = new API.ConsentSettings(this);
960
+ destinationTypes: API.DestinationTypes = new API.DestinationTypes(this);
912
961
  destinations: API.Destinations = new API.Destinations(this);
913
962
  experimentSettings: API.ExperimentSettings = new API.ExperimentSettings(this);
914
963
  experimentVariants: API.ExperimentVariants = new API.ExperimentVariants(this);
915
964
  experiments: API.Experiments = new API.Experiments(this);
916
965
  globalDispatchCenters: API.GlobalDispatchCenters = new API.GlobalDispatchCenters(this);
917
966
  heatmapPages: API.HeatmapPages = new API.HeatmapPages(this);
967
+ locations: API.Locations = new API.Locations(this);
918
968
  mappings: API.Mappings = new API.Mappings(this);
919
969
  replaySettings: API.ReplaySettings = new API.ReplaySettings(this);
920
970
  sources: API.Sources = new API.Sources(this);
921
971
  versions: API.Versions = new API.Versions(this);
922
- destinationTypes: API.DestinationTypes = new API.DestinationTypes(this);
972
+ webScannerRules: API.WebScannerRules = new API.WebScannerRules(this);
973
+ webScanners: API.WebScanners = new API.WebScanners(this);
974
+ mappingTemplates: API.MappingTemplates = new API.MappingTemplates(this);
975
+ defaultMappings: API.DefaultMappings = new API.DefaultMappings(this);
923
976
  }
924
977
 
925
978
  OursPrivacyPlatform.AllowedEvents = AllowedEvents;
926
979
  OursPrivacyPlatform.ConsentSettings = ConsentSettings;
980
+ OursPrivacyPlatform.DestinationTypes = DestinationTypes;
927
981
  OursPrivacyPlatform.Destinations = Destinations;
928
982
  OursPrivacyPlatform.ExperimentSettings = ExperimentSettings;
929
983
  OursPrivacyPlatform.ExperimentVariants = ExperimentVariants;
930
984
  OursPrivacyPlatform.Experiments = Experiments;
931
985
  OursPrivacyPlatform.GlobalDispatchCenters = GlobalDispatchCenters;
932
986
  OursPrivacyPlatform.HeatmapPages = HeatmapPages;
987
+ OursPrivacyPlatform.Locations = Locations;
933
988
  OursPrivacyPlatform.Mappings = Mappings;
934
989
  OursPrivacyPlatform.ReplaySettings = ReplaySettings;
935
990
  OursPrivacyPlatform.Sources = Sources;
936
991
  OursPrivacyPlatform.Versions = Versions;
937
- OursPrivacyPlatform.DestinationTypes = DestinationTypes;
992
+ OursPrivacyPlatform.WebScannerRules = WebScannerRules;
993
+ OursPrivacyPlatform.WebScanners = WebScanners;
994
+ OursPrivacyPlatform.MappingTemplates = MappingTemplates;
995
+ OursPrivacyPlatform.DefaultMappings = DefaultMappings;
938
996
 
939
997
  export declare namespace OursPrivacyPlatform {
940
998
  export type RequestOptions = Opts.RequestOptions;
@@ -963,6 +1021,12 @@ export declare namespace OursPrivacyPlatform {
963
1021
  type ConsentSettingUpdateParams as ConsentSettingUpdateParams,
964
1022
  };
965
1023
 
1024
+ export {
1025
+ DestinationTypes as DestinationTypes,
1026
+ type DestinationTypeListResponse as DestinationTypeListResponse,
1027
+ type DestinationTypeRetrieveResponse as DestinationTypeRetrieveResponse,
1028
+ };
1029
+
966
1030
  export {
967
1031
  Destinations as Destinations,
968
1032
  type DestinationListResponse as DestinationListResponse,
@@ -970,6 +1034,8 @@ export declare namespace OursPrivacyPlatform {
970
1034
  type DestinationRetrieveResponse as DestinationRetrieveResponse,
971
1035
  type DestinationUpdateResponse as DestinationUpdateResponse,
972
1036
  type DestinationDeleteResponse as DestinationDeleteResponse,
1037
+ type DestinationListResponsesCursor as DestinationListResponsesCursor,
1038
+ type DestinationListParams as DestinationListParams,
973
1039
  type DestinationCreateParams as DestinationCreateParams,
974
1040
  type DestinationUpdateParams as DestinationUpdateParams,
975
1041
  };
@@ -1047,6 +1113,17 @@ export declare namespace OursPrivacyPlatform {
1047
1113
  type HeatmapPageSummaryParams as HeatmapPageSummaryParams,
1048
1114
  };
1049
1115
 
1116
+ export {
1117
+ Locations as Locations,
1118
+ type LocationListResponse as LocationListResponse,
1119
+ type LocationCreateResponse as LocationCreateResponse,
1120
+ type LocationUpdateResponse as LocationUpdateResponse,
1121
+ type LocationEmbedCodeResponse as LocationEmbedCodeResponse,
1122
+ type LocationCreateParams as LocationCreateParams,
1123
+ type LocationUpdateParams as LocationUpdateParams,
1124
+ type LocationEmbedCodeParams as LocationEmbedCodeParams,
1125
+ };
1126
+
1050
1127
  export {
1051
1128
  Mappings as Mappings,
1052
1129
  type MappingListResponse as MappingListResponse,
@@ -1054,10 +1131,12 @@ export declare namespace OursPrivacyPlatform {
1054
1131
  type MappingRetrieveResponse as MappingRetrieveResponse,
1055
1132
  type MappingUpdateResponse as MappingUpdateResponse,
1056
1133
  type MappingDeleteResponse as MappingDeleteResponse,
1134
+ type MappingReorderResponse as MappingReorderResponse,
1057
1135
  type MappingListResponsesCursor as MappingListResponsesCursor,
1058
1136
  type MappingListParams as MappingListParams,
1059
1137
  type MappingCreateParams as MappingCreateParams,
1060
1138
  type MappingUpdateParams as MappingUpdateParams,
1139
+ type MappingReorderParams as MappingReorderParams,
1061
1140
  };
1062
1141
 
1063
1142
  export {
@@ -1102,8 +1181,40 @@ export declare namespace OursPrivacyPlatform {
1102
1181
  };
1103
1182
 
1104
1183
  export {
1105
- DestinationTypes as DestinationTypes,
1106
- type DestinationTypeListResponse as DestinationTypeListResponse,
1107
- type DestinationTypeRetrieveResponse as DestinationTypeRetrieveResponse,
1184
+ WebScannerRules as WebScannerRules,
1185
+ type WebScannerRuleListResponse as WebScannerRuleListResponse,
1186
+ type WebScannerRuleCreateResponse as WebScannerRuleCreateResponse,
1187
+ type WebScannerRuleRetrieveResponse as WebScannerRuleRetrieveResponse,
1188
+ type WebScannerRuleUpdateResponse as WebScannerRuleUpdateResponse,
1189
+ type WebScannerRuleDeleteResponse as WebScannerRuleDeleteResponse,
1190
+ type WebScannerRuleListParams as WebScannerRuleListParams,
1191
+ type WebScannerRuleCreateParams as WebScannerRuleCreateParams,
1192
+ type WebScannerRuleUpdateParams as WebScannerRuleUpdateParams,
1193
+ };
1194
+
1195
+ export {
1196
+ WebScanners as WebScanners,
1197
+ type WebScannerListResponse as WebScannerListResponse,
1198
+ type WebScannerCreateResponse as WebScannerCreateResponse,
1199
+ type WebScannerRetrieveResponse as WebScannerRetrieveResponse,
1200
+ type WebScannerUpdateResponse as WebScannerUpdateResponse,
1201
+ type WebScannerDeleteResponse as WebScannerDeleteResponse,
1202
+ type WebScannerTriggerResponse as WebScannerTriggerResponse,
1203
+ type WebScannerCreateParams as WebScannerCreateParams,
1204
+ type WebScannerUpdateParams as WebScannerUpdateParams,
1205
+ };
1206
+
1207
+ export {
1208
+ MappingTemplates as MappingTemplates,
1209
+ type MappingTemplateListResponse as MappingTemplateListResponse,
1210
+ type MappingTemplateListParams as MappingTemplateListParams,
1211
+ };
1212
+
1213
+ export {
1214
+ DefaultMappings as DefaultMappings,
1215
+ type DefaultMappingListResponse as DefaultMappingListResponse,
1216
+ type DefaultMappingRetrieveResponse as DefaultMappingRetrieveResponse,
1217
+ type DefaultMappingReplaceResponse as DefaultMappingReplaceResponse,
1218
+ type DefaultMappingReplaceParams as DefaultMappingReplaceParams,
1108
1219
  };
1109
1220
  }
@@ -0,0 +1,332 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class DefaultMappings extends APIResource {
9
+ /**
10
+ * List every stored default mapping for the account, one per destination that has
11
+ * ever written a default. Destinations that have not yet written a default mapping
12
+ * do not appear here. Use `GET /rest/v1/default-mappings/{destinationId}` to fetch
13
+ * the hydrated would-be row for a specific destination. Requires scope:
14
+ * mapping:list
15
+ */
16
+ list(options?: RequestOptions): APIPromise<DefaultMappingListResponse> {
17
+ return this._client.get('/rest/v1/default-mappings', options);
18
+ }
19
+
20
+ /**
21
+ * Fetch the destination's default mapping by destination id. Returns a hydrated
22
+ * row with empty `mappings[]` when no default mapping has been written yet (so
23
+ * callers do not need to handle a 404-vs-200 branch). Each destination has at most
24
+ * one default mapping. Requires scope: mapping:find
25
+ */
26
+ retrieve(id: string, options?: RequestOptions): APIPromise<DefaultMappingRetrieveResponse> {
27
+ return this._client.get(path`/rest/v1/default-mappings/${id}`, options);
28
+ }
29
+
30
+ /**
31
+ * Upsert the destination default mapping. Always replaces `mappings[]` wholesale
32
+ * (default mappings have no merge-partial semantic). Default mappings cannot have
33
+ * custom `logic`; the field is not accepted on this endpoint. Requires scope:
34
+ * mapping:update
35
+ */
36
+ replace(
37
+ id: string,
38
+ body: DefaultMappingReplaceParams,
39
+ options?: RequestOptions,
40
+ ): APIPromise<DefaultMappingReplaceResponse> {
41
+ return this._client.put(path`/rest/v1/default-mappings/${id}`, { body, ...options });
42
+ }
43
+ }
44
+
45
+ export interface DefaultMappingListResponse {
46
+ entities: Array<DefaultMappingListResponse.Entity>;
47
+ }
48
+
49
+ export namespace DefaultMappingListResponse {
50
+ export interface Entity {
51
+ id: string;
52
+
53
+ isEnabled: boolean;
54
+
55
+ mappings: Array<Entity.Mapping>;
56
+
57
+ destinationId?: string | null;
58
+
59
+ isDefaultMapping?: boolean | null;
60
+
61
+ /**
62
+ * Condition tree gating when this mapping fires. A node is either a leaf
63
+ * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
64
+ * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
65
+ * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
66
+ * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
67
+ */
68
+ logic?: unknown;
69
+
70
+ name?: string | null;
71
+
72
+ priority?: number | null;
73
+
74
+ sourceId?: string | null;
75
+
76
+ templateId?: string | null;
77
+
78
+ templateName?: string | null;
79
+
80
+ updatedAt?: string | null;
81
+ }
82
+
83
+ export namespace Entity {
84
+ export interface Mapping {
85
+ map: string;
86
+
87
+ property: string;
88
+
89
+ modification?:
90
+ | 'CamelCase'
91
+ | 'DmaIP'
92
+ | 'DomainOnly'
93
+ | 'DomainPathOnly'
94
+ | 'DomainPathUTMs'
95
+ | 'DomainUTMs'
96
+ | 'FakeDomain'
97
+ | 'FakeDomainRealPath'
98
+ | 'FakeIP'
99
+ | 'FullUrl'
100
+ | 'Hash'
101
+ | 'HashMD5'
102
+ | 'HashedCountry'
103
+ | 'HashedDateOfBirth'
104
+ | 'HashedGender'
105
+ | 'HashedNormalized'
106
+ | 'HashedNormalizedNoSpecialChars'
107
+ | 'HashedPhone'
108
+ | 'HashedState'
109
+ | 'HashedZip'
110
+ | 'KebabCase'
111
+ | 'LowerCase'
112
+ | 'None'
113
+ | 'Null'
114
+ | 'Redacted'
115
+ | 'RegionalIP'
116
+ | 'SnakeCase'
117
+ | 'StartCase'
118
+ | 'UpperCase'
119
+ | null;
120
+ }
121
+ }
122
+ }
123
+
124
+ export interface DefaultMappingRetrieveResponse {
125
+ id: string;
126
+
127
+ isEnabled: boolean;
128
+
129
+ mappings: Array<DefaultMappingRetrieveResponse.Mapping>;
130
+
131
+ destinationId?: string | null;
132
+
133
+ isDefaultMapping?: boolean | null;
134
+
135
+ /**
136
+ * Condition tree gating when this mapping fires. A node is either a leaf
137
+ * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
138
+ * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
139
+ * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
140
+ * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
141
+ */
142
+ logic?: unknown;
143
+
144
+ name?: string | null;
145
+
146
+ priority?: number | null;
147
+
148
+ sourceId?: string | null;
149
+
150
+ templateId?: string | null;
151
+
152
+ templateName?: string | null;
153
+
154
+ updatedAt?: string | null;
155
+ }
156
+
157
+ export namespace DefaultMappingRetrieveResponse {
158
+ export interface Mapping {
159
+ map: string;
160
+
161
+ property: string;
162
+
163
+ modification?:
164
+ | 'CamelCase'
165
+ | 'DmaIP'
166
+ | 'DomainOnly'
167
+ | 'DomainPathOnly'
168
+ | 'DomainPathUTMs'
169
+ | 'DomainUTMs'
170
+ | 'FakeDomain'
171
+ | 'FakeDomainRealPath'
172
+ | 'FakeIP'
173
+ | 'FullUrl'
174
+ | 'Hash'
175
+ | 'HashMD5'
176
+ | 'HashedCountry'
177
+ | 'HashedDateOfBirth'
178
+ | 'HashedGender'
179
+ | 'HashedNormalized'
180
+ | 'HashedNormalizedNoSpecialChars'
181
+ | 'HashedPhone'
182
+ | 'HashedState'
183
+ | 'HashedZip'
184
+ | 'KebabCase'
185
+ | 'LowerCase'
186
+ | 'None'
187
+ | 'Null'
188
+ | 'Redacted'
189
+ | 'RegionalIP'
190
+ | 'SnakeCase'
191
+ | 'StartCase'
192
+ | 'UpperCase'
193
+ | null;
194
+ }
195
+ }
196
+
197
+ export interface DefaultMappingReplaceResponse {
198
+ id: string;
199
+
200
+ isEnabled: boolean;
201
+
202
+ mappings: Array<DefaultMappingReplaceResponse.Mapping>;
203
+
204
+ destinationId?: string | null;
205
+
206
+ isDefaultMapping?: boolean | null;
207
+
208
+ /**
209
+ * Condition tree gating when this mapping fires. A node is either a leaf
210
+ * `condition` or a combinator (`AND`, `OR`, `NOT`). Combinator children are
211
+ * themselves `MappingLogic` nodes, so trees nest arbitrarily. Example leaf:
212
+ * `{ "condition": { "property": "$event.event", "operator": "Is", "value": "page_view" } }`.
213
+ * Example combinator: `{ "AND": [{ "condition": ... }, { "OR": [...] }] }`.
214
+ */
215
+ logic?: unknown;
216
+
217
+ name?: string | null;
218
+
219
+ priority?: number | null;
220
+
221
+ sourceId?: string | null;
222
+
223
+ templateId?: string | null;
224
+
225
+ templateName?: string | null;
226
+
227
+ updatedAt?: string | null;
228
+ }
229
+
230
+ export namespace DefaultMappingReplaceResponse {
231
+ export interface Mapping {
232
+ map: string;
233
+
234
+ property: string;
235
+
236
+ modification?:
237
+ | 'CamelCase'
238
+ | 'DmaIP'
239
+ | 'DomainOnly'
240
+ | 'DomainPathOnly'
241
+ | 'DomainPathUTMs'
242
+ | 'DomainUTMs'
243
+ | 'FakeDomain'
244
+ | 'FakeDomainRealPath'
245
+ | 'FakeIP'
246
+ | 'FullUrl'
247
+ | 'Hash'
248
+ | 'HashMD5'
249
+ | 'HashedCountry'
250
+ | 'HashedDateOfBirth'
251
+ | 'HashedGender'
252
+ | 'HashedNormalized'
253
+ | 'HashedNormalizedNoSpecialChars'
254
+ | 'HashedPhone'
255
+ | 'HashedState'
256
+ | 'HashedZip'
257
+ | 'KebabCase'
258
+ | 'LowerCase'
259
+ | 'None'
260
+ | 'Null'
261
+ | 'Redacted'
262
+ | 'RegionalIP'
263
+ | 'SnakeCase'
264
+ | 'StartCase'
265
+ | 'UpperCase'
266
+ | null;
267
+ }
268
+ }
269
+
270
+ export interface DefaultMappingReplaceParams {
271
+ /**
272
+ * Property mappings to persist as the destination default. Use
273
+ * `GET /rest/v1/mapping-templates?entityId={destinationId}` to discover the valid
274
+ * `property` values.
275
+ */
276
+ mappings: Array<DefaultMappingReplaceParams.Mapping>;
277
+
278
+ /**
279
+ * Toggle the default mapping on/off. Defaults to `true` when omitted. `null` is
280
+ * treated as omitted.
281
+ */
282
+ isEnabled?: boolean | null;
283
+ }
284
+
285
+ export namespace DefaultMappingReplaceParams {
286
+ export interface Mapping {
287
+ map: string;
288
+
289
+ property: string;
290
+
291
+ modification?:
292
+ | 'CamelCase'
293
+ | 'DmaIP'
294
+ | 'DomainOnly'
295
+ | 'DomainPathOnly'
296
+ | 'DomainPathUTMs'
297
+ | 'DomainUTMs'
298
+ | 'FakeDomain'
299
+ | 'FakeDomainRealPath'
300
+ | 'FakeIP'
301
+ | 'FullUrl'
302
+ | 'Hash'
303
+ | 'HashMD5'
304
+ | 'HashedCountry'
305
+ | 'HashedDateOfBirth'
306
+ | 'HashedGender'
307
+ | 'HashedNormalized'
308
+ | 'HashedNormalizedNoSpecialChars'
309
+ | 'HashedPhone'
310
+ | 'HashedState'
311
+ | 'HashedZip'
312
+ | 'KebabCase'
313
+ | 'LowerCase'
314
+ | 'None'
315
+ | 'Null'
316
+ | 'Redacted'
317
+ | 'RegionalIP'
318
+ | 'SnakeCase'
319
+ | 'StartCase'
320
+ | 'UpperCase'
321
+ | null;
322
+ }
323
+ }
324
+
325
+ export declare namespace DefaultMappings {
326
+ export {
327
+ type DefaultMappingListResponse as DefaultMappingListResponse,
328
+ type DefaultMappingRetrieveResponse as DefaultMappingRetrieveResponse,
329
+ type DefaultMappingReplaceResponse as DefaultMappingReplaceResponse,
330
+ type DefaultMappingReplaceParams as DefaultMappingReplaceParams,
331
+ };
332
+ }