@kard-financial/sdk 22.2.0 → 22.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.
Files changed (66) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/users/resources/attributions/client/Client.d.ts +25 -0
  3. package/dist/cjs/api/resources/users/resources/attributions/client/Client.js +67 -0
  4. package/dist/cjs/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponse.d.ts +23 -0
  5. package/dist/cjs/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponse.js +3 -0
  6. package/dist/cjs/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponseAttributes.d.ts +15 -0
  7. package/dist/cjs/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponseAttributes.js +3 -0
  8. package/dist/cjs/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponseData.d.ts +7 -0
  9. package/dist/cjs/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponseData.js +3 -0
  10. package/dist/cjs/api/resources/users/resources/attributions/types/AttributionState.d.ts +4 -0
  11. package/dist/cjs/api/resources/users/resources/attributions/types/CreateAttributionRequestUnion.d.ts +4 -1
  12. package/dist/cjs/api/resources/users/resources/attributions/types/PlacementSlotAttributionAttributes.d.ts +19 -0
  13. package/dist/cjs/api/resources/users/resources/attributions/types/PlacementSlotAttributionAttributes.js +3 -0
  14. package/dist/cjs/api/resources/users/resources/attributions/types/PlacementSlotAttributionRequest.d.ts +4 -0
  15. package/dist/cjs/api/resources/users/resources/attributions/types/PlacementSlotAttributionRequest.js +3 -0
  16. package/dist/cjs/api/resources/users/resources/attributions/types/PlacementSlotMedium.d.ts +5 -0
  17. package/dist/cjs/api/resources/users/resources/attributions/types/PlacementSlotMedium.js +8 -0
  18. package/dist/cjs/api/resources/users/resources/attributions/types/index.d.ts +6 -0
  19. package/dist/cjs/api/resources/users/resources/attributions/types/index.js +6 -0
  20. package/dist/cjs/api/resources/users/resources/rewards/client/Client.d.ts +27 -0
  21. package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +76 -0
  22. package/dist/cjs/api/resources/users/resources/rewards/client/requests/GetBatchesByPlacementRequest.d.ts +9 -0
  23. package/dist/cjs/api/resources/users/resources/rewards/client/requests/GetBatchesByPlacementRequest.js +3 -0
  24. package/dist/cjs/api/resources/users/resources/rewards/client/requests/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/users/resources/rewards/types/BatchSlotData.d.ts +18 -0
  26. package/dist/cjs/api/resources/users/resources/rewards/types/BatchSlotData.js +3 -0
  27. package/dist/cjs/api/resources/users/resources/rewards/types/BatchesResponseObject.d.ts +7 -0
  28. package/dist/cjs/api/resources/users/resources/rewards/types/BatchesResponseObject.js +3 -0
  29. package/dist/cjs/api/resources/users/resources/rewards/types/index.d.ts +2 -0
  30. package/dist/cjs/api/resources/users/resources/rewards/types/index.js +2 -0
  31. package/dist/cjs/version.d.ts +1 -1
  32. package/dist/cjs/version.js +1 -1
  33. package/dist/esm/BaseClient.mjs +2 -2
  34. package/dist/esm/api/resources/users/resources/attributions/client/Client.d.mts +25 -0
  35. package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +67 -0
  36. package/dist/esm/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponse.d.mts +23 -0
  37. package/dist/esm/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponse.mjs +2 -0
  38. package/dist/esm/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponseAttributes.d.mts +15 -0
  39. package/dist/esm/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponseAttributes.mjs +2 -0
  40. package/dist/esm/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponseData.d.mts +7 -0
  41. package/dist/esm/api/resources/users/resources/attributions/types/ActivatePlacementSlotResponseData.mjs +2 -0
  42. package/dist/esm/api/resources/users/resources/attributions/types/AttributionState.d.mts +4 -0
  43. package/dist/esm/api/resources/users/resources/attributions/types/CreateAttributionRequestUnion.d.mts +4 -1
  44. package/dist/esm/api/resources/users/resources/attributions/types/PlacementSlotAttributionAttributes.d.mts +19 -0
  45. package/dist/esm/api/resources/users/resources/attributions/types/PlacementSlotAttributionAttributes.mjs +2 -0
  46. package/dist/esm/api/resources/users/resources/attributions/types/PlacementSlotAttributionRequest.d.mts +4 -0
  47. package/dist/esm/api/resources/users/resources/attributions/types/PlacementSlotAttributionRequest.mjs +2 -0
  48. package/dist/esm/api/resources/users/resources/attributions/types/PlacementSlotMedium.d.mts +5 -0
  49. package/dist/esm/api/resources/users/resources/attributions/types/PlacementSlotMedium.mjs +5 -0
  50. package/dist/esm/api/resources/users/resources/attributions/types/index.d.mts +6 -0
  51. package/dist/esm/api/resources/users/resources/attributions/types/index.mjs +6 -0
  52. package/dist/esm/api/resources/users/resources/rewards/client/Client.d.mts +27 -0
  53. package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +76 -0
  54. package/dist/esm/api/resources/users/resources/rewards/client/requests/GetBatchesByPlacementRequest.d.mts +9 -0
  55. package/dist/esm/api/resources/users/resources/rewards/client/requests/GetBatchesByPlacementRequest.mjs +2 -0
  56. package/dist/esm/api/resources/users/resources/rewards/client/requests/index.d.mts +1 -0
  57. package/dist/esm/api/resources/users/resources/rewards/types/BatchSlotData.d.mts +18 -0
  58. package/dist/esm/api/resources/users/resources/rewards/types/BatchSlotData.mjs +2 -0
  59. package/dist/esm/api/resources/users/resources/rewards/types/BatchesResponseObject.d.mts +7 -0
  60. package/dist/esm/api/resources/users/resources/rewards/types/BatchesResponseObject.mjs +2 -0
  61. package/dist/esm/api/resources/users/resources/rewards/types/index.d.mts +2 -0
  62. package/dist/esm/api/resources/users/resources/rewards/types/index.mjs +2 -0
  63. package/dist/esm/version.d.mts +1 -1
  64. package/dist/esm/version.mjs +1 -1
  65. package/package.json +1 -1
  66. package/reference.md +189 -0
