@51eat/sdk 0.0.14 → 0.0.15
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/Client.d.ts +6 -0
- package/dist/cjs/Client.js +12 -2
- package/dist/cjs/api/resources/index.d.ts +5 -0
- package/dist/cjs/api/resources/index.js +6 -1
- package/dist/cjs/api/resources/recordClick/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/recordClick/client/Client.js +111 -0
- package/dist/cjs/api/resources/recordClick/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/recordClick/client/index.js +17 -0
- package/dist/cjs/api/resources/recordClick/client/requests/AdsRecordClickRequest.d.ts +10 -0
- package/dist/cjs/api/resources/recordClick/client/requests/AdsRecordClickRequest.js +3 -0
- package/dist/cjs/api/resources/recordClick/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/recordClick/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/recordClick/exports.d.ts +2 -0
- package/dist/cjs/api/resources/recordClick/exports.js +21 -0
- package/dist/cjs/api/resources/recordClick/index.d.ts +1 -0
- package/dist/cjs/api/resources/recordClick/index.js +17 -0
- package/dist/cjs/api/resources/serveAd/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/serveAd/client/Client.js +111 -0
- package/dist/cjs/api/resources/serveAd/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/serveAd/client/index.js +17 -0
- package/dist/cjs/api/resources/serveAd/client/requests/AdsServeAdRequest.d.ts +10 -0
- package/dist/cjs/api/resources/serveAd/client/requests/AdsServeAdRequest.js +3 -0
- package/dist/cjs/api/resources/serveAd/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/serveAd/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/serveAd/exports.d.ts +2 -0
- package/dist/cjs/api/resources/serveAd/exports.js +21 -0
- package/dist/cjs/api/resources/serveAd/index.d.ts +2 -0
- package/dist/cjs/api/resources/serveAd/index.js +18 -0
- package/dist/cjs/api/resources/serveAd/types/AdsServeAdResponse.d.ts +4 -0
- package/dist/cjs/api/resources/serveAd/types/AdsServeAdResponse.js +3 -0
- package/dist/cjs/api/resources/serveAd/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/serveAd/types/index.js +17 -0
- package/dist/cjs/api/types/AdResource.d.ts +11 -0
- package/dist/cjs/api/types/AdResource.js +3 -0
- package/dist/cjs/api/types/NotFoundErrorBody.d.ts +2 -7
- package/dist/cjs/api/types/NotFoundErrorBody.js +0 -7
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/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/Client.d.mts +6 -0
- package/dist/esm/Client.mjs +10 -0
- package/dist/esm/api/resources/index.d.mts +5 -0
- package/dist/esm/api/resources/index.mjs +5 -0
- package/dist/esm/api/resources/recordClick/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/recordClick/client/Client.mjs +74 -0
- package/dist/esm/api/resources/recordClick/client/index.d.mts +1 -0
- package/dist/esm/api/resources/recordClick/client/index.mjs +1 -0
- package/dist/esm/api/resources/recordClick/client/requests/AdsRecordClickRequest.d.mts +10 -0
- package/dist/esm/api/resources/recordClick/client/requests/AdsRecordClickRequest.mjs +2 -0
- package/dist/esm/api/resources/recordClick/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/recordClick/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/recordClick/exports.d.mts +2 -0
- package/dist/esm/api/resources/recordClick/exports.mjs +3 -0
- package/dist/esm/api/resources/recordClick/index.d.mts +1 -0
- package/dist/esm/api/resources/recordClick/index.mjs +1 -0
- package/dist/esm/api/resources/serveAd/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/serveAd/client/Client.mjs +74 -0
- package/dist/esm/api/resources/serveAd/client/index.d.mts +1 -0
- package/dist/esm/api/resources/serveAd/client/index.mjs +1 -0
- package/dist/esm/api/resources/serveAd/client/requests/AdsServeAdRequest.d.mts +10 -0
- package/dist/esm/api/resources/serveAd/client/requests/AdsServeAdRequest.mjs +2 -0
- package/dist/esm/api/resources/serveAd/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/serveAd/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/serveAd/exports.d.mts +2 -0
- package/dist/esm/api/resources/serveAd/exports.mjs +3 -0
- package/dist/esm/api/resources/serveAd/index.d.mts +2 -0
- package/dist/esm/api/resources/serveAd/index.mjs +2 -0
- package/dist/esm/api/resources/serveAd/types/AdsServeAdResponse.d.mts +4 -0
- package/dist/esm/api/resources/serveAd/types/AdsServeAdResponse.mjs +2 -0
- package/dist/esm/api/resources/serveAd/types/index.d.mts +1 -0
- package/dist/esm/api/resources/serveAd/types/index.mjs +1 -0
- package/dist/esm/api/types/AdResource.d.mts +11 -0
- package/dist/esm/api/types/AdResource.mjs +2 -0
- package/dist/esm/api/types/NotFoundErrorBody.d.mts +2 -7
- package/dist/esm/api/types/NotFoundErrorBody.mjs +1 -6
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +23 -1
- package/reference.md +104 -0
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export interface NotFoundErrorBody {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare namespace NotFoundErrorBody {
|
|
5
|
-
const Message: {
|
|
6
|
-
readonly EventNotFound: "Event not found.";
|
|
7
|
-
};
|
|
8
|
-
type Message = (typeof Message)[keyof typeof Message];
|
|
2
|
+
/** Error overview. */
|
|
3
|
+
message: string;
|
|
9
4
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.NotFoundErrorBody = void 0;
|
|
5
|
-
var NotFoundErrorBody;
|
|
6
|
-
(function (NotFoundErrorBody) {
|
|
7
|
-
NotFoundErrorBody.Message = {
|
|
8
|
-
EventNotFound: "Event not found.",
|
|
9
|
-
};
|
|
10
|
-
})(NotFoundErrorBody || (exports.NotFoundErrorBody = NotFoundErrorBody = {}));
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AdResource.js"), exports);
|
|
17
18
|
__exportStar(require("./Allergen.js"), exports);
|
|
18
19
|
__exportStar(require("./BardBlockquoteNode.js"), exports);
|
|
19
20
|
__exportStar(require("./BardBody.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.15";
|
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": "@51eat/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "0.0.
|
|
10
|
-
"User-Agent": "@51eat/sdk/0.0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.0.15",
|
|
10
|
+
"User-Agent": "@51eat/sdk/0.0.15",
|
|
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/Client.d.mts
CHANGED
|
@@ -8,6 +8,8 @@ import { DiscoveryClient } from "./api/resources/discovery/client/Client.mjs";
|
|
|
8
8
|
import { EditorialsClient } from "./api/resources/editorials/client/Client.mjs";
|
|
9
9
|
import { EventsClient } from "./api/resources/events/client/Client.mjs";
|
|
10
10
|
import { MyAccountClient } from "./api/resources/myAccount/client/Client.mjs";
|
|
11
|
+
import { RecordClickClient } from "./api/resources/recordClick/client/Client.mjs";
|
|
12
|
+
import { ServeAdClient } from "./api/resources/serveAd/client/Client.mjs";
|
|
11
13
|
import { TicketingClient } from "./api/resources/ticketing/client/Client.mjs";
|
|
12
14
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
13
15
|
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
@@ -29,6 +31,8 @@ export declare class FiveOneEatClient {
|
|
|
29
31
|
protected _events: EventsClient | undefined;
|
|
30
32
|
protected _myAccount: MyAccountClient | undefined;
|
|
31
33
|
protected _ticketing: TicketingClient | undefined;
|
|
34
|
+
protected _recordClick: RecordClickClient | undefined;
|
|
35
|
+
protected _serveAd: ServeAdClient | undefined;
|
|
32
36
|
constructor(options?: FiveOneEatClient.Options);
|
|
33
37
|
get authentication(): AuthenticationClient;
|
|
34
38
|
get broadcasting(): BroadcastingClient;
|
|
@@ -40,6 +44,8 @@ export declare class FiveOneEatClient {
|
|
|
40
44
|
get events(): EventsClient;
|
|
41
45
|
get myAccount(): MyAccountClient;
|
|
42
46
|
get ticketing(): TicketingClient;
|
|
47
|
+
get recordClick(): RecordClickClient;
|
|
48
|
+
get serveAd(): ServeAdClient;
|
|
43
49
|
/**
|
|
44
50
|
* Returns grouped results for each type. Use per_type to control how many results
|
|
45
51
|
* appear per section. Optionally filter by category, city, or geo radius.
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -18,6 +18,8 @@ import { DiscoveryClient } from "./api/resources/discovery/client/Client.mjs";
|
|
|
18
18
|
import { EditorialsClient } from "./api/resources/editorials/client/Client.mjs";
|
|
19
19
|
import { EventsClient } from "./api/resources/events/client/Client.mjs";
|
|
20
20
|
import { MyAccountClient } from "./api/resources/myAccount/client/Client.mjs";
|
|
21
|
+
import { RecordClickClient } from "./api/resources/recordClick/client/Client.mjs";
|
|
22
|
+
import { ServeAdClient } from "./api/resources/serveAd/client/Client.mjs";
|
|
21
23
|
import { TicketingClient } from "./api/resources/ticketing/client/Client.mjs";
|
|
22
24
|
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
23
25
|
import { mergeHeaders } from "./core/headers.mjs";
|
|
@@ -70,6 +72,14 @@ export class FiveOneEatClient {
|
|
|
70
72
|
var _a;
|
|
71
73
|
return ((_a = this._ticketing) !== null && _a !== void 0 ? _a : (this._ticketing = new TicketingClient(this._options)));
|
|
72
74
|
}
|
|
75
|
+
get recordClick() {
|
|
76
|
+
var _a;
|
|
77
|
+
return ((_a = this._recordClick) !== null && _a !== void 0 ? _a : (this._recordClick = new RecordClickClient(this._options)));
|
|
78
|
+
}
|
|
79
|
+
get serveAd() {
|
|
80
|
+
var _a;
|
|
81
|
+
return ((_a = this._serveAd) !== null && _a !== void 0 ? _a : (this._serveAd = new ServeAdClient(this._options)));
|
|
82
|
+
}
|
|
73
83
|
/**
|
|
74
84
|
* Returns grouped results for each type. Use per_type to control how many results
|
|
75
85
|
* appear per section. Optionally filter by category, city, or geo radius.
|
|
@@ -24,6 +24,11 @@ export * from "./events/types/index.mjs";
|
|
|
24
24
|
export * from "./myAccount/client/requests/index.mjs";
|
|
25
25
|
export * as myAccount from "./myAccount/index.mjs";
|
|
26
26
|
export * from "./myAccount/types/index.mjs";
|
|
27
|
+
export * from "./recordClick/client/requests/index.mjs";
|
|
28
|
+
export * as recordClick from "./recordClick/index.mjs";
|
|
29
|
+
export * from "./serveAd/client/requests/index.mjs";
|
|
30
|
+
export * as serveAd from "./serveAd/index.mjs";
|
|
31
|
+
export * from "./serveAd/types/index.mjs";
|
|
27
32
|
export * from "./ticketing/client/requests/index.mjs";
|
|
28
33
|
export * as ticketing from "./ticketing/index.mjs";
|
|
29
34
|
export * from "./ticketing/types/index.mjs";
|
|
@@ -24,6 +24,11 @@ export * from "./events/types/index.mjs";
|
|
|
24
24
|
export * from "./myAccount/client/requests/index.mjs";
|
|
25
25
|
export * as myAccount from "./myAccount/index.mjs";
|
|
26
26
|
export * from "./myAccount/types/index.mjs";
|
|
27
|
+
export * from "./recordClick/client/requests/index.mjs";
|
|
28
|
+
export * as recordClick from "./recordClick/index.mjs";
|
|
29
|
+
export * from "./serveAd/client/requests/index.mjs";
|
|
30
|
+
export * as serveAd from "./serveAd/index.mjs";
|
|
31
|
+
export * from "./serveAd/types/index.mjs";
|
|
27
32
|
export * from "./ticketing/client/requests/index.mjs";
|
|
28
33
|
export * as ticketing from "./ticketing/index.mjs";
|
|
29
34
|
export * from "./ticketing/types/index.mjs";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../index.mjs";
|
|
5
|
+
export declare namespace RecordClickClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class RecordClickClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<RecordClickClient.Options>;
|
|
12
|
+
constructor(options?: RecordClickClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {FiveOneEat.AdsRecordClickRequest} request
|
|
15
|
+
* @param {RecordClickClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
|
+
*
|
|
17
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
18
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* await client.recordClick.adsRecordClick({
|
|
22
|
+
* advertisement: "advertisement"
|
|
23
|
+
* })
|
|
24
|
+
*/
|
|
25
|
+
adsRecordClick(request: FiveOneEat.AdsRecordClickRequest, requestOptions?: RecordClickClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
26
|
+
private __adsRecordClick;
|
|
27
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as FiveOneEat from "../../../index.mjs";
|
|
18
|
+
export class RecordClickClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param {FiveOneEat.AdsRecordClickRequest} request
|
|
24
|
+
* @param {RecordClickClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
27
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* await client.recordClick.adsRecordClick({
|
|
31
|
+
* advertisement: "advertisement"
|
|
32
|
+
* })
|
|
33
|
+
*/
|
|
34
|
+
adsRecordClick(request, requestOptions) {
|
|
35
|
+
return core.HttpResponsePromise.fromPromise(this.__adsRecordClick(request, requestOptions));
|
|
36
|
+
}
|
|
37
|
+
__adsRecordClick(request, requestOptions) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40
|
+
const { advertisement } = request;
|
|
41
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
42
|
+
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);
|
|
43
|
+
const _response = yield core.fetcher({
|
|
44
|
+
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.FiveOneEatEnvironment.Production, `customer/ads/${core.url.encodePathParam(advertisement)}/click`),
|
|
45
|
+
method: "POST",
|
|
46
|
+
headers: _headers,
|
|
47
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
48
|
+
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,
|
|
49
|
+
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,
|
|
50
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
51
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
52
|
+
logging: this._options.logging,
|
|
53
|
+
});
|
|
54
|
+
if (_response.ok) {
|
|
55
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
56
|
+
}
|
|
57
|
+
if (_response.error.reason === "status-code") {
|
|
58
|
+
switch (_response.error.statusCode) {
|
|
59
|
+
case 401:
|
|
60
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
61
|
+
case 404:
|
|
62
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
63
|
+
default:
|
|
64
|
+
throw new errors.FiveOneEatError({
|
|
65
|
+
statusCode: _response.error.statusCode,
|
|
66
|
+
body: _response.error.body,
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/customer/ads/{advertisement}/click");
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { AdsRecordClickRequest } from "./AdsRecordClickRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as FiveOneEat from "../../../index.mjs";
|
|
5
|
+
export declare namespace ServeAdClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ServeAdClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ServeAdClient.Options>;
|
|
12
|
+
constructor(options?: ServeAdClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* @param {FiveOneEat.AdsServeAdRequest} request
|
|
15
|
+
* @param {ServeAdClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
16
|
+
*
|
|
17
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
18
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* await client.serveAd.adsServeAd({
|
|
22
|
+
* placement: "placement"
|
|
23
|
+
* })
|
|
24
|
+
*/
|
|
25
|
+
adsServeAd(request: FiveOneEat.AdsServeAdRequest, requestOptions?: ServeAdClient.RequestOptions): core.HttpResponsePromise<FiveOneEat.AdsServeAdResponse>;
|
|
26
|
+
private __adsServeAd;
|
|
27
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import * as environments from "../../../../environments.mjs";
|
|
15
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
16
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
17
|
+
import * as FiveOneEat from "../../../index.mjs";
|
|
18
|
+
export class ServeAdClient {
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param {FiveOneEat.AdsServeAdRequest} request
|
|
24
|
+
* @param {ServeAdClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @throws {@link FiveOneEat.UnauthorizedError}
|
|
27
|
+
* @throws {@link FiveOneEat.NotFoundError}
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* await client.serveAd.adsServeAd({
|
|
31
|
+
* placement: "placement"
|
|
32
|
+
* })
|
|
33
|
+
*/
|
|
34
|
+
adsServeAd(request, requestOptions) {
|
|
35
|
+
return core.HttpResponsePromise.fromPromise(this.__adsServeAd(request, requestOptions));
|
|
36
|
+
}
|
|
37
|
+
__adsServeAd(request, requestOptions) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
40
|
+
const { placement } = request;
|
|
41
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
42
|
+
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);
|
|
43
|
+
const _response = yield core.fetcher({
|
|
44
|
+
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.FiveOneEatEnvironment.Production, `customer/ads/${core.url.encodePathParam(placement)}`),
|
|
45
|
+
method: "GET",
|
|
46
|
+
headers: _headers,
|
|
47
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
48
|
+
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,
|
|
49
|
+
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,
|
|
50
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
51
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
52
|
+
logging: this._options.logging,
|
|
53
|
+
});
|
|
54
|
+
if (_response.ok) {
|
|
55
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
56
|
+
}
|
|
57
|
+
if (_response.error.reason === "status-code") {
|
|
58
|
+
switch (_response.error.statusCode) {
|
|
59
|
+
case 401:
|
|
60
|
+
throw new FiveOneEat.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
61
|
+
case 404:
|
|
62
|
+
throw new FiveOneEat.NotFoundError(_response.error.body, _response.rawResponse);
|
|
63
|
+
default:
|
|
64
|
+
throw new errors.FiveOneEatError({
|
|
65
|
+
statusCode: _response.error.statusCode,
|
|
66
|
+
body: _response.error.body,
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/customer/ads/{placement}");
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { AdsServeAdRequest } from "./AdsServeAdRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AdsServeAdResponse.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AdsServeAdResponse.mjs";
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
export interface NotFoundErrorBody {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare namespace NotFoundErrorBody {
|
|
5
|
-
const Message: {
|
|
6
|
-
readonly EventNotFound: "Event not found.";
|
|
7
|
-
};
|
|
8
|
-
type Message = (typeof Message)[keyof typeof Message];
|
|
2
|
+
/** Error overview. */
|
|
3
|
+
message: string;
|
|
9
4
|
}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
export
|
|
3
|
-
(function (NotFoundErrorBody) {
|
|
4
|
-
NotFoundErrorBody.Message = {
|
|
5
|
-
EventNotFound: "Event not found.",
|
|
6
|
-
};
|
|
7
|
-
})(NotFoundErrorBody || (NotFoundErrorBody = {}));
|
|
2
|
+
export {};
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.15";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.0.
|
|
1
|
+
export const SDK_VERSION = "0.0.15";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@51eat/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -132,6 +132,28 @@
|
|
|
132
132
|
},
|
|
133
133
|
"default": "./dist/cjs/api/resources/ticketing/exports.js"
|
|
134
134
|
},
|
|
135
|
+
"./recordClick": {
|
|
136
|
+
"import": {
|
|
137
|
+
"types": "./dist/esm/api/resources/recordClick/exports.d.mts",
|
|
138
|
+
"default": "./dist/esm/api/resources/recordClick/exports.mjs"
|
|
139
|
+
},
|
|
140
|
+
"require": {
|
|
141
|
+
"types": "./dist/cjs/api/resources/recordClick/exports.d.ts",
|
|
142
|
+
"default": "./dist/cjs/api/resources/recordClick/exports.js"
|
|
143
|
+
},
|
|
144
|
+
"default": "./dist/cjs/api/resources/recordClick/exports.js"
|
|
145
|
+
},
|
|
146
|
+
"./serveAd": {
|
|
147
|
+
"import": {
|
|
148
|
+
"types": "./dist/esm/api/resources/serveAd/exports.d.mts",
|
|
149
|
+
"default": "./dist/esm/api/resources/serveAd/exports.mjs"
|
|
150
|
+
},
|
|
151
|
+
"require": {
|
|
152
|
+
"types": "./dist/cjs/api/resources/serveAd/exports.d.ts",
|
|
153
|
+
"default": "./dist/cjs/api/resources/serveAd/exports.js"
|
|
154
|
+
},
|
|
155
|
+
"default": "./dist/cjs/api/resources/serveAd/exports.js"
|
|
156
|
+
},
|
|
135
157
|
"./package.json": "./package.json"
|
|
136
158
|
},
|
|
137
159
|
"files": [
|