contentful-management 11.36.2 → 11.38.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.
@@ -1,15 +1,16 @@
1
+ import * as AccessToken from './access-token';
1
2
  import * as ApiKey from './api-key';
3
+ import * as AppAccessToken from './app-access-token';
2
4
  import * as AppAction from './app-action';
3
5
  import * as AppActionCall from './app-action-call';
4
6
  import * as AppBundle from './app-bundle';
5
7
  import * as AppDefinition from './app-definition';
6
8
  import * as AppDetails from './app-details';
9
+ import * as AppEventSubscription from './app-event-subscription';
7
10
  import * as AppInstallation from './app-installation';
11
+ import * as AppKey from './app-key';
8
12
  import * as AppSignedRequest from './app-signed-request';
9
13
  import * as AppSigningSecret from './app-signing-secret';
10
- import * as AppEventSubscription from './app-event-subscription';
11
- import * as AppKey from './app-key';
12
- import * as AppAccessToken from './app-access-token';
13
14
  import * as AppUpload from './app-upload';
14
15
  import * as Asset from './asset';
15
16
  import * as AssetKey from './asset-key';
@@ -31,7 +32,6 @@ import * as Organization from './organization';
31
32
  import * as OrganizationInvitation from './organization-invitation';
32
33
  import * as OrganizationMembership from './organization-membership';
33
34
  import * as PersonalAccessToken from './personal-access-token';
34
- import * as AccessToken from './access-token';
35
35
  import * as PreviewApiKey from './preview-api-key';
36
36
  import * as Release from './release';
37
37
  import * as ReleaseAction from './release-action';
@@ -51,6 +51,7 @@ import * as TeamMembership from './team-membership';
51
51
  import * as TeamSpaceMembership from './team-space-membership';
52
52
  import * as UIConfig from './ui-config';
53
53
  import * as Upload from './upload';
54
+ import * as UploadCredential from './upload-credentials';
54
55
  import * as Usage from './usage';
55
56
  import * as User from './user';
56
57
  import * as UserUIConfig from './user-ui-config';
@@ -112,6 +113,7 @@ export default {
112
113
  TeamSpaceMembership,
113
114
  UIConfig,
114
115
  Upload,
116
+ UploadCredential,
115
117
  Usage,
116
118
  User,
117
119
  UserUIConfig,
@@ -0,0 +1,11 @@
1
+ import { getUploadHttpClient } from '../../../upload-http-client';
2
+ import * as raw from './raw';
3
+ const getBaseUrl = params => {
4
+ var _params$environmentId;
5
+ return `/spaces/${params.spaceId}/environments/${(_params$environmentId = params.environmentId) !== null && _params$environmentId !== void 0 ? _params$environmentId : 'master'}/upload_credentials`;
6
+ };
7
+ export const create = (http, params) => {
8
+ const httpUpload = getUploadHttpClient(http);
9
+ const path = getBaseUrl(params);
10
+ return raw.post(httpUpload, path);
11
+ };
@@ -46,7 +46,7 @@ function createClient(params, opts = {}) {
46
46
  const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
47
47
  const userAgent = getUserAgentHeader(
48
48
  // @ts-expect-error
49
- `${sdkMain}/${"11.36.2"}`, params.application, params.integration, params.feature);
49
+ `${sdkMain}/${"11.38.0"}`, params.application, params.integration, params.feature);
50
50
  const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
51
51
  userAgent
52
52
  }));
@@ -10,7 +10,6 @@
10
10
  * values used here will be the same that will be defined on the baseObject.
11
11
  */
