@oursprivacy/platform-sdk 1.0.0 → 1.2.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 (82) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +2 -2
  3. package/client.d.mts +5 -5
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +5 -5
  6. package/client.d.ts.map +1 -1
  7. package/client.js +8 -17
  8. package/client.js.map +1 -1
  9. package/client.mjs +8 -17
  10. package/client.mjs.map +1 -1
  11. package/internal/utils/query.d.mts +5 -0
  12. package/internal/utils/query.d.mts.map +1 -0
  13. package/internal/utils/query.d.ts +5 -0
  14. package/internal/utils/query.d.ts.map +1 -0
  15. package/internal/utils/query.js +23 -0
  16. package/internal/utils/query.js.map +1 -0
  17. package/internal/utils/query.mjs +20 -0
  18. package/internal/utils/query.mjs.map +1 -0
  19. package/internal/utils.d.mts +1 -0
  20. package/internal/utils.d.ts +1 -0
  21. package/internal/utils.js +1 -0
  22. package/internal/utils.js.map +1 -1
  23. package/internal/utils.mjs +1 -0
  24. package/package.json +1 -1
  25. package/resources/allowed-events.d.mts +22 -5
  26. package/resources/allowed-events.d.mts.map +1 -1
  27. package/resources/allowed-events.d.ts +22 -5
  28. package/resources/allowed-events.d.ts.map +1 -1
  29. package/resources/consent-settings.d.mts +64 -10
  30. package/resources/consent-settings.d.mts.map +1 -1
  31. package/resources/consent-settings.d.ts +64 -10
  32. package/resources/consent-settings.d.ts.map +1 -1
  33. package/resources/consent-settings.js +2 -2
  34. package/resources/consent-settings.js.map +1 -1
  35. package/resources/consent-settings.mjs +2 -2
  36. package/resources/consent-settings.mjs.map +1 -1
  37. package/resources/destinations.d.mts +48 -6
  38. package/resources/destinations.d.mts.map +1 -1
  39. package/resources/destinations.d.ts +48 -6
  40. package/resources/destinations.d.ts.map +1 -1
  41. package/resources/global-dispatch-centers.d.mts +45 -11
  42. package/resources/global-dispatch-centers.d.mts.map +1 -1
  43. package/resources/global-dispatch-centers.d.ts +45 -11
  44. package/resources/global-dispatch-centers.d.ts.map +1 -1
  45. package/resources/global-dispatch-centers.js +2 -2
  46. package/resources/global-dispatch-centers.js.map +1 -1
  47. package/resources/global-dispatch-centers.mjs +2 -2
  48. package/resources/global-dispatch-centers.mjs.map +1 -1
  49. package/resources/index.d.mts +2 -2
  50. package/resources/index.d.mts.map +1 -1
  51. package/resources/index.d.ts +2 -2
  52. package/resources/index.d.ts.map +1 -1
  53. package/resources/index.js.map +1 -1
  54. package/resources/index.mjs.map +1 -1
  55. package/resources/replay-settings.d.mts +60 -6
  56. package/resources/replay-settings.d.mts.map +1 -1
  57. package/resources/replay-settings.d.ts +60 -6
  58. package/resources/replay-settings.d.ts.map +1 -1
  59. package/resources/sources.d.mts +45 -6
  60. package/resources/sources.d.mts.map +1 -1
  61. package/resources/sources.d.ts +45 -6
  62. package/resources/sources.d.ts.map +1 -1
  63. package/resources/versions.d.mts +41 -5
  64. package/resources/versions.d.mts.map +1 -1
  65. package/resources/versions.d.ts +41 -5
  66. package/resources/versions.d.ts.map +1 -1
  67. package/src/client.ts +11 -26
  68. package/src/internal/utils/query.ts +23 -0
  69. package/src/internal/utils.ts +1 -0
  70. package/src/resources/allowed-events.ts +38 -6
  71. package/src/resources/consent-settings.ts +108 -14
  72. package/src/resources/destinations.ts +416 -8
  73. package/src/resources/global-dispatch-centers.ts +75 -15
  74. package/src/resources/index.ts +0 -2
  75. package/src/resources/replay-settings.ts +100 -8
  76. package/src/resources/sources.ts +235 -8
  77. package/src/resources/versions.ts +77 -7
  78. package/src/version.ts +1 -1
  79. package/version.d.mts +1 -1
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
  82. package/version.mjs +1 -1