@@ -0,0 +1,23 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ /**
3
+ * Ack payload for a slot activation request.
4
+ *
5
+ * @example
6
+ * {
7
+ * data: {
8
+ * type: "placementSlotAttribution",
9
+ * id: "c94a93a7-beb9-4e58-960c-2c812f849398",
10
+ * attributes: {
11
+ * placementId: "018f8d6b-1abc-7def-9012-345678901234",
12
+ * slotId: "slot-a",
13
+ * eventCode: "ACTIVATE",
14
+ * medium: "CTA",
15
+ * eventDate: "2025-01-01T00:00:00Z",
16
+ * offerIds: ["offer-1", "offer-2", "offer-3"]
17
+ * }
18
+ * }
19
+ * }
20
+ */
21
+ export interface ActivatePlacementSlotResponse {
22
+ data: KardApi.users.ActivatePlacementSlotResponseData;
23
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,15 @@
1
+ export interface ActivatePlacementSlotResponseAttributes {
2
+ /** Unique identifier of the placement */
3
+ placementId: string;
4
+ /** Stable identifier for the slot within the placement */
5
+ slotId: string;
6
+ eventCode: string;
7
+ medium: string;
8
+ eventDate: string;
9
+ /**
10
+ * All offer IDs that resolved under the slot's content strategy and had
11
+ * per-offer `offerAttribution` ACTIVATE events written. The partner can use
12
+ * this to render the batch immediately without an extra round-trip.
13
+ */
14
+ offerIds: string[];
15
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ export interface ActivatePlacementSlotResponseData {
3
+ type: string;
4
+ /** The slot-level attribution event id */
5
+ id: string;
6
+ attributes: KardApi.users.ActivatePlacementSlotResponseAttributes;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -4,4 +4,8 @@ export interface AttributionState {
4
4
  rank?: number | undefined;
5
5
  /** The active filters when the user saw the offer */
6
6
  filters?: KardApi.users.AttributionFilter[] | undefined;
7
+ /** Unique identifier of the placement the attribution event originated from */
8
+ placementId?: string | undefined;
9
+ /** Stable identifier for the slot within the placement */
10
+ slotId?: string | undefined;
7
11
  }
@@ -1,5 +1,5 @@
1
1
  import type * as KardApi from "../../../../../index.mjs";
2
- export type CreateAttributionRequestUnion = KardApi.users.CreateAttributionRequestUnion.OfferAttribution | KardApi.users.CreateAttributionRequestUnion.NotificationAttribution;
2
+ export type CreateAttributionRequestUnion = KardApi.users.CreateAttributionRequestUnion.OfferAttribution | KardApi.users.CreateAttributionRequestUnion.NotificationAttribution | KardApi.users.CreateAttributionRequestUnion.PlacementSlotAttribution;
3
3
  export declare namespace CreateAttributionRequestUnion {
4
4
  interface OfferAttribution extends KardApi.users.OfferAttributionRequest {
5
5
  type: "offerAttribution";
@@ -7,4 +7,7 @@ export declare namespace CreateAttributionRequestUnion {
7
7
  interface NotificationAttribution extends KardApi.users.NotificationAttributionRequest {
8
8
  type: "notificationAttribution";
9
9
  }
10
+ interface PlacementSlotAttribution extends KardApi.users.PlacementSlotAttributionRequest {
11
+ type: "placementSlotAttribution";
12
+ }
10
13
  }
@@ -0,0 +1,19 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ /**
3
+ * Attributes for a slot-level activation event on a batch-activation placement.
4
+ * A slot activation also writes per-offer `offerAttribution` ACTIVATE events for
5
+ * every offer resolved by the slot's content strategy (see `ActivatePlacementSlot`).
6
+ */
7
+ export interface PlacementSlotAttributionAttributes {
8
+ /** The slot ID (matches `state.slotId`) */
9
+ entityId: string;
10
+ eventCode: KardApi.users.EventCode;
11
+ medium: KardApi.users.PlacementSlotMedium;
12
+ /**
13
+ * The timestamp of the attribution event.
14
+ * Must be in ISO 8601 format (e.g., "2025-01-01T00:00:00Z").
15
+ */
16
+ eventDate: string;
17
+ /** Placement context for the attribution event */
18
+ state?: KardApi.users.AttributionState | undefined;
19
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ export interface PlacementSlotAttributionRequest {
3
+ attributes: KardApi.users.PlacementSlotAttributionAttributes;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ /** Where the placement-slot attribution event is taking place in your rewards experience. */
2
+ export declare const PlacementSlotMedium: {
3
+ readonly Cta: "CTA";
4
+ };
5
+ export type PlacementSlotMedium = (typeof PlacementSlotMedium)[keyof typeof PlacementSlotMedium];
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /** Where the placement-slot attribution event is taking place in your rewards experience. */
3
+ export const PlacementSlotMedium = {
4
+ Cta: "CTA",
5
+ };
@@ -3,6 +3,9 @@ export * from "./ActivateOfferIncludeOption.mjs";
3
3
  export * from "./ActivateOfferResponse.mjs";
4
4
  export * from "./ActivateOfferResponseAttributes.mjs";
5
5
  export * from "./ActivateOfferResponseData.mjs";
6
+ export * from "./ActivatePlacementSlotResponse.mjs";
7
+ export * from "./ActivatePlacementSlotResponseAttributes.mjs";
8
+ export * from "./ActivatePlacementSlotResponseData.mjs";
6
9
  export * from "./AttributionFilter.mjs";
7
10
  export * from "./AttributionState.mjs";
8
11
  export * from "./BoostOfferIncluded.mjs";
@@ -20,3 +23,6 @@ export * from "./NotificationMedium.mjs";
20
23
  export * from "./OfferAttributionAttributes.mjs";
21
24
  export * from "./OfferAttributionRequest.mjs";
22
25
  export * from "./OfferMedium.mjs";
26
+ export * from "./PlacementSlotAttributionAttributes.mjs";
27
+ export * from "./PlacementSlotAttributionRequest.mjs";
28
+ export * from "./PlacementSlotMedium.mjs";
@@ -3,6 +3,9 @@ export * from "./ActivateOfferIncludeOption.mjs";
3
3
  export * from "./ActivateOfferResponse.mjs";
4
4
  export * from "./ActivateOfferResponseAttributes.mjs";
5
5
  export * from "./ActivateOfferResponseData.mjs";
6
+ export * from "./ActivatePlacementSlotResponse.mjs";
7
+ export * from "./ActivatePlacementSlotResponseAttributes.mjs";
8
+ export * from "./ActivatePlacementSlotResponseData.mjs";
6
9
  export * from "./AttributionFilter.mjs";
7
10
  export * from "./AttributionState.mjs";
8
11
  export * from "./BoostOfferIncluded.mjs";
@@ -20,3 +23,6 @@ export * from "./NotificationMedium.mjs";
20
23
  export * from "./OfferAttributionAttributes.mjs";
21
24
  export * from "./OfferAttributionRequest.mjs";
22
25
  export * from "./OfferMedium.mjs";
26
+ export * from "./PlacementSlotAttributionAttributes.mjs";
27
+ export * from "./PlacementSlotAttributionRequest.mjs";
28
+ export * from "./PlacementSlotMedium.mjs";
@@ -56,6 +56,33 @@ export declare class RewardsClient {
56
56
  */
57
57
  placementOffers(organizationId: KardApi.OrganizationId, userId: KardApi.UserId, placementId: string, request?: KardApi.users.GetOffersByPlacementRequest, requestOptions?: RewardsClient.RequestOptions): core.HttpResponsePromise<KardApi.users.OffersResponseObject>;
58
58
  private __placementOffers;
59
+ /**
60
+ * Retrieve batches for a batch-activation placement. Returns each slot in slot
61
+ * order with its current offer set, alias, and freshness fields (`isActive`,
62
+ * `lastActivatedAt`, `expiresAt`). Applies the same per-user eligibility and
63
+ * per-slot content-strategy filter as Get Offers By Placement, independently
64
+ * per slot. A slot only flips to `isActive: false` when its refresh interval
65
+ * has elapsed AND its post-eligibility `offers[]` is non-empty; otherwise the
66
+ * slot is still returned and stays active so the partner UI does not promote
67
+ * "refresh" with nothing to show.<br/>
68
+ * <b>Required scopes:</b> `rewards:read`
69
+ *
70
+ * @param {KardApi.OrganizationId} organizationId
71
+ * @param {KardApi.UserId} userId
72
+ * @param {string} placementId
73
+ * @param {KardApi.users.GetBatchesByPlacementRequest} request
74
+ * @param {RewardsClient.RequestOptions} requestOptions - Request-specific configuration.
75
+ *
76
+ * @throws {@link KardApi.InternalServerError}
77
+ * @throws {@link KardApi.InvalidRequest}
78
+ * @throws {@link KardApi.DoesNotExistError}
79
+ * @throws {@link KardApi.UnauthorizedError}
80
+ *
81
+ * @example
82
+ * await client.users.rewards.placementBatches("organizationId", "userId", "placementId")
83
+ */
84
+ placementBatches(organizationId: KardApi.OrganizationId, userId: KardApi.UserId, placementId: string, request?: KardApi.users.GetBatchesByPlacementRequest, requestOptions?: RewardsClient.RequestOptions): core.HttpResponsePromise<KardApi.users.BatchesResponseObject>;
85
+ private __placementBatches;
59
86
  /**
60
87
  * Retrieve national and local geographic locations that a specified user has eligible in-store offers at. Use this endpoint to build
61
88
  * out your [map-specific UX experiences](/2024-10-01/api/getting-started#c-discover-clos-near-you-map-view). Please note
@@ -178,6 +178,82 @@ export class RewardsClient {
178
178
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/users/{userId}/placements/{placementId}/offers");
179
179
  });
180
180
  }
181
+ /**
182
+ * Retrieve batches for a batch-activation placement. Returns each slot in slot
183
+ * order with its current offer set, alias, and freshness fields (`isActive`,
184
+ * `lastActivatedAt`, `expiresAt`). Applies the same per-user eligibility and
185
+ * per-slot content-strategy filter as Get Offers By Placement, independently
186
+ * per slot. A slot only flips to `isActive: false` when its refresh interval
187
+ * has elapsed AND its post-eligibility `offers[]` is non-empty; otherwise the
188
+ * slot is still returned and stays active so the partner UI does not promote
189
+ * "refresh" with nothing to show.<br/>
190
+ * <b>Required scopes:</b> `rewards:read`
191
+ *
192
+ * @param {KardApi.OrganizationId} organizationId
193
+ * @param {KardApi.UserId} userId
194
+ * @param {string} placementId
195
+ * @param {KardApi.users.GetBatchesByPlacementRequest} request
196
+ * @param {RewardsClient.RequestOptions} requestOptions - Request-specific configuration.
197
+ *
198
+ * @throws {@link KardApi.InternalServerError}
199
+ * @throws {@link KardApi.InvalidRequest}
200
+ * @throws {@link KardApi.DoesNotExistError}
201
+ * @throws {@link KardApi.UnauthorizedError}
202
+ *
203
+ * @example
204
+ * await client.users.rewards.placementBatches("organizationId", "userId", "placementId")
205
+ */
206
+ placementBatches(organizationId, userId, placementId, request = {}, requestOptions) {
207
+ return core.HttpResponsePromise.fromPromise(this.__placementBatches(organizationId, userId, placementId, request, requestOptions));
208
+ }
209
+ __placementBatches(organizationId_1, userId_1, placementId_1) {
210
+ return __awaiter(this, arguments, void 0, function* (organizationId, userId, placementId, request = {}, requestOptions) {
211
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
212
+ const { supportedComponents } = request;
213
+ const _queryParams = {
214
+ supportedComponents: Array.isArray(supportedComponents)
215
+ ? supportedComponents.map((item) => item)
216
+ : supportedComponents != null
217
+ ? supportedComponents
218
+ : undefined,
219
+ };
220
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
221
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
222
+ const _response = yield core.fetcher({
223
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/placements/${core.url.encodePathParam(placementId)}/batches`),
224
+ method: "GET",
225
+ headers: _headers,
226
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
227
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
228
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
229
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
230
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
231
+ logging: this._options.logging,
232
+ });
233
+ if (_response.ok) {
234
+ return { data: _response.body, rawResponse: _response.rawResponse };
235
+ }
236
+ if (_response.error.reason === "status-code") {
237
+ switch (_response.error.statusCode) {
238
+ case 500:
239
+ throw new KardApi.InternalServerError(_response.error.body, _response.rawResponse);
240
+ case 400:
241
+ throw new KardApi.InvalidRequest(_response.error.body, _response.rawResponse);
242
+ case 404:
243
+ throw new KardApi.DoesNotExistError(_response.error.body, _response.rawResponse);
244
+ case 401:
245
+ throw new KardApi.UnauthorizedError(_response.error.body, _response.rawResponse);
246
+ default:
247
+ throw new errors.KardApiError({
248
+ statusCode: _response.error.statusCode,
249
+ body: _response.error.body,
250
+ rawResponse: _response.rawResponse,
251
+ });
252
+ }
253
+ }
254
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v2/issuers/{organizationId}/users/{userId}/placements/{placementId}/batches");
255
+ });
256
+ }
181
257
  /**
182
258
  * Retrieve national and local geographic locations that a specified user has eligible in-store offers at. Use this endpoint to build
183
259
  * out your [map-specific UX experiences](/2024-10-01/api/getting-started#c-discover-clos-near-you-map-view). Please note
@@ -0,0 +1,9 @@
1
+ import type * as KardApi from "../../../../../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface GetBatchesByPlacementRequest {
7
+ /** UI component types to include in the response. */
8
+ supportedComponents?: KardApi.users.ComponentType | KardApi.users.ComponentType[];
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,3 +1,4 @@
1
+ export type { GetBatchesByPlacementRequest } from "./GetBatchesByPlacementRequest.mjs";
1
2
  export type { GetLocationsByUserRequest } from "./GetLocationsByUserRequest.mjs";
2
3
  export type { GetOffersByPlacementRequest } from "./GetOffersByPlacementRequest.mjs";
3
4
  export type { GetOffersByUserRequest } from "./GetOffersByUserRequest.mjs";
@@ -0,0 +1,18 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ /**
3
+ * One slot in a batch-activation placement, with freshness fields and the offers that resolve under the slot's content strategy.
4
+ */
5
+ export interface BatchSlotData {
6
+ /** Stable identifier for the slot within the placement */
7
+ slotId: string;
8
+ /** Customer-defined alias for the slot, unique within the placement */
9
+ alias: string;
10
+ /** Whether the slot is still considered "fresh" for the user. Set to false only when the slot's `expiresAt` is in the past AND the slot resolves to a non-empty offer set; an empty offer set keeps the slot active so partner UIs do not promote "tap to refresh" with nothing to show. */
11
+ isActive: boolean;
12
+ /** Timestamp of the most recent placementSlotAttribution ACTIVATE event for this (user, placement, slot). Absent for cold slots that have never been activated. */
13
+ lastActivatedAt?: string | undefined;
14
+ /** Computed as `lastActivatedAt + placement.refreshInterval`. Absent for cold slots that have never been activated. */
15
+ expiresAt?: string | undefined;
16
+ /** The set of offers eligible for the user under this slot's content strategy. */
17
+ offers: KardApi.users.OfferDataUnion[];
18
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ import type * as KardApi from "../../../../../index.mjs";
2
+ /**
3
+ * Ordered list of slots for a batch-activation placement, with freshness fields and per-slot offer sets.
4
+ */
5
+ export interface BatchesResponseObject {
6
+ data: KardApi.users.BatchSlotData[];
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,6 +1,8 @@
1
1
  export * from "./Amount.mjs";
2
2
  export * from "./AmountType.mjs";
3
3
  export * from "./Asset.mjs";
4
+ export * from "./BatchesResponseObject.mjs";
5
+ export * from "./BatchSlotData.mjs";
4
6
  export * from "./ButtonStyle.mjs";
5
7
  export * from "./CategoryData.mjs";
6
8
  export * from "./CategoryFields.mjs";
@@ -1,6 +1,8 @@
1
1
  export * from "./Amount.mjs";
2
2
  export * from "./AmountType.mjs";
3
3
  export * from "./Asset.mjs";
4
+ export * from "./BatchesResponseObject.mjs";
5
+ export * from "./BatchSlotData.mjs";
4
6
  export * from "./ButtonStyle.mjs";
5
7
  export * from "./CategoryData.mjs";
6
8
  export * from "./CategoryFields.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "22.2.0";
1
+ export declare const SDK_VERSION = "22.4.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "22.2.0";
1
+ export const SDK_VERSION = "22.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kard-financial/sdk",
3
- "version": "22.2.0",
3
+ "version": "22.4.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -2717,6 +2717,100 @@ await client.users.attributions.boost("organization-123", "user-123", "offer-456
2717
2717
  </dl>
2718
2718
 
2719
2719
 
2720
+ </dd>
2721
+ </dl>
2722
+ </details>
2723
+
2724
+ <details><summary><code>client.users.attributions.<a href="/src/api/resources/users/resources/attributions/client/Client.ts">activatePlacementSlot</a>(organizationId, userId, placementId, slotId) -> KardApi.ActivatePlacementSlotResponse</code></summary>
2725
+ <dl>
2726
+ <dd>
2727
+
2728
+ #### 📝 Description
2729
+
2730
+ <dl>
2731
+ <dd>
2732
+
2733
+ <dl>
2734
+ <dd>
2735
+
2736
+ Record when a user activates a batch-activation placement slot. Writes a slot-level
2737
+ `placementSlotAttribution` ACTIVATE event and fans out a per-offer
2738
+ `offerAttribution` ACTIVATE event for every offer resolved by the slot's content
2739
+ strategy. The slot-level event id and the resolved `offerIds` are returned so the
2740
+ partner can render the batch immediately without an extra `getBatchesByPlacement`
2741
+ round-trip.
2742
+
2743
+ <b>Required scopes:</b> `attributions:write`
2744
+ </dd>
2745
+ </dl>
2746
+ </dd>
2747
+ </dl>
2748
+
2749
+ #### 🔌 Usage
2750
+
2751
+ <dl>
2752
+ <dd>
2753
+
2754
+ <dl>
2755
+ <dd>
2756
+
2757
+ ```typescript
2758
+ await client.users.attributions.activatePlacementSlot("organization-123", "user-123", "018f8d6b-1abc-7def-9012-345678901234", "slot-a");
2759
+
2760
+ ```
2761
+ </dd>
2762
+ </dl>
2763
+ </dd>
2764
+ </dl>
2765
+
2766
+ #### ⚙️ Parameters
2767
+
2768
+ <dl>
2769
+ <dd>
2770
+
2771
+ <dl>
2772
+ <dd>
2773
+
2774
+ **organizationId:** `KardApi.OrganizationId`
2775
+
2776
+ </dd>
2777
+ </dl>
2778
+
2779
+ <dl>
2780
+ <dd>
2781
+
2782
+ **userId:** `KardApi.UserId`
2783
+
2784
+ </dd>
2785
+ </dl>
2786
+
2787
+ <dl>
2788
+ <dd>
2789
+
2790
+ **placementId:** `string` — Unique identifier of the placement (UUID v7)
2791
+
2792
+ </dd>
2793
+ </dl>
2794
+
2795
+ <dl>
2796
+ <dd>
2797
+
2798
+ **slotId:** `string` — Stable identifier for the slot within the placement
2799
+
2800
+ </dd>
2801
+ </dl>
2802
+
2803
+ <dl>
2804
+ <dd>
2805
+
2806
+ **requestOptions:** `AttributionsClient.RequestOptions`
2807
+
2808
+ </dd>
2809
+ </dl>
2810
+ </dd>
2811
+ </dl>
2812
+
2813
+
2720
2814
  </dd>
2721
2815
  </dl>
2722
2816
  </details>
@@ -2965,6 +3059,101 @@ await client.users.rewards.placementOffers("organizationId", "userId", "placemen
2965
3059
  </dl>
2966
3060
 
2967
3061
 
3062
+ </dd>
3063
+ </dl>
3064
+ </details>
3065
+
3066
+ <details><summary><code>client.users.rewards.<a href="/src/api/resources/users/resources/rewards/client/Client.ts">placementBatches</a>(organizationId, userId, placementId, { ...params }) -> KardApi.BatchesResponseObject</code></summary>
3067
+ <dl>
3068
+ <dd>
3069
+
3070
+ #### 📝 Description
3071
+
3072
+ <dl>
3073
+ <dd>
3074
+
3075
+ <dl>
3076
+ <dd>
3077
+
3078
+ Retrieve batches for a batch-activation placement. Returns each slot in slot
3079
+ order with its current offer set, alias, and freshness fields (`isActive`,
3080
+ `lastActivatedAt`, `expiresAt`). Applies the same per-user eligibility and
3081
+ per-slot content-strategy filter as Get Offers By Placement, independently
3082
+ per slot. A slot only flips to `isActive: false` when its refresh interval
3083
+ has elapsed AND its post-eligibility `offers[]` is non-empty; otherwise the
3084
+ slot is still returned and stays active so the partner UI does not promote
3085
+ "refresh" with nothing to show.<br/>
3086
+ <b>Required scopes:</b> `rewards:read`
3087
+ </dd>
3088
+ </dl>
3089
+ </dd>
3090
+ </dl>
3091
+
3092
+ #### 🔌 Usage
3093
+
3094
+ <dl>
3095
+ <dd>
3096
+
3097
+ <dl>
3098
+ <dd>
3099
+
3100
+ ```typescript
3101
+ await client.users.rewards.placementBatches("organizationId", "userId", "placementId");
3102
+
3103
+ ```
3104
+ </dd>
3105
+ </dl>
3106
+ </dd>
3107
+ </dl>
3108
+
3109
+ #### ⚙️ Parameters
3110
+
3111
+ <dl>
3112
+ <dd>
3113
+
3114
+ <dl>
3115
+ <dd>
3116
+
3117
+ **organizationId:** `KardApi.OrganizationId`
3118
+
3119
+ </dd>
3120
+ </dl>
3121
+
3122
+ <dl>
3123
+ <dd>
3124
+
3125
+ **userId:** `KardApi.UserId`
3126
+
3127
+ </dd>
3128
+ </dl>
3129
+
3130
+ <dl>
3131
+ <dd>
3132
+
3133
+ **placementId:** `string`
3134
+
3135
+ </dd>
3136
+ </dl>
3137
+
3138
+ <dl>
3139
+ <dd>
3140
+
3141
+ **request:** `KardApi.users.GetBatchesByPlacementRequest`
3142
+
3143
+ </dd>
3144
+ </dl>
3145
+
3146
+ <dl>
3147
+ <dd>
3148
+
3149
+ **requestOptions:** `RewardsClient.RequestOptions`
3150
+
3151
+ </dd>
3152
+ </dl>
3153
+ </dd>
3154
+ </dl>
3155
+
3156
+
2968
3157
  </dd>
2969
3158
  </dl>
2970
3159
  </details>