Socket
Socket
Sign inDemoInstall

contentful-management

Package Overview
Dependencies
Maintainers
6
Versions
578
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

contentful-management - npm Package Compare versions

Comparing version 11.32.0 to 11.33.0

dist/es-modules/adapters/REST/endpoints/resource-provider.js

2

dist/es-modules/adapters/REST/endpoints/index.js

@@ -38,2 +38,3 @@ import * as ApiKey from './api-key';

import * as ReleaseAction from './release-action';
import * as ResourceProvider from './resource-provider';
import * as Role from './role';

@@ -97,2 +98,3 @@ import * as ScheduledAction from './scheduled-action';

ReleaseAction,
ResourceProvider,
Role,

@@ -99,0 +101,0 @@ ScheduledAction,

2

dist/es-modules/contentful-management.js

@@ -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.32.0"}`, params.application, params.integration, params.feature);
`${sdkMain}/${"11.33.0"}`, params.application, params.integration, params.feature);
const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {

@@ -52,0 +52,0 @@ userAgent

@@ -16,2 +16,5 @@ import entities from './entities';

} = entities.appBundle;
const {
wrapResourceProvider
} = entities.resourceProvider;
const getParams = data => ({

@@ -190,4 +193,73 @@ appDefinitionId: data.sys.id,

});
},
/**
* Creates or updates a resource provider
* @param data representation of the ResourceProvider
* @return Promise for the newly created or updated ResourceProvider
* @example ```javascript
* const contentful = require('contentful-management')
* const client = contentful.createClient({
* accessToken: '<content_management_api_key>'
* })
*
* // You need a valid AppDefinition with an activated AppBundle that has a contentful function configured
* client.getOrganization('<org_id>')
* .then((org) => org.getAppDefinition('<app_def_id>'))
* .then((appDefinition) => appDefinition.upsertResourceProvider({
* sys: {
* id: '<resource_provider_id>'
* },
* type: 'function',
* function: {
* sys: {
* id: '<contentful_function_id>',
* type: 'Link'
* linkType: 'Function'
* }
* }
* }))
* .then((resourceProvider) => console.log(resourceProvider))
* .catch(console.error)
* ```
*/
upsertResourceProvider(data) {
const raw = this.toPlainObject();
return makeRequest({
entityType: 'ResourceProvider',
action: 'upsert',
params: {
appDefinitionId: raw.sys.id,
organizationId: raw.sys.organization.sys.id
},
payload: data
}).then(payload => wrapResourceProvider(makeRequest, payload));
},
/**
* Gets a Resource Provider
* @return Promise for a Resource Provider
* @example ```javascript
* const contentful = require('contentful-management')
* const client = contentful.createClient({
* accessToken: '<content_management_api_key>'
* })
*
* client.getOrganization('<org_id>')
* .then((org) => org.getAppDefinition('<app_def_id>'))
* .then((appDefinition) => appDefinition.getResourceProvider())
* .then((resourceProvider) => console.log(resourceProvider))
* .catch(console.error)
* ```
*/
getResourceProvider() {
const raw = this.toPlainObject();
return makeRequest({
entityType: 'ResourceProvider',
action: 'get',
params: {
appDefinitionId: raw.sys.id,
organizationId: raw.sys.organization.sys.id
}
}).then(payload => wrapResourceProvider(makeRequest, payload));
}
};
}

@@ -55,2 +55,3 @@ import * as apiKey from './api-key';

