@kard-financial/sdk 18.2.0 → 20.0.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/contentStrategies/client/Client.d.ts +1 -2
- package/dist/cjs/api/resources/organizations/resources/contentStrategies/client/Client.js +1 -2
- package/dist/cjs/api/resources/organizations/resources/contentStrategies/types/ContentStrategyAttributes.d.ts +2 -2
- package/dist/cjs/api/resources/organizations/resources/contentStrategies/types/ContentStrategyFilter.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/contentStrategies/types/ContentStrategyFilter.js +1 -1
- package/dist/cjs/api/resources/organizations/resources/contentStrategies/types/ContentStrategyResponse.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/contentStrategies/types/CreateContentStrategyAttributes.d.ts +3 -3
- package/dist/cjs/api/resources/organizations/resources/contentStrategies/types/CreateContentStrategyRequestBody.d.ts +1 -1
- package/dist/cjs/api/resources/organizations/resources/contentStrategies/types/UpdateContentStrategyAttributes.d.ts +3 -3
- package/dist/cjs/api/resources/organizations/resources/placements/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/organizations/resources/placements/client/Client.js +12 -6
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/GetPlacementRequest.d.ts +8 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/GetPlacementRequest.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/ListPlacementsRequest.d.ts +2 -0
- package/dist/cjs/api/resources/organizations/resources/placements/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementListResponse.d.ts +2 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementResource.d.ts +10 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementResource.js +3 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/organizations/resources/placements/types/index.js +1 -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/contentStrategies/client/Client.d.mts +1 -2
- package/dist/esm/api/resources/organizations/resources/contentStrategies/client/Client.mjs +1 -2
- package/dist/esm/api/resources/organizations/resources/contentStrategies/types/ContentStrategyAttributes.d.mts +2 -2
- package/dist/esm/api/resources/organizations/resources/contentStrategies/types/ContentStrategyFilter.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/contentStrategies/types/ContentStrategyFilter.mjs +1 -1
- package/dist/esm/api/resources/organizations/resources/contentStrategies/types/ContentStrategyResponse.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/contentStrategies/types/CreateContentStrategyAttributes.d.mts +3 -3
- package/dist/esm/api/resources/organizations/resources/contentStrategies/types/CreateContentStrategyRequestBody.d.mts +1 -1
- package/dist/esm/api/resources/organizations/resources/contentStrategies/types/UpdateContentStrategyAttributes.d.mts +3 -3
- package/dist/esm/api/resources/organizations/resources/placements/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/organizations/resources/placements/client/Client.mjs +12 -6
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/GetPlacementRequest.d.mts +8 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/GetPlacementRequest.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/ListPlacementsRequest.d.mts +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementListResponse.d.mts +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementResource.d.mts +10 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/PlacementResource.mjs +2 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/index.d.mts +1 -0
- package/dist/esm/api/resources/organizations/resources/placements/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +10 -3
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": "20.0.0",
|
|
47
|
+
"User-Agent": "@kard-financial/sdk/20.0.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);
|
|
@@ -30,7 +30,7 @@ export declare class ContentStrategiesClient {
|
|
|
30
30
|
* type: "contentStrategy",
|
|
31
31
|
* attributes: {
|
|
32
32
|
* name: "Featured Travel",
|
|
33
|
-
*
|
|
33
|
+
* filter: "HIGHEST_CASHBACK",
|
|
34
34
|
* categories: ["Travel"],
|
|
35
35
|
* categoryExclusions: ["Gas"],
|
|
36
36
|
* merchantExclusions: ["merchant-abc"]
|
|
@@ -96,7 +96,6 @@ export declare class ContentStrategiesClient {
|
|
|
96
96
|
* type: "contentStrategy",
|
|
97
97
|
* attributes: {
|
|
98
98
|
* name: "name",
|
|
99
|
-
* filters: ["NEWLY_LIVE", "NEWLY_LIVE"],
|
|
100
99
|
* categories: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
101
100
|
* categoryExclusions: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
102
101
|
* merchantExclusions: ["merchantExclusions", "merchantExclusions"]
|
|
@@ -75,7 +75,7 @@ class ContentStrategiesClient {
|
|
|
75
75
|
* type: "contentStrategy",
|
|
76
76
|
* attributes: {
|
|
77
77
|
* name: "Featured Travel",
|
|
78
|
-
*
|
|
78
|
+
* filter: "HIGHEST_CASHBACK",
|
|
79
79
|
* categories: ["Travel"],
|
|
80
80
|
* categoryExclusions: ["Gas"],
|
|
81
81
|
* merchantExclusions: ["merchant-abc"]
|
|
@@ -288,7 +288,6 @@ class ContentStrategiesClient {
|
|
|
288
288
|
* type: "contentStrategy",
|
|
289
289
|
* attributes: {
|
|
290
290
|
* name: "name",
|
|
291
|
-
* filters: ["NEWLY_LIVE", "NEWLY_LIVE"],
|
|
292
291
|
* categories: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
293
292
|
* categoryExclusions: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
294
293
|
* merchantExclusions: ["merchantExclusions", "merchantExclusions"]
|
|
@@ -7,8 +7,8 @@ export interface ContentStrategyAttributes {
|
|
|
7
7
|
name: string;
|
|
8
8
|
/** ID of the organization this content strategy belongs to */
|
|
9
9
|
organizationId: string;
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/** Filter applied when selecting offers for the strategy */
|
|
11
|
+
filter?: KardApi.organizations.ContentStrategyFilter | undefined;
|
|
12
12
|
/** Merchant categories to include */
|
|
13
13
|
categories: KardApi.CategoryOption[];
|
|
14
14
|
/** Merchant categories to exclude */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Filter applied to the offers selected by a content strategy. The v1 starter set covers newly-live, expiring-soon, highest-cashback, and personalized selections. */
|
|
1
|
+
/** Filter applied to the offers selected by a content strategy. A strategy may have at most one filter. The v1 starter set covers newly-live, expiring-soon, highest-cashback, and personalized selections. */
|
|
2
2
|
export declare const ContentStrategyFilter: {
|
|
3
3
|
readonly NewlyLive: "NEWLY_LIVE";
|
|
4
4
|
readonly ExpiringSoon: "EXPIRING_SOON";
|
|
@@ -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.ContentStrategyFilter = void 0;
|
|
5
|
-
/** Filter applied to the offers selected by a content strategy. The v1 starter set covers newly-live, expiring-soon, highest-cashback, and personalized selections. */
|
|
5
|
+
/** Filter applied to the offers selected by a content strategy. A strategy may have at most one filter. The v1 starter set covers newly-live, expiring-soon, highest-cashback, and personalized selections. */
|
|
6
6
|
exports.ContentStrategyFilter = {
|
|
7
7
|
NewlyLive: "NEWLY_LIVE",
|
|
8
8
|
ExpiringSoon: "EXPIRING_SOON",
|
|
@@ -9,7 +9,7 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
9
9
|
* attributes: {
|
|
10
10
|
* name: "Featured Travel",
|
|
11
11
|
* organizationId: "org-123",
|
|
12
|
-
*
|
|
12
|
+
* filter: KardApi.organizations.ContentStrategyFilter.HighestCashback,
|
|
13
13
|
* categories: [KardApi.CategoryOption.Travel],
|
|
14
14
|
* categoryExclusions: [KardApi.CategoryOption.Gas],
|
|
15
15
|
* merchantExclusions: ["merchant-abc"],
|
|
@@ -5,7 +5,7 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
7
|
* name: "Featured Travel",
|
|
8
|
-
*
|
|
8
|
+
* filter: KardApi.organizations.ContentStrategyFilter.HighestCashback,
|
|
9
9
|
* categories: [KardApi.CategoryOption.Travel],
|
|
10
10
|
* categoryExclusions: [KardApi.CategoryOption.Gas],
|
|
11
11
|
* merchantExclusions: ["merchant-abc"]
|
|
@@ -14,8 +14,8 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
14
14
|
export interface CreateContentStrategyAttributes {
|
|
15
15
|
/** Name of the content strategy (unique within an organization) */
|
|
16
16
|
name: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/** Filter applied when selecting offers for the strategy */
|
|
18
|
+
filter?: KardApi.organizations.ContentStrategyFilter | undefined;
|
|
19
19
|
/** Merchant categories to include */
|
|
20
20
|
categories: KardApi.CategoryOption[];
|
|
21
21
|
/** Merchant categories to exclude */
|
|
@@ -8,7 +8,7 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
8
8
|
* type: "contentStrategy",
|
|
9
9
|
* attributes: {
|
|
10
10
|
* name: "Featured Travel",
|
|
11
|
-
*
|
|
11
|
+
* filter: KardApi.organizations.ContentStrategyFilter.HighestCashback,
|
|
12
12
|
* categories: [KardApi.CategoryOption.Travel],
|
|
13
13
|
* categoryExclusions: [KardApi.CategoryOption.Gas],
|
|
14
14
|
* merchantExclusions: ["merchant-abc"]
|
|
@@ -5,7 +5,7 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
7
|
* name: "Updated Travel Strategy",
|
|
8
|
-
*
|
|
8
|
+
* filter: KardApi.organizations.ContentStrategyFilter.ExpiringSoon,
|
|
9
9
|
* categories: [KardApi.CategoryOption.Travel, KardApi.CategoryOption.FoodBeverage],
|
|
10
10
|
* categoryExclusions: [],
|
|
11
11
|
* merchantExclusions: ["merchant-xyz"]
|
|
@@ -14,8 +14,8 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
14
14
|
export interface UpdateContentStrategyAttributes {
|
|
15
15
|
/** Name of the content strategy (unique within an organization) */
|
|
16
16
|
name: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/** Filter applied when selecting offers for the strategy */
|
|
18
|
+
filter?: KardApi.organizations.ContentStrategyFilter | undefined;
|
|
19
19
|
/** Merchant categories to include */
|
|
20
20
|
categories: KardApi.CategoryOption[];
|
|
21
21
|
/** Merchant categories to exclude */
|
|
@@ -73,6 +73,7 @@ export declare class PlacementsClient {
|
|
|
73
73
|
*
|
|
74
74
|
* @param {string} organizationId - Unique identifier of the organization
|
|
75
75
|
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
76
|
+
* @param {KardApi.organizations.GetPlacementRequest} request
|
|
76
77
|
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
78
|
*
|
|
78
79
|
* @throws {@link KardApi.UnauthorizedError}
|
|
@@ -83,7 +84,7 @@ export declare class PlacementsClient {
|
|
|
83
84
|
* @example
|
|
84
85
|
* await client.organizations.placements.get("organizationId", "placementId")
|
|
85
86
|
*/
|
|
86
|
-
get(organizationId: string, placementId: string, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.
|
|
87
|
+
get(organizationId: string, placementId: string, request?: KardApi.organizations.GetPlacementRequest, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.PlacementResource>;
|
|
87
88
|
private __get;
|
|
88
89
|
/**
|
|
89
90
|
* Replace a placement. All fields must be provided. Use type "placementMainPage" or "placementPushNotification" to set the placement kind. If the type is "placementPushNotification", availableSlots is automatically set to 1.
|
|
@@ -166,11 +166,12 @@ class PlacementsClient {
|
|
|
166
166
|
__list(organizationId_1) {
|
|
167
167
|
return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
|
|
168
168
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
169
|
-
const { "filter[type]": filterType, "filter[name]": filterName, "filter[contentStrategyId]": filterContentStrategyId, "page[after]": pageAfter, "page[size]": pageSize, } = request;
|
|
169
|
+
const { "filter[type]": filterType, "filter[name]": filterName, "filter[contentStrategyId]": filterContentStrategyId, include, "page[after]": pageAfter, "page[size]": pageSize, } = request;
|
|
170
170
|
const _queryParams = {
|
|
171
171
|
"filter[type]": filterType != null ? filterType : undefined,
|
|
172
172
|
"filter[name]": filterName,
|
|
173
173
|
"filter[contentStrategyId]": filterContentStrategyId,
|
|
174
|
+
include,
|
|
174
175
|
"page[after]": pageAfter,
|
|
175
176
|
"page[size]": pageSize,
|
|
176
177
|
};
|
|
@@ -221,6 +222,7 @@ class PlacementsClient {
|
|
|
221
222
|
*
|
|
222
223
|
* @param {string} organizationId - Unique identifier of the organization
|
|
223
224
|
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
225
|
+
* @param {KardApi.organizations.GetPlacementRequest} request
|
|
224
226
|
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
225
227
|
*
|
|
226
228
|
* @throws {@link KardApi.UnauthorizedError}
|
|
@@ -231,19 +233,23 @@ class PlacementsClient {
|
|
|
231
233
|
* @example
|
|
232
234
|
* await client.organizations.placements.get("organizationId", "placementId")
|
|
233
235
|
*/
|
|
234
|
-
get(organizationId, placementId, requestOptions) {
|
|
235
|
-
return core.HttpResponsePromise.fromPromise(this.__get(organizationId, placementId, requestOptions));
|
|
236
|
+
get(organizationId, placementId, request = {}, requestOptions) {
|
|
237
|
+
return core.HttpResponsePromise.fromPromise(this.__get(organizationId, placementId, request, requestOptions));
|
|
236
238
|
}
|
|
237
|
-
__get(
|
|
238
|
-
return __awaiter(this,
|
|
239
|
+
__get(organizationId_1, placementId_1) {
|
|
240
|
+
return __awaiter(this, arguments, void 0, function* (organizationId, placementId, request = {}, requestOptions) {
|
|
239
241
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
242
|
+
const { include } = request;
|
|
243
|
+
const _queryParams = {
|
|
244
|
+
include,
|
|
245
|
+
};
|
|
240
246
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
241
247
|
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
242
248
|
const _response = yield core.fetcher({
|
|
243
249
|
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)}/placements/${core.url.encodePathParam(placementId)}`),
|
|
244
250
|
method: "GET",
|
|
245
251
|
headers: _headers,
|
|
246
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
252
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
247
253
|
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,
|
|
248
254
|
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,
|
|
249
255
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -10,6 +10,8 @@ export interface ListPlacementsRequest {
|
|
|
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 (allowed value is `contentStrategy`). */
|
|
14
|
+
include?: string;
|
|
13
15
|
/** Cursor value for the next page of results */
|
|
14
16
|
"page[after]"?: string;
|
|
15
17
|
/** Maximum number of records to return [1 - 200] (default = 200) */
|
package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementListResponse.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import type * as KardApi from "../../../../../index.js";
|
|
|
5
5
|
export interface PlacementListResponse {
|
|
6
6
|
/** Array of placement resources */
|
|
7
7
|
data: KardApi.organizations.PlacementFormatUnion[];
|
|
8
|
+
/** Related resources requested via the `include` query parameter. Only populated when `include=contentStrategy` is supplied and at least one placement in `data` is linked to a content strategy. */
|
|
9
|
+
included?: KardApi.organizations.ContentStrategyResponse[] | undefined;
|
|
8
10
|
links?: KardApi.Links | undefined;
|
|
9
11
|
/** Pagination metadata */
|
|
10
12
|
meta?: KardApi.OrganizationPaginationMetadata | undefined;
|
package/dist/cjs/api/resources/organizations/resources/placements/types/PlacementResource.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Single placement document, optionally with embedded related resources
|
|
4
|
+
*/
|
|
5
|
+
export interface PlacementResource {
|
|
6
|
+
/** Placement resource */
|
|
7
|
+
data: KardApi.organizations.PlacementFormatUnion;
|
|
8
|
+
/** Related resources requested via the `include` query parameter. Only populated when `include=contentStrategy` is supplied and the placement is linked to a content strategy. */
|
|
9
|
+
included?: KardApi.organizations.ContentStrategyResponse[] | undefined;
|
|
10
|
+
}
|
|
@@ -11,6 +11,7 @@ export * from "./MainPagePlacementAttributes.js";
|
|
|
11
11
|
export * from "./MainPagePlacementData.js";
|
|
12
12
|
export * from "./PlacementFormatUnion.js";
|
|
13
13
|
export * from "./PlacementListResponse.js";
|
|
14
|
+
export * from "./PlacementResource.js";
|
|
14
15
|
export * from "./PlacementTypeFilter.js";
|
|
15
16
|
export * from "./PushNotificationPlacementAttributes.js";
|
|
16
17
|
export * from "./PushNotificationPlacementData.js";
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./MainPagePlacementAttributes.js"), exports);
|
|
|
27
27
|
__exportStar(require("./MainPagePlacementData.js"), exports);
|
|
28
28
|
__exportStar(require("./PlacementFormatUnion.js"), exports);
|
|
29
29
|
__exportStar(require("./PlacementListResponse.js"), exports);
|
|
30
|
+
__exportStar(require("./PlacementResource.js"), exports);
|
|
30
31
|
__exportStar(require("./PlacementTypeFilter.js"), exports);
|
|
31
32
|
__exportStar(require("./PushNotificationPlacementAttributes.js"), exports);
|
|
32
33
|
__exportStar(require("./PushNotificationPlacementData.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "20.0.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@kard-financial/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "
|
|
10
|
-
"User-Agent": "@kard-financial/sdk/
|
|
9
|
+
"X-Fern-SDK-Version": "20.0.0",
|
|
10
|
+
"User-Agent": "@kard-financial/sdk/20.0.0",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
package/dist/esm/api/resources/organizations/resources/contentStrategies/client/Client.d.mts
CHANGED
|
@@ -30,7 +30,7 @@ export declare class ContentStrategiesClient {
|
|
|
30
30
|
* type: "contentStrategy",
|
|
31
31
|
* attributes: {
|
|
32
32
|
* name: "Featured Travel",
|
|
33
|
-
*
|
|
33
|
+
* filter: "HIGHEST_CASHBACK",
|
|
34
34
|
* categories: ["Travel"],
|
|
35
35
|
* categoryExclusions: ["Gas"],
|
|
36
36
|
* merchantExclusions: ["merchant-abc"]
|
|
@@ -96,7 +96,6 @@ export declare class ContentStrategiesClient {
|
|
|
96
96
|
* type: "contentStrategy",
|
|
97
97
|
* attributes: {
|
|
98
98
|
* name: "name",
|
|
99
|
-
* filters: ["NEWLY_LIVE", "NEWLY_LIVE"],
|
|
100
99
|
* categories: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
101
100
|
* categoryExclusions: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
102
101
|
* merchantExclusions: ["merchantExclusions", "merchantExclusions"]
|
|
@@ -39,7 +39,7 @@ export class ContentStrategiesClient {
|
|
|
39
39
|
* type: "contentStrategy",
|
|
40
40
|
* attributes: {
|
|
41
41
|
* name: "Featured Travel",
|
|
42
|
-
*
|
|
42
|
+
* filter: "HIGHEST_CASHBACK",
|
|
43
43
|
* categories: ["Travel"],
|
|
44
44
|
* categoryExclusions: ["Gas"],
|
|
45
45
|
* merchantExclusions: ["merchant-abc"]
|
|
@@ -252,7 +252,6 @@ export class ContentStrategiesClient {
|
|
|
252
252
|
* type: "contentStrategy",
|
|
253
253
|
* attributes: {
|
|
254
254
|
* name: "name",
|
|
255
|
-
* filters: ["NEWLY_LIVE", "NEWLY_LIVE"],
|
|
256
255
|
* categories: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
257
256
|
* categoryExclusions: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
258
257
|
* merchantExclusions: ["merchantExclusions", "merchantExclusions"]
|
|
@@ -7,8 +7,8 @@ export interface ContentStrategyAttributes {
|
|
|
7
7
|
name: string;
|
|
8
8
|
/** ID of the organization this content strategy belongs to */
|
|
9
9
|
organizationId: string;
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/** Filter applied when selecting offers for the strategy */
|
|
11
|
+
filter?: KardApi.organizations.ContentStrategyFilter | undefined;
|
|
12
12
|
/** Merchant categories to include */
|
|
13
13
|
categories: KardApi.CategoryOption[];
|
|
14
14
|
/** Merchant categories to exclude */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Filter applied to the offers selected by a content strategy. The v1 starter set covers newly-live, expiring-soon, highest-cashback, and personalized selections. */
|
|
1
|
+
/** Filter applied to the offers selected by a content strategy. A strategy may have at most one filter. The v1 starter set covers newly-live, expiring-soon, highest-cashback, and personalized selections. */
|
|
2
2
|
export declare const ContentStrategyFilter: {
|
|
3
3
|
readonly NewlyLive: "NEWLY_LIVE";
|
|
4
4
|
readonly ExpiringSoon: "EXPIRING_SOON";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
/** Filter applied to the offers selected by a content strategy. The v1 starter set covers newly-live, expiring-soon, highest-cashback, and personalized selections. */
|
|
2
|
+
/** Filter applied to the offers selected by a content strategy. A strategy may have at most one filter. The v1 starter set covers newly-live, expiring-soon, highest-cashback, and personalized selections. */
|
|
3
3
|
export const ContentStrategyFilter = {
|
|
4
4
|
NewlyLive: "NEWLY_LIVE",
|
|
5
5
|
ExpiringSoon: "EXPIRING_SOON",
|
|
@@ -9,7 +9,7 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
9
9
|
* attributes: {
|
|
10
10
|
* name: "Featured Travel",
|
|
11
11
|
* organizationId: "org-123",
|
|
12
|
-
*
|
|
12
|
+
* filter: KardApi.organizations.ContentStrategyFilter.HighestCashback,
|
|
13
13
|
* categories: [KardApi.CategoryOption.Travel],
|
|
14
14
|
* categoryExclusions: [KardApi.CategoryOption.Gas],
|
|
15
15
|
* merchantExclusions: ["merchant-abc"],
|
|
@@ -5,7 +5,7 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
7
|
* name: "Featured Travel",
|
|
8
|
-
*
|
|
8
|
+
* filter: KardApi.organizations.ContentStrategyFilter.HighestCashback,
|
|
9
9
|
* categories: [KardApi.CategoryOption.Travel],
|
|
10
10
|
* categoryExclusions: [KardApi.CategoryOption.Gas],
|
|
11
11
|
* merchantExclusions: ["merchant-abc"]
|
|
@@ -14,8 +14,8 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
14
14
|
export interface CreateContentStrategyAttributes {
|
|
15
15
|
/** Name of the content strategy (unique within an organization) */
|
|
16
16
|
name: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/** Filter applied when selecting offers for the strategy */
|
|
18
|
+
filter?: KardApi.organizations.ContentStrategyFilter | undefined;
|
|
19
19
|
/** Merchant categories to include */
|
|
20
20
|
categories: KardApi.CategoryOption[];
|
|
21
21
|
/** Merchant categories to exclude */
|
|
@@ -8,7 +8,7 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
8
8
|
* type: "contentStrategy",
|
|
9
9
|
* attributes: {
|
|
10
10
|
* name: "Featured Travel",
|
|
11
|
-
*
|
|
11
|
+
* filter: KardApi.organizations.ContentStrategyFilter.HighestCashback,
|
|
12
12
|
* categories: [KardApi.CategoryOption.Travel],
|
|
13
13
|
* categoryExclusions: [KardApi.CategoryOption.Gas],
|
|
14
14
|
* merchantExclusions: ["merchant-abc"]
|
|
@@ -5,7 +5,7 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
5
5
|
* @example
|
|
6
6
|
* {
|
|
7
7
|
* name: "Updated Travel Strategy",
|
|
8
|
-
*
|
|
8
|
+
* filter: KardApi.organizations.ContentStrategyFilter.ExpiringSoon,
|
|
9
9
|
* categories: [KardApi.CategoryOption.Travel, KardApi.CategoryOption.FoodBeverage],
|
|
10
10
|
* categoryExclusions: [],
|
|
11
11
|
* merchantExclusions: ["merchant-xyz"]
|
|
@@ -14,8 +14,8 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
14
14
|
export interface UpdateContentStrategyAttributes {
|
|
15
15
|
/** Name of the content strategy (unique within an organization) */
|
|
16
16
|
name: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/** Filter applied when selecting offers for the strategy */
|
|
18
|
+
filter?: KardApi.organizations.ContentStrategyFilter | undefined;
|
|
19
19
|
/** Merchant categories to include */
|
|
20
20
|
categories: KardApi.CategoryOption[];
|
|
21
21
|
/** Merchant categories to exclude */
|
|
@@ -73,6 +73,7 @@ export declare class PlacementsClient {
|
|
|
73
73
|
*
|
|
74
74
|
* @param {string} organizationId - Unique identifier of the organization
|
|
75
75
|
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
76
|
+
* @param {KardApi.organizations.GetPlacementRequest} request
|
|
76
77
|
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
78
|
*
|
|
78
79
|
* @throws {@link KardApi.UnauthorizedError}
|
|
@@ -83,7 +84,7 @@ export declare class PlacementsClient {
|
|
|
83
84
|
* @example
|
|
84
85
|
* await client.organizations.placements.get("organizationId", "placementId")
|
|
85
86
|
*/
|
|
86
|
-
get(organizationId: string, placementId: string, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.
|
|
87
|
+
get(organizationId: string, placementId: string, request?: KardApi.organizations.GetPlacementRequest, requestOptions?: PlacementsClient.RequestOptions): core.HttpResponsePromise<KardApi.organizations.PlacementResource>;
|
|
87
88
|
private __get;
|
|
88
89
|
/**
|
|
89
90
|
* Replace a placement. All fields must be provided. Use type "placementMainPage" or "placementPushNotification" to set the placement kind. If the type is "placementPushNotification", availableSlots is automatically set to 1.
|
|
@@ -130,11 +130,12 @@ export class PlacementsClient {
|
|
|
130
130
|
__list(organizationId_1) {
|
|
131
131
|
return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
|
|
132
132
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
133
|
-
const { "filter[type]": filterType, "filter[name]": filterName, "filter[contentStrategyId]": filterContentStrategyId, "page[after]": pageAfter, "page[size]": pageSize, } = request;
|
|
133
|
+
const { "filter[type]": filterType, "filter[name]": filterName, "filter[contentStrategyId]": filterContentStrategyId, include, "page[after]": pageAfter, "page[size]": pageSize, } = request;
|
|
134
134
|
const _queryParams = {
|
|
135
135
|
"filter[type]": filterType != null ? filterType : undefined,
|
|
136
136
|
"filter[name]": filterName,
|
|
137
137
|
"filter[contentStrategyId]": filterContentStrategyId,
|
|
138
|
+
include,
|
|
138
139
|
"page[after]": pageAfter,
|
|
139
140
|
"page[size]": pageSize,
|
|
140
141
|
};
|
|
@@ -185,6 +186,7 @@ export class PlacementsClient {
|
|
|
185
186
|
*
|
|
186
187
|
* @param {string} organizationId - Unique identifier of the organization
|
|
187
188
|
* @param {string} placementId - Unique identifier of the placement (UUID v7)
|
|
189
|
+
* @param {KardApi.organizations.GetPlacementRequest} request
|
|
188
190
|
* @param {PlacementsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
189
191
|
*
|
|
190
192
|
* @throws {@link KardApi.UnauthorizedError}
|
|
@@ -195,19 +197,23 @@ export class PlacementsClient {
|
|
|
195
197
|
* @example
|
|
196
198
|
* await client.organizations.placements.get("organizationId", "placementId")
|
|
197
199
|
*/
|
|
198
|
-
get(organizationId, placementId, requestOptions) {
|
|
199
|
-
return core.HttpResponsePromise.fromPromise(this.__get(organizationId, placementId, requestOptions));
|
|
200
|
+
get(organizationId, placementId, request = {}, requestOptions) {
|
|
201
|
+
return core.HttpResponsePromise.fromPromise(this.__get(organizationId, placementId, request, requestOptions));
|
|
200
202
|
}
|
|
201
|
-
__get(
|
|
202
|
-
return __awaiter(this,
|
|
203
|
+
__get(organizationId_1, placementId_1) {
|
|
204
|
+
return __awaiter(this, arguments, void 0, function* (organizationId, placementId, request = {}, requestOptions) {
|
|
203
205
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
206
|
+
const { include } = request;
|
|
207
|
+
const _queryParams = {
|
|
208
|
+
include,
|
|
209
|
+
};
|
|
204
210
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
205
211
|
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);
|
|
206
212
|
const _response = yield core.fetcher({
|
|
207
213
|
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)}/placements/${core.url.encodePathParam(placementId)}`),
|
|
208
214
|
method: "GET",
|
|
209
215
|
headers: _headers,
|
|
210
|
-
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
216
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
211
217
|
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,
|
|
212
218
|
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,
|
|
213
219
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
@@ -10,6 +10,8 @@ export interface ListPlacementsRequest {
|
|
|
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 (allowed value is `contentStrategy`). */
|
|
14
|
+
include?: string;
|
|
13
15
|
/** Cursor value for the next page of results */
|
|
14
16
|
"page[after]"?: string;
|
|
15
17
|
/** Maximum number of records to return [1 - 200] (default = 200) */
|
package/dist/esm/api/resources/organizations/resources/placements/types/PlacementListResponse.d.mts
CHANGED
|
@@ -5,6 +5,8 @@ import type * as KardApi from "../../../../../index.mjs";
|
|
|
5
5
|
export interface PlacementListResponse {
|
|
6
6
|
/** Array of placement resources */
|
|
7
7
|
data: KardApi.organizations.PlacementFormatUnion[];
|
|
8
|
+
/** Related resources requested via the `include` query parameter. Only populated when `include=contentStrategy` is supplied and at least one placement in `data` is linked to a content strategy. */
|
|
9
|
+
included?: KardApi.organizations.ContentStrategyResponse[] | undefined;
|
|
8
10
|
links?: KardApi.Links | undefined;
|
|
9
11
|
/** Pagination metadata */
|
|
10
12
|
meta?: KardApi.OrganizationPaginationMetadata | undefined;
|
package/dist/esm/api/resources/organizations/resources/placements/types/PlacementResource.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as KardApi from "../../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Single placement document, optionally with embedded related resources
|
|
4
|
+
*/
|
|
5
|
+
export interface PlacementResource {
|
|
6
|
+
/** Placement resource */
|
|
7
|
+
data: KardApi.organizations.PlacementFormatUnion;
|
|
8
|
+
/** Related resources requested via the `include` query parameter. Only populated when `include=contentStrategy` is supplied and the placement is linked to a content strategy. */
|
|
9
|
+
included?: KardApi.organizations.ContentStrategyResponse[] | undefined;
|
|
10
|
+
}
|
|
@@ -11,6 +11,7 @@ export * from "./MainPagePlacementAttributes.mjs";
|
|
|
11
11
|
export * from "./MainPagePlacementData.mjs";
|
|
12
12
|
export * from "./PlacementFormatUnion.mjs";
|
|
13
13
|
export * from "./PlacementListResponse.mjs";
|
|
14
|
+
export * from "./PlacementResource.mjs";
|
|
14
15
|
export * from "./PlacementTypeFilter.mjs";
|
|
15
16
|
export * from "./PushNotificationPlacementAttributes.mjs";
|
|
16
17
|
export * from "./PushNotificationPlacementData.mjs";
|
|
@@ -11,6 +11,7 @@ export * from "./MainPagePlacementAttributes.mjs";
|
|
|
11
11
|
export * from "./MainPagePlacementData.mjs";
|
|
12
12
|
export * from "./PlacementFormatUnion.mjs";
|
|
13
13
|
export * from "./PlacementListResponse.mjs";
|
|
14
|
+
export * from "./PlacementResource.mjs";
|
|
14
15
|
export * from "./PlacementTypeFilter.mjs";
|
|
15
16
|
export * from "./PushNotificationPlacementAttributes.mjs";
|
|
16
17
|
export * from "./PushNotificationPlacementData.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "20.0.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "20.0.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -841,7 +841,7 @@ await client.organizations.contentStrategies.create("org-123", {
|
|
|
841
841
|
type: "contentStrategy",
|
|
842
842
|
attributes: {
|
|
843
843
|
name: "Featured Travel",
|
|
844
|
-
|
|
844
|
+
filter: "HIGHEST_CASHBACK",
|
|
845
845
|
categories: ["Travel"],
|
|
846
846
|
categoryExclusions: ["Gas"],
|
|
847
847
|
merchantExclusions: ["merchant-abc"]
|
|
@@ -1065,7 +1065,6 @@ await client.organizations.contentStrategies.update("organizationId", "contentSt
|
|
|
1065
1065
|
type: "contentStrategy",
|
|
1066
1066
|
attributes: {
|
|
1067
1067
|
name: "name",
|
|
1068
|
-
filters: ["NEWLY_LIVE", "NEWLY_LIVE"],
|
|
1069
1068
|
categories: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
1070
1069
|
categoryExclusions: ["Arts & Entertainment", "Arts & Entertainment"],
|
|
1071
1070
|
merchantExclusions: ["merchantExclusions", "merchantExclusions"]
|
|
@@ -1345,7 +1344,7 @@ await client.organizations.placements.list("organizationId");
|
|
|
1345
1344
|
</dl>
|
|
1346
1345
|
</details>
|
|
1347
1346
|
|
|
1348
|
-
<details><summary><code>client.organizations.placements.<a href="/src/api/resources/organizations/resources/placements/client/Client.ts">get</a>(organizationId, placementId) -> KardApi.
|
|
1347
|
+
<details><summary><code>client.organizations.placements.<a href="/src/api/resources/organizations/resources/placements/client/Client.ts">get</a>(organizationId, placementId, { ...params }) -> KardApi.PlacementResource</code></summary>
|
|
1349
1348
|
<dl>
|
|
1350
1349
|
<dd>
|
|
1351
1350
|
|
|
@@ -1404,6 +1403,14 @@ await client.organizations.placements.get("organizationId", "placementId");
|
|
|
1404
1403
|
<dl>
|
|
1405
1404
|
<dd>
|
|
1406
1405
|
|
|
1406
|
+
**request:** `KardApi.organizations.GetPlacementRequest`
|
|
1407
|
+
|
|
1408
|
+
</dd>
|
|
1409
|
+
</dl>
|
|
1410
|
+
|
|
1411
|
+
<dl>
|
|
1412
|
+
<dd>
|
|
1413
|
+
|
|
1407
1414
|
**requestOptions:** `PlacementsClient.RequestOptions`
|
|
1408
1415
|
|
|
1409
1416
|
</dd>
|