@kard-financial/sdk 28.2.0 → 29.1.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/client/Client.d.ts +51 -4
- package/dist/cjs/api/resources/organizations/resources/placements/client/Client.js +51 -4
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/GetPlacementRequest.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/ListPlacementsRequest.d.ts +2 -2
- package/dist/cjs/api/resources/organizations/resources/placements/types/BatchActivationPlacementData.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/Cadence.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/CadenceFrequency.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/CadenceFrequency.js +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateBatchActivationSlot.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateEmailAttributes.d.ts +25 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateEmailPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateGroupAttributes.d.ts +20 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateGroupPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePlacementDataUnion.d.ts +9 -3
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreatePlacementRequestBody.d.ts +48 -1
- package/dist/{esm/api/resources/organizations/resources/placements/types/CreateMainPageAttributes.d.mts → cjs/api/resources/organizations/resources/placements/types/CreateStandardAttributes.d.ts} +2 -2
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateStandardPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/EmailPlacementAttributes.d.ts +16 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/{MainPagePlacementData.d.ts → EmailPlacementData.d.ts} +3 -3
- package/dist/cjs/api/resources/organizations/resources/placements/types/EmailPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/GroupPlacementAttributes.d.ts +9 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/GroupPlacementAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/GroupPlacementData.d.ts +11 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/GroupPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/IncludedResource.d.ts +6 -3
- package/dist/{esm/api/resources/organizations/resources/placements/types/MainPagePlacementAttributes.d.mts → cjs/api/resources/organizations/resources/placements/types/PlacementAttributes.d.ts} +2 -2
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementData.d.ts +11 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementFormatUnion.d.ts +44 -4
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementListResponse.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementResource.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementTypeFilter.d.ts +3 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementTypeFilter.js +3 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/SlottedPlacementRelationships.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/SlottedPlacementRelationships.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateBatchActivationSlot.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateEmailAttributes.d.ts +25 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateEmailAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateEmailPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateEmailPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateGroupAttributes.d.ts +21 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateGroupAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateGroupPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateGroupPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdatePlacementDataUnion.d.ts +9 -3
- package/dist/cjs/api/resources/organizations/resources/placements/types/{UpdateMainPageAttributes.d.ts → UpdateStandardAttributes.d.ts} +2 -2
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateStandardAttributes.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateStandardPlacementData.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateStandardPlacementData.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/index.d.ts +19 -7
- package/dist/cjs/api/resources/organizations/resources/placements/types/index.js +19 -7
- package/dist/cjs/api/resources/transactions/types/TransactionsAttributes.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/rewards/client/Client.d.ts +12 -8
- package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +12 -8
- package/dist/cjs/api/resources/users/resources/rewards/types/BatchesResponseObject.d.ts +1 -1
- package/dist/cjs/api/resources/users/resources/rewards/types/PlacementBatchAttributes.d.ts +2 -2
- package/dist/cjs/api/resources/users/resources/rewards/types/PlacementBatchData.d.ts +1 -1
- 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/client/Client.d.mts +51 -4
- package/dist/esm/api/resources/organizations/resources/placements/client/Client.mjs +51 -4
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/GetPlacementRequest.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/ListPlacementsRequest.d.mts +2 -2
- package/dist/esm/api/resources/organizations/resources/placements/types/BatchActivationPlacementData.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/Cadence.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/CadenceFrequency.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/CadenceFrequency.mjs +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateBatchActivationSlot.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateEmailAttributes.d.mts +25 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateEmailPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateGroupAttributes.d.mts +20 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateGroupPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePlacementDataUnion.d.mts +9 -3
- package/dist/esm/api/resources/organizations/resources/placements/types/CreatePlacementRequestBody.d.mts +48 -1
- package/dist/{cjs/api/resources/organizations/resources/placements/types/CreateMainPageAttributes.d.ts → esm/api/resources/organizations/resources/placements/types/CreateStandardAttributes.d.mts} +2 -2
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateStandardPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/EmailPlacementAttributes.d.mts +16 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/{MainPagePlacementData.d.mts → EmailPlacementData.d.mts} +3 -3
- package/dist/esm/api/resources/organizations/resources/placements/types/EmailPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/GroupPlacementAttributes.d.mts +9 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/GroupPlacementAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/GroupPlacementData.d.mts +11 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/GroupPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/IncludedResource.d.mts +6 -3
- package/dist/{cjs/api/resources/organizations/resources/placements/types/MainPagePlacementAttributes.d.ts → esm/api/resources/organizations/resources/placements/types/PlacementAttributes.d.mts} +2 -2
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementData.d.mts +11 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementFormatUnion.d.mts +44 -4
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementListResponse.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementResource.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementTypeFilter.d.mts +3 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementTypeFilter.mjs +3 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/SlottedPlacementRelationships.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/SlottedPlacementRelationships.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateBatchActivationSlot.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateEmailAttributes.d.mts +25 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateEmailAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateEmailPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateEmailPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateGroupAttributes.d.mts +21 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateGroupAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateGroupPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateGroupPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdatePlacementDataUnion.d.mts +9 -3
- package/dist/esm/api/resources/organizations/resources/placements/types/{UpdateMainPageAttributes.d.mts → UpdateStandardAttributes.d.mts} +2 -2
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateStandardAttributes.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateStandardPlacementData.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateStandardPlacementData.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/index.d.mts +19 -7
- package/dist/esm/api/resources/organizations/resources/placements/types/index.mjs +19 -7
- package/dist/esm/api/resources/transactions/types/TransactionsAttributes.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/rewards/client/Client.d.mts +12 -8
- package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +12 -8
- package/dist/esm/api/resources/users/resources/rewards/types/BatchesResponseObject.d.mts +1 -1
- package/dist/esm/api/resources/users/resources/rewards/types/PlacementBatchAttributes.d.mts +2 -2
- package/dist/esm/api/resources/users/resources/rewards/types/PlacementBatchData.d.mts +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +16 -12
- package/dist/cjs/api/resources/organizations/resources/placements/types/BatchActivationPlacementRelationships.d.ts +0 -8
- package/dist/cjs/api/resources/organizations/resources/placements/types/CreateMainPagePlacementData.d.ts +0 -8
- package/dist/cjs/api/resources/organizations/resources/placements/types/UpdateMainPagePlacementData.d.ts +0 -8
- package/dist/esm/api/resources/organizations/resources/placements/types/BatchActivationPlacementRelationships.d.mts +0 -8
- package/dist/esm/api/resources/organizations/resources/placements/types/CreateMainPagePlacementData.d.mts +0 -8
- package/dist/esm/api/resources/organizations/resources/placements/types/UpdateMainPagePlacementData.d.mts +0 -8
- /package/dist/cjs/api/resources/organizations/resources/placements/types/{BatchActivationPlacementRelationships.js → CreateEmailAttributes.js} +0 -0
- /package/dist/cjs/api/resources/organizations/resources/placements/types/{CreateMainPageAttributes.js → CreateEmailPlacementData.js} +0 -0
- /package/dist/cjs/api/resources/organizations/resources/placements/types/{CreateMainPagePlacementData.js → CreateGroupAttributes.js} +0 -0
- /package/dist/cjs/api/resources/organizations/resources/placements/types/{MainPagePlacementAttributes.js → CreateGroupPlacementData.js} +0 -0
- /package/dist/cjs/api/resources/organizations/resources/placements/types/{MainPagePlacementData.js → CreateStandardAttributes.js} +0 -0
- /package/dist/cjs/api/resources/organizations/resources/placements/types/{UpdateMainPageAttributes.js → CreateStandardPlacementData.js} +0 -0
- /package/dist/cjs/api/resources/organizations/resources/placements/types/{UpdateMainPagePlacementData.js → EmailPlacementAttributes.js} +0 -0
- /package/dist/esm/api/resources/organizations/resources/placements/types/{BatchActivationPlacementRelationships.mjs → CreateEmailAttributes.mjs} +0 -0
- /package/dist/esm/api/resources/organizations/resources/placements/types/{CreateMainPageAttributes.mjs → CreateEmailPlacementData.mjs} +0 -0
- /package/dist/esm/api/resources/organizations/resources/placements/types/{CreateMainPagePlacementData.mjs → CreateGroupAttributes.mjs} +0 -0
- /package/dist/esm/api/resources/organizations/resources/placements/types/{MainPagePlacementAttributes.mjs → CreateGroupPlacementData.mjs} +0 -0
- /package/dist/esm/api/resources/organizations/resources/placements/types/{MainPagePlacementData.mjs → CreateStandardAttributes.mjs} +0 -0
- /package/dist/esm/api/resources/organizations/resources/placements/types/{UpdateMainPageAttributes.mjs → CreateStandardPlacementData.mjs} +0 -0
- /package/dist/esm/api/resources/organizations/resources/placements/types/{UpdateMainPagePlacementData.mjs → EmailPlacementAttributes.mjs} +0 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@kard-financial/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "
|
|
47
|
-
"User-Agent": "@kard-financial/sdk/
|
|
46
|
+
"X-Fern-SDK-Version": "29.1.0",
|
|
47
|
+
"User-Agent": "@kard-financial/sdk/29.1.0",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -11,7 +11,7 @@ export declare class PlacementsClient {
|
|
|
11
11
|
protected readonly _options: NormalizedClientOptionsWithAuth<PlacementsClient.Options>;
|
|
12
12
|
constructor(options?: PlacementsClient.Options);
|
|
13
13
|
/**
|
|
14
|
-
* Create a placement for the organization. Use type "
|
|
14
|
+
* Create a placement for the organization. Use type "placement" for standard placements (requires name and availableSlots), "placementPushNotification" for push-notification placements (requires name and cadence; availableSlots is automatically set to 1), "placementEmail" for email placements (requires name, cadence, and availableSlots), "placementBatchActivation" for batch-activation placements (requires name, refreshInterval, and slots), or "placementGroup" for group placements (requires name and slots).
|
|
15
15
|
*
|
|
16
16
|
* @param {string} organizationId - Unique identifier of the organization
|
|
17
17
|
* @param {KardApi.organizations.CreatePlacementRequestBody} request
|
|
@@ -26,7 +26,7 @@ export declare class PlacementsClient {
|
|
|
26
26
|
* @example
|
|
27
27
|
* await client.organizations.placements.create("org-123", {
|
|
28
28
|
* data: {
|
|
29
|
-
* type: "
|
|
29
|
+
* type: "placement",
|
|
30
30
|
* attributes: {
|
|
31
31
|
* name: "Homepage Banner",
|
|
32
32
|
* availableSlots: 5
|
|
@@ -47,6 +47,53 @@ export declare class PlacementsClient {
|
|
|
47
47
|
* }
|
|
48
48
|
* }
|
|
49
49
|
* })
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.organizations.placements.create("org-123", {
|
|
53
|
+
* data: {
|
|
54
|
+
* type: "placementEmail",
|
|
55
|
+
* attributes: {
|
|
56
|
+
* name: "Weekly Deals Email",
|
|
57
|
+
* availableSlots: 10,
|
|
58
|
+
* cadence: {
|
|
59
|
+
* frequency: "WEEKLY",
|
|
60
|
+
* timeOfDay: "10:00",
|
|
61
|
+
* dayOfWeek: "MON"
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* })
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* await client.organizations.placements.create("org-123", {
|
|
69
|
+
* data: {
|
|
70
|
+
* type: "placementBatchActivation",
|
|
71
|
+
* attributes: {
|
|
72
|
+
* name: "Weekly Cohort",
|
|
73
|
+
* refreshInterval: "P7D",
|
|
74
|
+
* slots: [{
|
|
75
|
+
* placementId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
76
|
+
* alias: "primary",
|
|
77
|
+
* shortDescription: "Featured deals refreshed each week"
|
|
78
|
+
* }]
|
|
79
|
+
* }
|
|
80
|
+
* }
|
|
81
|
+
* })
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* await client.organizations.placements.create("org-123", {
|
|
85
|
+
* data: {
|
|
86
|
+
* type: "placementGroup",
|
|
87
|
+
* attributes: {
|
|
88
|
+
* name: "Seasonal Collection",
|
|
89
|
+
* slots: [{
|
|
90
|
+
* placementId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
91
|
+
* alias: "primary",
|
|
92
|
+
* shortDescription: "Seasonal picks"
|
|
93
|
+
* }]
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
* })
|
|
50
97
|
*/
|
|
51
98
|
create(organizationId: string, request: KardApi.organizations.CreatePlacementRequestBody, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.PlacementFormatUnion>;
|
|
52
99
|
private __create;
|
|
@@ -87,7 +134,7 @@ export declare class PlacementsClient {
|
|
|
87
134
|
get(organizationId: string, placementId: string, request?: KardApi.organizations.GetPlacementRequest, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.PlacementResource>;
|
|
88
135
|
private __get;
|
|
89
136
|
/**
|
|
90
|
-
* Replace a placement. All fields must be provided. Use type "
|
|
137
|
+
* Replace a placement. All fields must be provided. Use type "placement", "placementPushNotification", "placementEmail", "placementBatchActivation", or "placementGroup" to set the placement kind. If the type is "placementPushNotification", availableSlots is automatically set to 1.
|
|
91
138
|
*
|
|
92
139
|
* @param {string} organizationId - Unique identifier of the organization
|
|
93
140
|
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
@@ -103,7 +150,7 @@ export declare class PlacementsClient {
|
|
|
103
150
|
* @example
|
|
104
151
|
* await client.organizations.placements.update("organizationId", "placementId", {
|
|
105
152
|
* data: {
|
|
106
|
-
* type: "
|
|
153
|
+
* type: "placement",
|
|
107
154
|
* attributes: {
|
|
108
155
|
* name: "name",
|
|
109
156
|
* availableSlots: 1
|
|
@@ -56,7 +56,7 @@ class PlacementsClient {
|
|
|
56
56
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Create a placement for the organization. Use type "
|
|
59
|
+
* Create a placement for the organization. Use type "placement" for standard placements (requires name and availableSlots), "placementPushNotification" for push-notification placements (requires name and cadence; availableSlots is automatically set to 1), "placementEmail" for email placements (requires name, cadence, and availableSlots), "placementBatchActivation" for batch-activation placements (requires name, refreshInterval, and slots), or "placementGroup" for group placements (requires name and slots).
|
|
60
60
|
*
|
|
61
61
|
* @param {string} organizationId - Unique identifier of the organization
|
|
62
62
|
* @param {KardApi.organizations.CreatePlacementRequestBody} request
|
|
@@ -71,7 +71,7 @@ class PlacementsClient {
|
|
|
71
71
|
* @example
|
|
72
72
|
* await client.organizations.placements.create("org-123", {
|
|
73
73
|
* data: {
|
|
74
|
-
* type: "
|
|
74
|
+
* type: "placement",
|
|
75
75
|
* attributes: {
|
|
76
76
|
* name: "Homepage Banner",
|
|
77
77
|
* availableSlots: 5
|
|
@@ -92,6 +92,53 @@ class PlacementsClient {
|
|
|
92
92
|
* }
|
|
93
93
|
* }
|
|
94
94
|
* })
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* await client.organizations.placements.create("org-123", {
|
|
98
|
+
* data: {
|
|
99
|
+
* type: "placementEmail",
|
|
100
|
+
* attributes: {
|
|
101
|
+
* name: "Weekly Deals Email",
|
|
102
|
+
* availableSlots: 10,
|
|
103
|
+
* cadence: {
|
|
104
|
+
* frequency: "WEEKLY",
|
|
105
|
+
* timeOfDay: "10:00",
|
|
106
|
+
* dayOfWeek: "MON"
|
|
107
|
+
* }
|
|
108
|
+
* }
|
|
109
|
+
* }
|
|
110
|
+
* })
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* await client.organizations.placements.create("org-123", {
|
|
114
|
+
* data: {
|
|
115
|
+
* type: "placementBatchActivation",
|
|
116
|
+
* attributes: {
|
|
117
|
+
* name: "Weekly Cohort",
|
|
118
|
+
* refreshInterval: "P7D",
|
|
119
|
+
* slots: [{
|
|
120
|
+
* placementId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
121
|
+
* alias: "primary",
|
|
122
|
+
* shortDescription: "Featured deals refreshed each week"
|
|
123
|
+
* }]
|
|
124
|
+
* }
|
|
125
|
+
* }
|
|
126
|
+
* })
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* await client.organizations.placements.create("org-123", {
|
|
130
|
+
* data: {
|
|
131
|
+
* type: "placementGroup",
|
|
132
|
+
* attributes: {
|
|
133
|
+
* name: "Seasonal Collection",
|
|
134
|
+
* slots: [{
|
|
135
|
+
* placementId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
136
|
+
* alias: "primary",
|
|
137
|
+
* shortDescription: "Seasonal picks"
|
|
138
|
+
* }]
|
|
139
|
+
* }
|
|
140
|
+
* }
|
|
141
|
+
* })
|
|
95
142
|
*/
|
|
96
143
|
create(organizationId, request, requestOptions) {
|
|
97
144
|
return core.HttpResponsePromise.fromPromise(this.__create(organizationId, request, requestOptions));
|
|
@@ -284,7 +331,7 @@ class PlacementsClient {
|
|
|
284
331
|
});
|
|
285
332
|
}
|
|
286
333
|
/**
|
|
287
|
-
* Replace a placement. All fields must be provided. Use type "
|
|
334
|
+
* Replace a placement. All fields must be provided. Use type "placement", "placementPushNotification", "placementEmail", "placementBatchActivation", or "placementGroup" to set the placement kind. If the type is "placementPushNotification", availableSlots is automatically set to 1.
|
|
288
335
|
*
|
|
289
336
|
* @param {string} organizationId - Unique identifier of the organization
|
|
290
337
|
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
@@ -300,7 +347,7 @@ class PlacementsClient {
|
|
|
300
347
|
* @example
|
|
301
348
|
* await client.organizations.placements.update("organizationId", "placementId", {
|
|
302
349
|
* data: {
|
|
303
|
-
* type: "
|
|
350
|
+
* type: "placement",
|
|
304
351
|
* attributes: {
|
|
305
352
|
* name: "name",
|
|
306
353
|
* availableSlots: 1
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* {}
|
|
4
4
|
*/
|
|
5
5
|
export interface GetPlacementRequest {
|
|
6
|
-
/** CSV list of related resources to embed in the `included` array. Supported paths: `contentStrategy` (the direct content strategy of a non-batch placement), `slots` (the slot resources of a batch-activation placement), `slots.placement` (and the placement each slot references), and `slots.placement.contentStrategy` (and the content strategy of each referenced placement). Dotted paths implicitly include all intermediate resources. */
|
|
6
|
+
/** CSV list of related resources to embed in the `included` array. Supported paths: `contentStrategy` (the direct content strategy of a non-batch placement), `slots` (the slot resources of a batch-activation or group placement), `slots.placement` (and the placement each slot references), and `slots.placement.contentStrategy` (and the content strategy of each referenced placement). Dotted paths implicitly include all intermediate resources. */
|
|
7
7
|
include?: string;
|
|
8
8
|
}
|
|
@@ -4,13 +4,13 @@ import type * as KardApi from "../../../../../../index.js";
|
|
|
4
4
|
* {}
|
|
5
5
|
*/
|
|
6
6
|
export interface ListPlacementsRequest {
|
|
7
|
-
/** Filter by placement type (
|
|
7
|
+
/** Filter by placement type (placement, placementPushNotification, placementEmail, placementBatchActivation, or placementGroup) */
|
|
8
8
|
"filter[type]"?: KardApi.organizations.PlacementTypeFilter;
|
|
9
9
|
/** Filter by exact placement name (unique within an organization per type) */
|
|
10
10
|
"filter[name]"?: string;
|
|
11
11
|
/** Filter by the ID of the content strategy linked to the placement */
|
|
12
12
|
"filter[contentStrategyId]"?: string;
|
|
13
|
-
/** CSV list of related resources to embed in the `included` array. Supported paths: `contentStrategy` (the direct content strategy of a non-batch placement), `slots` (the slot resources of a batch-activation placement), `slots.placement` (and the placement each slot references), and `slots.placement.contentStrategy` (and the content strategy of each referenced placement). Dotted paths implicitly include all intermediate resources. */
|
|
13
|
+
/** CSV list of related resources to embed in the `included` array. Supported paths: `contentStrategy` (the direct content strategy of a non-batch placement), `slots` (the slot resources of a batch-activation or group placement), `slots.placement` (and the placement each slot references), and `slots.placement.contentStrategy` (and the content strategy of each referenced placement). Dotted paths implicitly include all intermediate resources. */
|
|
14
14
|
include?: string;
|
|
15
15
|
/** Cursor value for the next page of results */
|
|
16
16
|
"page[after]"?: string;
|
|
@@ -7,5 +7,5 @@ export interface BatchActivationPlacementData {
|
|
|
7
7
|
id: string;
|
|
8
8
|
attributes: KardApi.organizations.BatchActivationPlacementAttributes;
|
|
9
9
|
/** JSON:API relationships for the placement. Always present on a batch-activation placement; the `slots` to-many relationship lists the slot resource identifiers. */
|
|
10
|
-
relationships: KardApi.organizations.
|
|
10
|
+
relationships: KardApi.organizations.SlottedPlacementRelationships;
|
|
11
11
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.CadenceFrequency = void 0;
|
|
5
|
-
/** How often a push notification placement delivers */
|
|
5
|
+
/** How often a push notification or email placement delivers */
|
|
6
6
|
exports.CadenceFrequency = {
|
|
7
7
|
Daily: "DAILY",
|
|
8
8
|
Weekly: "WEEKLY",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A slot in a batch-activation placement at creation time
|
|
2
|
+
* A slot in a batch-activation or group placement at creation time
|
|
3
3
|
*/
|
|
4
4
|
export interface CreateBatchActivationSlot {
|
|
5
5
|
/** ID of another placement that fills this slot. The referenced placement provides both the content strategy and the limit on the number of offers available to the slot. */
|
package/dist/cjs/api/resources/organizations/resources/placements/types/CreateEmailAttributes.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Attributes for creating an email placement
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* name: "Weekly Deals Email",
|
|
8
|
+
* availableSlots: 10,
|
|
9
|
+
* cadence: {
|
|
10
|
+
* frequency: KardApi.organizations.CadenceFrequency.Weekly,
|
|
11
|
+
* timeOfDay: "10:00",
|
|
12
|
+
* dayOfWeek: KardApi.organizations.DayOfWeek.Mon
|
|
13
|
+
* }
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
export interface CreateEmailAttributes {
|
|
17
|
+
/** Name of the placement */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Number of available slots (minimum 1) */
|
|
20
|
+
availableSlots: number;
|
|
21
|
+
/** Delivery cadence for the email */
|
|
22
|
+
cadence: KardApi.organizations.Cadence;
|
|
23
|
+
/** ID of the content strategy to link this placement to */
|
|
24
|
+
contentStrategyId?: string | undefined;
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Data for creating an email placement
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateEmailPlacementData {
|
|
6
|
+
/** Email placement attributes for creation */
|
|
7
|
+
attributes: KardApi.organizations.CreateEmailAttributes;
|
|
8
|
+
}
|
package/dist/cjs/api/resources/organizations/resources/placements/types/CreateGroupAttributes.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Attributes for creating a group placement
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* {
|
|
7
|
+
* name: "Seasonal Collection",
|
|
8
|
+
* slots: [{
|
|
9
|
+
* placementId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
10
|
+
* alias: "primary",
|
|
11
|
+
* shortDescription: "Seasonal picks"
|
|
12
|
+
* }]
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export interface CreateGroupAttributes {
|
|
16
|
+
/** Name of the placement */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Slots that make up the group */
|
|
19
|
+
slots: KardApi.organizations.CreateBatchActivationSlot[];
|
|
20
|
+
}
|
|
@@ -2,15 +2,21 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Discriminated union for creating a placement
|
|
4
4
|
*/
|
|
5
|
-
export type CreatePlacementDataUnion = KardApi.organizations.CreatePlacementDataUnion.
|
|
5
|
+
export type CreatePlacementDataUnion = KardApi.organizations.CreatePlacementDataUnion.Placement | KardApi.organizations.CreatePlacementDataUnion.PlacementPushNotification | KardApi.organizations.CreatePlacementDataUnion.PlacementEmail | KardApi.organizations.CreatePlacementDataUnion.PlacementBatchActivation | KardApi.organizations.CreatePlacementDataUnion.PlacementGroup;
|
|
6
6
|
export declare namespace CreatePlacementDataUnion {
|
|
7
|
-
interface
|
|
8
|
-
type: "
|
|
7
|
+
interface Placement extends KardApi.organizations.CreateStandardPlacementData {
|
|
8
|
+
type: "placement";
|
|
9
9
|
}
|
|
10
10
|
interface PlacementPushNotification extends KardApi.organizations.CreatePushNotificationPlacementData {
|
|
11
11
|
type: "placementPushNotification";
|
|
12
12
|
}
|
|
13
|
+
interface PlacementEmail extends KardApi.organizations.CreateEmailPlacementData {
|
|
14
|
+
type: "placementEmail";
|
|
15
|
+
}
|
|
13
16
|
interface PlacementBatchActivation extends KardApi.organizations.CreateBatchActivationPlacementData {
|
|
14
17
|
type: "placementBatchActivation";
|
|
15
18
|
}
|
|
19
|
+
interface PlacementGroup extends KardApi.organizations.CreateGroupPlacementData {
|
|
20
|
+
type: "placementGroup";
|
|
21
|
+
}
|
|
16
22
|
}
|
|
@@ -5,7 +5,7 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
7
|
* data: {
|
|
8
|
-
* type: "
|
|
8
|
+
* type: "placement",
|
|
9
9
|
* attributes: {
|
|
10
10
|
* name: "Homepage Banner",
|
|
11
11
|
* availableSlots: 5
|
|
@@ -26,6 +26,53 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
26
26
|
* }
|
|
27
27
|
* }
|
|
28
28
|
* }
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* {
|
|
32
|
+
* data: {
|
|
33
|
+
* type: "placementEmail",
|
|
34
|
+
* attributes: {
|
|
35
|
+
* name: "Weekly Deals Email",
|
|
36
|
+
* availableSlots: 10,
|
|
37
|
+
* cadence: {
|
|
38
|
+
* frequency: KardApi.organizations.CadenceFrequency.Weekly,
|
|
39
|
+
* timeOfDay: "10:00",
|
|
40
|
+
* dayOfWeek: KardApi.organizations.DayOfWeek.Mon
|
|
41
|
+
* }
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* {
|
|
48
|
+
* data: {
|
|
49
|
+
* type: "placementBatchActivation",
|
|
50
|
+
* attributes: {
|
|
51
|
+
* name: "Weekly Cohort",
|
|
52
|
+
* refreshInterval: "P7D",
|
|
53
|
+
* slots: [{
|
|
54
|
+
* placementId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
55
|
+
* alias: "primary",
|
|
56
|
+
* shortDescription: "Featured deals refreshed each week"
|
|
57
|
+
* }]
|
|
58
|
+
* }
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* {
|
|
64
|
+
* data: {
|
|
65
|
+
* type: "placementGroup",
|
|
66
|
+
* attributes: {
|
|
67
|
+
* name: "Seasonal Collection",
|
|
68
|
+
* slots: [{
|
|
69
|
+
* placementId: "01961e5a-f26f-7e44-ce5f-1ad7c9fb4e67",
|
|
70
|
+
* alias: "primary",
|
|
71
|
+
* shortDescription: "Seasonal picks"
|
|
72
|
+
* }]
|
|
73
|
+
* }
|
|
74
|
+
* }
|
|
75
|
+
* }
|
|
29
76
|
*/
|
|
30
77
|
export interface CreatePlacementRequestBody {
|
|
31
78
|
/** Placement data for creation */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Attributes for creating a
|
|
2
|
+
* Attributes for creating a standard placement
|
|
3
3
|
*
|
|
4
4
|
* @example
|
|
5
5
|
* {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* availableSlots: 5
|
|
8
8
|
* }
|
|
9
9
|
*/
|
|
10
|
-
export interface
|
|
10
|
+
export interface CreateStandardAttributes {
|
|
11
11
|
/** Name of the placement */
|
|
12
12
|
name: string;
|
|
13
13
|
/** Number of available slots (minimum 1) */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Data for creating a standard placement
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateStandardPlacementData {
|
|
6
|
+
/** Standard placement attributes for creation */
|
|
7
|
+
attributes: KardApi.organizations.CreateStandardAttributes;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Attributes for an email placement
|
|
4
|
+
*/
|
|
5
|
+
export interface EmailPlacementAttributes {
|
|
6
|
+
/** Name of the placement */
|
|
7
|
+
name: string;
|
|
8
|
+
/** ID of the organization this placement belongs to */
|
|
9
|
+
organizationId: string;
|
|
10
|
+
/** Number of available slots */
|
|
11
|
+
availableSlots: number;
|
|
12
|
+
/** Delivery cadence for the email */
|
|
13
|
+
cadence: KardApi.organizations.Cadence;
|
|
14
|
+
/** ID of the content strategy linked to this placement, if any. Retained alongside `relationships.contentStrategy` for backward compatibility. */
|
|
15
|
+
contentStrategyId?: string | undefined;
|
|
16
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type * as KardApi from "../../../../../index.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Email placement resource data
|
|
4
4
|
*/
|
|
5
|
-
export interface
|
|
5
|
+
export interface EmailPlacementData {
|
|
6
6
|
/** Unique identifier of the placement (UUID v7) */
|
|
7
7
|
id: string;
|
|
8
|
-
attributes: KardApi.organizations.
|
|
8
|
+
attributes: KardApi.organizations.EmailPlacementAttributes;
|
|
9
9
|
/** JSON:API relationships for the placement. Omitted entirely when the placement has no linked resources. */
|
|
10
10
|
relationships?: KardApi.organizations.PlacementRelationships | undefined;
|
|
11
11
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attributes for a group placement. A group is configured like a batch-activation placement but has no refreshInterval. Slot detail is exposed via `relationships.slots` (resource identifiers) and the `batchActivationSlot` entries in `included`; request `?include=slots` (or a deeper path) to get the slot details.
|
|
3
|
+
*/
|
|
4
|
+
export interface GroupPlacementAttributes {
|
|
5
|
+
/** Name of the placement */
|
|
6
|
+
name: string;
|
|
7
|
+
/** ID of the organization this placement belongs to */
|
|
8
|
+
organizationId: string;
|
|
9
|
+
}
|
package/dist/cjs/api/resources/organizations/resources/placements/types/GroupPlacementData.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Group placement resource data
|
|
4
|
+
*/
|
|
5
|
+
export interface GroupPlacementData {
|
|
6
|
+
/** Unique identifier of the placement (UUID v7) */
|
|
7
|
+
id: string;
|
|
8
|
+
attributes: KardApi.organizations.GroupPlacementAttributes;
|
|
9
|
+
/** JSON:API relationships for the placement. Always present on a group placement; the `slots` to-many relationship lists the slot resource identifiers. */
|
|
10
|
+
relationships: KardApi.organizations.SlottedPlacementRelationships;
|
|
11
|
+
}
|
package/dist/cjs/api/resources/organizations/resources/placements/types/IncludedResource.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Discriminated union of every resource type that can appear in the `included` array. The shape of each branch matches the corresponding primary-data resource (same attributes and relationships), keyed on the JSON:API `type` discriminant.
|
|
4
4
|
*/
|
|
5
|
-
export type IncludedResource = KardApi.organizations.IncludedResource.ContentStrategy | KardApi.organizations.IncludedResource.BatchActivationSlot | KardApi.organizations.IncludedResource.
|
|
5
|
+
export type IncludedResource = KardApi.organizations.IncludedResource.ContentStrategy | KardApi.organizations.IncludedResource.BatchActivationSlot | KardApi.organizations.IncludedResource.Placement | KardApi.organizations.IncludedResource.PlacementPushNotification | KardApi.organizations.IncludedResource.PlacementEmail;
|
|
6
6
|
export declare namespace IncludedResource {
|
|
7
7
|
interface ContentStrategy extends KardApi.organizations.ContentStrategyInclusion {
|
|
8
8
|
type: "contentStrategy";
|
|
@@ -10,10 +10,13 @@ export declare namespace IncludedResource {
|
|
|
10
10
|
interface BatchActivationSlot extends KardApi.organizations.BatchActivationSlotInclusion {
|
|
11
11
|
type: "batchActivationSlot";
|
|
12
12
|
}
|
|
13
|
-
interface
|
|
14
|
-
type: "
|
|
13
|
+
interface Placement extends KardApi.organizations.PlacementData {
|
|
14
|
+
type: "placement";
|
|
15
15
|
}
|
|
16
16
|
interface PlacementPushNotification extends KardApi.organizations.PushNotificationPlacementData {
|
|
17
17
|
type: "placementPushNotification";
|
|
18
18
|
}
|
|
19
|
+
interface PlacementEmail extends KardApi.organizations.EmailPlacementData {
|
|
20
|
+
type: "placementEmail";
|
|
21
|
+
}
|
|
19
22
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Attributes for a
|
|
2
|
+
* Attributes for a standard placement
|
|
3
3
|
*/
|
|
4
|
-
export interface
|
|
4
|
+
export interface PlacementAttributes {
|
|
5
5
|
/** Name of the placement */
|
|
6
6
|
name: string;
|
|
7
7
|
/** ID of the organization this placement belongs to */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Standard placement resource data
|
|
4
|
+
*/
|
|
5
|
+
export interface PlacementData {
|
|
6
|
+
/** Unique identifier of the placement (UUID v7) */
|
|
7
|
+
id: string;
|
|
8
|
+
attributes: KardApi.organizations.PlacementAttributes;
|
|
9
|
+
/** JSON:API relationships for the placement. Omitted entirely when the placement has no linked resources. */
|
|
10
|
+
relationships?: KardApi.organizations.PlacementRelationships | undefined;
|
|
11
|
+
}
|