@@ -24,23 +24,62 @@ export declare class Sources extends APIResource {
24
24
  delete(id: string, options?: RequestOptions): APIPromise<SourceDeleteResponse>;
25
25
  }
26
26
  export interface SourceCreateResponse {
27
- data?: unknown;
27
+ id: string;
28
+ createdAt: string;
29
+ status: 'Disabled' | 'Enabled';
30
+ type: 'AlchemerWebhook' | 'AndroidNativeApi' | 'CSharpApi' | 'CalComWebhooks' | 'CalendlyWebhook' | 'CallRail' | 'CallTrackingMetrics' | 'DotNetApi' | 'FacebookLeadAds' | 'FormsortWebhooks' | 'Formstack' | 'GoLangApi' | 'HTTPApiSource' | 'Healthie' | 'HubspotAppActions' | 'HubspotFormWebhook' | 'JotFormWebhooks' | 'KotlinApi' | 'NodejsApi' | 'PHPApi' | 'PixelImage' | 'PythonApi' | 'ReactNativeApi' | 'RedirectSource' | 'RubyApi' | 'SegmentWebPlugin' | 'TypeformWebhooks' | 'WebSource' | 'Webhook' | 'WhatConverts' | 'iOSNativeApi';
31
+ name?: string | null;
28
32
  }
29
33
  export interface SourceRetrieveResponse {
30
- data?: unknown;
34
+ id: string;
35
+ createdAt: string;
36
+ status: 'Disabled' | 'Enabled';
37
+ type: 'AlchemerWebhook' | 'AndroidNativeApi' | 'CSharpApi' | 'CalComWebhooks' | 'CalendlyWebhook' | 'CallRail' | 'CallTrackingMetrics' | 'DotNetApi' | 'FacebookLeadAds' | 'FormsortWebhooks' | 'Formstack' | 'GoLangApi' | 'HTTPApiSource' | 'Healthie' | 'HubspotAppActions' | 'HubspotFormWebhook' | 'JotFormWebhooks' | 'KotlinApi' | 'NodejsApi' | 'PHPApi' | 'PixelImage' | 'PythonApi' | 'ReactNativeApi' | 'RedirectSource' | 'RubyApi' | 'SegmentWebPlugin' | 'TypeformWebhooks' | 'WebSource' | 'Webhook' | 'WhatConverts' | 'iOSNativeApi';
38
+ name?: string | null;
31
39
  }
32
40
  export interface SourceUpdateResponse {
33
- data?: unknown;
41
+ id: string;
42
+ createdAt: string;
43
+ status: 'Disabled' | 'Enabled';
44
+ type: 'AlchemerWebhook' | 'AndroidNativeApi' | 'CSharpApi' | 'CalComWebhooks' | 'CalendlyWebhook' | 'CallRail' | 'CallTrackingMetrics' | 'DotNetApi' | 'FacebookLeadAds' | 'FormsortWebhooks' | 'Formstack' | 'GoLangApi' | 'HTTPApiSource' | 'Healthie' | 'HubspotAppActions' | 'HubspotFormWebhook' | 'JotFormWebhooks' | 'KotlinApi' | 'NodejsApi' | 'PHPApi' | 'PixelImage' | 'PythonApi' | 'ReactNativeApi' | 'RedirectSource' | 'RubyApi' | 'SegmentWebPlugin' | 'TypeformWebhooks' | 'WebSource' | 'Webhook' | 'WhatConverts' | 'iOSNativeApi';
45
+ name?: string | null;
34
46
  }
35
47
  export interface SourceListResponse {
36
- data?: unknown;
48
+ entities: Array<SourceListResponse.Entity>;
37
49
  }
