@remkoj/optimizely-cms-api 5.0.2 → 6.0.0-pre1
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/api-client.d.ts +53 -10
- package/dist/api-client.js +142 -42
- package/dist/client/client/client.d.ts +2 -0
- package/dist/client/client/client.js +147 -0
- package/dist/client/client/index.d.ts +7 -0
- package/dist/client/client/index.js +14 -0
- package/dist/client/client/types.d.ts +119 -0
- package/dist/client/client/utils.d.ts +45 -0
- package/dist/client/client/utils.js +296 -0
- package/dist/client/client.gen.d.ts +12 -0
- package/dist/client/client.gen.js +9 -0
- package/dist/client/core/auth.d.ts +18 -0
- package/dist/client/core/auth.js +17 -0
- package/dist/client/core/bodySerializer.d.ts +17 -0
- package/dist/client/core/bodySerializer.js +56 -0
- package/dist/client/core/params.d.ts +23 -0
- package/dist/client/core/params.js +91 -0
- package/dist/client/core/pathSerializer.d.ts +33 -0
- package/dist/client/core/pathSerializer.js +122 -0
- package/dist/client/core/types.d.ts +73 -0
- package/dist/client/index.d.ts +4 -78
- package/dist/client/index.js +19 -46
- package/dist/client/sdk.gen.d.ts +256 -0
- package/dist/client/sdk.gen.js +638 -0
- package/dist/client/transformers.gen.d.ts +34 -0
- package/dist/client/transformers.gen.js +273 -0
- package/dist/client/types.gen.d.ts +2941 -0
- package/dist/client/types.gen.js +87 -0
- package/dist/client-config.d.ts +2 -0
- package/dist/client-config.js +27 -0
- package/dist/config.js +1 -2
- package/dist/getaccesstoken.js +1 -2
- package/dist/index.d.ts +3 -5
- package/dist/index.js +6 -8
- package/dist/version.json +2 -2
- package/package.json +20 -11
- package/dist/client/CmsIntegrationApiClient.d.ts +0 -22
- package/dist/client/CmsIntegrationApiClient.js +0 -34
- package/dist/client/core/ApiError.d.ts +0 -10
- package/dist/client/core/ApiError.js +0 -15
- package/dist/client/core/ApiRequestOptions.d.ts +0 -13
- package/dist/client/core/ApiResult.d.ts +0 -7
- package/dist/client/core/BaseHttpRequest.d.ts +0 -8
- package/dist/client/core/BaseHttpRequest.js +0 -9
- package/dist/client/core/CancelablePromise.d.ts +0 -20
- package/dist/client/core/CancelablePromise.js +0 -116
- package/dist/client/core/FetchHttpRequest.d.ts +0 -14
- package/dist/client/core/FetchHttpRequest.js +0 -20
- package/dist/client/core/OpenAPI.d.ts +0 -16
- package/dist/client/core/OpenAPI.js +0 -14
- package/dist/client/core/request.d.ts +0 -30
- package/dist/client/core/request.js +0 -294
- package/dist/client/models/BinaryProperty.d.ts +0 -8
- package/dist/client/models/BinaryProperty.js +0 -2
- package/dist/client/models/BooleanProperty.d.ts +0 -5
- package/dist/client/models/BooleanProperty.js +0 -2
- package/dist/client/models/Changeset.d.ts +0 -26
- package/dist/client/models/Changeset.js +0 -2
- package/dist/client/models/ChangesetItem.d.ts +0 -11
- package/dist/client/models/ChangesetItem.js +0 -2
- package/dist/client/models/ChangesetItemPage.d.ts +0 -19
- package/dist/client/models/ChangesetItemPage.js +0 -2
- package/dist/client/models/ChangesetPage.d.ts +0 -19
- package/dist/client/models/ChangesetPage.js +0 -2
- package/dist/client/models/ComponentListItem.d.ts +0 -10
- package/dist/client/models/ComponentListItem.js +0 -2
- package/dist/client/models/ComponentProperty.d.ts +0 -10
- package/dist/client/models/ComponentProperty.js +0 -2
- package/dist/client/models/CompositionBehavior.d.ts +0 -7
- package/dist/client/models/CompositionBehavior.js +0 -15
- package/dist/client/models/ContentBaseType.d.ts +0 -14
- package/dist/client/models/ContentBaseType.js +0 -22
- package/dist/client/models/ContentComponent.d.ts +0 -30
- package/dist/client/models/ContentComponent.js +0 -2
- package/dist/client/models/ContentItem.d.ts +0 -60
- package/dist/client/models/ContentItem.js +0 -2
- package/dist/client/models/ContentItemListWithContentTypes.d.ts +0 -27
- package/dist/client/models/ContentItemListWithContentTypes.js +0 -2
- package/dist/client/models/ContentItemPage.d.ts +0 -19
- package/dist/client/models/ContentItemPage.js +0 -2
- package/dist/client/models/ContentItemWithContentTypes.d.ts +0 -12
- package/dist/client/models/ContentItemWithContentTypes.js +0 -2
- package/dist/client/models/ContentListItem.d.ts +0 -14
- package/dist/client/models/ContentListItem.js +0 -2
- package/dist/client/models/ContentLocaleInfo.d.ts +0 -19
- package/dist/client/models/ContentLocaleInfo.js +0 -2
- package/dist/client/models/ContentMetadata.d.ts +0 -38
- package/dist/client/models/ContentMetadata.js +0 -2
- package/dist/client/models/ContentMetadataPage.d.ts +0 -19
- package/dist/client/models/ContentMetadataPage.js +0 -2
- package/dist/client/models/ContentProperty.d.ts +0 -14
- package/dist/client/models/ContentProperty.js +0 -2
- package/dist/client/models/ContentReference.d.ts +0 -17
- package/dist/client/models/ContentReference.js +0 -2
- package/dist/client/models/ContentReferenceListItem.d.ts +0 -14
- package/dist/client/models/ContentReferenceListItem.js +0 -2
- package/dist/client/models/ContentReferenceProperty.d.ts +0 -14
- package/dist/client/models/ContentReferenceProperty.js +0 -2
- package/dist/client/models/ContentType.d.ts +0 -84
- package/dist/client/models/ContentType.js +0 -2
- package/dist/client/models/ContentTypeFeature.d.ts +0 -10
- package/dist/client/models/ContentTypeFeature.js +0 -18
- package/dist/client/models/ContentTypePage.d.ts +0 -19
- package/dist/client/models/ContentTypePage.js +0 -2
- package/dist/client/models/ContentTypeProperty.d.ts +0 -47
- package/dist/client/models/ContentTypeProperty.js +0 -2
- package/dist/client/models/ContentTypeUsage.d.ts +0 -7
- package/dist/client/models/ContentTypeUsage.js +0 -15
- package/dist/client/models/CopyContentOptions.d.ts +0 -21
- package/dist/client/models/CopyContentOptions.js +0 -2
- package/dist/client/models/DateTimeListItem.d.ts +0 -14
- package/dist/client/models/DateTimeListItem.js +0 -2
- package/dist/client/models/DateTimeProperty.d.ts +0 -14
- package/dist/client/models/DateTimeProperty.js +0 -2
- package/dist/client/models/DisplaySetting.d.ts +0 -22
- package/dist/client/models/DisplaySetting.js +0 -2
- package/dist/client/models/DisplaySettingChoice.d.ts +0 -13
- package/dist/client/models/DisplaySettingChoice.js +0 -2
- package/dist/client/models/DisplayTemplate.d.ts +0 -49
- package/dist/client/models/DisplayTemplate.js +0 -2
- package/dist/client/models/DisplayTemplatePage.d.ts +0 -19
- package/dist/client/models/DisplayTemplatePage.js +0 -2
- package/dist/client/models/DoubleEnumerationSettings.d.ts +0 -10
- package/dist/client/models/DoubleEnumerationSettings.js +0 -2
- package/dist/client/models/DoubleEnumerationValue.d.ts +0 -13
- package/dist/client/models/DoubleEnumerationValue.js +0 -2
- package/dist/client/models/FloatListItem.d.ts +0 -16
- package/dist/client/models/FloatListItem.js +0 -2
- package/dist/client/models/FloatProperty.d.ts +0 -16
- package/dist/client/models/FloatProperty.js +0 -2
- package/dist/client/models/ImageDescriptor.d.ts +0 -17
- package/dist/client/models/ImageDescriptor.js +0 -2
- package/dist/client/models/IndexingType.d.ts +0 -8
- package/dist/client/models/IndexingType.js +0 -16
- package/dist/client/models/Int32EnumerationSettings.d.ts +0 -10
- package/dist/client/models/Int32EnumerationSettings.js +0 -2
- package/dist/client/models/Int32EnumerationValue.d.ts +0 -13
- package/dist/client/models/Int32EnumerationValue.js +0 -2
- package/dist/client/models/IntegerListItem.d.ts +0 -16
- package/dist/client/models/IntegerListItem.js +0 -2
- package/dist/client/models/IntegerProperty.d.ts +0 -16
- package/dist/client/models/IntegerProperty.js +0 -2
- package/dist/client/models/JsonStringProperty.d.ts +0 -5
- package/dist/client/models/JsonStringProperty.js +0 -2
- package/dist/client/models/ListProperty.d.ts +0 -26
- package/dist/client/models/ListProperty.js +0 -2
- package/dist/client/models/ListPropertyItem.d.ts +0 -11
- package/dist/client/models/ListPropertyItem.js +0 -2
- package/dist/client/models/LocaleStatus.d.ts +0 -7
- package/dist/client/models/LocaleStatus.js +0 -15
- package/dist/client/models/OauthToken.d.ts +0 -18
- package/dist/client/models/OauthToken.js +0 -2
- package/dist/client/models/OauthTokenError.d.ts +0 -13
- package/dist/client/models/OauthTokenError.js +0 -2
- package/dist/client/models/OauthTokenRequest.d.ts +0 -21
- package/dist/client/models/OauthTokenRequest.js +0 -2
- package/dist/client/models/ProblemDetails.d.ts +0 -1
- package/dist/client/models/ProblemDetails.js +0 -2
- package/dist/client/models/PropertyDataType.d.ts +0 -18
- package/dist/client/models/PropertyDataType.js +0 -26
- package/dist/client/models/PropertyFormat.d.ts +0 -37
- package/dist/client/models/PropertyFormat.js +0 -2
- package/dist/client/models/PropertyFormatPage.d.ts +0 -19
- package/dist/client/models/PropertyFormatPage.js +0 -2
- package/dist/client/models/PropertyGroup.d.ts +0 -21
- package/dist/client/models/PropertyGroup.js +0 -2
- package/dist/client/models/PropertyGroupPage.d.ts +0 -19
- package/dist/client/models/PropertyGroupPage.js +0 -2
- package/dist/client/models/StringEnumerationSettings.d.ts +0 -10
- package/dist/client/models/StringEnumerationSettings.js +0 -2
- package/dist/client/models/StringEnumerationValue.d.ts +0 -13
- package/dist/client/models/StringEnumerationValue.js +0 -2
- package/dist/client/models/StringListItem.d.ts +0 -20
- package/dist/client/models/StringListItem.js +0 -2
- package/dist/client/models/StringProperty.d.ts +0 -20
- package/dist/client/models/StringProperty.js +0 -2
- package/dist/client/models/UrlListItem.d.ts +0 -5
- package/dist/client/models/UrlListItem.js +0 -2
- package/dist/client/models/UrlProperty.d.ts +0 -5
- package/dist/client/models/UrlProperty.js +0 -2
- package/dist/client/models/VersionStatus.d.ts +0 -12
- package/dist/client/models/VersionStatus.js +0 -20
- package/dist/client/services/ChangesetsService.d.ts +0 -105
- package/dist/client/services/ChangesetsService.js +0 -239
- package/dist/client/services/ContentService.d.ts +0 -172
- package/dist/client/services/ContentService.js +0 -409
- package/dist/client/services/ContentTypesService.d.ts +0 -66
- package/dist/client/services/ContentTypesService.js +0 -149
- package/dist/client/services/DisplayTemplatesService.d.ts +0 -60
- package/dist/client/services/DisplayTemplatesService.js +0 -135
- package/dist/client/services/OauthService.d.ts +0 -17
- package/dist/client/services/OauthService.js +0 -28
- package/dist/client/services/PropertyFormatsService.d.ts +0 -26
- package/dist/client/services/PropertyFormatsService.js +0 -53
- package/dist/client/services/PropertyGroupsService.d.ts +0 -61
- package/dist/client/services/PropertyGroupsService.js +0 -135
- /package/dist/client/{core/ApiRequestOptions.js → client/types.js} +0 -0
- /package/dist/client/core/{ApiResult.js → types.js} +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.VersionStatus = exports.PropertyDataType = exports.LocaleStatus = exports.IndexingType = exports.ContentTypeUsage = exports.ContentTypeFeature = exports.ContentBaseType = exports.CompositionBehavior = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* Represent a Composition behavior for a ContentType.
|
|
7
|
+
*/
|
|
8
|
+
exports.CompositionBehavior = {
|
|
9
|
+
SECTION_ENABLED: 'sectionEnabled',
|
|
10
|
+
ELEMENT_ENABLED: 'elementEnabled'
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Represent the base type of a ContentType.
|
|
14
|
+
*/
|
|
15
|
+
exports.ContentBaseType = {
|
|
16
|
+
PAGE: 'page',
|
|
17
|
+
COMPONENT: 'component',
|
|
18
|
+
MEDIA: 'media',
|
|
19
|
+
IMAGE: 'image',
|
|
20
|
+
VIDEO: 'video',
|
|
21
|
+
FOLDER: 'folder',
|
|
22
|
+
EXPERIENCE: 'experience',
|
|
23
|
+
SECTION: 'section',
|
|
24
|
+
ELEMENT: 'element'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Represent different features that a content type can have.
|
|
28
|
+
*/
|
|
29
|
+
exports.ContentTypeFeature = {
|
|
30
|
+
LOCALIZATION: 'localization',
|
|
31
|
+
VERSIONING: 'versioning',
|
|
32
|
+
PUBLISH_PERIOD: 'publishPeriod',
|
|
33
|
+
ROUTING: 'routing',
|
|
34
|
+
BINARY: 'binary'
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Represent the usage types for a ContentType.
|
|
38
|
+
*/
|
|
39
|
+
exports.ContentTypeUsage = {
|
|
40
|
+
PROPERTY: 'property',
|
|
41
|
+
INSTANCE: 'instance'
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Represents the indexing type of a content type property.
|
|
45
|
+
*/
|
|
46
|
+
exports.IndexingType = {
|
|
47
|
+
DISABLED: 'disabled',
|
|
48
|
+
QUERYABLE: 'queryable',
|
|
49
|
+
SEARCHABLE: 'searchable'
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Represent the different status values of a content locale.
|
|
53
|
+
*/
|
|
54
|
+
exports.LocaleStatus = {
|
|
55
|
+
DRAFT: 'draft',
|
|
56
|
+
PUBLISHED: 'published'
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Represent the basic type that a PropertyFormat
|
|
60
|
+
* is using for data storage and data transport.
|
|
61
|
+
*/
|
|
62
|
+
exports.PropertyDataType = {
|
|
63
|
+
STRING: 'string',
|
|
64
|
+
URL: 'url',
|
|
65
|
+
BOOLEAN: 'boolean',
|
|
66
|
+
INTEGER: 'integer',
|
|
67
|
+
FLOAT: 'float',
|
|
68
|
+
DATE_TIME: 'dateTime',
|
|
69
|
+
CONTENT_REFERENCE: 'contentReference',
|
|
70
|
+
CONTENT: 'content',
|
|
71
|
+
BINARY: 'binary',
|
|
72
|
+
JSON: 'json',
|
|
73
|
+
ARRAY: 'array',
|
|
74
|
+
COMPONENT: 'component'
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Represent the different status values of a content version.
|
|
78
|
+
*/
|
|
79
|
+
exports.VersionStatus = {
|
|
80
|
+
DRAFT: 'draft',
|
|
81
|
+
READY: 'ready',
|
|
82
|
+
PUBLISHED: 'published',
|
|
83
|
+
PREVIOUS: 'previous',
|
|
84
|
+
SCHEDULED: 'scheduled',
|
|
85
|
+
REJECTED: 'rejected',
|
|
86
|
+
IN_REVIEW: 'inReview'
|
|
87
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createClientConfig = void 0;
|
|
4
|
+
const config_1 = require("./config");
|
|
5
|
+
const getaccesstoken_1 = require("./getaccesstoken");
|
|
6
|
+
const createClientConfig = (config) => {
|
|
7
|
+
const envConfig = (0, config_1.getCmsIntegrationApiConfigFromEnvironment)();
|
|
8
|
+
const baseUrl = envConfig.base.href;
|
|
9
|
+
const newClientConfig = {
|
|
10
|
+
baseUrl,
|
|
11
|
+
auth: (auth) => {
|
|
12
|
+
auth.scheme = "bearer";
|
|
13
|
+
auth.type = "apiKey";
|
|
14
|
+
return (0, getaccesstoken_1.getAccessToken)(envConfig).catch((error) => {
|
|
15
|
+
if (envConfig?.debug)
|
|
16
|
+
console.error(`❌ Error while resolving the Access Token`, error);
|
|
17
|
+
return undefined;
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
...config,
|
|
21
|
+
};
|
|
22
|
+
// Ensure the baseUrl is set
|
|
23
|
+
if (!newClientConfig.baseUrl)
|
|
24
|
+
newClientConfig.baseUrl = baseUrl;
|
|
25
|
+
return newClientConfig;
|
|
26
|
+
};
|
|
27
|
+
exports.createClientConfig = createClientConfig;
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getCmsIntegrationApiConfigFromEnvironment = getCmsIntegrationApiConfigFromEnvironment;
|
|
4
|
-
const OpenAPI_1 = require("./client/core/OpenAPI");
|
|
5
4
|
const types_1 = require("./types");
|
|
6
5
|
function getCmsIntegrationApiConfigFromEnvironment() {
|
|
7
6
|
const cmsUrl = getOptional('OPTIMIZELY_CMS_URL', 'https://example.cms.optimizely.com');
|
|
@@ -13,7 +12,7 @@ function getCmsIntegrationApiConfigFromEnvironment() {
|
|
|
13
12
|
let baseUrl;
|
|
14
13
|
try {
|
|
15
14
|
const cmsUrlAdjusted = cmsUrl.includes("://") ? cmsUrl : 'https://' + cmsUrl;
|
|
16
|
-
baseUrl = new URL(
|
|
15
|
+
baseUrl = new URL('/_cms/preview2', cmsUrlAdjusted);
|
|
17
16
|
if (cmsVersion == types_1.OptiCmsVersion.CMS12)
|
|
18
17
|
baseUrl.pathname = baseUrl.pathname.replace('preview2', 'preview1');
|
|
19
18
|
}
|
package/dist/getaccesstoken.js
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAccessToken = getAccessToken;
|
|
4
4
|
const config_1 = require("./config");
|
|
5
|
-
const OpenAPI_1 = require("./client/core/OpenAPI");
|
|
6
5
|
const types_1 = require("./types");
|
|
7
6
|
function isErrorResponse(response) {
|
|
8
7
|
return typeof (response.error) == 'string';
|
|
9
8
|
}
|
|
10
9
|
async function getAccessToken(config) {
|
|
11
10
|
const options = config ?? (0, config_1.getCmsIntegrationApiConfigFromEnvironment)();
|
|
12
|
-
let authUrl = new URL(
|
|
11
|
+
let authUrl = new URL(`/_cms/preview2/oauth/token`, options.base).href;
|
|
13
12
|
const headers = new Headers();
|
|
14
13
|
if (options.cmsVersion == types_1.OptiCmsVersion.CMS12)
|
|
15
14
|
authUrl = authUrl.replace('preview2', 'preview1');
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export * from './config';
|
|
2
|
-
export * as IntegrationApi from './client';
|
|
3
|
-
export {
|
|
4
|
-
export { ApiClient } from './api-client';
|
|
5
|
-
export { ApiClient as CmsIntegrationApiClient } from './api-client';
|
|
2
|
+
export * as IntegrationApi from './client/types.gen';
|
|
3
|
+
export { ApiClient, ApiError, ApiClient as CoreClient, type ApiClientStatic, type CmsIntegrationApiClient } from './api-client';
|
|
6
4
|
export { OptiCmsVersion } from "./types";
|
|
7
5
|
import { type CmsIntegrationApiOptions } from './config';
|
|
8
|
-
import {
|
|
6
|
+
import { type CmsIntegrationApiClient } from './api-client';
|
|
9
7
|
export declare function createClient(config?: CmsIntegrationApiOptions): CmsIntegrationApiClient;
|
|
10
8
|
export declare enum ContentRoots {
|
|
11
9
|
/**
|
package/dist/index.js
CHANGED
|
@@ -36,21 +36,19 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.ContentTypeKeys = exports.ContentRoots = exports.OptiCmsVersion = exports.
|
|
39
|
+
exports.ContentTypeKeys = exports.ContentRoots = exports.OptiCmsVersion = exports.CoreClient = exports.ApiError = exports.ApiClient = exports.IntegrationApi = void 0;
|
|
40
40
|
exports.createClient = createClient;
|
|
41
41
|
__exportStar(require("./config"), exports);
|
|
42
|
-
exports.IntegrationApi = __importStar(require("./client"));
|
|
43
|
-
var client_1 = require("./client");
|
|
44
|
-
Object.defineProperty(exports, "CoreClient", { enumerable: true, get: function () { return client_1.CmsIntegrationApiClient; } });
|
|
42
|
+
exports.IntegrationApi = __importStar(require("./client/types.gen"));
|
|
45
43
|
var api_client_1 = require("./api-client");
|
|
46
44
|
Object.defineProperty(exports, "ApiClient", { enumerable: true, get: function () { return api_client_1.ApiClient; } });
|
|
47
|
-
|
|
48
|
-
Object.defineProperty(exports, "
|
|
45
|
+
Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return api_client_1.ApiError; } });
|
|
46
|
+
Object.defineProperty(exports, "CoreClient", { enumerable: true, get: function () { return api_client_1.ApiClient; } });
|
|
49
47
|
var types_1 = require("./types");
|
|
50
48
|
Object.defineProperty(exports, "OptiCmsVersion", { enumerable: true, get: function () { return types_1.OptiCmsVersion; } });
|
|
51
|
-
const
|
|
49
|
+
const api_client_2 = require("./api-client");
|
|
52
50
|
function createClient(config) {
|
|
53
|
-
return new
|
|
51
|
+
return new api_client_2.ApiClient(config);
|
|
54
52
|
}
|
|
55
53
|
var ContentRoots;
|
|
56
54
|
(function (ContentRoots) {
|
package/dist/version.json
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@remkoj/optimizely-cms-api",
|
|
3
3
|
"displayName": "Optimizely CMS - Integration API Client",
|
|
4
4
|
"description": "A Javascript client for the Integration API provided by the Optimizely CMS.",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "6.0.0-pre1",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"main": "./dist/index.js",
|
|
@@ -11,20 +11,29 @@
|
|
|
11
11
|
"./dist"
|
|
12
12
|
],
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@
|
|
15
|
-
"
|
|
16
|
-
"
|
|
14
|
+
"@hey-api/client-fetch": "^0.13.1",
|
|
15
|
+
"@hey-api/openapi-ts": "^0.77.0",
|
|
16
|
+
"@types/node": "^22.16.0",
|
|
17
|
+
"dotenv": "^17.0.1",
|
|
18
|
+
"dotenv-expand": "^12.0.2",
|
|
19
|
+
"glob": "^11.0.3",
|
|
20
|
+
"rimraf": "^6.0.1",
|
|
21
|
+
"typescript": "^5.8.3"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@types/node": "^22.16.0",
|
|
25
|
+
"dotenv": "^17.0.1",
|
|
26
|
+
"glob": "^11.0.3",
|
|
17
27
|
"openapi-typescript-codegen": "^0.29.0",
|
|
18
28
|
"tslib": "^2.8.1",
|
|
19
29
|
"typescript": "^5.8.3"
|
|
20
30
|
},
|
|
21
31
|
"scripts": {
|
|
22
|
-
"clean": "
|
|
23
|
-
"prepare": "tsc --build",
|
|
32
|
+
"clean": "rimraf -g ./dist ./*.tsbuildinfo && rimraf -g ./openapi-ts*log",
|
|
33
|
+
"prepare": "tsc --build && yarn node scripts/copy-client.mjs",
|
|
24
34
|
"watch": "tsc --watch",
|
|
25
|
-
"rebuild": "yarn clean && yarn
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
35
|
+
"rebuild": "yarn clean && yarn generate && tsc --build --force",
|
|
36
|
+
"generate": "yarn node scripts/create-client.mjs"
|
|
37
|
+
},
|
|
38
|
+
"stableVersion": "5.1.0"
|
|
30
39
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { BaseHttpRequest } from './core/BaseHttpRequest';
|
|
2
|
-
import type { OpenAPIConfig } from './core/OpenAPI';
|
|
3
|
-
import { ChangesetsService } from './services/ChangesetsService';
|
|
4
|
-
import { ContentService } from './services/ContentService';
|
|
5
|
-
import { ContentTypesService } from './services/ContentTypesService';
|
|
6
|
-
import { DisplayTemplatesService } from './services/DisplayTemplatesService';
|
|
7
|
-
import { OauthService } from './services/OauthService';
|
|
8
|
-
import { PropertyFormatsService } from './services/PropertyFormatsService';
|
|
9
|
-
import { PropertyGroupsService } from './services/PropertyGroupsService';
|
|
10
|
-
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
|
11
|
-
export declare class CmsIntegrationApiClient {
|
|
12
|
-
readonly changesets: ChangesetsService;
|
|
13
|
-
readonly content: ContentService;
|
|
14
|
-
readonly contentTypes: ContentTypesService;
|
|
15
|
-
readonly displayTemplates: DisplayTemplatesService;
|
|
16
|
-
readonly oauth: OauthService;
|
|
17
|
-
readonly propertyFormats: PropertyFormatsService;
|
|
18
|
-
readonly propertyGroups: PropertyGroupsService;
|
|
19
|
-
readonly request: BaseHttpRequest;
|
|
20
|
-
constructor(config?: Partial<OpenAPIConfig>, HttpRequest?: HttpRequestConstructor);
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CmsIntegrationApiClient = void 0;
|
|
4
|
-
const FetchHttpRequest_1 = require("./core/FetchHttpRequest");
|
|
5
|
-
const ChangesetsService_1 = require("./services/ChangesetsService");
|
|
6
|
-
const ContentService_1 = require("./services/ContentService");
|
|
7
|
-
const ContentTypesService_1 = require("./services/ContentTypesService");
|
|
8
|
-
const DisplayTemplatesService_1 = require("./services/DisplayTemplatesService");
|
|
9
|
-
const OauthService_1 = require("./services/OauthService");
|
|
10
|
-
const PropertyFormatsService_1 = require("./services/PropertyFormatsService");
|
|
11
|
-
const PropertyGroupsService_1 = require("./services/PropertyGroupsService");
|
|
12
|
-
class CmsIntegrationApiClient {
|
|
13
|
-
constructor(config, HttpRequest = FetchHttpRequest_1.FetchHttpRequest) {
|
|
14
|
-
this.request = new HttpRequest({
|
|
15
|
-
BASE: config?.BASE ?? '/_cms/preview2',
|
|
16
|
-
VERSION: config?.VERSION ?? 'preview2',
|
|
17
|
-
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
|
18
|
-
CREDENTIALS: config?.CREDENTIALS ?? 'include',
|
|
19
|
-
TOKEN: config?.TOKEN,
|
|
20
|
-
USERNAME: config?.USERNAME,
|
|
21
|
-
PASSWORD: config?.PASSWORD,
|
|
22
|
-
HEADERS: config?.HEADERS,
|
|
23
|
-
ENCODE_PATH: config?.ENCODE_PATH,
|
|
24
|
-
});
|
|
25
|
-
this.changesets = new ChangesetsService_1.ChangesetsService(this.request);
|
|
26
|
-
this.content = new ContentService_1.ContentService(this.request);
|
|
27
|
-
this.contentTypes = new ContentTypesService_1.ContentTypesService(this.request);
|
|
28
|
-
this.displayTemplates = new DisplayTemplatesService_1.DisplayTemplatesService(this.request);
|
|
29
|
-
this.oauth = new OauthService_1.OauthService(this.request);
|
|
30
|
-
this.propertyFormats = new PropertyFormatsService_1.PropertyFormatsService(this.request);
|
|
31
|
-
this.propertyGroups = new PropertyGroupsService_1.PropertyGroupsService(this.request);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.CmsIntegrationApiClient = CmsIntegrationApiClient;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import type { ApiResult } from './ApiResult';
|
|
3
|
-
export declare class ApiError extends Error {
|
|
4
|
-
readonly url: string;
|
|
5
|
-
readonly status: number;
|
|
6
|
-
readonly statusText: string;
|
|
7
|
-
readonly body: any;
|
|
8
|
-
readonly request: ApiRequestOptions;
|
|
9
|
-
constructor(request: ApiRequestOptions, response: ApiResult, message: string);
|
|
10
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiError = void 0;
|
|
4
|
-
class ApiError extends Error {
|
|
5
|
-
constructor(request, response, message) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'ApiError';
|
|
8
|
-
this.url = response.url;
|
|
9
|
-
this.status = response.status;
|
|
10
|
-
this.statusText = response.statusText;
|
|
11
|
-
this.body = response.body;
|
|
12
|
-
this.request = request;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.ApiError = ApiError;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type ApiRequestOptions = {
|
|
2
|
-
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
3
|
-
readonly url: string;
|
|
4
|
-
readonly path?: Record<string, any>;
|
|
5
|
-
readonly cookies?: Record<string, any>;
|
|
6
|
-
readonly headers?: Record<string, any>;
|
|
7
|
-
readonly query?: Record<string, any>;
|
|
8
|
-
readonly formData?: Record<string, any>;
|
|
9
|
-
readonly body?: any;
|
|
10
|
-
readonly mediaType?: string;
|
|
11
|
-
readonly responseHeader?: string;
|
|
12
|
-
readonly errors?: Record<number, string>;
|
|
13
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import type { CancelablePromise } from './CancelablePromise';
|
|
3
|
-
import type { OpenAPIConfig } from './OpenAPI';
|
|
4
|
-
export declare abstract class BaseHttpRequest {
|
|
5
|
-
readonly config: OpenAPIConfig;
|
|
6
|
-
constructor(config: OpenAPIConfig);
|
|
7
|
-
abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
|
|
8
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare class CancelError extends Error {
|
|
2
|
-
constructor(message: string);
|
|
3
|
-
get isCancelled(): boolean;
|
|
4
|
-
}
|
|
5
|
-
export interface OnCancel {
|
|
6
|
-
readonly isResolved: boolean;
|
|
7
|
-
readonly isRejected: boolean;
|
|
8
|
-
readonly isCancelled: boolean;
|
|
9
|
-
(cancelHandler: () => void): void;
|
|
10
|
-
}
|
|
11
|
-
export declare class CancelablePromise<T> implements Promise<T> {
|
|
12
|
-
#private;
|
|
13
|
-
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
|
|
14
|
-
get [Symbol.toStringTag](): string;
|
|
15
|
-
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
16
|
-
catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
|
|
17
|
-
finally(onFinally?: (() => void) | null): Promise<T>;
|
|
18
|
-
cancel(): void;
|
|
19
|
-
get isCancelled(): boolean;
|
|
20
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _CancelablePromise_isResolved, _CancelablePromise_isRejected, _CancelablePromise_isCancelled, _CancelablePromise_cancelHandlers, _CancelablePromise_promise, _CancelablePromise_resolve, _CancelablePromise_reject;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.CancelablePromise = exports.CancelError = void 0;
|
|
16
|
-
/* generated using openapi-typescript-codegen -- do not edit */
|
|
17
|
-
/* istanbul ignore file */
|
|
18
|
-
/* tslint:disable */
|
|
19
|
-
/* eslint-disable */
|
|
20
|
-
class CancelError extends Error {
|
|
21
|
-
constructor(message) {
|
|
22
|
-
super(message);
|
|
23
|
-
this.name = 'CancelError';
|
|
24
|
-
}
|
|
25
|
-
get isCancelled() {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.CancelError = CancelError;
|
|
30
|
-
class CancelablePromise {
|
|
31
|
-
constructor(executor) {
|
|
32
|
-
_CancelablePromise_isResolved.set(this, void 0);
|
|
33
|
-
_CancelablePromise_isRejected.set(this, void 0);
|
|
34
|
-
_CancelablePromise_isCancelled.set(this, void 0);
|
|
35
|
-
_CancelablePromise_cancelHandlers.set(this, void 0);
|
|
36
|
-
_CancelablePromise_promise.set(this, void 0);
|
|
37
|
-
_CancelablePromise_resolve.set(this, void 0);
|
|
38
|
-
_CancelablePromise_reject.set(this, void 0);
|
|
39
|
-
__classPrivateFieldSet(this, _CancelablePromise_isResolved, false, "f");
|
|
40
|
-
__classPrivateFieldSet(this, _CancelablePromise_isRejected, false, "f");
|
|
41
|
-
__classPrivateFieldSet(this, _CancelablePromise_isCancelled, false, "f");
|
|
42
|
-
__classPrivateFieldSet(this, _CancelablePromise_cancelHandlers, [], "f");
|
|
43
|
-
__classPrivateFieldSet(this, _CancelablePromise_promise, new Promise((resolve, reject) => {
|
|
44
|
-
__classPrivateFieldSet(this, _CancelablePromise_resolve, resolve, "f");
|
|
45
|
-
__classPrivateFieldSet(this, _CancelablePromise_reject, reject, "f");
|
|
46
|
-
const onResolve = (value) => {
|
|
47
|
-
if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
__classPrivateFieldSet(this, _CancelablePromise_isResolved, true, "f");
|
|
51
|
-
if (__classPrivateFieldGet(this, _CancelablePromise_resolve, "f"))
|
|
52
|
-
__classPrivateFieldGet(this, _CancelablePromise_resolve, "f").call(this, value);
|
|
53
|
-
};
|
|
54
|
-
const onReject = (reason) => {
|
|
55
|
-
if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
__classPrivateFieldSet(this, _CancelablePromise_isRejected, true, "f");
|
|
59
|
-
if (__classPrivateFieldGet(this, _CancelablePromise_reject, "f"))
|
|
60
|
-
__classPrivateFieldGet(this, _CancelablePromise_reject, "f").call(this, reason);
|
|
61
|
-
};
|
|
62
|
-
const onCancel = (cancelHandler) => {
|
|
63
|
-
if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
__classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").push(cancelHandler);
|
|
67
|
-
};
|
|
68
|
-
Object.defineProperty(onCancel, 'isResolved', {
|
|
69
|
-
get: () => __classPrivateFieldGet(this, _CancelablePromise_isResolved, "f"),
|
|
70
|
-
});
|
|
71
|
-
Object.defineProperty(onCancel, 'isRejected', {
|
|
72
|
-
get: () => __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f"),
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(onCancel, 'isCancelled', {
|
|
75
|
-
get: () => __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f"),
|
|
76
|
-
});
|
|
77
|
-
return executor(onResolve, onReject, onCancel);
|
|
78
|
-
}), "f");
|
|
79
|
-
}
|
|
80
|
-
get [(_CancelablePromise_isResolved = new WeakMap(), _CancelablePromise_isRejected = new WeakMap(), _CancelablePromise_isCancelled = new WeakMap(), _CancelablePromise_cancelHandlers = new WeakMap(), _CancelablePromise_promise = new WeakMap(), _CancelablePromise_resolve = new WeakMap(), _CancelablePromise_reject = new WeakMap(), Symbol.toStringTag)]() {
|
|
81
|
-
return "Cancellable Promise";
|
|
82
|
-
}
|
|
83
|
-
then(onFulfilled, onRejected) {
|
|
84
|
-
return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").then(onFulfilled, onRejected);
|
|
85
|
-
}
|
|
86
|
-
catch(onRejected) {
|
|
87
|
-
return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").catch(onRejected);
|
|
88
|
-
}
|
|
89
|
-
finally(onFinally) {
|
|
90
|
-
return __classPrivateFieldGet(this, _CancelablePromise_promise, "f").finally(onFinally);
|
|
91
|
-
}
|
|
92
|
-
cancel() {
|
|
93
|
-
if (__classPrivateFieldGet(this, _CancelablePromise_isResolved, "f") || __classPrivateFieldGet(this, _CancelablePromise_isRejected, "f") || __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f")) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
__classPrivateFieldSet(this, _CancelablePromise_isCancelled, true, "f");
|
|
97
|
-
if (__classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").length) {
|
|
98
|
-
try {
|
|
99
|
-
for (const cancelHandler of __classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f")) {
|
|
100
|
-
cancelHandler();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
console.warn('Cancellation threw an error', error);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
__classPrivateFieldGet(this, _CancelablePromise_cancelHandlers, "f").length = 0;
|
|
109
|
-
if (__classPrivateFieldGet(this, _CancelablePromise_reject, "f"))
|
|
110
|
-
__classPrivateFieldGet(this, _CancelablePromise_reject, "f").call(this, new CancelError('Request aborted'));
|
|
111
|
-
}
|
|
112
|
-
get isCancelled() {
|
|
113
|
-
return __classPrivateFieldGet(this, _CancelablePromise_isCancelled, "f");
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.CancelablePromise = CancelablePromise;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import { BaseHttpRequest } from './BaseHttpRequest';
|
|
3
|
-
import type { CancelablePromise } from './CancelablePromise';
|
|
4
|
-
import type { OpenAPIConfig } from './OpenAPI';
|
|
5
|
-
export declare class FetchHttpRequest extends BaseHttpRequest {
|
|
6
|
-
constructor(config: OpenAPIConfig);
|
|
7
|
-
/**
|
|
8
|
-
* Request method
|
|
9
|
-
* @param options The request options from the service
|
|
10
|
-
* @returns CancelablePromise<T>
|
|
11
|
-
* @throws ApiError
|
|
12
|
-
*/
|
|
13
|
-
request<T>(options: ApiRequestOptions): CancelablePromise<T>;
|
|
14
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FetchHttpRequest = void 0;
|
|
4
|
-
const BaseHttpRequest_1 = require("./BaseHttpRequest");
|
|
5
|
-
const request_1 = require("./request");
|
|
6
|
-
class FetchHttpRequest extends BaseHttpRequest_1.BaseHttpRequest {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
super(config);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Request method
|
|
12
|
-
* @param options The request options from the service
|
|
13
|
-
* @returns CancelablePromise<T>
|
|
14
|
-
* @throws ApiError
|
|
15
|
-
*/
|
|
16
|
-
request(options) {
|
|
17
|
-
return (0, request_1.request)(this.config, options);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.FetchHttpRequest = FetchHttpRequest;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
3
|
-
type Headers = Record<string, string>;
|
|
4
|
-
export type OpenAPIConfig = {
|
|
5
|
-
BASE: string;
|
|
6
|
-
VERSION: string;
|
|
7
|
-
WITH_CREDENTIALS: boolean;
|
|
8
|
-
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
9
|
-
TOKEN?: string | Resolver<string> | undefined;
|
|
10
|
-
USERNAME?: string | Resolver<string> | undefined;
|
|
11
|
-
PASSWORD?: string | Resolver<string> | undefined;
|
|
12
|
-
HEADERS?: Headers | Resolver<Headers> | undefined;
|
|
13
|
-
ENCODE_PATH?: ((path: string) => string) | undefined;
|
|
14
|
-
};
|
|
15
|
-
export declare const OpenAPI: OpenAPIConfig;
|
|
16
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpenAPI = void 0;
|
|
4
|
-
exports.OpenAPI = {
|
|
5
|
-
BASE: '/_cms/preview2',
|
|
6
|
-
VERSION: 'preview2',
|
|
7
|
-
WITH_CREDENTIALS: false,
|
|
8
|
-
CREDENTIALS: 'include',
|
|
9
|
-
TOKEN: undefined,
|
|
10
|
-
USERNAME: undefined,
|
|
11
|
-
PASSWORD: undefined,
|
|
12
|
-
HEADERS: undefined,
|
|
13
|
-
ENCODE_PATH: undefined,
|
|
14
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
-
import type { ApiResult } from './ApiResult';
|
|
3
|
-
import { CancelablePromise } from './CancelablePromise';
|
|
4
|
-
import type { OnCancel } from './CancelablePromise';
|
|
5
|
-
import type { OpenAPIConfig } from './OpenAPI';
|
|
6
|
-
export declare const isDefined: <T>(value: T | null | undefined) => value is Exclude<T, null | undefined>;
|
|
7
|
-
export declare const isString: (value: any) => value is string;
|
|
8
|
-
export declare const isStringWithValue: (value: any) => value is string;
|
|
9
|
-
export declare const isBlob: (value: any) => value is Blob;
|
|
10
|
-
export declare const isFormData: (value: any) => value is FormData;
|
|
11
|
-
export declare const base64: (str: string) => string;
|
|
12
|
-
export declare const getQueryString: (params: Record<string, any>) => string;
|
|
13
|
-
export declare const getFormData: (options: ApiRequestOptions) => FormData | undefined;
|
|
14
|
-
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
15
|
-
export declare const resolve: <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>) => Promise<T | undefined>;
|
|
16
|
-
export declare const getHeaders: (config: OpenAPIConfig, options: ApiRequestOptions) => Promise<Headers>;
|
|
17
|
-
export declare const getRequestBody: (options: ApiRequestOptions) => any;
|
|
18
|
-
export declare const sendRequest: (config: OpenAPIConfig, options: ApiRequestOptions, url: string, body: any, formData: FormData | undefined, headers: Headers, onCancel: OnCancel) => Promise<Response>;
|
|
19
|
-
export declare const getResponseHeader: (response: Response, responseHeader?: string) => string | undefined;
|
|
20
|
-
export declare const getResponseBody: (response: Response) => Promise<any>;
|
|
21
|
-
export declare const catchErrorCodes: (options: ApiRequestOptions, result: ApiResult) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Request method
|
|
24
|
-
* @param config The OpenAPI configuration object
|
|
25
|
-
* @param options The request options from the service
|
|
26
|
-
* @returns CancelablePromise<T>
|
|
27
|
-
* @throws ApiError
|
|
28
|
-
*/
|
|
29
|
-
export declare const request: <T>(config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
|
|
30
|
-
export {};
|