12
12
  export default function enhanceWithMethods(baseObject, methodsObject) {
13
- // @ts-expect-error
14
13
  return Object.keys(methodsObject).reduce((enhancedObject, methodName) => {
15
14
  Object.defineProperty(enhancedObject, methodName, {
16
15
  enumerable: false,
@@ -0,0 +1,33 @@
1
+ import { freezeSys, toPlainObject } from 'contentful-sdk-core';
2
+ import copy from 'fast-copy';
3
+ import enhanceWithMethods from '../enhance-with-methods';
4
+ /**
5
+ * @private
6
+ */
7
+ function createUploadCredentialsApi(makeRequest) {
8
+ return {
9
+ create: async function create() {
10
+ const raw = this.toPlainObject();
11
+ return makeRequest({
12
+ entityType: 'UploadCredential',
13
+ action: 'create',
14
+ params: {
15
+ spaceId: raw.sys.space.sys.id,
16
+ environmentId: raw.sys.id
17
+ }
18
+ });
19
+ }
20
+ };
21
+ }
22
+
23
+ /**
24
+ * @private
25
+ * @param {function} makeRequest - function to make requests via an adapter
26
+ * @param {object} data - Raw upload credential data
27
+ * @return {UploadCredential} Wrapped upload credential data
28
+ */
29
+ export function wrapUploadCredential(makeRequest, data) {
30
+ const uploadCredential = toPlainObject(copy(data));
31
+ const uploadCredentialWithMethods = enhanceWithMethods(uploadCredential, createUploadCredentialsApi(makeRequest));
32
+ return freezeSys(uploadCredentialWithMethods);
33
+ }
@@ -1,3 +1,3 @@
1
1
  export * from './common-types';
2
2
  export * from './plain/common-types';
3
- export { WorkflowStepPermissionType, WorkflowStepPermissionAction, WorkflowStepPermissionEffect } from './entities/workflow-definition';
3
+ export { WorkflowStepPermissionAction, WorkflowStepPermissionEffect, WorkflowStepPermissionType } from './entities/workflow-definition';
@@ -278,6 +278,9 @@ export const createPlainClient = (makeRequest, defaults) => {
278
278
  create: wrap(wrapParams, 'Upload', 'create'),
279
279
  delete: wrap(wrapParams, 'Upload', 'delete')
280
280
  },
281
+ uploadCredential: {
282
+ create: wrap(wrapParams, 'UploadCredential', 'create')
283
+ },
281
284
  locale: {
282
285
  get: wrap(wrapParams, 'Locale', 'get'),
283
286
  getMany: wrap(wrapParams, 'Locale', 'getMany'),
@@ -1,15 +1,16 @@
1
+ import * as AccessToken from './access-token';
1
2
  import * as ApiKey from './api-key';
3
+ import * as AppAccessToken from './app-access-token';
2
4
  import * as AppAction from './app-action';
3
5
  import * as AppActionCall from './app-action-call';
4
6
  import * as AppBundle from './app-bundle';
5
7
  import * as AppDefinition from './app-definition';
6
8
  import * as AppDetails from './app-details';
9
+ import * as AppEventSubscription from './app-event-subscription';
7
10
  import * as AppInstallation from './app-installation';
11
+ import * as AppKey from './app-key';
8
12
  import * as AppSignedRequest from './app-signed-request';
9
13
  import * as AppSigningSecret from './app-signing-secret';
10
- import * as AppEventSubscription from './app-event-subscription';
11
- import * as AppKey from './app-key';
12
- import * as AppAccessToken from './app-access-token';
13
14
  import * as AppUpload from './app-upload';
14
15
  import * as Asset from './asset';
15
16
  import * as AssetKey from './asset-key';
@@ -31,7 +32,6 @@ import * as Organization from './organization';
31
32
  import * as OrganizationInvitation from './organization-invitation';
32
33
  import * as OrganizationMembership from './organization-membership';
33
34
  import * as PersonalAccessToken from './personal-access-token';
34
- import * as AccessToken from './access-token';
35
35
  import * as PreviewApiKey from './preview-api-key';
36
36
  import * as Release from './release';
37
37
  import * as ReleaseAction from './release-action';
@@ -51,6 +51,7 @@ import * as TeamMembership from './team-membership';
51
51
  import * as TeamSpaceMembership from './team-space-membership';
52
52
  import * as UIConfig from './ui-config';
53
53
  import * as Upload from './upload';
54
+ import * as UploadCredential from './upload-credentials';
54
55
  import * as Usage from './usage';
55
56
  import * as User from './user';
56
57
  import * as UserUIConfig from './user-ui-config';
@@ -112,6 +113,7 @@ declare const _default: {
112
113
  TeamSpaceMembership: typeof TeamSpaceMembership;
113
114
  UIConfig: typeof UIConfig;
114
115
  Upload: typeof Upload;
116
+ UploadCredential: typeof UploadCredential;
115
117
  Usage: typeof Usage;
116
118
  User: typeof User;
117
119
  UserUIConfig: typeof UserUIConfig;
@@ -0,0 +1,2 @@
1
+ import type { RestEndpoint } from '../types';
2
+ export declare const create: RestEndpoint<'UploadCredential', 'create'>;
@@ -1,27 +1,35 @@
1
1
  import type { RawAxiosRequestConfig, RawAxiosRequestHeaders } from 'axios';
2
2
  import type { OpPatch } from 'json-patch';
3
3
  import type { Stream } from 'stream';
4
+ import type { AccessTokenProps, CreatePersonalAccessTokenProps as CreatePATProps } from './entities/access-token';
5
+ import type { ApiKeyProps, CreateApiKeyProps } from './entities/api-key';
4
6
  import type { AppActionProps, CreateAppActionProps } from './entities/app-action';
5
7
  import type { AppActionCallProps, AppActionCallResponse, CreateAppActionCallProps } from './entities/app-action-call';
6
8
  import type { AppBundleProps, CreateAppBundleProps } from './entities/app-bundle';
7
- import type { ApiKeyProps, CreateApiKeyProps } from './entities/api-key';
8
- import type { AppDefinitionProps, CreateAppDefinitionProps } from './entities/app-definition';
9
+ import type { AppDefinitionProps, AppInstallationsForOrganizationProps, CreateAppDefinitionProps } from './entities/app-definition';
10
+ import type { AppDetailsProps, CreateAppDetailsProps } from './entities/app-details';
9
11
  import type { AppInstallationProps, CreateAppInstallationProps } from './entities/app-installation';
12
+ import type { AppSignedRequestProps, CreateAppSignedRequestProps } from './entities/app-signed-request';
13
+ import type { AppSigningSecretProps, CreateAppSigningSecretProps } from './entities/app-signing-secret';
14
+ import type { AppUploadProps } from './entities/app-upload';
10
15
  import type { AssetFileProp, AssetProcessingForLocale, AssetProps, CreateAssetProps } from './entities/asset';
11
- import type { ContentTypeProps, CreateContentTypeProps } from './entities/content-type';
16
+ import type { AssetKeyProps, CreateAssetKeyProps } from './entities/asset-key';
17
+ import type { BulkActionProps, BulkActionPublishPayload, BulkActionUnpublishPayload, BulkActionValidatePayload } from './entities/bulk-action';
12
18
  import type { CommentProps, CreateCommentParams, CreateCommentProps, DeleteCommentParams, GetCommentParentEntityParams, GetManyCommentsParams, PlainTextBodyFormat, RichTextBodyFormat, RichTextCommentBodyPayload, RichTextCommentProps, UpdateCommentParams, UpdateCommentProps } from './entities/comment';
19
+ import type { ContentTypeProps, CreateContentTypeProps } from './entities/content-type';
13
20
  import type { EditorInterfaceProps } from './entities/editor-interface';
14
21
  import type { CreateEntryProps, EntryProps, EntryReferenceProps } from './entities/entry';
15
22
  import type { CreateEnvironmentProps, EnvironmentProps } from './entities/environment';
16
23
  import type { CreateEnvironmentAliasProps, EnvironmentAliasProps } from './entities/environment-alias';
24
+ import type { CreateExtensionProps, ExtensionProps } from './entities/extension';
17
25
  import type { CreateLocaleProps, LocaleProps } from './entities/locale';
18
- import type { AppInstallationsForOrganizationProps } from './entities/app-definition';
19
26
  import type { OrganizationProps } from './entities/organization';
20
27
  import type { CreateOrganizationInvitationProps, OrganizationInvitationProps } from './entities/organization-invitation';
21
28
  import type { OrganizationMembershipProps } from './entities/organization-membership';
22
29
  import type { CreatePersonalAccessTokenProps, PersonalAccessTokenProps } from './entities/personal-access-token';
23
- import type { AccessTokenProps, CreatePersonalAccessTokenProps as CreatePATProps } from './entities/access-token';
24
30
  import type { PreviewApiKeyProps } from './entities/preview-api-key';
31
+ import type { ReleasePayload, ReleaseProps, ReleaseQueryOptions, ReleaseValidatePayload } from './entities/release';
32
+ import type { ReleaseAction, ReleaseActionProps, ReleaseActionQueryOptions } from './entities/release-action';
25
33
  import type { CreateRoleProps, RoleProps } from './entities/role';
26
34
  import type { ScheduledActionProps } from './entities/scheduled-action';
27
35
  import type { SnapshotProps } from './entities/snapshot';
@@ -32,35 +40,26 @@ import type { CreateTagProps, DeleteTagParams, TagProps, UpdateTagProps } from '
32
40
  import type { CreateTeamProps, TeamProps } from './entities/team';
33
41
  import type { CreateTeamMembershipProps, TeamMembershipProps } from './entities/team-membership';
34
42
  import type { CreateTeamSpaceMembershipProps, TeamSpaceMembershipProps } from './entities/team-space-membership';
35
- import type { CreateExtensionProps, ExtensionProps } from './entities/extension';
36
43
  import type { UsageProps } from './entities/usage';
37
44
  import type { UserProps } from './entities/user';
38
45
  import type { CreateWebhooksProps, UpsertWebhookSigningSecretPayload, WebhookCallDetailsProps, WebhookCallOverviewProps, WebhookHealthProps, WebhookProps, WebhookRetryPolicyPayload, WebhookRetryPolicyProps, WebhookSigningSecretProps } from './entities/webhook';
39
- import type { AssetKeyProps, CreateAssetKeyProps } from './entities/asset-key';
40
- import type { AppUploadProps } from './entities/app-upload';
41
- import type { AppDetailsProps, CreateAppDetailsProps } from './entities/app-details';
42
- import type { AppSignedRequestProps, CreateAppSignedRequestProps } from './entities/app-signed-request';
43
- import type { AppSigningSecretProps, CreateAppSigningSecretProps } from './entities/app-signing-secret';
44
- import type { BulkActionProps, BulkActionPublishPayload, BulkActionUnpublishPayload, BulkActionValidatePayload } from './entities/bulk-action';
45
- import type { ReleasePayload, ReleaseProps, ReleaseQueryOptions, ReleaseValidatePayload } from './entities/release';
46
- import type { ReleaseAction, ReleaseActionProps, ReleaseActionQueryOptions } from './entities/release-action';
47
46
  import type { CreateTaskParams, CreateTaskProps, DeleteTaskParams, TaskProps, UpdateTaskParams, UpdateTaskProps } from './entities/task';
48
- import type { CreateWorkflowDefinitionParams, CreateWorkflowDefinitionProps, DeleteWorkflowDefinitionParams, WorkflowDefinitionProps, WorkflowDefinitionQueryOptions } from './entities/workflow-definition';
49
- import type { CompleteWorkflowParams, CreateWorkflowParams, CreateWorkflowProps, DeleteWorkflowParams, WorkflowProps, WorkflowQueryOptions } from './entities/workflow';
50
- import type { WorkflowsChangelogEntryProps, WorkflowsChangelogQueryOptions } from './entities/workflows-changelog-entry';
51
- import type { UIConfigProps } from './entities/ui-config';
52
- import type { UserUIConfigProps } from './entities/user-ui-config';
53
- import type { CreateEnvironmentTemplateProps, EnvironmentTemplateProps } from './entities/environment-template';
54
- import type { CreateEnvironmentTemplateInstallationProps, EnvironmentTemplateInstallationProps, EnvironmentTemplateValidationProps, ValidateEnvironmentTemplateInstallationProps } from './entities/environment-template-installation';
55
- import type { FunctionProps } from './entities/function';
47
+ import type { AppAccessTokenProps, CreateAppAccessTokenProps } from './entities/app-access-token';
56
48
  import type { AppEventSubscriptionProps, CreateAppEventSubscriptionProps } from './entities/app-event-subscription';
57
49
  import type { AppKeyProps, CreateAppKeyProps } from './entities/app-key';
58
- import type { AppAccessTokenProps, CreateAppAccessTokenProps } from './entities/app-access-token';
59
50
  import type { ConceptProps, CreateConceptProps } from './entities/concept';
60
51
  import type { ConceptSchemeProps, CreateConceptSchemeProps } from './entities/concept-scheme';
52
+ import type { CreateEnvironmentTemplateProps, EnvironmentTemplateProps } from './entities/environment-template';
53
+ import type { CreateEnvironmentTemplateInstallationProps, EnvironmentTemplateInstallationProps, EnvironmentTemplateValidationProps, ValidateEnvironmentTemplateInstallationProps } from './entities/environment-template-installation';
54
+ import type { FunctionProps } from './entities/function';
55
+ import type { ResourceProps, ResourceQueryOptions } from './entities/resource';
61
56
  import type { ResourceProviderProps, UpsertResourceProviderProps } from './entities/resource-provider';
62
57
  import type { ResourceTypeProps, SpaceEnvResourceTypeProps, UpsertResourceTypeProps } from './entities/resource-type';
63
- import type { ResourceProps, ResourceQueryOptions } from './entities/resource';
58
+ import type { UIConfigProps } from './entities/ui-config';
59
+ import type { UserUIConfigProps } from './entities/user-ui-config';
60
+ import type { CompleteWorkflowParams, CreateWorkflowParams, CreateWorkflowProps, DeleteWorkflowParams, WorkflowProps, WorkflowQueryOptions } from './entities/workflow';
61
+ import type { CreateWorkflowDefinitionParams, CreateWorkflowDefinitionProps, DeleteWorkflowDefinitionParams, WorkflowDefinitionProps, WorkflowDefinitionQueryOptions } from './entities/workflow-definition';
62
+ import type { WorkflowsChangelogEntryProps, WorkflowsChangelogQueryOptions } from './entities/workflows-changelog-entry';
64
63
  export interface DefaultElements<TPlainObject extends object = object> {
65
64
  toPlainObject(): TPlainObject;
66
65
  }
@@ -465,6 +464,7 @@ type MRInternal<UA extends boolean> = {
465
464
  (opts: MROpts<'Upload', 'get', UA>): MRReturn<'Entry', 'get'>;
466
465
  (opts: MROpts<'Upload', 'create', UA>): MRReturn<'Entry', 'create'>;
467
466
  (opts: MROpts<'Upload', 'delete', UA>): MRReturn<'Entry', 'delete'>;
467
+ (opts: MROpts<'UploadCredential', 'create', UA>): MRReturn<'UploadCredential', 'create'>;
468
468
  (opts: MROpts<'Usage', 'getManyForSpace', UA>): MRReturn<'Usage', 'getManyForSpace'>;
469
469
  (opts: MROpts<'Usage', 'getManyForOrganization', UA>): MRReturn<'Usage', 'getManyForOrganization'>;
470
470
  (opts: MROpts<'User', 'getManyForSpace', UA>): MRReturn<'User', 'getManyForSpace'>;
@@ -2033,6 +2033,12 @@ export type MRActions = {
2033
2033
  return: any;
2034
2034
  };
2035
2035
  };
2036
+ UploadCredential: {
2037
+ create: {
2038
+ params: GetSpaceEnvironmentParams;
2039
+ return: any;
2040
+ };
2041
+ };
2036
2042
  Usage: {
2037
2043
  getManyForSpace: {
2038
2044
  params: {
@@ -91,7 +91,7 @@ export declare const FIELD_TYPES: Array<keyof typeof INTERNAL_TO_API>;
91
91
  * - Assets
92
92
  * - File
93
93
  */
94
- 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;
94
+ export declare function toInternalFieldType(api: Partial<ContentFields>): "Asset" | "Entry" | "File" | "Entries" | "Boolean" | "Symbol" | "Number" | "Resource" | "Text" | "RichText" | "Integer" | "Date" | "Object" | "Location" | "Symbols" | "Assets" | "Resources" | undefined;
95
95
  export declare const DEFAULTS_WIDGET: {
96
96
  Text: {
97
97
  widgetId: string;
@@ -7,6 +7,7 @@ export type SpaceProps = {
7
7
  id: string;
8
8
  };
9
9
  };
10
+ archivedAt?: string;
10
11
  };
11
12
  name: string;
12
13
  };
@@ -0,0 +1,43 @@
1
+ import type { DefaultElements, MakeRequest, MetaSysProps, SysLink } from '../common-types';
2
+ export type UploadCredentialProps = {
3
+ /**
4
+ * System metadata
5
+ */
6
+ sys: MetaSysProps & {
7
+ space: SysLink;
8
+ environment?: SysLink;
9
+ };
10
+ };
11
+ export interface UploadCredential extends UploadCredentialProps, DefaultElements<UploadCredentialProps> {
12
+ /**
13
+ * creates the upload credentials.
14
+ * @return upload credentials for file uploads
15
+ * @example
16
+ * const contentful = require('contentful-management')
17
+ *
18
+ * const client = contentful.createClient({
19
+ * accessToken: '<content_management_api_key>'
20
+ * })
21
+ *
22
+ * try {
23
+ * const space = await client.getSpace('<space_id>')
24
+ * const environment = await space.getEnvironment('<environment_id>')
25
+ *
26
+ * const upload = await client.uploadCredential.create({
27
+ * spaceId: space.sys.id,
28
+ * environmentId: environment.sys.id
29
+ * })
30
+ * } catch (error) {
31
+ * console.error(error)
32
+ * }
33
+ *
34
+ */
35
+ create(): Promise<UploadCredentialProps>;
36
+ }
37
+ /**
38
+ * @private
39
+ * @param {function} makeRequest - function to make requests via an adapter
40
+ * @param {object} data - Raw upload credential data
41
+ * @return {UploadCredential} Wrapped upload credential data
42
+ */
43
+ export declare function wrapUploadCredential(makeRequest: MakeRequest, data: UploadCredentialProps): UploadCredential;
@@ -1,26 +1,25 @@
1
1
  export * from './common-types';
2
- export * from './plain/common-types';
2
+ export type { AccessToken, AccessTokenProps as AccessTokenProp, CreatePersonalAccessTokenProps as CreatePATProps, } from './entities/access-token';
3
3
  export type { ApiKey, ApiKeyProps, CreateApiKeyProps } from './entities/api-key';
4
+ export type { AppAccessToken, AppAccessTokenProps, CreateAppAccessTokenProps, } from './entities/app-access-token';
4
5
  export type { AppAction, AppActionCategoryProps, AppActionCategoryType, AppActionParameterDefinition, AppActionProps, AppActionType, CreateAppActionProps, } from './entities/app-action';
5
6
  export type { AppActionCall, AppActionCallProps, CreateAppActionCallProps, } from './entities/app-action-call';
6
7
  export type { AppBundle, AppBundleFile, AppBundleProps, CreateAppBundleProps, } from './entities/app-bundle';
7
8
  export type { AppDefinition, AppDefinitionProps, AppLocation, CreateAppDefinitionProps, EntryFieldLocation, NavigationItem, PageLocation, SimpleLocation, } from './entities/app-definition';
8
9
  export type { AppDetails, AppDetailsProps, AppIcon, CreateAppDetailsProps, IconType, } from './entities/app-details';
10
+ export type { AppEventSubscription, AppEventSubscriptionProps, CreateAppEventSubscriptionProps, } from './entities/app-event-subscription';
9
11
  export type { AppInstallation, AppInstallationProps, CreateAppInstallationProps, } from './entities/app-installation';
12
+ export type { AppKey, AppKeyProps, CreateAppKeyProps } from './entities/app-key';
10
13
  export type { AppSignedRequest, AppSignedRequestProps, CreateAppSignedRequestProps, } from './entities/app-signed-request';
11
14
  export type { AppSigningSecret, AppSigningSecretProps, CreateAppSigningSecretProps, } from './entities/app-signing-secret';
12
- export type { AppEventSubscription, AppEventSubscriptionProps, CreateAppEventSubscriptionProps, } from './entities/app-event-subscription';
13
- export type { AppKey, AppKeyProps, CreateAppKeyProps } from './entities/app-key';
14
- export type { AppAccessToken, AppAccessTokenProps, CreateAppAccessTokenProps, } from './entities/app-access-token';
15
15
  export type { AppUpload, AppUploadProps } from './entities/app-upload';
16
16
  export type { Asset, AssetFileProp, AssetProps, CreateAssetProps } from './entities/asset';
17
17
  export type { AssetKey, AssetKeyProps, CreateAssetKeyProps } from './entities/asset-key';
18
18
  export type { BulkAction, BulkActionPayload, BulkActionProps, BulkActionPublishPayload, BulkActionStatus, BulkActionType, BulkActionUnpublishPayload, BulkActionValidatePayload, } from './entities/bulk-action';
19
- export type { RichTextCommentDocument, RichTextCommentProps, Comment, CommentProps, CreateCommentProps, UpdateCommentProps, DeleteCommentParams, GetCommentParentEntityParams, GetManyCommentsParams, } from './entities/comment';
19
+ export type { Comment, CommentProps, CreateCommentProps, DeleteCommentParams, GetCommentParentEntityParams, GetManyCommentsParams, RichTextCommentDocument, RichTextCommentProps, UpdateCommentProps, } from './entities/comment';
20
20
  export type { AnnotationAssignment, ContentType, ContentTypeMetadata, ContentTypeProps, CreateContentTypeProps, } from './entities/content-type';
21
21
  export type { ContentFields, ContentTypeFieldValidation, ContentfulEntryResource, ExternalResource, } from './entities/content-type-fields';
22
22
  export type { Control, Editor, EditorInterface, EditorInterfaceProps, EditorLayoutItem, FieldGroupItem, FieldItem, GroupControl, SidebarItem, } from './entities/editor-interface';
23
- export type { FunctionProps } from './entities/function';
24
23
  export type { CreateEntryProps, Entry, EntryProps, WithResourceName } from './entities/entry';
25
24
  export type { CreateEnvironmentProps, Environment, EnvironmentProps } from './entities/environment';
26
25
  export type { CreateEnvironmentAliasProps, EnvironmentAlias, EnvironmentAliasProps, } from './entities/environment-alias';
@@ -28,14 +27,14 @@ export type { ContentTypeTemplateProps, CreateEnvironmentTemplateProps, EditorIn
28
27
  export type { CreateEnvironmentTemplateInstallationProps, EnvironmentTemplateInstallation, EnvironmentTemplateInstallationProps, EnvironmentTemplateInstallationStatus, EnvironmentTemplateValidationProps, ValidateEnvironmentTemplateInstallationProps, ValidationFinding, } from './entities/environment-template-installation';
29
28
  export type { CreateExtensionProps as CreateUIExtensionProps, Extension as UIExtension, ExtensionProps as UIExtensionProps, } from './entities/extension';
30
29
  export type { FieldType } from './entities/field-type';
30
+ export type { FunctionProps } from './entities/function';
31
31
  export type { CreateLocaleProps, Locale, LocaleProps } from './entities/locale';
32
32
  export type { Organization, OrganizationProp, OrganizationProps } from './entities/organization';
33
33
  export type { CreateOrganizationInvitationProps, OrganizationInvitation, OrganizationInvitationProps, } from './entities/organization-invitation';
34
34
  export type { OrganizationMembership, OrganizationMembershipProps, } from './entities/organization-membership';
35
35
  export type { CreatePersonalAccessTokenProps, PersonalAccessToken, PersonalAccessTokenProp, PersonalAccessTokenProps, } from './entities/personal-access-token';
36
- export type { CreatePersonalAccessTokenProps as CreatePATProps, AccessToken, AccessTokenProps as AccessTokenProp, } from './entities/access-token';
37
36
  export type { PreviewApiKey, PreviewApiKeyProps } from './entities/preview-api-key';
38
- export type { Release, ReleasePayload, ReleaseProps, ReleaseQueryOptions, ReleaseSysProps, ReleaseValidateOptions, ReleaseMetadata, ReleaseReferenceFilters, } from './entities/release';
37
+ export type { Release, ReleaseMetadata, ReleasePayload, ReleaseProps, ReleaseQueryOptions, ReleaseReferenceFilters, ReleaseSysProps, ReleaseValidateOptions, } from './entities/release';
39
38
  export type { ReleaseAction, ReleaseActionProps, ReleaseActionQueryOptions, ReleaseActionSysProps, ReleaseActionTypes, } from './entities/release-action';
40
39
  export type { CreateRoleProps, Role, RoleProps } from './entities/role';
41
40
  export type { ScheduledAction, ScheduledActionProps, ScheduledActionSysProps, } from './entities/scheduled-action';
@@ -50,17 +49,19 @@ export type { CreateTeamMembershipProps, TeamMembership, TeamMembershipProps, }
50
49
  export type { CreateTeamSpaceMembershipProps, TeamSpaceMembership, TeamSpaceMembershipProps, } from './entities/team-space-membership';
51
50
  export type { UIConfig, UIConfigProps } from './entities/ui-config';
52
51
  export type { Upload, UploadProps } from './entities/upload';
52
+ export type { UploadCredential, UploadCredentialProps } from './entities/upload-credential';
53
53
  export type { Usage, UsageProps } from './entities/usage';
54
54
  export type { User, UserProps } from './entities/user';
55
55
  export type { UserUIConfig, UserUIConfigProps } from './entities/user-ui-config';
56
- export type { CreateWebhooksProps, UpdateWebhookProps, WebhookCallRequest, WebhookFilter, WebhookProps, WebHooks, WebhookTransformation, UpsertWebhookSigningSecretPayload, WebhookSigningSecretProps, } from './entities/webhook';
57
- export type { WorkflowDefinition, WorkflowDefinitionSysProps, WorkflowDefinitionProps, CreateWorkflowDefinitionProps, UpdateWorkflowDefinitionProps, CreateWorkflowDefinitionParams, UpdateWorkflowDefinitionParams, DeleteWorkflowDefinitionParams, WorkflowStepProps, UpdateWorkflowStepProps, CreateWorkflowStepProps, WorkflowDefinitionQueryOptions, WorkflowDefinitionValidationLink, WorkflowStepAction, WorkflowStepActionType, WorkflowStepPermission, WorkflowStepPermissionActors, WorkflowStepEmailActionRecipient, WorkflowStepEmailAction, WorkflowStepTaskAction, WorkflowStepAppAction, } from './entities/workflow-definition';
58
- export { WorkflowStepPermissionType, WorkflowStepPermissionAction, WorkflowStepPermissionEffect, } from './entities/workflow-definition';
59
- export type { DefinedParameters, FreeFormParameters, ParameterDefinition, ParameterOption, ParameterType, InstallationParameterType, } from './entities/widget-parameters';
60
- export type { CreateWorkflowProps, UpdateWorkflowProps, DeleteWorkflowParams, Workflow, WorkflowProps, WorkflowQueryOptions, } from './entities/workflow';
61
- export type { WorkflowsChangelogEntry, WorkflowsChangelogEntryProps, WorkflowsChangelogQueryOptions, } from './entities/workflows-changelog-entry';
56
+ export type { CreateWebhooksProps, UpdateWebhookProps, UpsertWebhookSigningSecretPayload, WebHooks, WebhookCallRequest, WebhookFilter, WebhookProps, WebhookSigningSecretProps, WebhookTransformation, } from './entities/webhook';
57
+ export type { CreateWorkflowDefinitionParams, CreateWorkflowDefinitionProps, CreateWorkflowStepProps, DeleteWorkflowDefinitionParams, UpdateWorkflowDefinitionParams, UpdateWorkflowDefinitionProps, UpdateWorkflowStepProps, WorkflowDefinition, WorkflowDefinitionProps, WorkflowDefinitionQueryOptions, WorkflowDefinitionSysProps, WorkflowDefinitionValidationLink, WorkflowStepAction, WorkflowStepActionType, WorkflowStepAppAction, WorkflowStepEmailAction, WorkflowStepEmailActionRecipient, WorkflowStepPermission, WorkflowStepPermissionActors, WorkflowStepProps, WorkflowStepTaskAction, } from './entities/workflow-definition';
58
+ export * from './plain/common-types';
59
+ export { WorkflowStepPermissionAction, WorkflowStepPermissionEffect, WorkflowStepPermissionType, } from './entities/workflow-definition';
62
60
  export type { ConceptProps, CreateConceptProps } from './entities/concept';
63
61
  export type { ConceptSchemeProps, CreateConceptSchemeProps } from './entities/concept-scheme';
62
+ export type { ResourceProps, ResourceQueryOptions } from './entities/resource';
64
63
  export type { ResourceProvider, ResourceProviderProps, UpsertResourceProviderProps, } from './entities/resource-provider';
65
64
  export type { ResourceType, ResourceTypeProps, SpaceEnvResourceTypeProps, UpsertResourceTypeProps, } from './entities/resource-type';
66
- export type { ResourceProps, ResourceQueryOptions } from './entities/resource';
65
+ export type { DefinedParameters, FreeFormParameters, InstallationParameterType, ParameterDefinition, ParameterOption, ParameterType, } from './entities/widget-parameters';
66
+ export type { CreateWorkflowProps, DeleteWorkflowParams, UpdateWorkflowProps, Workflow, WorkflowProps, WorkflowQueryOptions, } from './entities/workflow';
67
+ export type { WorkflowsChangelogEntry, WorkflowsChangelogEntryProps, WorkflowsChangelogQueryOptions, } from './entities/workflows-changelog-entry';
@@ -1,67 +1,68 @@
1
1
  import type { RawAxiosRequestConfig, RawAxiosRequestHeaders } from 'axios';
2
2
  import type { OpPatch } from 'json-patch';
3
3
  import type { BasicCursorPaginationOptions, CollectionProp, CursorPaginatedCollectionProp, EnvironmentTemplateParams, GetAppDefinitionParams, GetBulkActionParams, GetContentTypeParams, GetEnvironmentTemplateParams, GetOrganizationMembershipParams, GetOrganizationParams, GetReleaseParams, GetSnapshotForContentTypeParams, GetSnapshotForEntryParams, GetSpaceEnvironmentParams, GetSpaceParams, KeyValueMap, QueryParams } from '../common-types';
4
+ import type { AccessTokenProps, CreatePersonalAccessTokenProps as CreatePATProps } from '../entities/access-token';
4
5
  import type { ApiKeyProps, CreateApiKeyProps } from '../entities/api-key';
5
6
  import type { AssetFileProp, AssetProcessingForLocale, AssetProps, CreateAssetProps } from '../entities/asset';
7
+ import type { AssetKeyProps, CreateAssetKeyProps } from '../entities/asset-key';
8
+ import type { BulkActionPayload, BulkActionProps, BulkActionPublishPayload, BulkActionUnpublishPayload, BulkActionValidatePayload } from '../entities/bulk-action';
6
9
  import type { ContentTypeProps, CreateContentTypeProps } from '../entities/content-type';
7
10
  import type { CreateEntryProps, EntryProps, EntryReferenceProps } from '../entities/entry';
11
+ import type { CreateEnvironmentTemplateProps, EnvironmentTemplateProps } from '../entities/environment-template';
12
+ import type { CreateEnvironmentTemplateInstallationProps, EnvironmentTemplateInstallationProps, EnvironmentTemplateValidationProps, ValidateEnvironmentTemplateInstallationProps } from '../entities/environment-template-installation';
13
+ import type { FunctionProps } from '../entities/function';
8
14
  import type { CreateOrganizationInvitationProps, OrganizationInvitationProps } from '../entities/organization-invitation';
9
15
  import type { OrganizationMembershipProps } from '../entities/organization-membership';
10
16
  import type { CreatePersonalAccessTokenProps, PersonalAccessTokenProps } from '../entities/personal-access-token';
11
- import type { AccessTokenProps, CreatePersonalAccessTokenProps as CreatePATProps } from '../entities/access-token';
12
17
  import type { PreviewApiKeyProps } from '../entities/preview-api-key';
13
- import type { CreateUpdateScheduledActionProps, ScheduledActionProps } from '../entities/scheduled-action';
14
- import type { SnapshotProps } from '../entities/snapshot';
15
- import type { DefaultParams, OptionalDefaults } from './wrappers/wrap';
16
- import type { AssetKeyProps, CreateAssetKeyProps } from '../entities/asset-key';
17
- import type { FunctionProps } from '../entities/function';
18
- import type { BulkActionPayload, BulkActionProps, BulkActionPublishPayload, BulkActionUnpublishPayload, BulkActionValidatePayload } from '../entities/bulk-action';
19
18
  import type { ReleasePayload, ReleaseProps, ReleaseQueryOptions, ReleaseValidatePayload } from '../entities/release';
20
19
  import type { ReleaseActionProps, ReleaseActionQueryOptions } from '../entities/release-action';
21
- import type { CreateEnvironmentTemplateProps, EnvironmentTemplateProps } from '../entities/environment-template';
22
- import type { CreateEnvironmentTemplateInstallationProps, EnvironmentTemplateInstallationProps, EnvironmentTemplateValidationProps, ValidateEnvironmentTemplateInstallationProps } from '../entities/environment-template-installation';
20
+ import type { CreateUpdateScheduledActionProps, ScheduledActionProps } from '../entities/scheduled-action';
21
+ import type { SnapshotProps } from '../entities/snapshot';
22
+ import type { AppAccessTokenPlainClientAPI } from './entities/app-access-token';
23
23
  import type { AppActionPlainClientAPI } from './entities/app-action';
24
24
  import type { AppActionCallPlainClientAPI } from './entities/app-action-call';
25
- import type { EditorInterfacePlainClientAPI } from './entities/editor-interface';
26
- import type { UIConfigPlainClientAPI } from './entities/ui-config';
27
- import type { UserUIConfigPlainClientAPI } from './entities/user-ui-config';
28
- import type { AppDefinitionPlainClientAPI } from './entities/app-definition';
29
- import type { AppUploadPlainClientAPI } from './entities/app-upload';
30
25
  import type { AppBundlePlainClientAPI } from './entities/app-bundle';
26
+ import type { AppDefinitionPlainClientAPI } from './entities/app-definition';
31
27
  import type { AppDetailsPlainClientAPI } from './entities/app-details';
28
+ import type { AppEventSubscriptionPlainClientAPI } from './entities/app-event-subscription';
32
29
  import type { AppInstallationPlainClientAPI } from './entities/app-installation';
33
- import type { WebhookPlainClientAPI } from './entities/webhook';
30
+ import type { AppKeyPlainClientAPI } from './entities/app-key';
34
31
  import type { AppSignedRequestPlainClientAPI } from './entities/app-signed-request';
35
32
  import type { AppSigningSecretPlainClientAPI } from './entities/app-signing-secret';
33
+ import type { AppUploadPlainClientAPI } from './entities/app-upload';
34
+ import type { CommentPlainClientAPI } from './entities/comment';
35
+ import type { ConceptPlainClientAPI } from './entities/concept';
36
+ import type { ConceptSchemePlainClientAPI } from './entities/concept-scheme';
37
+ import type { EditorInterfacePlainClientAPI } from './entities/editor-interface';
38
+ import type { EnvironmentPlainClientAPI } from './entities/environment';
39
+ import type { EnvironmentAliasPlainClientAPI } from './entities/environment-alias';
36
40
  import type { ExtensionPlainClientAPI } from './entities/extension';
37
- import type { AppEventSubscriptionPlainClientAPI } from './entities/app-event-subscription';
38
- import type { AppKeyPlainClientAPI } from './entities/app-key';
39
- import type { UserPlainClientAPI } from './entities/user';
40
- import type { UploadPlainClientAPI } from './entities/upload';
41
- import type { OrganizationPlainClientAPI } from './entities/organization';
42
41
  import type { LocalePlainClientAPI } from './entities/locale';
42
+ import type { OrganizationPlainClientAPI } from './entities/organization';
43
+ import type { ResourcePlainAPI } from './entities/resource';
44
+ import type { ResourceProviderPlainClientAPI } from './entities/resource-provider';
45
+ import type { ResourceTypePlainClientAPI } from './entities/resource-type';
46
+ import type { RolePlainClientAPI } from './entities/role';
43
47
  import type { SpacePlainClientAPI } from './entities/space';
44
- import type { SpaceMembershipPlainClientAPI } from './entities/space-membership';
45
48
  import type { SpaceMemberPlainClientAPI } from './entities/space-member';
46
- import type { EnvironmentPlainClientAPI } from './entities/environment';
47
- import type { EnvironmentAliasPlainClientAPI } from './entities/environment-alias';
48
- import type { CommentPlainClientAPI } from './entities/comment';
49
- import type { TaskPlainClientAPI } from './entities/task';
50
- import type { WorkflowPlainClientAPI } from './entities/workflow';
51
- import type { WorkflowsChangelogPlainClientAPI } from './entities/workflows-changelog';
52
- import type { WorkflowDefinitionPlainClientAPI } from './entities/workflow-definition';
53
- import type { RolePlainClientAPI } from './entities/role';
49
+ import type { SpaceMembershipPlainClientAPI } from './entities/space-membership';
54
50
  import type { TagPlainClientAPI } from './entities/tag';
55
- import type { UsagePlainClientAPI } from './entities/usage';
56
- import type { TeamSpaceMembershipPlainClientAPI } from './entities/team-space-membership';
51
+ import type { TaskPlainClientAPI } from './entities/task';
57
52
  import type { TeamPlainClientAPI } from './entities/team';
58
53
  import type { TeamMembershipPlainClientAPI } from './entities/team-membership';
59
- import type { AppAccessTokenPlainClientAPI } from './entities/app-access-token';
60
- import type { ConceptPlainClientAPI } from './entities/concept';
61
- import type { ConceptSchemePlainClientAPI } from './entities/concept-scheme';
62
- import type { ResourceProviderPlainClientAPI } from './entities/resource-provider';
63
- import type { ResourceTypePlainClientAPI } from './entities/resource-type';
64
- import type { ResourcePlainAPI } from './entities/resource';
54
+ import type { TeamSpaceMembershipPlainClientAPI } from './entities/team-space-membership';
55
+ import type { UIConfigPlainClientAPI } from './entities/ui-config';
56
+ import type { UploadPlainClientAPI } from './entities/upload';
57
+ import type { UploadCredentialAPI } from './entities/upload-credential';
58
+ import type { UsagePlainClientAPI } from './entities/usage';
59
+ import type { UserPlainClientAPI } from './entities/user';
60
+ import type { UserUIConfigPlainClientAPI } from './entities/user-ui-config';
61
+ import type { WebhookPlainClientAPI } from './entities/webhook';
62
+ import type { WorkflowPlainClientAPI } from './entities/workflow';
63
+ import type { WorkflowDefinitionPlainClientAPI } from './entities/workflow-definition';
64
+ import type { WorkflowsChangelogPlainClientAPI } from './entities/workflows-changelog';
65
+ import type { DefaultParams, OptionalDefaults } from './wrappers/wrap';
65
66
  export type PlainClientAPI = {
66
67
  raw: {
67
68
  getDefaultParams(): DefaultParams | undefined;
@@ -230,6 +231,7 @@ export type PlainClientAPI = {
230
231
  create(params: OptionalDefaults<GetSpaceEnvironmentParams>, data: CreateAssetKeyProps): Promise<AssetKeyProps>;
231
232
  };
232
233
  upload: UploadPlainClientAPI;
234
+ uploadCredential: UploadCredentialAPI;
233
235
  locale: LocalePlainClientAPI;
234
236
  personalAccessToken: {
235
237
  get(params: OptionalDefaults<{
@@ -0,0 +1,38 @@
1
+ import type { GetSpaceEnvironmentParams, MetaSysProps } from '../../common-types';
2
+ import type { OptionalDefaults } from '../wrappers/wrap';
3
+ export type UploadCredential = {
4
+ /**
5
+ * System metadata
6
+ */
7
+ sys: MetaSysProps & {
8
+ type: 'UploadCredential';
9
+ };
10
+ /**
11
+ * upload credentials
12
+ */
13
+ uploadCredentials: {
14
+ policy: string;
15
+ signature: string;
16
+ expiresAt: string;
17
+ createdAt: string;
18
+ };
19
+ };
20
+ export type UploadCredentialAPI = {
21
+ /** Creates a Space Environment UploadCredential for Filestack Upload
22
+ *
23
+ * @param params Space Id and Environment Id to identify the Space Environment
24
+ * @param data the Space Environment Upload
25
+ * @returns the Space Environment Upload
26
+ * @throws if the request fails, or the Space Environment is not found
27
+ * @example
28
+ * ```javascript
29
+ * const credential = await client.uploadCredential.create(
30
+ * {
31
+ * spaceId: '<space_id>',
32
+ * environmentId: '<environment_id>',
33
+ * }
34
+ * );
35
+ * ```
36
+ */
37
+ create(params: OptionalDefaults<GetSpaceEnvironmentParams>): Promise<UploadCredential>;
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contentful-management",
3
- "version": "11.36.2",
3
+ "version": "11.38.0",
4
4
  "description": "Client for Contentful's Content Management API",
5
5
  "homepage": "https://www.contentful.com/developers/documentation/content-management-api/",
6
6
  "main": "./dist/contentful-management.node.js",