38
- export interface SourceDeleteResponse {
39
- data?: unknown;
50
+ export declare namespace SourceListResponse {
51
+ interface Entity {
52
+ id: string;
53
+ createdAt: string;
54
+ status: 'Disabled' | 'Enabled';
55
+ type: 'AlchemerWebhook' | 'AndroidNativeApi' | 'CSharpApi' | 'CalComWebhooks' | 'CalendlyWebhook' | 'CallRail' | 'CallTrackingMetrics' | 'DotNetApi' | 'FacebookLeadAds' | 'FormsortWebhooks' | 'Formstack' | 'GoLangApi' | 'HTTPApiSource' | 'Healthie' | 'HubspotAppActions' | 'HubspotFormWebhook' | 'JotFormWebhooks' | 'KotlinApi' | 'NodejsApi' | 'PHPApi' | 'PixelImage' | 'PythonApi' | 'ReactNativeApi' | 'RedirectSource' | 'RubyApi' | 'SegmentWebPlugin' | 'TypeformWebhooks' | 'WebSource' | 'Webhook' | 'WhatConverts' | 'iOSNativeApi';
56
+ name?: string | null;
57
+ }
40
58
  }
59
+ export type SourceDeleteResponse = boolean;
41
60
  export interface SourceCreateParams {
61
+ type: 'AlchemerWebhook' | 'AndroidNativeApi' | 'CSharpApi' | 'CalComWebhooks' | 'CalendlyWebhook' | 'CallRail' | 'CallTrackingMetrics' | 'DotNetApi' | 'FacebookLeadAds' | 'FormsortWebhooks' | 'Formstack' | 'GoLangApi' | 'HTTPApiSource' | 'Healthie' | 'HubspotAppActions' | 'HubspotFormWebhook' | 'JotFormWebhooks' | 'KotlinApi' | 'NodejsApi' | 'PHPApi' | 'PixelImage' | 'PythonApi' | 'ReactNativeApi' | 'RedirectSource' | 'RubyApi' | 'SegmentWebPlugin' | 'TypeformWebhooks' | 'WebSource' | 'Webhook' | 'WhatConverts' | 'iOSNativeApi';
62
+ name?: string | null;
42
63
  }
43
64
  export interface SourceUpdateParams {
65
+ status: 'Disabled' | 'Enabled';
66
+ botControlMode?: 'Allow' | 'Block' | 'Threshold' | null;
67
+ botScoreThreshold?: number | null;
68
+ excludeRequestContext?: boolean | null;
69
+ name?: string | null;
70
+ probabilisticIdentity?: SourceUpdateParams.ProbabilisticIdentity | null;
71
+ projectAPIKey?: string | null;
72
+ redirectUrl?: string | null;
73
+ selectedAccountId?: string | null;
74
+ whitelistDomains?: Array<unknown> | null;
75
+ whitelistIps?: Array<string> | null;
76
+ }
77
+ export declare namespace SourceUpdateParams {
78
+ interface ProbabilisticIdentity {
79
+ enabled: boolean;
80
+ matchWindowMinutes?: number | null;
81
+ maxMatchesPerIp?: number | null;
82
+ }
44
83
  }
45
84
  export declare namespace Sources {
46
85
  export { type SourceCreateResponse as SourceCreateResponse, type SourceRetrieveResponse as SourceRetrieveResponse, type SourceUpdateResponse as SourceUpdateResponse, type SourceListResponse as SourceListResponse, type SourceDeleteResponse as SourceDeleteResponse, type SourceCreateParams as SourceCreateParams, type SourceUpdateParams as SourceUpdateParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../src/resources/sources.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI5F;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,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B,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,IAAI,CAAC;IAExD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,qBAAqB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,qBAAqB,CAAC,EAAE,kBAAkB,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAExE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,gBAAgB,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAEzC,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CACrC;AAED,yBAAiB,kBAAkB,CAAC;IAClC,UAAiB,qBAAqB;QACpC,OAAO,EAAE,OAAO,CAAC;QAEjB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAEnC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACjC;CACF;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -20,20 +20,56 @@ export declare class Versions extends APIResource {
20
20
  list(options?: RequestOptions): APIPromise<VersionListResponse>;
21
21
  }
22
22
  export interface VersionCreateResponse {
23
- data?: unknown;
23
+ success: boolean;
24
+ error?: string | null;
24
25
  }
25
26
  export interface VersionRetrieveResponse {
26
- data?: unknown;
27
+ id: string;
28
+ createdAt: string;
29
+ isPublished: boolean;
30
+ versionNumber: number;
31
+ name?: string | null;
32
+ notes?: string | null;
33
+ publishedAt?: string | null;
27
34
  }
28
35
  export interface VersionUpdateResponse {
29
- data?: unknown;
36
+ id: string;
37
+ createdAt: string;
38
+ isPublished: boolean;
39
+ versionNumber: number;
40
+ name?: string | null;
41
+ notes?: string | null;
42
+ publishedAt?: string | null;
30
43
  }
31
- export interface VersionListResponse {
32
- data?: unknown;
44
+ export type VersionListResponse = Array<VersionListResponse.VersionListResponseItem>;
45
+ export declare namespace VersionListResponse {
46
+ interface VersionListResponseItem {
47
+ id: string;
48
+ createdAt: string;
49
+ isPublished: boolean;
50
+ versionNumber: number;
51
+ name?: string | null;
52
+ publishedAt?: string | null;
53
+ }
33
54
  }
34
55
  export interface VersionCreateParams {
56
+ includeAllowedEvents?: Array<string> | null;
57
+ includeConsentSettings?: Array<string> | null;
58
+ includeDestinations?: Array<string> | null;
59
+ includeExternalAllowedEventData?: Array<string> | null;
60
+ includeGlobalDispatchCenters?: Array<string> | null;
61
+ includeMappings?: Array<string> | null;
62
+ includeReplaySettings?: Array<string> | null;
63
+ includeSources?: Array<string> | null;
64
+ includeTagManagerTags?: Array<string> | null;
65
+ includeTagManagerTriggers?: Array<string> | null;
66
+ includeTagManagerVariables?: Array<string> | null;
67
+ name?: string | null;
68
+ notes?: string | null;
35
69
  }
36
70
  export interface VersionUpdateParams {
71
+ name?: string | null;
72
+ notes?: string | null;
37
73
  }
38
74
  export declare namespace Versions {
39
75
  export { type VersionCreateResponse as VersionCreateResponse, type VersionRetrieveResponse as VersionRetrieveResponse, type VersionUpdateResponse as VersionUpdateResponse, type VersionListResponse as VersionListResponse, type VersionCreateParams as VersionCreateParams, type VersionUpdateParams as VersionUpdateParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../src/resources/versions.ts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I,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -20,20 +20,56 @@ export declare class Versions extends APIResource {
20
20
  list(options?: RequestOptions): APIPromise<VersionListResponse>;
21
21
  }
22
22
  export interface VersionCreateResponse {
23
- data?: unknown;
23
+ success: boolean;
24
+ error?: string | null;
24
25
  }
25
26
  export interface VersionRetrieveResponse {
26
- data?: unknown;
27
+ id: string;
28
+ createdAt: string;
29
+ isPublished: boolean;
30
+ versionNumber: number;
31
+ name?: string | null;
32
+ notes?: string | null;
33
+ publishedAt?: string | null;
27
34
  }
28
35
  export interface VersionUpdateResponse {
29
- data?: unknown;
36
+ id: string;
37
+ createdAt: string;
38
+ isPublished: boolean;
39
+ versionNumber: number;
40
+ name?: string | null;
41
+ notes?: string | null;
42
+ publishedAt?: string | null;
30
43
  }
31
- export interface VersionListResponse {
32
- data?: unknown;
44
+ export type VersionListResponse = Array<VersionListResponse.VersionListResponseItem>;
45
+ export declare namespace VersionListResponse {
46
+ interface VersionListResponseItem {
47
+ id: string;
48
+ createdAt: string;
49
+ isPublished: boolean;
50
+ versionNumber: number;
51
+ name?: string | null;
52
+ publishedAt?: string | null;
53
+ }
33
54
  }
34
55
  export interface VersionCreateParams {
56
+ includeAllowedEvents?: Array<string> | null;
57
+ includeConsentSettings?: Array<string> | null;
58
+ includeDestinations?: Array<string> | null;
59
+ includeExternalAllowedEventData?: Array<string> | null;
60
+ includeGlobalDispatchCenters?: Array<string> | null;
61
+ includeMappings?: Array<string> | null;
62
+ includeReplaySettings?: Array<string> | null;
63
+ includeSources?: Array<string> | null;
64
+ includeTagManagerTags?: Array<string> | null;
65
+ includeTagManagerTriggers?: Array<string> | null;
66
+ includeTagManagerVariables?: Array<string> | null;
67
+ name?: string | null;
68
+ notes?: string | null;
35
69
  }
36
70
  export interface VersionUpdateParams {
71
+ name?: string | null;
72
+ notes?: string | null;
37
73
  }
38
74
  export declare namespace Versions {
39
75
  export { type VersionCreateResponse as VersionCreateResponse, type VersionRetrieveResponse as VersionRetrieveResponse, type VersionUpdateResponse as VersionUpdateResponse, type VersionListResponse as VersionListResponse, type VersionCreateParams as VersionCreateParams, type VersionUpdateParams as VersionUpdateParams, };
@@ -1 +1 @@
1
- {"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../src/resources/versions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAInF;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI1G;;OAEG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;CAGhE;AAED,MA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from './internal/detect-platform';
12
12
  import * as Shims from './internal/shims';
13
13
  import * as Opts from './internal/request-options';
14
+ import { stringifyQuery } from './internal/utils/query';
14
15
  import { VERSION } from './version';
15
16
  import * as Errors from './core/error';
16
17
  import * as Uploads from './core/uploads';
@@ -25,7 +26,6 @@ import {
25
26
  AllowedEvents,
26
27
  } from './resources/allowed-events';
27
28
  import {
28
- ConsentSettingCreateParams,
29
29
  ConsentSettingCreateResponse,
30
30
  ConsentSettingDeleteResponse,
31
31
  ConsentSettingListResponse,
@@ -45,7 +45,6 @@ import {
45
45
  Destinations,
46
46
  } from './resources/destinations';
47
47
  import {
48
- GlobalDispatchCenterCreateParams,
49
48
  GlobalDispatchCenterCreateResponse,
50
49
  GlobalDispatchCenterDeleteResponse,
51
50
  GlobalDispatchCenterListResponse,
@@ -279,21 +278,8 @@ export class OursPrivacyPlatform {
279
278
  /**
280
279
  * Basic re-implementation of `qs.stringify` for primitive types.
281
280
  */
282
- protected stringifyQuery(query: Record<string, unknown>): string {
283
- return Object.entries(query)
284
- .filter(([_, value]) => typeof value !== 'undefined')
285
- .map(([key, value]) => {
286
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
287
- return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
288
- }
289
- if (value === null) {
290
- return `${encodeURIComponent(key)}=`;
291
- }
292
- throw new Errors.OursPrivacyPlatformError(
293
- `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
294
- );
295
- })
296
- .join('&');
281
+ protected stringifyQuery(query: object | Record<string, unknown>): string {
282
+ return stringifyQuery(query);
297
283
  }
298
284
 
299
285
  private getUserAgent(): string {
@@ -325,12 +311,13 @@ export class OursPrivacyPlatform {
325
311
  : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
326
312
 
327
313
  const defaultQuery = this.defaultQuery();
328
- if (!isEmptyObj(defaultQuery)) {
329
- query = { ...defaultQuery, ...query };
314
+ const pathQuery = Object.fromEntries(url.searchParams);
315
+ if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
316
+ query = { ...pathQuery, ...defaultQuery, ...query };
330
317
  }
331
318
 
332
319
  if (typeof query === 'object' && query && !Array.isArray(query)) {
333
- url.search = this.stringifyQuery(query as Record<string, unknown>);
320
+ url.search = this.stringifyQuery(query);
334
321
  }
335
322
 
336
323
  return url.toString();
@@ -635,9 +622,9 @@ export class OursPrivacyPlatform {
635
622
  }
636
623
  }
637
624
 
638
- // If the API asks us to wait a certain amount of time (and it's a reasonable amount),
639
- // just do what it says, but otherwise calculate a default
640
- if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
625
+ // If the API asks us to wait a certain amount of time, just do what it
626
+ // says, but otherwise calculate a default
627
+ if (timeoutMillis === undefined) {
641
628
  const maxRetries = options.maxRetries ?? this.maxRetries;
642
629
  timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
643
630
  }
@@ -769,7 +756,7 @@ export class OursPrivacyPlatform {
769
756
  ) {
770
757
  return {
771
758
  bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
772
- body: this.stringifyQuery(body as Record<string, unknown>),
759
+ body: this.stringifyQuery(body),
773
760
  };
774
761
  } else {
775
762
  return this.#encoder({ body, headers });
@@ -853,7 +840,6 @@ export declare namespace OursPrivacyPlatform {
853
840
  type ConsentSettingUpdateResponse as ConsentSettingUpdateResponse,
854
841
  type ConsentSettingListResponse as ConsentSettingListResponse,
855
842
  type ConsentSettingDeleteResponse as ConsentSettingDeleteResponse,
856
- type ConsentSettingCreateParams as ConsentSettingCreateParams,
857
843
  type ConsentSettingUpdateParams as ConsentSettingUpdateParams,
858
844
  };
859
845
 
@@ -864,7 +850,6 @@ export declare namespace OursPrivacyPlatform {
864
850
  type GlobalDispatchCenterUpdateResponse as GlobalDispatchCenterUpdateResponse,
865
851
  type GlobalDispatchCenterListResponse as GlobalDispatchCenterListResponse,
866
852
  type GlobalDispatchCenterDeleteResponse as GlobalDispatchCenterDeleteResponse,
867
- type GlobalDispatchCenterCreateParams as GlobalDispatchCenterCreateParams,
868
853
  type GlobalDispatchCenterUpdateParams as GlobalDispatchCenterUpdateParams,
869
854
  };
870
855
 
@@ -0,0 +1,23 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { OursPrivacyPlatformError } from '../../core/error';
4
+
5
+ /**
6
+ * Basic re-implementation of `qs.stringify` for primitive types.
7
+ */
8
+ export function stringifyQuery(query: object | Record<string, unknown>) {
9
+ return Object.entries(query)
10
+ .filter(([_, value]) => typeof value !== 'undefined')
11
+ .map(([key, value]) => {
12
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
13
+ return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
14
+ }
15
+ if (value === null) {
16
+ return `${encodeURIComponent(key)}=`;
17
+ }
18
+ throw new OursPrivacyPlatformError(
19
+ `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
20
+ );
21
+ })
22
+ .join('&');
23
+ }
@@ -6,3 +6,4 @@ export * from './utils/env';
6
6
  export * from './utils/log';
7
7
  export * from './utils/uuid';
8
8
  export * from './utils/sleep';
9
+ export * from './utils/query';
@@ -36,22 +36,54 @@ export class AllowedEvents extends APIResource {
36
36
  }
37
37
 
38
38
  export interface AllowedEventCreateResponse {
39
- data?: unknown;
39
+ id: string;
40
+
41
+ createdAt: string;
42
+
43
+ destinationIds: Array<string>;
44
+
45
+ name: string;
46
+
47
+ updatedAt?: string | null;
40
48
  }
41
49
 
42
50
  export interface AllowedEventRetrieveResponse {
43
- data?: unknown;
51
+ id: string;
52
+
53
+ createdAt: string;
54
+
55
+ destinationIds: Array<string>;
56
+
57
+ name: string;
58
+
59
+ updatedAt?: string | null;
44
60
  }
45
61
 
46
62
  export interface AllowedEventListResponse {
47
- data?: unknown;
63
+ entities: Array<AllowedEventListResponse.Entity>;
48
64
  }
49
65
 
50
- export interface AllowedEventDeleteResponse {
51
- data?: unknown;
66
+ export namespace AllowedEventListResponse {
67
+ export interface Entity {
68
+ id: string;
69
+
70
+ createdAt: string;
71
+
72
+ destinationIds: Array<string>;
73
+
74
+ name: string;
75
+
76
+ updatedAt?: string | null;
77
+ }
52
78
  }
53
79
 
54
- export interface AllowedEventCreateParams {}
80
+ export type AllowedEventDeleteResponse = boolean;
81
+
82
+ export interface AllowedEventCreateParams {
83
+ name: string;
84
+
85
+ destinationIds?: Array<string> | string | null;
86
+ }
55
87
 
56
88
  export declare namespace AllowedEvents {
57
89
  export {
@@ -9,17 +9,14 @@ export class ConsentSettings extends APIResource {
9
9
  /**
10
10
  * Create a new consent setting. Requires scope: consentSettings:create
11
11
  */
12
- create(
13
- body: ConsentSettingCreateParams,
14
- options?: RequestOptions,
15
- ): APIPromise<ConsentSettingCreateResponse> {
16
- return this._client.post('/rest/v1/consent-settings', { body, ...options });
12
+ create(options?: RequestOptions): APIPromise<ConsentSettingCreateResponse> {
13
+ return this._client.post('/rest/v1/consent-settings', options);
17
14
  }
18
15
 
19
16
  /**
20
17
  * Find a single consent setting by ID. Requires scope: consentSettings:find
21
18
  */
22
- retrieve(id: string, options?: RequestOptions): APIPromise<ConsentSettingRetrieveResponse> {
19
+ retrieve(id: string, options?: RequestOptions): APIPromise<ConsentSettingRetrieveResponse | null> {
23
20
  return this._client.get(path`/rest/v1/consent-settings/${id}`, options);
24
21
  }
25
22
 
@@ -50,28 +47,126 @@ export class ConsentSettings extends APIResource {
50
47
  }
51
48
 
52
49
  export interface ConsentSettingCreateResponse {
53
- data?: unknown;
50
+ isSuccess: boolean;
51
+
52
+ cause?: string | null;
53
+
54
+ consentSettings?: ConsentSettingCreateResponse.ConsentSettings | null;
55
+ }
56
+
57
+ export namespace ConsentSettingCreateResponse {
58
+ export interface ConsentSettings {
59
+ id: string;
60
+
61
+ createdAt: string;
62
+
63
+ kind: string;
64
+
65
+ name: string;
66
+
67
+ status: 'Disabled' | 'Enabled';
68
+
69
+ updatedAt?: string | null;
70
+ }
54
71
  }
55
72
 
56
73
  export interface ConsentSettingRetrieveResponse {
57
- data?: unknown;
74
+ id: string;
75
+
76
+ createdAt: string;
77
+
78
+ kind: string;
79
+
80
+ name: string;
81
+
82
+ status: 'Disabled' | 'Enabled';
83
+
84
+ updatedAt?: string | null;
58
85
  }
59
86
 
60
87
  export interface ConsentSettingUpdateResponse {
61
- data?: unknown;
88
+ isSuccess: boolean;
89
+
90
+ cause?: string | null;
91
+
92
+ consentSettings?: ConsentSettingUpdateResponse.ConsentSettings | null;
93
+ }
94
+
95
+ export namespace ConsentSettingUpdateResponse {
96
+ export interface ConsentSettings {
97
+ id: string;
98
+
99
+ createdAt: string;
100
+
101
+ kind: string;
102
+
103
+ name: string;
104
+
105
+ status: 'Disabled' | 'Enabled';
106
+
107
+ updatedAt?: string | null;
108
+ }
62
109
  }
63
110
 
64
111
  export interface ConsentSettingListResponse {
65
- data?: unknown;
112
+ entities: Array<ConsentSettingListResponse.Entity>;
113
+ }
114
+
115
+ export namespace ConsentSettingListResponse {
116
+ export interface Entity {
117
+ id: string;
118
+
119
+ createdAt: string;
120
+
121
+ kind: string;
122
+
123
+ name: string;
124
+
125
+ status: 'Disabled' | 'Enabled';
126
+
127
+ updatedAt?: string | null;
128
+ }
66
129
  }
67
130
 
68
131
  export interface ConsentSettingDeleteResponse {
69
- data?: unknown;
132
+ id: string;
133
+
134
+ createdAt: string;
135
+
136
+ kind: string;
137
+
138
+ name: string;
139
+
140
+ status: 'Disabled' | 'Enabled';
141
+
142
+ updatedAt?: string | null;
70
143
  }
71
144
 
72
- export interface ConsentSettingCreateParams {}
145
+ export interface ConsentSettingUpdateParams {
146
+ categories: Array<unknown>;
147
+
148
+ name: string;
149
+
150
+ regions: Array<unknown>;
151
+
152
+ services: Array<unknown>;
153
+
154
+ status: 'Disabled' | 'Enabled';
155
+
156
+ consentCookieName?: string | null;
73
157
 
74
- export interface ConsentSettingUpdateParams {}
158
+ customDomain?: unknown;
159
+
160
+ default?: unknown;
161
+
162
+ revision?: number | null;
163
+
164
+ skipBlockingClassNames?: Array<string> | null;
165
+
166
+ webSDKToken?: string | null;
167
+
168
+ whitelistDomains?: Array<unknown> | null;
169
+ }
75
170
 
76
171
  export declare namespace ConsentSettings {
77
172
  export {
@@ -80,7 +175,6 @@ export declare namespace ConsentSettings {
80
175
  type ConsentSettingUpdateResponse as ConsentSettingUpdateResponse,
81
176
  type ConsentSettingListResponse as ConsentSettingListResponse,
82
177
  type ConsentSettingDeleteResponse as ConsentSettingDeleteResponse,
83
- type ConsentSettingCreateParams as ConsentSettingCreateParams,
84
178
  type ConsentSettingUpdateParams as ConsentSettingUpdateParams,
85
179
  };
86
180
  }