@kard-financial/sdk 22.1.0 → 22.3.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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/organizations/resources/placements/types/BatchActivationPlacementAttributes.d.ts +14 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/BatchActivationPlacementAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/BatchActivationPlacementData.d.ts +9 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/BatchActivationPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/BatchActivationSlot.d.ts +11 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/BatchActivationSlot.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateBatchActivationAttributes.d.ts +22 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateBatchActivationAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateBatchActivationPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateBatchActivationPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateBatchActivationSlot.d.ts +9 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateBatchActivationSlot.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePlacementDataUnion.d.ts +4 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementFormatUnion.d.ts +20 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementTypeFilter.d.ts +1 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementTypeFilter.js +1 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateBatchActivationAttributes.d.ts +23 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateBatchActivationAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateBatchActivationPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateBatchActivationPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateBatchActivationSlot.d.ts +11 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateBatchActivationSlot.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePlacementDataUnion.d.ts +4 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/index.d.ts +9 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/index.js +9 -0
- package/dist/cjs/api/resources/users/resources/rewards/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +76 -0
- package/dist/cjs/api/resources/users/resources/rewards/client/requests/GetBatchesByPlacementRequest.d.ts +9 -0
- package/dist/cjs/api/resources/users/resources/rewards/client/requests/GetBatchesByPlacementRequest.js +3 -0
- package/dist/cjs/api/resources/users/resources/rewards/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/BatchSlotData.d.ts +18 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/BatchSlotData.js +3 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/BatchesResponseObject.d.ts +7 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/BatchesResponseObject.js +3 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/rewards/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/organizations/resources/placements/types/BatchActivationPlacementAttributes.d.mts +14 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/BatchActivationPlacementAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/BatchActivationPlacementData.d.mts +9 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/BatchActivationPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/BatchActivationSlot.d.mts +11 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/BatchActivationSlot.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateBatchActivationAttributes.d.mts +22 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateBatchActivationAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateBatchActivationPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateBatchActivationPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateBatchActivationSlot.d.mts +9 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateBatchActivationSlot.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePlacementDataUnion.d.mts +4 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementFormatUnion.d.mts +20 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementTypeFilter.d.mts +1 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementTypeFilter.mjs +1 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateBatchActivationAttributes.d.mts +23 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateBatchActivationAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateBatchActivationPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateBatchActivationPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateBatchActivationSlot.d.mts +11 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateBatchActivationSlot.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePlacementDataUnion.d.mts +4 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/index.d.mts +9 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/index.mjs +9 -0
- package/dist/esm/api/resources/users/resources/rewards/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +76 -0
- package/dist/esm/api/resources/users/resources/rewards/client/requests/GetBatchesByPlacementRequest.d.mts +9 -0
- package/dist/esm/api/resources/users/resources/rewards/client/requests/GetBatchesByPlacementRequest.mjs +2 -0
- package/dist/esm/api/resources/users/resources/rewards/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/users/resources/rewards/types/BatchSlotData.d.mts +18 -0
- package/dist/esm/api/resources/users/resources/rewards/types/BatchSlotData.mjs +2 -0
- package/dist/esm/api/resources/users/resources/rewards/types/BatchesResponseObject.d.mts +7 -0
- package/dist/esm/api/resources/users/resources/rewards/types/BatchesResponseObject.mjs +2 -0
- package/dist/esm/api/resources/users/resources/rewards/types/index.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/rewards/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +95 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Data for creating a batch-activation placement
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateBatchActivationPlacementData {
|
|
6
|
+
/** Batch-activation placement attributes for creation */
|
|
7
|
+
attributes: KardApi.organizations.CreateBatchActivationAttributes;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A slot in a batch-activation placement at creation time
|
|
3
|
+
*/
|
|
4
|
+
export interface CreateBatchActivationSlot {
|
|
5
|
+
/** ID of the content strategy that fills this slot */
|
|
6
|
+
contentStrategyId: string;
|
|
7
|
+
/** Customer-defined alias for the slot, unique within the placement */
|
|
8
|
+
alias: string;
|
|
9
|
+
}
|
|
@@ -2,7 +2,7 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* Discriminated union for creating a placement
|
|
4
4
|
*/
|
|
5
|
-
export type CreatePlacementDataUnion = KardApi.organizations.CreatePlacementDataUnion.PlacementMainPage | KardApi.organizations.CreatePlacementDataUnion.PlacementPushNotification;
|
|
5
|
+
export type CreatePlacementDataUnion = KardApi.organizations.CreatePlacementDataUnion.PlacementMainPage | KardApi.organizations.CreatePlacementDataUnion.PlacementPushNotification | KardApi.organizations.CreatePlacementDataUnion.PlacementBatchActivation;
|
|
6
6
|
export declare namespace CreatePlacementDataUnion {
|
|
7
7
|
interface PlacementMainPage extends KardApi.organizations.CreateMainPagePlacementData {
|
|
8
8
|
type: "placementMainPage";
|
|
@@ -10,4 +10,7 @@ export declare namespace CreatePlacementDataUnion {
|
|
|
10
10
|
interface PlacementPushNotification extends KardApi.organizations.CreatePushNotificationPlacementData {
|
|
11
11
|
type: "placementPushNotification";
|
|
12
12
|
}
|
|
13
|
+
interface PlacementBatchActivation extends KardApi.organizations.CreateBatchActivationPlacementData {
|
|
14
|
+
type: "placementBatchActivation";
|
|
15
|
+
}
|
|
13
16
|
}
|
package/dist/esm/api/resources/organizations/resources/placements/types/PlacementFormatUnion.d.mts
CHANGED
|
@@ -26,8 +26,24 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
26
26
|
* }
|
|
27
27
|
* }
|
|
28
28
|
* }
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* {
|
|
32
|
+
* type: "placementBatchActivation",
|
|
33
|
+
* id: "01961e5a-d94e-7c22-ac3f-f8b5a7e92c45",
|
|
34
|
+
* attributes: {
|
|
35
|
+
* name: "Weekly Cohort",
|
|
36
|
+
* organizationId: "org-123",
|
|
37
|
+
* refreshInterval: "P7D",
|
|
38
|
+
* slots: [{
|
|
39
|
+
* slotId: "01961e5a-e15f-7d33-bd4f-09c6b8fa3d56",
|
|
40
|
+
* contentStrategyId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
41
|
+
* alias: "primary"
|
|
42
|
+
* }]
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
29
45
|
*/
|
|
30
|
-
export type PlacementFormatUnion = KardApi.organizations.PlacementFormatUnion.PlacementMainPage | KardApi.organizations.PlacementFormatUnion.PlacementPushNotification;
|
|
46
|
+
export type PlacementFormatUnion = KardApi.organizations.PlacementFormatUnion.PlacementMainPage | KardApi.organizations.PlacementFormatUnion.PlacementPushNotification | KardApi.organizations.PlacementFormatUnion.PlacementBatchActivation;
|
|
31
47
|
export declare namespace PlacementFormatUnion {
|
|
32
48
|
interface PlacementMainPage extends KardApi.organizations.MainPagePlacementData {
|
|
33
49
|
type: "placementMainPage";
|
|
@@ -35,4 +51,7 @@ export declare namespace PlacementFormatUnion {
|
|
|
35
51
|
interface PlacementPushNotification extends KardApi.organizations.PushNotificationPlacementData {
|
|
36
52
|
type: "placementPushNotification";
|
|
37
53
|
}
|
|
54
|
+
interface PlacementBatchActivation extends KardApi.organizations.BatchActivationPlacementData {
|
|
55
|
+
type: "placementBatchActivation";
|
|
56
|
+
}
|
|
38
57
|
}
|
package/dist/esm/api/resources/organizations/resources/placements/types/PlacementTypeFilter.d.mts
CHANGED
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
export declare const PlacementTypeFilter: {
|
|
3
3
|
readonly PlacementMainPage: "placementMainPage";
|
|
4
4
|
readonly PlacementPushNotification: "placementPushNotification";
|
|
5
|
+
readonly PlacementBatchActivation: "placementBatchActivation";
|
|
5
6
|
};
|
|
6
7
|
export type PlacementTypeFilter = (typeof PlacementTypeFilter)[keyof typeof PlacementTypeFilter];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Attributes for updating a batch-activation placement. All fields are required.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* name: "Updated Cohort",
|
|
8
|
+
* refreshInterval: "P14D",
|
|
9
|
+
* slots: [{
|
|
10
|
+
* slotId: "01961e5a-e15f-7d33-bd4f-09c6b8fa3d56",
|
|
11
|
+
* contentStrategyId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
12
|
+
* alias: "primary"
|
|
13
|
+
* }]
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
export interface UpdateBatchActivationAttributes {
|
|
17
|
+
/** Name of the placement */
|
|
18
|
+
name: string;
|
|
19
|
+
/** ISO-8601 duration controlling how often the activation cohort refreshes */
|
|
20
|
+
refreshInterval: string;
|
|
21
|
+
/** Slots that make up the activation cohort. Slots present in the prior state but absent from this list are removed. */
|
|
22
|
+
slots: KardApi.organizations.UpdateBatchActivationSlot[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Data for updating a batch-activation placement
|
|
4
|
+
*/
|
|
5
|
+
export interface UpdateBatchActivationPlacementData {
|
|
6
|
+
/** Batch-activation placement attributes for update */
|
|
7
|
+
attributes: KardApi.organizations.UpdateBatchActivationAttributes;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A slot in a batch-activation placement at update time
|
|
3
|
+
*/
|
|
4
|
+
export interface UpdateBatchActivationSlot {
|
|
5
|
+
/** Existing slot identifier. Echo the value from a prior GET to keep the slot stable; omit to mint a fresh slot. If the contentStrategyId changes, the slotId is regenerated regardless of what was echoed. */
|
|
6
|
+
slotId?: string | undefined;
|
|
7
|
+
/** ID of the content strategy that fills this slot */
|
|
8
|
+
contentStrategyId: string;
|
|
9
|
+
/** Customer-defined alias for the slot, unique within the placement */
|
|
10
|
+
alias: string;
|
|
11
|
+
}
|
|
@@ -2,7 +2,7 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
2
2
|
/**
|
|
3
3
|
* Discriminated union for updating a placement
|
|
4
4
|
*/
|
|
5
|
-
export type UpdatePlacementDataUnion = KardApi.organizations.UpdatePlacementDataUnion.PlacementMainPage | KardApi.organizations.UpdatePlacementDataUnion.PlacementPushNotification;
|
|
5
|
+
export type UpdatePlacementDataUnion = KardApi.organizations.UpdatePlacementDataUnion.PlacementMainPage | KardApi.organizations.UpdatePlacementDataUnion.PlacementPushNotification | KardApi.organizations.UpdatePlacementDataUnion.PlacementBatchActivation;
|
|
6
6
|
export declare namespace UpdatePlacementDataUnion {
|
|
7
7
|
interface PlacementMainPage extends KardApi.organizations.UpdateMainPagePlacementData {
|
|
8
8
|
type: "placementMainPage";
|
|
@@ -10,4 +10,7 @@ export declare namespace UpdatePlacementDataUnion {
|
|
|
10
10
|
interface PlacementPushNotification extends KardApi.organizations.UpdatePushNotificationPlacementData {
|
|
11
11
|
type: "placementPushNotification";
|
|
12
12
|
}
|
|
13
|
+
interface PlacementBatchActivation extends KardApi.organizations.UpdateBatchActivationPlacementData {
|
|
14
|
+
type: "placementBatchActivation";
|
|
15
|
+
}
|
|
13
16
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
export * from "./BatchActivationPlacementAttributes.mjs";
|
|
2
|
+
export * from "./BatchActivationPlacementData.mjs";
|
|
3
|
+
export * from "./BatchActivationSlot.mjs";
|
|
1
4
|
export * from "./Cadence.mjs";
|
|
2
5
|
export * from "./CadenceFrequency.mjs";
|
|
6
|
+
export * from "./CreateBatchActivationAttributes.mjs";
|
|
7
|
+
export * from "./CreateBatchActivationPlacementData.mjs";
|
|
8
|
+
export * from "./CreateBatchActivationSlot.mjs";
|
|
3
9
|
export * from "./CreateMainPageAttributes.mjs";
|
|
4
10
|
export * from "./CreateMainPagePlacementData.mjs";
|
|
5
11
|
export * from "./CreatePlacementDataUnion.mjs";
|
|
@@ -15,6 +21,9 @@ export * from "./PlacementResource.mjs";
|
|
|
15
21
|
export * from "./PlacementTypeFilter.mjs";
|
|
16
22
|
export * from "./PushNotificationPlacementAttributes.mjs";
|
|
17
23
|
export * from "./PushNotificationPlacementData.mjs";
|
|
24
|
+
export * from "./UpdateBatchActivationAttributes.mjs";
|
|
25
|
+
export * from "./UpdateBatchActivationPlacementData.mjs";
|
|
26
|
+
export * from "./UpdateBatchActivationSlot.mjs";
|
|
18
27
|
export * from "./UpdateMainPageAttributes.mjs";
|
|
19
28
|
export * from "./UpdateMainPagePlacementData.mjs";
|
|
20
29
|
export * from "./UpdatePlacementDataUnion.mjs";
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
export * from "./BatchActivationPlacementAttributes.mjs";
|
|
2
|
+
export * from "./BatchActivationPlacementData.mjs";
|
|
3
|
+
export * from "./BatchActivationSlot.mjs";
|
|
1
4
|
export * from "./Cadence.mjs";
|
|
2
5
|
export * from "./CadenceFrequency.mjs";
|
|
6
|
+
export * from "./CreateBatchActivationAttributes.mjs";
|
|
7
|
+
export * from "./CreateBatchActivationPlacementData.mjs";
|
|
8
|
+
export * from "./CreateBatchActivationSlot.mjs";
|
|
3
9
|
export * from "./CreateMainPageAttributes.mjs";
|
|
4
10
|
export * from "./CreateMainPagePlacementData.mjs";
|
|
5
11
|
export * from "./CreatePlacementDataUnion.mjs";
|
|
@@ -15,6 +21,9 @@ export * from "./PlacementResource.mjs";
|
|
|
15
21
|
export * from "./PlacementTypeFilter.mjs";
|
|
16
22
|
export * from "./PushNotificationPlacementAttributes.mjs";
|
|
17
23
|
export * from "./PushNotificationPlacementData.mjs";
|
|
24
|
+
export * from "./UpdateBatchActivationAttributes.mjs";
|
|
25
|
+
export * from "./UpdateBatchActivationPlacementData.mjs";
|
|
26
|
+
export * from "./UpdateBatchActivationSlot.mjs";
|
|
18
27
|
export * from "./UpdateMainPageAttributes.mjs";
|
|
19
28
|
export * from "./UpdateMainPagePlacementData.mjs";
|
|
20
29
|
export * from "./UpdatePlacementDataUnion.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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "22.
|
|
1
|
+
export declare const SDK_VERSION = "22.3.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "22.
|
|
1
|
+
export const SDK_VERSION = "22.3.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -2965,6 +2965,101 @@ await client.users.rewards.placementOffers("organizationId", "userId", "placemen
|
|
|
2965
2965
|
</dl>
|
|
2966
2966
|
|
|
2967
2967
|
|
|
2968
|
+
</dd>
|
|
2969
|
+
</dl>
|
|
2970
|
+
</details>
|
|
2971
|
+
|
|
2972
|
+
<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>
|
|
2973
|
+
<dl>
|
|
2974
|
+
<dd>
|
|
2975
|
+
|
|
2976
|
+
#### 📝 Description
|
|
2977
|
+
|
|
2978
|
+
<dl>
|
|
2979
|
+
<dd>
|
|
2980
|
+
|
|
2981
|
+
<dl>
|
|
2982
|
+
<dd>
|
|
2983
|
+
|
|
2984
|
+
Retrieve batches for a batch-activation placement. Returns each slot in slot
|
|
2985
|
+
order with its current offer set, alias, and freshness fields (`isActive`,
|
|
2986
|
+
`lastActivatedAt`, `expiresAt`). Applies the same per-user eligibility and
|
|
2987
|
+
per-slot content-strategy filter as Get Offers By Placement, independently
|
|
2988
|
+
per slot. A slot only flips to `isActive: false` when its refresh interval
|
|
2989
|
+
has elapsed AND its post-eligibility `offers[]` is non-empty; otherwise the
|
|
2990
|
+
slot is still returned and stays active so the partner UI does not promote
|
|
2991
|
+
"refresh" with nothing to show.<br/>
|
|
2992
|
+
<b>Required scopes:</b> `rewards:read`
|
|
2993
|
+
</dd>
|
|
2994
|
+
</dl>
|
|
2995
|
+
</dd>
|
|
2996
|
+
</dl>
|
|
2997
|
+
|
|
2998
|
+
#### 🔌 Usage
|
|
2999
|
+
|
|
3000
|
+
<dl>
|
|
3001
|
+
<dd>
|
|
3002
|
+
|
|
3003
|
+
<dl>
|
|
3004
|
+
<dd>
|
|
3005
|
+
|
|
3006
|
+
```typescript
|
|
3007
|
+
await client.users.rewards.placementBatches("organizationId", "userId", "placementId");
|
|
3008
|
+
|
|
3009
|
+
```
|
|
3010
|
+
</dd>
|
|
3011
|
+
</dl>
|
|
3012
|
+
</dd>
|
|
3013
|
+
</dl>
|
|
3014
|
+
|
|
3015
|
+
#### ⚙️ Parameters
|
|
3016
|
+
|
|
3017
|
+
<dl>
|
|
3018
|
+
<dd>
|
|
3019
|
+
|
|
3020
|
+
<dl>
|
|
3021
|
+
<dd>
|
|
3022
|
+
|
|
3023
|
+
**organizationId:** `KardApi.OrganizationId`
|
|
3024
|
+
|
|
3025
|
+
</dd>
|
|
3026
|
+
</dl>
|
|
3027
|
+
|
|
3028
|
+
<dl>
|
|
3029
|
+
<dd>
|
|
3030
|
+
|
|
3031
|
+
**userId:** `KardApi.UserId`
|
|
3032
|
+
|
|
3033
|
+
</dd>
|
|
3034
|
+
</dl>
|
|
3035
|
+
|
|
3036
|
+
<dl>
|
|
3037
|
+
<dd>
|
|
3038
|
+
|
|
3039
|
+
**placementId:** `string`
|
|
3040
|
+
|
|
3041
|
+
</dd>
|
|
3042
|
+
</dl>
|
|
3043
|
+
|
|
3044
|
+
<dl>
|
|
3045
|
+
<dd>
|
|
3046
|
+
|
|
3047
|
+
**request:** `KardApi.users.GetBatchesByPlacementRequest`
|
|
3048
|
+
|
|
3049
|
+
</dd>
|
|
3050
|
+
</dl>
|
|
3051
|
+
|
|
3052
|
+
<dl>
|
|
3053
|
+
<dd>
|
|
3054
|
+
|
|
3055
|
+
**requestOptions:** `RewardsClient.RequestOptions`
|
|
3056
|
+
|
|
3057
|
+
</dd>
|
|
3058
|
+
</dl>
|
|
3059
|
+
</dd>
|
|
3060
|
+
</dl>
|
|
3061
|
+
|
|
3062
|
+
|
|
2968
3063
|
</dd>
|
|
2969
3064
|
</dl>
|
|
2970
3065
|
</details>
|