import * as conceptScheme from './concept-scheme';
import * as resourceProvider from './resource-provider';
export default {

@@ -93,2 +94,3 @@ accessToken,

releaseAction,
resourceProvider,
role,

@@ -95,0 +97,0 @@ scheduledAction,

@@ -377,2 +377,7 @@ 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; }

},
resourceProvider: {
get: wrap(wrapParams, 'ResourceProvider', 'get'),
upsert: wrap(wrapParams, 'ResourceProvider', 'upsert'),
delete: wrap(wrapParams, 'ResourceProvider', 'delete')
},
extension: {

@@ -379,0 +384,0 @@ get: wrap(wrapParams, 'Extension', 'get'),

@@ -38,2 +38,3 @@ import * as ApiKey from './api-key';

import * as ReleaseAction from './release-action';
import * as ResourceProvider from './resource-provider';
import * as Role from './role';

@@ -97,2 +98,3 @@ import * as ScheduledAction from './scheduled-action';

ReleaseAction: typeof ReleaseAction;
ResourceProvider: typeof ResourceProvider;
Role: typeof Role;

@@ -99,0 +101,0 @@ ScheduledAction: typeof ScheduledAction;

import type { MakeRequest, QueryOptions, SpaceQueryOptions } from './common-types';
import type { CreateAppBundleProps } from './entities/app-bundle';
import type { UpsertResourceProviderProps } from './entities/resource-provider';
/**

@@ -120,2 +121,50 @@ * @private

getInstallationsForOrg(query?: SpaceQueryOptions): Promise<import("./entities/app-definition").AppInstallationsForOrganizationProps>;
/**
* Creates or updates a resource provider
* @param data representation of the ResourceProvider
* @return Promise for the newly created or updated ResourceProvider
* @example ```javascript
* const contentful = require('contentful-management')
* const client = contentful.createClient({
* accessToken: '<content_management_api_key>'
* })
*
* // You need a valid AppDefinition with an activated AppBundle that has a contentful function configured
* client.getOrganization('<org_id>')
* .then((org) => org.getAppDefinition('<app_def_id>'))
* .then((appDefinition) => appDefinition.upsertResourceProvider({
* sys: {
* id: '<resource_provider_id>'
* },
* type: 'function',
* function: {
* sys: {
* id: '<contentful_function_id>',
* type: 'Link'
* linkType: 'Function'
* }
* }
* }))
* .then((resourceProvider) => console.log(resourceProvider))
* .catch(console.error)
* ```
*/
upsertResourceProvider(data: UpsertResourceProviderProps): Promise<import("./entities/resource-provider").ResourceProvider>;
/**
* Gets a Resource Provider
* @return Promise for a Resource Provider
* @example ```javascript
* const contentful = require('contentful-management')
* const client = contentful.createClient({
* accessToken: '<content_management_api_key>'
* })
*
* client.getOrganization('<org_id>')
* .then((org) => org.getAppDefinition('<app_def_id>'))
* .then((appDefinition) => appDefinition.getResourceProvider())
* .then((resourceProvider) => console.log(resourceProvider))
* .catch(console.error)
* ```
*/
getResourceProvider(): Promise<import("./entities/resource-provider").ResourceProvider>;
};

@@ -55,2 +55,3 @@ import * as apiKey from './api-key';

import * as conceptScheme from './concept-scheme';
import * as resourceProvider from './resource-provider';
declare const _default: {

@@ -93,2 +94,3 @@ accessToken: typeof accessToken;

releaseAction: typeof releaseAction;
resourceProvider: typeof resourceProvider;
role: typeof role;

@@ -95,0 +97,0 @@ scheduledAction: typeof scheduledAction;

@@ -64,1 +64,2 @@ export * from './common-types';

export type { ConceptSchemeProps, CreateConceptSchemeProps } from './entities/concept-scheme';
export type { ResourceProvider, ResourceProviderProps, UpsertResourceProviderProps, } from './entities/resource-provider';

@@ -62,2 +62,3 @@ import type { RawAxiosRequestConfig, RawAxiosRequestHeaders } from 'axios';

import type { ConceptSchemePlainClientAPI } from './entities/concept-scheme';
import type { ResourceProviderPlainClientAPI } from './entities/resource-provider';
export type PlainClientAPI = {

@@ -329,2 +330,3 @@ raw: {

appInstallation: AppInstallationPlainClientAPI;
resourceProvider: ResourceProviderPlainClientAPI;
extension: ExtensionPlainClientAPI;

@@ -331,0 +333,0 @@ webhook: WebhookPlainClientAPI;

{
"name": "contentful-management",
"version": "11.32.0",
"version": "11.33.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc