@oursprivacy/platform-sdk 1.13.0 → 1.14.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 (40) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +12 -8
  3. package/client.d.mts +4 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +4 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/experiment-variants.d.mts +73 -79
  11. package/resources/experiment-variants.d.mts.map +1 -1
  12. package/resources/experiment-variants.d.ts +73 -79
  13. package/resources/experiment-variants.d.ts.map +1 -1
  14. package/resources/experiment-variants.js +14 -7
  15. package/resources/experiment-variants.js.map +1 -1
  16. package/resources/experiment-variants.mjs +14 -7
  17. package/resources/experiment-variants.mjs.map +1 -1
  18. package/resources/index.d.mts +2 -2
  19. package/resources/index.d.mts.map +1 -1
  20. package/resources/index.d.ts +2 -2
  21. package/resources/index.d.ts.map +1 -1
  22. package/resources/index.js.map +1 -1
  23. package/resources/index.mjs.map +1 -1
  24. package/resources/mappings.d.mts +26 -24
  25. package/resources/mappings.d.mts.map +1 -1
  26. package/resources/mappings.d.ts +26 -24
  27. package/resources/mappings.d.ts.map +1 -1
  28. package/resources/mappings.js +6 -2
  29. package/resources/mappings.js.map +1 -1
  30. package/resources/mappings.mjs +6 -2
  31. package/resources/mappings.mjs.map +1 -1
  32. package/src/client.ts +4 -0
  33. package/src/resources/experiment-variants.ts +94 -96
  34. package/src/resources/index.ts +2 -0
  35. package/src/resources/mappings.ts +31 -25
  36. package/src/version.ts +1 -1
  37. package/version.d.mts +1 -1
  38. package/version.d.ts +1 -1
  39. package/version.js +1 -1
  40. package/version.mjs +1 -1
@@ -2,15 +2,22 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import { APIPromise } from '../core/api-promise';
5
+ import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
5
6
  import { RequestOptions } from '../internal/request-options';
6
7
  import { path } from '../internal/utils/path';
7
8
 
8
9
  export class Mappings extends APIResource {
9
10
  /**
10
- * List all mappings for an entity. Requires scope: mapping:list
11
+ * List mappings for an entity (a source or destination). Requires the `entityId`
12
+ * query parameter. Supports cursor pagination via `limit` and `cursor`. Sorted by
13
+ * `priority` ascending, then by `id` for deterministic pagination. Requires scope:
14
+ * mapping:list
11
15
  */
12
- list(query: MappingListParams, options?: RequestOptions): APIPromise<MappingListResponse> {
13
- return this._client.get('/rest/v1/mappings', { query, ...options });
16
+ list(
17
+ query: MappingListParams,
18
+ options?: RequestOptions,
19
+ ): PagePromise<MappingListResponsesCursor, MappingListResponse> {
20
+ return this._client.getAPIList('/rest/v1/mappings', Cursor<MappingListResponse>, { query, ...options });
14
21
  }
15
22
 
16
23
  /**
@@ -43,41 +50,39 @@ export class Mappings extends APIResource {
43
50
  }
44
51
  }
45
52
 
46
- export type MappingListResponse = Array<MappingListResponse.MappingListResponseItem>;
53
+ export type MappingListResponsesCursor = Cursor<MappingListResponse>;
47
54
 
48
- export namespace MappingListResponse {
49
- export interface MappingListResponseItem {
50
- id: string;
55
+ export interface MappingListResponse {
56
+ id: string;
51
57
 
52
- isEnabled: boolean;
58
+ isEnabled: boolean;
53
59
 
54
- mappings: Array<MappingListResponseItem.Mapping>;
60
+ mappings: Array<MappingListResponse.Mapping>;
55
61
 
56
- destinationId?: string | null;
62
+ destinationId?: string | null;
57
63
 
58
- isDefaultMapping?: boolean | null;
64
+ isDefaultMapping?: boolean | null;
59
65
 
60
- name?: string | null;
66
+ name?: string | null;
61
67
 
62
- priority?: number | null;
68
+ priority?: number | null;
63
69
 
64
- sourceId?: string | null;
70
+ sourceId?: string | null;
65
71
 
66
- templateId?: string | null;
72
+ templateId?: string | null;
67
73
 
68
- templateName?: string | null;
74
+ templateName?: string | null;
69
75
 
70
- updatedAt?: string | null;
71
- }
76
+ updatedAt?: string | null;
77
+ }
72
78
 
73
- export namespace MappingListResponseItem {
74
- export interface Mapping {
75
- map: string;
79
+ export namespace MappingListResponse {
80
+ export interface Mapping {
81
+ map: string;
76
82
 
77
- property: string;
83
+ property: string;
78
84
 
79
- modification?: string | null;
80
- }
85
+ modification?: string | null;
81
86
  }
82
87
  }
83
88
 
@@ -185,7 +190,7 @@ export namespace MappingUpdateResponse {
185
190
 
186
191
  export type MappingDeleteResponse = boolean;
187
192
 
188
- export interface MappingListParams {
193
+ export interface MappingListParams extends CursorParams {
189
194
  /**
190
195
  * Filter mappings by their parent entity id (for example an allowed event id).
191
196
  */
@@ -223,6 +228,7 @@ export declare namespace Mappings {
223
228
  type MappingRetrieveResponse as MappingRetrieveResponse,
224
229
  type MappingUpdateResponse as MappingUpdateResponse,
225
230
  type MappingDeleteResponse as MappingDeleteResponse,
231
+ type MappingListResponsesCursor as MappingListResponsesCursor,
226
232
  type MappingListParams as MappingListParams,
227
233
  type MappingCreateParams as MappingCreateParams,
228
234
  type MappingUpdateParams as MappingUpdateParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.13.0'; // x-release-please-version
1
+ export const VERSION = '1.14.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.13.0";
1
+ export declare const VERSION = "1.14.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.13.0";
1
+ export declare const VERSION = "1.14.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.13.0'; // x-release-please-version
4
+ exports.VERSION = '1.14.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.13.0'; // x-release-please-version
1
+ export const VERSION = '1.14.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map