contentful-management
Advanced tools
Comparing version 11.34.0 to 11.35.0
@@ -38,2 +38,3 @@ import * as ApiKey from './api-key'; | ||
import * as ReleaseAction from './release-action'; | ||
import * as Resource from './resource'; | ||
import * as ResourceProvider from './resource-provider'; | ||
@@ -99,2 +100,3 @@ import * as ResourceType from './resource-type'; | ||
ReleaseAction, | ||
Resource, | ||
ResourceProvider, | ||
@@ -101,0 +103,0 @@ ResourceType, |
@@ -5,2 +5,3 @@ import * as raw from './raw'; | ||
const getEntityUrl = params => `${getBaseUrl(params)}/${params.resourceTypeId}`; | ||
const getSpaceEnvUrl = params => `/spaces/${params.spaceId}/environments/${params.environmentId}/resource_types`; | ||
export const get = (http, params) => { | ||
@@ -20,2 +21,5 @@ return raw.get(http, getEntityUrl(params)); | ||
return raw.get(http, getBaseUrl(params)); | ||
}; | ||
export const getForEnvironment = (http, params) => { | ||
return raw.get(http, getSpaceEnvUrl(params)); | ||
}; |
@@ -49,3 +49,3 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
// @ts-expect-error | ||
`${sdkMain}/${"11.34.0"}`, params.application, params.integration, params.feature); | ||
`${sdkMain}/${"11.35.0"}`, params.application, params.integration, params.feature); | ||
const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, { | ||
@@ -52,0 +52,0 @@ userAgent |
@@ -57,2 +57,3 @@ import * as apiKey from './api-key'; | ||
import * as resourceType from './resource-type'; | ||
import * as resource from './resource'; | ||
export default { | ||
@@ -97,2 +98,3 @@ accessToken, | ||
resourceType, | ||
resource, | ||
role, | ||
@@ -99,0 +101,0 @@ scheduledAction, |
@@ -88,2 +88,3 @@ import { toPlainObject, freezeSys } from 'contentful-sdk-core'; | ||
}, | ||
headers: {}, | ||
payload: data | ||
@@ -90,0 +91,0 @@ }).then(data => wrapResourceType(makeRequest, data)); |
import { toPlainObject, freezeSys } from 'contentful-sdk-core'; | ||
import copy from 'fast-copy'; | ||
import enhanceWithMethods from '../enhance-with-methods'; | ||
import { wrapCursorPaginatedCollection } from '../common-utils'; | ||
const publicResourceTypeFields = ['name']; | ||
/** | ||
@@ -86,2 +88,7 @@ * @private | ||
return freezeSys(ResourceTypeWithMethods); | ||
} | ||
} | ||
export function wrapResourceTypeforEnvironment(makeRequest, data) { | ||
const resourceType = toPlainObject(data); | ||
return freezeSys(resourceType); | ||
} | ||
export const wrapResourceTypesForEnvironmentCollection = wrapCursorPaginatedCollection(wrapResourceTypeforEnvironment); |
@@ -377,2 +377,5 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
}, | ||
resource: { | ||
getMany: wrap(wrapParams, 'Resource', 'getMany') | ||
}, | ||
resourceProvider: { | ||
@@ -387,3 +390,4 @@ get: wrap(wrapParams, 'ResourceProvider', 'get'), | ||
upsert: wrap(wrapParams, 'ResourceType', 'upsert'), | ||
delete: wrap(wrapParams, 'ResourceType', 'delete') | ||
delete: wrap(wrapParams, 'ResourceType', 'delete'), | ||
getForEnvironment: wrap(wrapParams, 'ResourceType', 'getForEnvironment') | ||
}, | ||
@@ -390,0 +394,0 @@ extension: { |
@@ -38,2 +38,3 @@ import * as ApiKey from './api-key'; | ||
import * as ReleaseAction from './release-action'; | ||
import * as Resource from './resource'; | ||
import * as ResourceProvider from './resource-provider'; | ||
@@ -99,2 +100,3 @@ import * as ResourceType from './resource-type'; | ||
ReleaseAction: typeof ReleaseAction; | ||
Resource: typeof Resource; | ||
ResourceProvider: typeof ResourceProvider; | ||
@@ -101,0 +103,0 @@ ResourceType: typeof ResourceType; |
@@ -6,1 +6,2 @@ import type { RestEndpoint } from '../types'; | ||
export declare const getMany: RestEndpoint<'ResourceType', 'getMany'>; | ||
export declare const getForEnvironment: RestEndpoint<'ResourceType', 'getForEnvironment'>; |
@@ -94,3 +94,3 @@ import type { ContentFields } from '../../entities/content-type-fields'; | ||
*/ | ||
export declare function toInternalFieldType(api: Partial<ContentFields>): "File" | "Entries" | "Boolean" | "Symbol" | "Number" | "Asset" | "Entry" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "Resource" | "Symbols" | "Assets" | "Resources" | undefined; | ||
export declare function toInternalFieldType(api: Partial<ContentFields>): "File" | "Entries" | "Boolean" | "Symbol" | "Number" | "Asset" | "Entry" | "Resource" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "Symbols" | "Assets" | "Resources" | undefined; | ||
export declare const DEFAULTS_WIDGET: { | ||
@@ -97,0 +97,0 @@ Text: { |
@@ -57,2 +57,3 @@ import * as apiKey from './api-key'; | ||
import * as resourceType from './resource-type'; | ||
import * as resource from './resource'; | ||
declare const _default: { | ||
@@ -97,2 +98,3 @@ accessToken: typeof accessToken; | ||
resourceType: typeof resourceType; | ||
resource: typeof resource; | ||
role: typeof role; | ||
@@ -99,0 +101,0 @@ scheduledAction: typeof scheduledAction; |
@@ -1,2 +0,2 @@ | ||
import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types'; | ||
import type { BasicMetaSysProps, CursorPaginatedCollectionProp, DefaultElements, MakeRequest, SysLink } from '../common-types'; | ||
export type ResourceTypeProps = { | ||
@@ -8,4 +8,4 @@ /** | ||
appDefinition: SysLink; | ||
resourceProvider: SysLink; | ||
organization: SysLink; | ||
resourceProvider: SysLink; | ||
}; | ||
@@ -34,2 +34,7 @@ /** | ||
}; | ||
declare const publicResourceTypeFields: readonly ["name"]; | ||
type OptionalSysFields = 'createdAt' | 'createdBy' | 'updatedAt' | 'updatedBy' | 'appDefinition' | 'organization'; | ||
export type SpaceEnvResourceTypeProps = Pick<ResourceTypeProps, typeof publicResourceTypeFields[number]> & { | ||
sys: Partial<Pick<ResourceTypeProps['sys'], OptionalSysFields>> & Omit<ResourceTypeProps['sys'], OptionalSysFields>; | ||
}; | ||
export type UpsertResourceTypeProps = Omit<ResourceTypeProps, 'sys'>; | ||
@@ -47,1 +52,4 @@ export interface ResourceType extends ResourceTypeProps, DefaultElements<ResourceTypeProps> { | ||
export declare function wrapResourceType(makeRequest: MakeRequest, data: ResourceTypeProps): ResourceType; | ||
export declare function wrapResourceTypeforEnvironment(makeRequest: MakeRequest, data: SpaceEnvResourceTypeProps): SpaceEnvResourceTypeProps; | ||
export declare const wrapResourceTypesForEnvironmentCollection: (makeRequest: MakeRequest, data: CursorPaginatedCollectionProp<SpaceEnvResourceTypeProps>) => CursorPaginatedCollectionProp<SpaceEnvResourceTypeProps>; | ||
export {}; |
@@ -65,2 +65,3 @@ export * from './common-types'; | ||
export type { ResourceProvider, ResourceProviderProps, UpsertResourceProviderProps, } from './entities/resource-provider'; | ||
export type { ResourceType, ResourceTypeProps, UpsertResourceTypeProps, } from './entities/resource-type'; | ||
export type { ResourceType, ResourceTypeProps, SpaceEnvResourceTypeProps, UpsertResourceTypeProps, } from './entities/resource-type'; | ||
export type { ResourceProps, ResourceQueryOptions } from './entities/resource'; |
@@ -64,2 +64,3 @@ import type { RawAxiosRequestConfig, RawAxiosRequestHeaders } from 'axios'; | ||
import type { ResourceTypePlainClientAPI } from './entities/resource-type'; | ||
import type { ResourcePlainAPI } from './entities/resource'; | ||
export type PlainClientAPI = { | ||
@@ -291,2 +292,5 @@ raw: { | ||
}; | ||
resource: ResourcePlainAPI; | ||
resourceProvider: ResourceProviderPlainClientAPI; | ||
resourceType: ResourceTypePlainClientAPI; | ||
role: RolePlainClientAPI; | ||
@@ -332,4 +336,2 @@ scheduledActions: { | ||
appInstallation: AppInstallationPlainClientAPI; | ||
resourceProvider: ResourceProviderPlainClientAPI; | ||
resourceType: ResourceTypePlainClientAPI; | ||
extension: ExtensionPlainClientAPI; | ||
@@ -336,0 +338,0 @@ webhook: WebhookPlainClientAPI; |
import type { RawAxiosRequestHeaders } from 'axios'; | ||
import type { OptionalDefaults } from '../wrappers/wrap'; | ||
import type { CollectionProp, GetResourceTypeParams } from '../../common-types'; | ||
import type { BasicCursorPaginationOptions, CollectionProp, CursorPaginatedCollectionProp, GetResourceTypeParams, GetSpaceEnvironmentParams } from '../../common-types'; | ||
import type { ResourceTypeProps, UpsertResourceTypeProps } from '../../export-types'; | ||
import type { SpaceEnvResourceTypeProps } from '../../entities/resource-type'; | ||
export type ResourceTypePlainClientAPI = { | ||
@@ -9,3 +10,6 @@ get(params: OptionalDefaults<GetResourceTypeParams>): Promise<ResourceTypeProps>; | ||
delete(params: OptionalDefaults<GetResourceTypeParams>): Promise<any>; | ||
getForEnvironment(params: OptionalDefaults<GetSpaceEnvironmentParams> & { | ||
query?: BasicCursorPaginationOptions; | ||
}): Promise<CursorPaginatedCollectionProp<SpaceEnvResourceTypeProps>>; | ||
getMany(params: OptionalDefaults<Omit<GetResourceTypeParams, 'resourceTypeId'>>): Promise<CollectionProp<ResourceTypeProps>>; | ||
}; |
{ | ||
"name": "contentful-management", | ||
"version": "11.34.0", | ||
"version": "11.35.0", | ||
"description": "Client for Contentful's Content Management API", | ||
@@ -5,0 +5,0 @@ "homepage": "https://www.contentful.com/developers/documentation/content-management-api/", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8057960
420
84786