amazon-creators-api 1.2.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/LICENSE.txt +202 -0
- package/README.md +102 -0
- package/dist/ApiClient.d.ts +273 -0
- package/dist/ApiClient.js +895 -0
- package/dist/api/DefaultApi.d.ts +124 -0
- package/dist/api/DefaultApi.js +409 -0
- package/dist/api/TypedDefaultApi.d.ts +132 -0
- package/dist/api/TypedDefaultApi.js +223 -0
- package/dist/auth/OAuth2Config.d.ts +78 -0
- package/dist/auth/OAuth2Config.js +152 -0
- package/dist/auth/OAuth2TokenManager.d.ts +38 -0
- package/dist/auth/OAuth2TokenManager.js +177 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.js +657 -0
- package/dist/model/AccessDeniedExceptionResponseContent.d.ts +42 -0
- package/dist/model/AccessDeniedExceptionResponseContent.js +139 -0
- package/dist/model/AccessDeniedReason.d.ts +32 -0
- package/dist/model/AccessDeniedReason.js +65 -0
- package/dist/model/Availability.d.ts +27 -0
- package/dist/model/Availability.js +60 -0
- package/dist/model/BrowseNode.d.ts +35 -0
- package/dist/model/BrowseNode.js +184 -0
- package/dist/model/BrowseNodeAncestor.d.ts +32 -0
- package/dist/model/BrowseNodeAncestor.js +129 -0
- package/dist/model/BrowseNodeChild.d.ts +31 -0
- package/dist/model/BrowseNodeChild.js +116 -0
- package/dist/model/BrowseNodeInfo.d.ts +30 -0
- package/dist/model/BrowseNodeInfo.js +128 -0
- package/dist/model/BrowseNodesResult.d.ts +29 -0
- package/dist/model/BrowseNodesResult.js +114 -0
- package/dist/model/ByLineInfo.d.ts +31 -0
- package/dist/model/ByLineInfo.js +141 -0
- package/dist/model/Classifications.d.ts +30 -0
- package/dist/model/Classifications.js +107 -0
- package/dist/model/Condition.d.ts +27 -0
- package/dist/model/Condition.js +60 -0
- package/dist/model/ContentInfo.d.ts +32 -0
- package/dist/model/ContentInfo.js +135 -0
- package/dist/model/ContentRating.d.ts +29 -0
- package/dist/model/ContentRating.js +94 -0
- package/dist/model/Contributor.d.ts +32 -0
- package/dist/model/Contributor.js +128 -0
- package/dist/model/CustomerReviews.d.ts +30 -0
- package/dist/model/CustomerReviews.js +102 -0
- package/dist/model/DealDetails.d.ts +34 -0
- package/dist/model/DealDetails.js +144 -0
- package/dist/model/DeliveryFlag.d.ts +37 -0
- package/dist/model/DeliveryFlag.js +70 -0
- package/dist/model/DimensionBasedAttribute.d.ts +32 -0
- package/dist/model/DimensionBasedAttribute.js +133 -0
- package/dist/model/ErrorData.d.ts +41 -0
- package/dist/model/ErrorData.js +131 -0
- package/dist/model/ExternalIds.d.ts +31 -0
- package/dist/model/ExternalIds.js +120 -0
- package/dist/model/Feed.d.ts +44 -0
- package/dist/model/Feed.js +152 -0
- package/dist/model/GetBrowseNodesRequestContent.d.ts +43 -0
- package/dist/model/GetBrowseNodesRequestContent.js +158 -0
- package/dist/model/GetBrowseNodesResource.d.ts +27 -0
- package/dist/model/GetBrowseNodesResource.js +60 -0
- package/dist/model/GetBrowseNodesResponseContent.d.ts +30 -0
- package/dist/model/GetBrowseNodesResponseContent.js +128 -0
- package/dist/model/GetFeedRequestContent.d.ts +38 -0
- package/dist/model/GetFeedRequestContent.js +114 -0
- package/dist/model/GetFeedResponseContent.d.ts +38 -0
- package/dist/model/GetFeedResponseContent.js +114 -0
- package/dist/model/GetItemsRequestContent.d.ts +45 -0
- package/dist/model/GetItemsRequestContent.js +188 -0
- package/dist/model/GetItemsResource.d.ts +187 -0
- package/dist/model/GetItemsResource.js +220 -0
- package/dist/model/GetItemsResponseContent.d.ts +30 -0
- package/dist/model/GetItemsResponseContent.js +128 -0
- package/dist/model/GetReportRequestContent.d.ts +38 -0
- package/dist/model/GetReportRequestContent.js +114 -0
- package/dist/model/GetReportResponseContent.d.ts +38 -0
- package/dist/model/GetReportResponseContent.js +114 -0
- package/dist/model/GetVariationsRequestContent.d.ts +48 -0
- package/dist/model/GetVariationsRequestContent.js +209 -0
- package/dist/model/GetVariationsResource.d.ts +202 -0
- package/dist/model/GetVariationsResource.js +235 -0
- package/dist/model/GetVariationsResponseContent.d.ts +30 -0
- package/dist/model/GetVariationsResponseContent.js +128 -0
- package/dist/model/ImageSize.d.ts +31 -0
- package/dist/model/ImageSize.js +108 -0
- package/dist/model/ImageType.d.ts +32 -0
- package/dist/model/ImageType.js +133 -0
- package/dist/model/Images.d.ts +30 -0
- package/dist/model/Images.js +127 -0
- package/dist/model/InternalServerExceptionResponseContent.d.ts +40 -0
- package/dist/model/InternalServerExceptionResponseContent.js +128 -0
- package/dist/model/Item.d.ts +38 -0
- package/dist/model/Item.js +228 -0
- package/dist/model/ItemInfo.d.ts +39 -0
- package/dist/model/ItemInfo.js +234 -0
- package/dist/model/ItemsResult.d.ts +29 -0
- package/dist/model/ItemsResult.js +114 -0
- package/dist/model/LanguageType.d.ts +30 -0
- package/dist/model/LanguageType.js +104 -0
- package/dist/model/Languages.d.ts +31 -0
- package/dist/model/Languages.js +138 -0
- package/dist/model/ListFeedsResponseContent.d.ts +29 -0
- package/dist/model/ListFeedsResponseContent.js +112 -0
- package/dist/model/ListReportsResponseContent.d.ts +38 -0
- package/dist/model/ListReportsResponseContent.js +132 -0
- package/dist/model/ManufactureInfo.d.ts +31 -0
- package/dist/model/ManufactureInfo.js +120 -0
- package/dist/model/Money.d.ts +31 -0
- package/dist/model/Money.js +112 -0
- package/dist/model/MultiValuedAttribute.d.ts +31 -0
- package/dist/model/MultiValuedAttribute.js +117 -0
- package/dist/model/OfferAvailabilityV2.d.ts +32 -0
- package/dist/model/OfferAvailabilityV2.js +120 -0
- package/dist/model/OfferConditionV2.d.ts +31 -0
- package/dist/model/OfferConditionV2.js +116 -0
- package/dist/model/OfferListingV2.d.ts +37 -0
- package/dist/model/OfferListingV2.js +189 -0
- package/dist/model/OfferLoyaltyPointsV2.d.ts +29 -0
- package/dist/model/OfferLoyaltyPointsV2.js +88 -0
- package/dist/model/OfferMerchantInfoV2.d.ts +30 -0
- package/dist/model/OfferMerchantInfoV2.js +104 -0
- package/dist/model/OfferPriceV2.d.ts +32 -0
- package/dist/model/OfferPriceV2.js +135 -0
- package/dist/model/OfferSavingBasis.d.ts +31 -0
- package/dist/model/OfferSavingBasis.js +115 -0
- package/dist/model/OfferSavings.d.ts +30 -0
- package/dist/model/OfferSavings.js +102 -0
- package/dist/model/OfferType.d.ts +32 -0
- package/dist/model/OfferType.js +65 -0
- package/dist/model/OffersV2.d.ts +29 -0
- package/dist/model/OffersV2.js +114 -0
- package/dist/model/ProductInfo.d.ts +34 -0
- package/dist/model/ProductInfo.js +162 -0
- package/dist/model/Rating.d.ts +29 -0
- package/dist/model/Rating.js +88 -0
- package/dist/model/Refinement.d.ts +31 -0
- package/dist/model/Refinement.js +138 -0
- package/dist/model/RefinementBin.d.ts +30 -0
- package/dist/model/RefinementBin.js +104 -0
- package/dist/model/ReportMetadata.d.ts +44 -0
- package/dist/model/ReportMetadata.js +152 -0
- package/dist/model/ResourceNotFoundExceptionResponseContent.d.ts +44 -0
- package/dist/model/ResourceNotFoundExceptionResponseContent.js +156 -0
- package/dist/model/SavingBasisType.d.ts +37 -0
- package/dist/model/SavingBasisType.js +70 -0
- package/dist/model/SearchItemsRequestContent.d.ts +51 -0
- package/dist/model/SearchItemsRequestContent.js +343 -0
- package/dist/model/SearchItemsResource.d.ts +192 -0
- package/dist/model/SearchItemsResource.js +225 -0
- package/dist/model/SearchItemsResponseContent.d.ts +30 -0
- package/dist/model/SearchItemsResponseContent.js +128 -0
- package/dist/model/SearchRefinements.d.ts +31 -0
- package/dist/model/SearchRefinements.js +140 -0
- package/dist/model/SearchResult.d.ts +32 -0
- package/dist/model/SearchResult.js +148 -0
- package/dist/model/SingleBooleanValuedAttribute.d.ts +31 -0
- package/dist/model/SingleBooleanValuedAttribute.js +112 -0
- package/dist/model/SingleIntegerValuedAttribute.d.ts +31 -0
- package/dist/model/SingleIntegerValuedAttribute.js +112 -0
- package/dist/model/SingleStringValuedAttribute.d.ts +31 -0
- package/dist/model/SingleStringValuedAttribute.js +116 -0
- package/dist/model/SortBy.d.ts +47 -0
- package/dist/model/SortBy.js +80 -0
- package/dist/model/TechnicalInfo.d.ts +30 -0
- package/dist/model/TechnicalInfo.js +108 -0
- package/dist/model/ThrottleExceptionResponseContent.d.ts +42 -0
- package/dist/model/ThrottleExceptionResponseContent.js +152 -0
- package/dist/model/TradeInInfo.d.ts +30 -0
- package/dist/model/TradeInInfo.js +102 -0
- package/dist/model/TradeInPrice.d.ts +31 -0
- package/dist/model/TradeInPrice.js +112 -0
- package/dist/model/UnauthorizedExceptionReason.d.ts +62 -0
- package/dist/model/UnauthorizedExceptionReason.js +95 -0
- package/dist/model/UnauthorizedExceptionResponseContent.d.ts +41 -0
- package/dist/model/UnauthorizedExceptionResponseContent.js +137 -0
- package/dist/model/UnitBasedAttribute.d.ts +32 -0
- package/dist/model/UnitBasedAttribute.js +124 -0
- package/dist/model/ValidationExceptionField.d.ts +41 -0
- package/dist/model/ValidationExceptionField.js +129 -0
- package/dist/model/ValidationExceptionReason.d.ts +47 -0
- package/dist/model/ValidationExceptionReason.js +80 -0
- package/dist/model/ValidationExceptionResponseContent.d.ts +43 -0
- package/dist/model/ValidationExceptionResponseContent.js +170 -0
- package/dist/model/VariationAttribute.d.ts +30 -0
- package/dist/model/VariationAttribute.js +104 -0
- package/dist/model/VariationDimension.d.ts +32 -0
- package/dist/model/VariationDimension.js +132 -0
- package/dist/model/VariationSummary.d.ts +32 -0
- package/dist/model/VariationSummary.js +146 -0
- package/dist/model/VariationSummaryPrice.d.ts +30 -0
- package/dist/model/VariationSummaryPrice.js +107 -0
- package/dist/model/VariationsResult.d.ts +30 -0
- package/dist/model/VariationsResult.js +128 -0
- package/dist/model/WebsiteSalesRank.d.ts +32 -0
- package/dist/model/WebsiteSalesRank.js +124 -0
- package/package.json +67 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thin typed wrapper around DefaultApi that keeps runtime behavior unchanged
|
|
3
|
+
* while exposing strongly-typed method signatures to TypeScript consumers.
|
|
4
|
+
*/
|
|
5
|
+
export default class TypedDefaultApi {
|
|
6
|
+
/**
|
|
7
|
+
* @param {ApiClient} [apiClient] Optional ApiClient instance.
|
|
8
|
+
*/
|
|
9
|
+
constructor(apiClient?: ApiClient);
|
|
10
|
+
/** @type {ApiClient} */
|
|
11
|
+
apiClient: ApiClient;
|
|
12
|
+
/** @type {DefaultApi} */
|
|
13
|
+
defaultApi: DefaultApi;
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} xMarketplace
|
|
16
|
+
* @param {import('../model/GetBrowseNodesRequestContent').default} request
|
|
17
|
+
* @returns {Promise<import('../model/GetBrowseNodesResponseContent').default>}
|
|
18
|
+
*/
|
|
19
|
+
getBrowseNodes(xMarketplace: string, request: import("../model/GetBrowseNodesRequestContent").default): Promise<import("../model/GetBrowseNodesResponseContent").default>;
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} xMarketplace
|
|
22
|
+
* @param {import('../model/GetBrowseNodesRequestContent').default} request
|
|
23
|
+
* @returns {Promise<{ data: import('../model/GetBrowseNodesResponseContent').default, response: any }>}
|
|
24
|
+
*/
|
|
25
|
+
getBrowseNodesWithHttpInfo(xMarketplace: string, request: import("../model/GetBrowseNodesRequestContent").default): Promise<{
|
|
26
|
+
data: import("../model/GetBrowseNodesResponseContent").default;
|
|
27
|
+
response: any;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* @param {string} xMarketplace
|
|
31
|
+
* @param {import('../model/GetFeedRequestContent').default} request
|
|
32
|
+
* @returns {Promise<import('../model/GetFeedResponseContent').default>}
|
|
33
|
+
*/
|
|
34
|
+
getFeed(xMarketplace: string, request: import("../model/GetFeedRequestContent").default): Promise<import("../model/GetFeedResponseContent").default>;
|
|
35
|
+
/**
|
|
36
|
+
* @param {string} xMarketplace
|
|
37
|
+
* @param {import('../model/GetFeedRequestContent').default} request
|
|
38
|
+
* @returns {Promise<{ data: import('../model/GetFeedResponseContent').default, response: any }>}
|
|
39
|
+
*/
|
|
40
|
+
getFeedWithHttpInfo(xMarketplace: string, request: import("../model/GetFeedRequestContent").default): Promise<{
|
|
41
|
+
data: import("../model/GetFeedResponseContent").default;
|
|
42
|
+
response: any;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* @param {string} xMarketplace
|
|
46
|
+
* @param {import('../model/GetItemsRequestContent').default} request
|
|
47
|
+
* @returns {Promise<import('../model/GetItemsResponseContent').default>}
|
|
48
|
+
*/
|
|
49
|
+
getItems(xMarketplace: string, request: import("../model/GetItemsRequestContent").default): Promise<import("../model/GetItemsResponseContent").default>;
|
|
50
|
+
/**
|
|
51
|
+
* @param {string} xMarketplace
|
|
52
|
+
* @param {import('../model/GetItemsRequestContent').default} request
|
|
53
|
+
* @returns {Promise<{ data: import('../model/GetItemsResponseContent').default, response: any }>}
|
|
54
|
+
*/
|
|
55
|
+
getItemsWithHttpInfo(xMarketplace: string, request: import("../model/GetItemsRequestContent").default): Promise<{
|
|
56
|
+
data: import("../model/GetItemsResponseContent").default;
|
|
57
|
+
response: any;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* @param {string} xMarketplace
|
|
61
|
+
* @param {import('../model/GetReportRequestContent').default} request
|
|
62
|
+
* @returns {Promise<import('../model/GetReportResponseContent').default>}
|
|
63
|
+
*/
|
|
64
|
+
getReport(xMarketplace: string, request: import("../model/GetReportRequestContent").default): Promise<import("../model/GetReportResponseContent").default>;
|
|
65
|
+
/**
|
|
66
|
+
* @param {string} xMarketplace
|
|
67
|
+
* @param {import('../model/GetReportRequestContent').default} request
|
|
68
|
+
* @returns {Promise<{ data: import('../model/GetReportResponseContent').default, response: any }>}
|
|
69
|
+
*/
|
|
70
|
+
getReportWithHttpInfo(xMarketplace: string, request: import("../model/GetReportRequestContent").default): Promise<{
|
|
71
|
+
data: import("../model/GetReportResponseContent").default;
|
|
72
|
+
response: any;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* @param {string} xMarketplace
|
|
76
|
+
* @param {import('../model/GetVariationsRequestContent').default} request
|
|
77
|
+
* @returns {Promise<import('../model/GetVariationsResponseContent').default>}
|
|
78
|
+
*/
|
|
79
|
+
getVariations(xMarketplace: string, request: import("../model/GetVariationsRequestContent").default): Promise<import("../model/GetVariationsResponseContent").default>;
|
|
80
|
+
/**
|
|
81
|
+
* @param {string} xMarketplace
|
|
82
|
+
* @param {import('../model/GetVariationsRequestContent').default} request
|
|
83
|
+
* @returns {Promise<{ data: import('../model/GetVariationsResponseContent').default, response: any }>}
|
|
84
|
+
*/
|
|
85
|
+
getVariationsWithHttpInfo(xMarketplace: string, request: import("../model/GetVariationsRequestContent").default): Promise<{
|
|
86
|
+
data: import("../model/GetVariationsResponseContent").default;
|
|
87
|
+
response: any;
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* @param {string} xMarketplace
|
|
91
|
+
* @returns {Promise<import('../model/ListFeedsResponseContent').default>}
|
|
92
|
+
*/
|
|
93
|
+
listFeeds(xMarketplace: string): Promise<import("../model/ListFeedsResponseContent").default>;
|
|
94
|
+
/**
|
|
95
|
+
* @param {string} xMarketplace
|
|
96
|
+
* @returns {Promise<{ data: import('../model/ListFeedsResponseContent').default, response: any }>}
|
|
97
|
+
*/
|
|
98
|
+
listFeedsWithHttpInfo(xMarketplace: string): Promise<{
|
|
99
|
+
data: import("../model/ListFeedsResponseContent").default;
|
|
100
|
+
response: any;
|
|
101
|
+
}>;
|
|
102
|
+
/**
|
|
103
|
+
* @param {string} xMarketplace
|
|
104
|
+
* @returns {Promise<import('../model/ListReportsResponseContent').default>}
|
|
105
|
+
*/
|
|
106
|
+
listReports(xMarketplace: string): Promise<import("../model/ListReportsResponseContent").default>;
|
|
107
|
+
/**
|
|
108
|
+
* @param {string} xMarketplace
|
|
109
|
+
* @returns {Promise<{ data: import('../model/ListReportsResponseContent').default, response: any }>}
|
|
110
|
+
*/
|
|
111
|
+
listReportsWithHttpInfo(xMarketplace: string): Promise<{
|
|
112
|
+
data: import("../model/ListReportsResponseContent").default;
|
|
113
|
+
response: any;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* @param {string} xMarketplace
|
|
117
|
+
* @param {import('../model/SearchItemsRequestContent').default} request
|
|
118
|
+
* @returns {Promise<import('../model/SearchItemsResponseContent').default>}
|
|
119
|
+
*/
|
|
120
|
+
searchItems(xMarketplace: string, request: import("../model/SearchItemsRequestContent").default): Promise<import("../model/SearchItemsResponseContent").default>;
|
|
121
|
+
/**
|
|
122
|
+
* @param {string} xMarketplace
|
|
123
|
+
* @param {import('../model/SearchItemsRequestContent').default} request
|
|
124
|
+
* @returns {Promise<{ data: import('../model/SearchItemsResponseContent').default, response: any }>}
|
|
125
|
+
*/
|
|
126
|
+
searchItemsWithHttpInfo(xMarketplace: string, request: import("../model/SearchItemsRequestContent").default): Promise<{
|
|
127
|
+
data: import("../model/SearchItemsResponseContent").default;
|
|
128
|
+
response: any;
|
|
129
|
+
}>;
|
|
130
|
+
}
|
|
131
|
+
import ApiClient from "../ApiClient";
|
|
132
|
+
import DefaultApi from "./DefaultApi";
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _DefaultApi = _interopRequireDefault(require("./DefaultApi"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
13
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
16
|
+
* Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
17
|
+
*
|
|
18
|
+
* Licensed under the Apache License, Version 2.0 (the "License").
|
|
19
|
+
* You may not use this file except in compliance with the License.
|
|
20
|
+
* A copy of the License is located at
|
|
21
|
+
*
|
|
22
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
23
|
+
*
|
|
24
|
+
* or in the "license" file accompanying this file. This file is distributed
|
|
25
|
+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
26
|
+
* express or implied. See the License for the specific language governing
|
|
27
|
+
* permissions and limitations under the License.
|
|
28
|
+
*/ /**
|
|
29
|
+
* Copyright (c) 2026 Ryan Chiang
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Thin typed wrapper around DefaultApi that keeps runtime behavior unchanged
|
|
33
|
+
* while exposing strongly-typed method signatures to TypeScript consumers.
|
|
34
|
+
*/
|
|
35
|
+
var TypedDefaultApi = exports["default"] = /*#__PURE__*/function () {
|
|
36
|
+
/**
|
|
37
|
+
* @param {ApiClient} [apiClient] Optional ApiClient instance.
|
|
38
|
+
*/
|
|
39
|
+
function TypedDefaultApi(apiClient) {
|
|
40
|
+
_classCallCheck(this, TypedDefaultApi);
|
|
41
|
+
/** @type {ApiClient} */
|
|
42
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
43
|
+
/** @type {DefaultApi} */
|
|
44
|
+
this.defaultApi = new _DefaultApi["default"](this.apiClient);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @param {string} xMarketplace
|
|
49
|
+
* @param {import('../model/GetBrowseNodesRequestContent').default} request
|
|
50
|
+
* @returns {Promise<import('../model/GetBrowseNodesResponseContent').default>}
|
|
51
|
+
*/
|
|
52
|
+
return _createClass(TypedDefaultApi, [{
|
|
53
|
+
key: "getBrowseNodes",
|
|
54
|
+
value: function getBrowseNodes(xMarketplace, request) {
|
|
55
|
+
return this.defaultApi.getBrowseNodes(xMarketplace, request);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param {string} xMarketplace
|
|
60
|
+
* @param {import('../model/GetBrowseNodesRequestContent').default} request
|
|
61
|
+
* @returns {Promise<{ data: import('../model/GetBrowseNodesResponseContent').default, response: any }>}
|
|
62
|
+
*/
|
|
63
|
+
}, {
|
|
64
|
+
key: "getBrowseNodesWithHttpInfo",
|
|
65
|
+
value: function getBrowseNodesWithHttpInfo(xMarketplace, request) {
|
|
66
|
+
return this.defaultApi.getBrowseNodesWithHttpInfo(xMarketplace, request);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param {string} xMarketplace
|
|
71
|
+
* @param {import('../model/GetFeedRequestContent').default} request
|
|
72
|
+
* @returns {Promise<import('../model/GetFeedResponseContent').default>}
|
|
73
|
+
*/
|
|
74
|
+
}, {
|
|
75
|
+
key: "getFeed",
|
|
76
|
+
value: function getFeed(xMarketplace, request) {
|
|
77
|
+
return this.defaultApi.getFeed(xMarketplace, request);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @param {string} xMarketplace
|
|
82
|
+
* @param {import('../model/GetFeedRequestContent').default} request
|
|
83
|
+
* @returns {Promise<{ data: import('../model/GetFeedResponseContent').default, response: any }>}
|
|
84
|
+
*/
|
|
85
|
+
}, {
|
|
86
|
+
key: "getFeedWithHttpInfo",
|
|
87
|
+
value: function getFeedWithHttpInfo(xMarketplace, request) {
|
|
88
|
+
return this.defaultApi.getFeedWithHttpInfo(xMarketplace, request);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* @param {string} xMarketplace
|
|
93
|
+
* @param {import('../model/GetItemsRequestContent').default} request
|
|
94
|
+
* @returns {Promise<import('../model/GetItemsResponseContent').default>}
|
|
95
|
+
*/
|
|
96
|
+
}, {
|
|
97
|
+
key: "getItems",
|
|
98
|
+
value: function getItems(xMarketplace, request) {
|
|
99
|
+
return this.defaultApi.getItems(xMarketplace, request);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @param {string} xMarketplace
|
|
104
|
+
* @param {import('../model/GetItemsRequestContent').default} request
|
|
105
|
+
* @returns {Promise<{ data: import('../model/GetItemsResponseContent').default, response: any }>}
|
|
106
|
+
*/
|
|
107
|
+
}, {
|
|
108
|
+
key: "getItemsWithHttpInfo",
|
|
109
|
+
value: function getItemsWithHttpInfo(xMarketplace, request) {
|
|
110
|
+
return this.defaultApi.getItemsWithHttpInfo(xMarketplace, request);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @param {string} xMarketplace
|
|
115
|
+
* @param {import('../model/GetReportRequestContent').default} request
|
|
116
|
+
* @returns {Promise<import('../model/GetReportResponseContent').default>}
|
|
117
|
+
*/
|
|
118
|
+
}, {
|
|
119
|
+
key: "getReport",
|
|
120
|
+
value: function getReport(xMarketplace, request) {
|
|
121
|
+
return this.defaultApi.getReport(xMarketplace, request);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @param {string} xMarketplace
|
|
126
|
+
* @param {import('../model/GetReportRequestContent').default} request
|
|
127
|
+
* @returns {Promise<{ data: import('../model/GetReportResponseContent').default, response: any }>}
|
|
128
|
+
*/
|
|
129
|
+
}, {
|
|
130
|
+
key: "getReportWithHttpInfo",
|
|
131
|
+
value: function getReportWithHttpInfo(xMarketplace, request) {
|
|
132
|
+
return this.defaultApi.getReportWithHttpInfo(xMarketplace, request);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @param {string} xMarketplace
|
|
137
|
+
* @param {import('../model/GetVariationsRequestContent').default} request
|
|
138
|
+
* @returns {Promise<import('../model/GetVariationsResponseContent').default>}
|
|
139
|
+
*/
|
|
140
|
+
}, {
|
|
141
|
+
key: "getVariations",
|
|
142
|
+
value: function getVariations(xMarketplace, request) {
|
|
143
|
+
return this.defaultApi.getVariations(xMarketplace, request);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @param {string} xMarketplace
|
|
148
|
+
* @param {import('../model/GetVariationsRequestContent').default} request
|
|
149
|
+
* @returns {Promise<{ data: import('../model/GetVariationsResponseContent').default, response: any }>}
|
|
150
|
+
*/
|
|
151
|
+
}, {
|
|
152
|
+
key: "getVariationsWithHttpInfo",
|
|
153
|
+
value: function getVariationsWithHttpInfo(xMarketplace, request) {
|
|
154
|
+
return this.defaultApi.getVariationsWithHttpInfo(xMarketplace, request);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @param {string} xMarketplace
|
|
159
|
+
* @returns {Promise<import('../model/ListFeedsResponseContent').default>}
|
|
160
|
+
*/
|
|
161
|
+
}, {
|
|
162
|
+
key: "listFeeds",
|
|
163
|
+
value: function listFeeds(xMarketplace) {
|
|
164
|
+
return this.defaultApi.listFeeds(xMarketplace);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @param {string} xMarketplace
|
|
169
|
+
* @returns {Promise<{ data: import('../model/ListFeedsResponseContent').default, response: any }>}
|
|
170
|
+
*/
|
|
171
|
+
}, {
|
|
172
|
+
key: "listFeedsWithHttpInfo",
|
|
173
|
+
value: function listFeedsWithHttpInfo(xMarketplace) {
|
|
174
|
+
return this.defaultApi.listFeedsWithHttpInfo(xMarketplace);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @param {string} xMarketplace
|
|
179
|
+
* @returns {Promise<import('../model/ListReportsResponseContent').default>}
|
|
180
|
+
*/
|
|
181
|
+
}, {
|
|
182
|
+
key: "listReports",
|
|
183
|
+
value: function listReports(xMarketplace) {
|
|
184
|
+
return this.defaultApi.listReports(xMarketplace);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @param {string} xMarketplace
|
|
189
|
+
* @returns {Promise<{ data: import('../model/ListReportsResponseContent').default, response: any }>}
|
|
190
|
+
*/
|
|
191
|
+
}, {
|
|
192
|
+
key: "listReportsWithHttpInfo",
|
|
193
|
+
value: function listReportsWithHttpInfo(xMarketplace) {
|
|
194
|
+
return this.defaultApi.listReportsWithHttpInfo(xMarketplace);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @param {string} xMarketplace
|
|
199
|
+
* @param {import('../model/SearchItemsRequestContent').default} request
|
|
200
|
+
* @returns {Promise<import('../model/SearchItemsResponseContent').default>}
|
|
201
|
+
*/
|
|
202
|
+
}, {
|
|
203
|
+
key: "searchItems",
|
|
204
|
+
value: function searchItems(xMarketplace, request) {
|
|
205
|
+
return this.defaultApi.searchItems(xMarketplace, {
|
|
206
|
+
searchItemsRequestContent: request
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* @param {string} xMarketplace
|
|
212
|
+
* @param {import('../model/SearchItemsRequestContent').default} request
|
|
213
|
+
* @returns {Promise<{ data: import('../model/SearchItemsResponseContent').default, response: any }>}
|
|
214
|
+
*/
|
|
215
|
+
}, {
|
|
216
|
+
key: "searchItemsWithHttpInfo",
|
|
217
|
+
value: function searchItemsWithHttpInfo(xMarketplace, request) {
|
|
218
|
+
return this.defaultApi.searchItemsWithHttpInfo(xMarketplace, {
|
|
219
|
+
searchItemsRequestContent: request
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}]);
|
|
223
|
+
}();
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export = OAuth2Config;
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License").
|
|
6
|
+
* You may not use this file except in compliance with the License.
|
|
7
|
+
* A copy of the License is located at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* or in the "license" file accompanying this file. This file is distributed
|
|
12
|
+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
13
|
+
* express or implied. See the License for the specific language governing
|
|
14
|
+
* permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* OAuth2 configuration class that manages version-specific cognito endpoints
|
|
18
|
+
* @class OAuth2Config
|
|
19
|
+
*/
|
|
20
|
+
declare class OAuth2Config {
|
|
21
|
+
static COGNITO_SCOPE: string;
|
|
22
|
+
static LWA_SCOPE: string;
|
|
23
|
+
static GRANT_TYPE: string;
|
|
24
|
+
/**
|
|
25
|
+
* Creates an OAuth2Config instance
|
|
26
|
+
* @param {string} credentialId - The OAuth2 credential ID
|
|
27
|
+
* @param {string} credentialSecret - The OAuth2 credential secret
|
|
28
|
+
* @param {string} version - The OAuth2 token version (determines the token endpoint)
|
|
29
|
+
* @param {string} authEndpoint - OAuth2 auth endpoint URL
|
|
30
|
+
*/
|
|
31
|
+
constructor(credentialId: string, credentialSecret: string, version: string, authEndpoint: string);
|
|
32
|
+
credentialId: string;
|
|
33
|
+
credentialSecret: string;
|
|
34
|
+
version: string;
|
|
35
|
+
authEndpoint: string;
|
|
36
|
+
cognitoEndpoint: string;
|
|
37
|
+
/**
|
|
38
|
+
* Determines the token endpoint to use
|
|
39
|
+
* @returns {string} The OAuth2 token endpoint URL
|
|
40
|
+
* @throws {Error} If the version is not supported and no custom authEndpoint is provided
|
|
41
|
+
*/
|
|
42
|
+
determineTokenEndpoint(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if this is an LWA (v3.x) configuration
|
|
45
|
+
* @returns {boolean} True if using LWA authentication
|
|
46
|
+
*/
|
|
47
|
+
isLwa(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Gets the credential ID
|
|
50
|
+
* @returns {string} The credential ID
|
|
51
|
+
*/
|
|
52
|
+
getCredentialId(): string;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the credential secret
|
|
55
|
+
* @returns {string} The credential secret
|
|
56
|
+
*/
|
|
57
|
+
getCredentialSecret(): string;
|
|
58
|
+
/**
|
|
59
|
+
* Gets the credential version
|
|
60
|
+
* @returns {string} The credential version
|
|
61
|
+
*/
|
|
62
|
+
getVersion(): string;
|
|
63
|
+
/**
|
|
64
|
+
* Gets the Cognito token endpoint URL
|
|
65
|
+
* @returns {string} The token endpoint URL
|
|
66
|
+
*/
|
|
67
|
+
getCognitoEndpoint(): string;
|
|
68
|
+
/**
|
|
69
|
+
* Gets the OAuth2 scope
|
|
70
|
+
* @returns {string} The OAuth2 scope
|
|
71
|
+
*/
|
|
72
|
+
getScope(): string;
|
|
73
|
+
/**
|
|
74
|
+
* Gets the OAuth2 grant type
|
|
75
|
+
* @returns {string} The OAuth2 grant type
|
|
76
|
+
*/
|
|
77
|
+
getGrantType(): string;
|
|
78
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
5
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
6
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
7
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
/**
|
|
11
|
+
* Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License").
|
|
14
|
+
* You may not use this file except in compliance with the License.
|
|
15
|
+
* A copy of the License is located at
|
|
16
|
+
*
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* or in the "license" file accompanying this file. This file is distributed
|
|
20
|
+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
|
|
21
|
+
* express or implied. See the License for the specific language governing
|
|
22
|
+
* permissions and limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* OAuth2 configuration class that manages version-specific cognito endpoints
|
|
26
|
+
* @class OAuth2Config
|
|
27
|
+
*/
|
|
28
|
+
var OAuth2Config = /*#__PURE__*/function () {
|
|
29
|
+
/**
|
|
30
|
+
* Creates an OAuth2Config instance
|
|
31
|
+
* @param {string} credentialId - The OAuth2 credential ID
|
|
32
|
+
* @param {string} credentialSecret - The OAuth2 credential secret
|
|
33
|
+
* @param {string} version - The OAuth2 token version (determines the token endpoint)
|
|
34
|
+
* @param {string} authEndpoint - OAuth2 auth endpoint URL
|
|
35
|
+
*/
|
|
36
|
+
function OAuth2Config(credentialId, credentialSecret, version, authEndpoint) {
|
|
37
|
+
_classCallCheck(this, OAuth2Config);
|
|
38
|
+
this.credentialId = credentialId;
|
|
39
|
+
this.credentialSecret = credentialSecret;
|
|
40
|
+
this.version = version;
|
|
41
|
+
this.authEndpoint = authEndpoint;
|
|
42
|
+
this.cognitoEndpoint = this.determineTokenEndpoint();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Determines the token endpoint to use
|
|
47
|
+
* @returns {string} The OAuth2 token endpoint URL
|
|
48
|
+
* @throws {Error} If the version is not supported and no custom authEndpoint is provided
|
|
49
|
+
*/
|
|
50
|
+
return _createClass(OAuth2Config, [{
|
|
51
|
+
key: "determineTokenEndpoint",
|
|
52
|
+
value: function determineTokenEndpoint() {
|
|
53
|
+
// Custom authEndpoint used for testing
|
|
54
|
+
if (this.authEndpoint) {
|
|
55
|
+
return this.authEndpoint;
|
|
56
|
+
}
|
|
57
|
+
switch (this.version) {
|
|
58
|
+
// Cognito endpoints (v2.x)
|
|
59
|
+
case "2.1":
|
|
60
|
+
return "https://creatorsapi.auth.us-east-1.amazoncognito.com/oauth2/token";
|
|
61
|
+
case "2.2":
|
|
62
|
+
return "https://creatorsapi.auth.eu-south-2.amazoncognito.com/oauth2/token";
|
|
63
|
+
case "2.3":
|
|
64
|
+
return "https://creatorsapi.auth.us-west-2.amazoncognito.com/oauth2/token";
|
|
65
|
+
// LWA endpoints (v3.x)
|
|
66
|
+
case "3.1":
|
|
67
|
+
return "https://api.amazon.com/auth/o2/token";
|
|
68
|
+
case "3.2":
|
|
69
|
+
return "https://api.amazon.co.uk/auth/o2/token";
|
|
70
|
+
case "3.3":
|
|
71
|
+
return "https://api.amazon.co.jp/auth/o2/token";
|
|
72
|
+
default:
|
|
73
|
+
throw new Error("Unsupported version: ".concat(this.version, ". Supported versions are: 2.1, 2.2, 2.3, 3.1, 3.2, 3.3"));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Checks if this is an LWA (v3.x) configuration
|
|
79
|
+
* @returns {boolean} True if using LWA authentication
|
|
80
|
+
*/
|
|
81
|
+
}, {
|
|
82
|
+
key: "isLwa",
|
|
83
|
+
value: function isLwa() {
|
|
84
|
+
return this.version.startsWith("3.");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Gets the credential ID
|
|
89
|
+
* @returns {string} The credential ID
|
|
90
|
+
*/
|
|
91
|
+
}, {
|
|
92
|
+
key: "getCredentialId",
|
|
93
|
+
value: function getCredentialId() {
|
|
94
|
+
return this.credentialId;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Gets the credential secret
|
|
99
|
+
* @returns {string} The credential secret
|
|
100
|
+
*/
|
|
101
|
+
}, {
|
|
102
|
+
key: "getCredentialSecret",
|
|
103
|
+
value: function getCredentialSecret() {
|
|
104
|
+
return this.credentialSecret;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Gets the credential version
|
|
109
|
+
* @returns {string} The credential version
|
|
110
|
+
*/
|
|
111
|
+
}, {
|
|
112
|
+
key: "getVersion",
|
|
113
|
+
value: function getVersion() {
|
|
114
|
+
return this.version;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Gets the Cognito token endpoint URL
|
|
119
|
+
* @returns {string} The token endpoint URL
|
|
120
|
+
*/
|
|
121
|
+
}, {
|
|
122
|
+
key: "getCognitoEndpoint",
|
|
123
|
+
value: function getCognitoEndpoint() {
|
|
124
|
+
return this.cognitoEndpoint;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Gets the OAuth2 scope
|
|
129
|
+
* @returns {string} The OAuth2 scope
|
|
130
|
+
*/
|
|
131
|
+
}, {
|
|
132
|
+
key: "getScope",
|
|
133
|
+
value: function getScope() {
|
|
134
|
+
return this.isLwa() ? OAuth2Config.LWA_SCOPE : OAuth2Config.COGNITO_SCOPE;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Gets the OAuth2 grant type
|
|
139
|
+
* @returns {string} The OAuth2 grant type
|
|
140
|
+
*/
|
|
141
|
+
}, {
|
|
142
|
+
key: "getGrantType",
|
|
143
|
+
value: function getGrantType() {
|
|
144
|
+
return OAuth2Config.GRANT_TYPE;
|
|
145
|
+
}
|
|
146
|
+
}]);
|
|
147
|
+
}();
|
|
148
|
+
// Constants
|
|
149
|
+
_defineProperty(OAuth2Config, "COGNITO_SCOPE", "creatorsapi/default");
|
|
150
|
+
_defineProperty(OAuth2Config, "LWA_SCOPE", "creatorsapi::default");
|
|
151
|
+
_defineProperty(OAuth2Config, "GRANT_TYPE", "client_credentials");
|
|
152
|
+
module.exports = OAuth2Config;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export = OAuth2TokenManager;
|
|
2
|
+
/**
|
|
3
|
+
* OAuth2 token manager that handles token acquisition, caching, and automatic refresh
|
|
4
|
+
* Note: ApiClient automatically manages token caching for optimal performance.
|
|
5
|
+
* Direct instantiation is only needed for advanced use cases.
|
|
6
|
+
* @class OAuth2TokenManager
|
|
7
|
+
*/
|
|
8
|
+
declare class OAuth2TokenManager {
|
|
9
|
+
/**
|
|
10
|
+
* Creates an OAuth2TokenManager instance
|
|
11
|
+
* @param {OAuth2Config} config - The OAuth2 configuration
|
|
12
|
+
*/
|
|
13
|
+
constructor(config: OAuth2Config);
|
|
14
|
+
config: OAuth2Config;
|
|
15
|
+
accessToken: any;
|
|
16
|
+
expiresAt: number;
|
|
17
|
+
/**
|
|
18
|
+
* Gets a valid OAuth2 access token, refreshing if necessary
|
|
19
|
+
* @returns {Promise<string>} A promise that resolves to a valid access token
|
|
20
|
+
* @throws {Error} If token acquisition fails
|
|
21
|
+
*/
|
|
22
|
+
getToken(): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Checks if the current token is valid and not expired
|
|
25
|
+
* @returns {boolean} True if the token is valid, false otherwise
|
|
26
|
+
*/
|
|
27
|
+
isTokenValid(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Refreshes the OAuth2 access token using client credentials grant
|
|
30
|
+
* @returns {Promise<string>} A promise that resolves to the new access token
|
|
31
|
+
* @throws {Error} If token refresh fails
|
|
32
|
+
*/
|
|
33
|
+
refreshToken(): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Clears the cached token, forcing a refresh on the next getToken() call
|
|
36
|
+
*/
|
|
37
|
+
clearToken(): void;
|
|
38
|
+
}
|