UNPKG

36.9 kBTypeScriptView Raw
1import type { Stream } from 'stream';
2import type { CreateTeamMembershipProps } from './entities/team-membership';
3import type { CreateTeamProps } from './entities/team';
4import type { CreateOrganizationInvitationProps } from './entities/organization-invitation';
5import type { BasicQueryOptions, MakeRequest, QueryOptions, QueryParams } from './common-types';
6import type { CreateAppDefinitionProps } from './entities/app-definition';
7import type { CreateAppActionProps } from './entities/app-action';
8import type { CreateAppSigningSecretProps } from './entities/app-signing-secret';
9import type { CreateAppEventSubscriptionProps } from './entities/app-event-subscription';
10import type { CreateAppKeyProps } from './entities/app-key';
11import type { CreateAppDetailsProps } from './entities/app-details';
12/**
13 * @private
14 */
15export type ContentfulOrganizationAPI = ReturnType<typeof createOrganizationApi>;
16/**
17 * Creates API object with methods to access the Organization API
18 * @param {MakeRequest} makeRequest - function to make requests via an adapter
19 * @return {ContentfulOrganizationAPI}
20 * @private
21 */
22export default function createOrganizationApi(makeRequest: MakeRequest): {
23 /**
24 * Gets a collection of spaces in the organization
25 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
26 * @return Promise a collection of Spaces in the organization
27 * @example ```javascript
28 * const contentful = require('contentful-management')
29 * const client = contentful.createClient({
30 * accessToken: '<content_management_api_key>'
31 * })
32 *
33 * client.getOrganization('<organization_id>')
34 * .then((organization) => organization.getSpaces())
35 * .then((spaces) => console.log(spaces))
36 * .catch(console.error)
37 * ```
38 */
39 getSpaces(query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").Space, import("./export-types").SpaceProps>>;
40 /**
41 * Gets a User
42 * @return Promise for a User
43 * @example ```javascript
44 * const contentful = require('contentful-management')
45 * const client = contentful.createClient({
46 * accessToken: '<content_management_api_key>'
47 * })
48 *
49 * client.getOrganization('<organization_id>')
50 * .then((organization) => organization.getUser('id'))
51 * .then((user) => console.log(user))
52 * .catch(console.error)
53 * ```
54 */
55 getUser(id: string): Promise<import("./export-types").UserProps & {
56 toPlainObject(): import("./export-types").UserProps;
57 }>;
58 /**
59 * Gets a collection of Users in organization
60 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
61 * @return Promise a collection of Users in organization
62 * @example ```javascript
63 * const contentful = require('contentful-management')
64 * const client = contentful.createClient({
65 * accessToken: '<content_management_api_key>'
66 * })
67 *
68 * client.getOrganization('<organization_id>')
69 * .then((organization) => organization.getUsers())
70 * .then((users) => console.log(users))
71 * .catch(console.error)
72 * ```
73 */
74 getUsers(query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").UserProps & {
75 toPlainObject(): import("./export-types").UserProps;
76 }, import("./export-types").UserProps>>;
77 /**
78 * Gets an Organization Membership
79 * @param id - Organization Membership ID
80 * @return Promise for an Organization Membership
81 * @example ```javascript
82 * const contentful = require('contentful-management')
83 * const client = contentful.createClient({
84 * accessToken: '<content_management_api_key>'
85 * })
86 *
87 * client.getOrganization('organization_id')
88 * .then((organization) => organization.getOrganizationMembership('organizationMembership_id'))
89 * .then((organizationMembership) => console.log(organizationMembership))
90 * .catch(console.error)
91 * ```
92 */
93 getOrganizationMembership(id: string): Promise<import("./export-types").OrganizationMembership>;
94 /**
95 * Gets a collection of Organization Memberships
96 * @param params - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
97 * @return Promise for a collection of Organization Memberships
98 * @example ```javascript
99 * const contentful = require('contentful-management')
100 * const client = contentful.createClient({
101 * accessToken: '<content_management_api_key>'
102 * })
103 *
104 * client.getOrganization('organization_id')
105 * .then((organization) => organization.getOrganizationMemberships({'limit': 100})) // you can add more queries as 'key': 'value'
106 * .then((response) => console.log(response.items))
107 * .catch(console.error)
108 * ```
109 */
110 getOrganizationMemberships(params?: QueryParams): Promise<import("./common-types").Collection<import("./export-types").OrganizationMembership, import("./export-types").OrganizationMembershipProps>>;
111 /**
112 * Creates a Team
113 * @param data representation of the Team to be created
114 * @example ```javascript
115 * const contentful = require('contentful-management')
116 * const client = contentful.createClient({
117 * accessToken: '<content_management_api_key>'
118 * })
119 *
120 * client.getOrganization('<org_id>')
121 * .then((org) => org.createTeam({
122 * name: 'new team',
123 * description: 'new team description'
124 * }))
125 * .then((team) => console.log(team))
126 * .catch(console.error)
127 * ```
128 */
129 createTeam(data: CreateTeamProps): Promise<import("./entities/team").Team>;
130 /**
131 * Gets an Team
132 * @example ```javascript
133 * const contentful = require('contentful-management')
134 * const client = contentful.createClient({
135 * accessToken: '<content_management_api_key>'
136 * })
137 *
138 * client.getOrganization('orgId')
139 * .then((organization) => organization.getTeam('teamId'))
140 * .then((team) => console.log(team))
141 * .catch(console.error)
142 * ```
143 */
144 getTeam(teamId: string): Promise<import("./entities/team").Team>;
145 /**
146 * Gets all Teams in an organization
147 * @example ```javascript
148 * const contentful = require('contentful-management')
149 * const client = contentful.createClient({
150 * accessToken: '<content_management_api_key>'
151 * })
152 *
153 * client.getOrganization('orgId')
154 * .then((organization) => organization.getTeams())
155 * .then((teams) => console.log(teams))
156 * .catch(console.error)
157 * ```
158 */
159 getTeams(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/team").Team, import("./entities/team").TeamProps>>;
160 /**
161 * Creates a Team membership
162 * @param teamId - Id of the team the membership will be created in
163 * @param data - Object representation of the Team Membership to be created
164 * @return Promise for the newly created TeamMembership
165 * @example ```javascript
166 * const contentful = require('contentful-management')
167 * const client = contentful.createClient({
168 * accessToken: '<content_management_api_key>'
169 * })
170 *
171 * client.getOrganization('organizationId')
172 * .then((org) => org.createTeamMembership('teamId', {
173 * admin: true,
174 * organizationMembershipId: 'organizationMembershipId'
175 * }))
176 * .then((teamMembership) => console.log(teamMembership))
177 * .catch(console.error)
178 * ```
179 */
180 createTeamMembership(teamId: string, data: CreateTeamMembershipProps): Promise<import("./entities/team-membership").TeamMembership>;
181 /**
182 * Gets an Team Membership from the team with given teamId
183 * @return Promise for an Team Membership
184 * @example ```javascript
185 * const contentful = require('contentful-management')
186 * const client = contentful.createClient({
187 * accessToken: '<content_management_api_key>'
188 * })
189 *
190 * client.getOrganization('organizationId')
191 * .then((organization) => organization.getTeamMembership('teamId', 'teamMembership_id'))
192 * .then((teamMembership) => console.log(teamMembership))
193 * .catch(console.error)
194 * ```
195 */
196 getTeamMembership(teamId: string, teamMembershipId: string): Promise<import("./entities/team-membership").TeamMembership>;
197 /**
198 * Get all Team Memberships. If teamID is provided in the optional config object, it will return all Team Memberships in that team. By default, returns all team memberships for the organization.
199 * @return Promise for a Team Membership Collection
200 * @example ```javascript
201 * const contentful = require('contentful-management')
202 * const client = contentful.createClient({
203 * accessToken: '<content_management_api_key>'
204 * })
205 *
206 * client.getOrganization('organizationId')
207 * .then((organization) => organization.getTeamMemberships('teamId'))
208 * .then((teamMemberships) => console.log(teamMemberships))
209 * .catch(console.error)
210 * ```
211 */
212 getTeamMemberships(opts?: {
213 teamId?: string;
214 query?: QueryOptions;
215 }): Promise<import("./common-types").Collection<import("./entities/team-membership").TeamMembership, import("./entities/team-membership").TeamMembershipProps>>;
216 /**
217 * Get all Team Space Memberships. If teamID is provided in the optional config object, it will return all Team Space Memberships in that team. By default, returns all team space memberships across all teams in the organization.
218 * @return Promise for a Team Space Membership Collection
219 * @example ```javascript
220 * const contentful = require('contentful-management')
221 * const client = contentful.createClient({
222 * accessToken: '<content_management_api_key>'
223 * })
224 *
225 * client.getOrganization('organizationId')
226 * .then((organization) => organization.getTeamSpaceMemberships('teamId'))
227 * .then((teamSpaceMemberships) => console.log(teamSpaceMemberships))
228 * .catch(console.error)
229 * ```
230 */
231 getTeamSpaceMemberships(opts?: {
232 teamId?: string;
233 query?: QueryOptions;
234 }): Promise<import("./common-types").Collection<import("./export-types").TeamSpaceMembership, import("./export-types").TeamSpaceMembershipProps>>;
235 /**
236 * Get a Team Space Membership with given teamSpaceMembershipId
237 * @return Promise for a Team Space Membership
238 * @example ```javascript
239 * const contentful = require('contentful-management')
240 * const client = contentful.createClient({
241 * accessToken: '<content_management_api_key>'
242 * })
243 *
244 * client.getOrganization('organizationId')
245 * .then((organization) => organization.getTeamSpaceMembership('teamSpaceMembershipId'))
246 * .then((teamSpaceMembership) => console.log(teamSpaceMembership))
247 * .catch(console.error)]
248 * ```
249 */
250 getTeamSpaceMembership(teamSpaceMembershipId: string): Promise<import("./export-types").TeamSpaceMembership>;
251 /**
252 * Gets an Space Membership in Organization
253 * @param id - Organiztion Space Membership ID
254 * @return Promise for a Space Membership in an organization
255 * @example ```javascript
256 * const contentful = require('contentful-management')
257 * const client = contentful.createClient({
258 * accessToken: '<content_management_api_key>'
259 * })
260 *
261 * client.getOrganization('organization_id')
262 * .then((organization) => organization.getOrganizationSpaceMembership('organizationSpaceMembership_id'))
263 * .then((organizationMembership) => console.log(organizationMembership))
264 * .catch(console.error)
265 * ```
266 */
267 getOrganizationSpaceMembership(id: string): Promise<import("./export-types").SpaceMembership>;
268 /**
269 * Gets a collection Space Memberships in organization
270 * @param query - Object with search parameters. Check the <a href="https://www.contentful.com/developers/docs/javascript/tutorials/using-js-cda-sdk/#retrieving-entries-with-search-parameters">JS SDK tutorial</a> and the <a href="https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters">REST API reference</a> for more details.
271 * @return Promise for a Space Membership collection across all spaces in the organization
272 * @example ```javascript
273 * const contentful = require('contentful-management')
274 * const client = contentful.createClient({
275 * accessToken: '<content_management_api_key>'
276 * })
277 *
278 * client.getOrganization('organization_id')
279 * .then((organization) => organization.getOrganizationSpaceMemberships()) // you can add queries like 'limit': 100
280 * .then((response) => console.log(response.items))
281 * .catch(console.error)
282 * ```
283 */
284 getOrganizationSpaceMemberships(query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").SpaceMembership, import("./export-types").SpaceMembershipProps>>;
285 /**
286 * Gets an Invitation in Organization
287 * @return Promise for a OrganizationInvitation in an organization
288 * @example ```javascript
289 * const contentful = require('contentful-management')
290 * const client = contentful.createClient({
291 * accessToken: '<content_management_api_key>'
292 * })
293 *
294 * client.getOrganization('<org_id>')
295 * .then((organization) => organization.getOrganizationInvitation('invitation_id'))
296 * .then((invitation) => console.log(invitation))
297 * .catch(console.error)
298 * ```
299 */
300 getOrganizationInvitation(invitationId: string): Promise<import("./entities/organization-invitation").OrganizationInvitation>;
301 /**
302 * Create an Invitation in Organization
303 * @return Promise for a OrganizationInvitation in an organization
304 * @example ```javascript
305 * const contentful = require('contentful-management')
306 * const client = contentful.createClient({
307 * accessToken: '<content_management_api_key>'
308 * })
309 *
310 * client.getOrganization('<org_id>')
311 * .then((organization) => organization.createOrganizationInvitation({
312 * email: 'user.email@example.com'
313 * firstName: 'User First Name'
314 * lastName: 'User Last Name'
315 * role: 'developer'
316 * })
317 * .catch(console.error)
318 * ```
319 */
320 createOrganizationInvitation(data: CreateOrganizationInvitationProps): Promise<import("./entities/organization-invitation").OrganizationInvitation>;
321 /**
322 * Gets a collection of Roles
323 * @return Promise for a collection of Roles
324 * @example ```javascript
325 * const contentful = require('contentful-management')
326 *
327 * const client = contentful.createClient({
328 * accessToken: '<content_management_api_key>'
329 * })
330 *
331 * client.getOrganization('<org_id>')
332 * .then((org) => org.getRoles())
333 * .then((response) => console.log(response.items))
334 * .catch(console.error)
335 * ```
336 */
337 getRoles(query?: QueryOptions): Promise<import("./common-types").Collection<import("./export-types").Role, import("./export-types").RoleProps>>;
338 /**
339 * Creates an app definition
340 * @param Object representation of the App Definition to be created
341 * @return Promise for the newly created AppDefinition
342 * @example ```javascript
343 * const contentful = require('contentful-management')
344 * const client = contentful.createClient({
345 * accessToken: '<content_management_api_key>'
346 * })
347 *
348 * client.getOrganization('<org_id>')
349 * .then((org) => org.createAppDefinition({
350 * name: 'Example app',
351 * locations: [{ location: 'app-config' }],
352 * src: "http://my-app-host.com/my-app"
353 * }))
354 * .then((appDefinition) => console.log(appDefinition))
355 * .catch(console.error)
356 * ```
357 */
358 createAppDefinition(data: CreateAppDefinitionProps): Promise<import("./entities/app-definition").AppDefinition>;
359 /**
360 * Gets all app definitions
361 * @return Promise for a collection of App Definitions
362 * @example ```javascript
363 * const contentful = require('contentful-management')
364 * const client = contentful.createClient({
365 * accessToken: '<content_management_api_key>'
366 * })
367 *
368 * client.getOrganization('<org_id>')
369 * .then((org) => org.getAppDefinitions())
370 * .then((response) => console.log(response.items))
371 * .catch(console.error)
372 * ```
373 */
374 getAppDefinitions(query?: QueryOptions): Promise<import("./common-types").Collection<import("./entities/app-definition").AppDefinition, import("./entities/app-definition").AppDefinitionProps>>;
375 /**
376 * Gets an app definition
377 * @return Promise for an App Definition
378 * @example ```javascript
379 * const contentful = require('contentful-management')
380 * const client = contentful.createClient({
381 * accessToken: '<content_management_api_key>'
382 * })
383 *
384 * client.getOrganization('<org_id>')
385 * .then((org) => org.getAppDefinition('<app_definition_id>'))
386 * .then((appDefinition) => console.log(appDefinition))
387 * .catch(console.error)
388 * ```
389 */
390 getAppDefinition(id: string): Promise<import("./entities/app-definition").AppDefinition>;
391 /**
392 * Gets an app upload
393 * @return Promise for an App Upload
394 * @example ```javascript
395 * const contentful = require('contentful-management')
396 * const client = contentful.createClient({
397 * accessToken: '<content_management_api_key>'
398 * })
399 *
400 * client.getOrganization('<org_id>')
401 * .then((org) => org.getAppUpload('<app_upload_id>'))
402 * .then((appUpload) => console.log(appUpload))
403 * .catch(console.error)
404 * ```
405 */
406 getAppUpload(appUploadId: string): Promise<import("./export-types").AppUpload>;
407 /**
408 * Creates an app upload
409 * @return Promise for an App Upload
410 * @example ```javascript
411 * const contentful = require('contentful-management')
412 * const client = contentful.createClient({
413 * accessToken: '<content_management_api_key>'
414 * })
415 *
416 * client.getOrganization('<org_id>')
417 * .then((org) => org.createAppUpload('some_zip_file'))
418 * .then((appUpload) => console.log(appUpload))
419 * .catch(console.error)
420 * ```
421 */
422 createAppUpload(file: string | ArrayBuffer | Stream): Promise<import("./export-types").AppUpload>;
423 /**
424 * Creates or updates an app signing secret
425 * @return Promise for an App SigningSecret
426 * @example ```javascript
427 * const contentful = require('contentful-management')
428 * const client = contentful.createClient({
429 * accessToken: '<content_management_api_key>'
430 * })
431 *
432 * client.getOrganization('<org_id>')
433 * .then((org) => org.upsertAppSigningSecret('app_definition_id', { value: 'tsren3s1....wn1e' }))
434 * .then((appSigningSecret) => console.log(appSigningSecret))
435 * .catch(console.error)
436 * ```
437 */
438 upsertAppSigningSecret(appDefinitionId: string, data: CreateAppSigningSecretProps): Promise<import("./entities/app-signing-secret").AppSigningSecret>;
439 /**
440 * Gets an app signing secret
441 * @return Promise for an App SigningSecret
442 * @example ```javascript
443 * const contentful = require('contentful-management')
444 * const client = contentful.createClient({
445 * accessToken: '<content_management_api_key>'
446 * })
447 *
448 * client.getOrganization('<org_id>')
449 * .then((org) => org.getAppSigningSecret('app_definition_id'))
450 * .then((appSigningSecret) => console.log(appSigningSecret))
451 * .catch(console.error)
452 * ```
453 */
454 getAppSigningSecret(appDefinitionId: string): Promise<import("./entities/app-signing-secret").AppSigningSecret>;
455 /**
456 * Deletes an app signing secret
457 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
458 * @example ```javascript
459 * const contentful = require('contentful-management')
460 * const client = contentful.createClient({
461 * accessToken: '<content_management_api_key>'
462 * })
463 *
464 * client.getOrganization('<org_id>')
465 * .then((org) => org.deleteAppSigningSecret('app_definition_id'))
466 * .then((result) => console.log(result))
467 * .catch(console.error)
468 * ```
469 */
470 deleteAppSigningSecret(appDefinitionId: string): Promise<void>;
471 /**
472 * Creates or updates an app event subscription
473 * @return Promise for an App Event Subscription
474 * @example ```javascript
475 * const contentful = require('contentful-management')
476 * const client = contentful.createClient({
477 * accessToken: '<content_management_api_key>'
478 * })
479 *
480 * client.getOrganization('<org_id>')
481 * .then((org) => org.upsertAppEventSubscription('app_definition_id', { targetUrl: '<target_url>', topics: ['<topic>'] }))
482 * .then((appEventSubscription) => console.log(appEventSubscription))
483 * .catch(console.error)
484 * ```
485 */
486 upsertAppEventSubscription(appDefinitionId: string, data: CreateAppEventSubscriptionProps): Promise<import("./entities/app-event-subscription").AppEventSubscription>;
487 /**
488 * Gets an app event subscription
489 * @return Promise for an App Event Subscription
490 * @example ```javascript
491 * const contentful = require('contentful-management')
492 * const client = contentful.createClient({
493 * accessToken: '<content_management_api_key>'
494 * })
495 *
496 * client.getOrganization('<org_id>')
497 * .then((org) => org.getAppEventSubscription('app_definition_id'))
498 * .then((appEventSubscription) => console.log(appEventSubscription))
499 * .catch(console.error)
500 * ```
501 */
502 getAppEventSubscription(appDefinitionId: string): Promise<import("./entities/app-event-subscription").AppEventSubscription>;
503 /**
504 * Deletes the current App Event Subscription for the given App
505 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
506 * @example ```javascript
507 * const contentful = require('contentful-management')
508 * const client = contentful.createClient({
509 * accessToken: '<content_management_api_key>'
510 * })
511 *
512 * client.getOrganization('<org_id>')
513 * .then((org) => org.deleteAppEventSubscription('app_definition_id'))
514 * .then((result) => console.log(result))
515 * .catch(console.error)
516 * ```
517 */
518 deleteAppEventSubscription(appDefinitionId: string): Promise<void>;
519 /**
520 * Creates or updates an app event subscription
521 * @return Promise for an App Event Subscription
522 * @example ```javascript
523 * const contentful = require('contentful-management')
524 * const client = contentful.createClient({
525 * accessToken: '<content_management_api_key>'
526 * })
527 *
528 * // generate a new private key
529 * client.getOrganization('<org_id>')
530 * .then((org) => org.upsertAppEventSubscription('app_definition_id', { generate: true }))
531 * .then((appEventSubscription) => console.log(appEventSubscription))
532 * .catch(console.error)
533 *
534 * // or use an existing JSON Web Key
535 * client.getOrganization('<org_id>')
536 * .then((org) => org.upsertAppEventSubscription('app_definition_id', { jwk: 'jwk' }))
537 * .then((appEventSubscription) => console.log(appEventSubscription))
538 * .catch(console.error)
539 * ```
540 */
541 createAppKey(appDefinitionId: string, data: CreateAppKeyProps): Promise<import("./entities/app-key").AppKey>;
542 /**
543 * Gets an app key by fingerprint
544 * @return Promise for an App Key
545 * @example ```javascript
546 * const contentful = require('contentful-management')
547 * const client = contentful.createClient({
548 * accessToken: '<content_management_api_key>'
549 * })
550 *
551 * client.getOrganization('<org_id>')
552 * .then((org) => org.getAppKey('app_definition_id', 'fingerprint'))
553 * .then((appKey) => console.log(appKey))
554 * .catch(console.error)
555 * ```
556 */
557 getAppKey(appDefinitionId: string, fingerprint: string): Promise<import("./entities/app-key").AppKey>;
558 /**
559 * Gets all keys for the given app
560 * @return Promise for an array of App Keys
561 * @example ```javascript
562 * const contentful = require('contentful-management')
563 * const client = contentful.createClient({
564 * accessToken: '<content_management_api_key>'
565 * })
566 *
567 * // with default pagination
568 * client.getOrganization('<org_id>')
569 * .then((org) => org.getAppKeys('app_definition_id'))
570 * .then((appKeys) => console.log(appKeys))
571 * .catch(console.error)
572 *
573 * // with explicit pagination
574 * client.getOrganization('<org_id>')
575 * .then((org) => org.getAppKeys('app_definition_id', { skip: 'skip', limit: 'limit' }))
576 * .then((appKeys) => console.log(appKeys))
577 * .catch(console.error)
578 * ```
579 */
580 getAppKeys(appDefinitionId: string, query?: BasicQueryOptions): Promise<import("./common-types").Collection<import("./entities/app-key").AppKey, import("./entities/app-key").AppKeyProps>>;
581 /**
582 * Deletes an app key by fingerprint.
583 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
584 * @example ```javascript
585 * const contentful = require('contentful-management')
586 * const client = contentful.createClient({
587 * accessToken: '<content_management_api_key>'
588 * })
589 *
590 * client.getOrganization('<org_id>')
591 * .then((org) => org.deleteAppKey('app_definition_id', 'fingerprint'))
592 * .then((result) => console.log(result))
593 * .catch(console.error)
594 * ```
595 */
596 deleteAppKey(appDefinitionId: string, fingerprint: string): Promise<void>;
597 /**
598 * Creates or updates an app details entity
599 * @return Promise for an App Details
600 * @example ```javascript
601 * const contentful = require('contentful-management')
602 * const client = contentful.createClient({
603 * accessToken: '<content_management_api_key>'
604 * })
605 *
606 * client.getOrganization('<org_id>')
607 * .then((org) => org.upsertAppDetails('app_definition_id',
608 * { icon: { value: 'base_64_image', type: 'base64' }}
609 * ))
610 * .then((appDetails) => console.log(appDetails))
611 * .catch(console.error)
612 * ```
613 */
614 upsertAppDetails(appDefinitionId: string, data: CreateAppDetailsProps): Promise<import("./entities/app-details").AppDetails>;
615 /**
616 * Gets an app details entity
617 * @return Promise for an App Details
618 * @example ```javascript
619 * const contentful = require('contentful-management')
620 * const client = contentful.createClient({
621 * accessToken: '<content_management_api_key>'
622 * })
623 *
624 * client.getOrganization('<org_id>')
625 * .then((org) => org.getAppDetails('app_definition_id'))
626 * .then((appDetails) => console.log(appDetails))
627 * .catch(console.error)
628 * ```
629 */
630 getAppDetails(appDefinitionId: string): Promise<import("./entities/app-details").AppDetails>;
631 /**
632 * Deletes an app details entity.
633 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
634 * @example ```javascript
635 * const contentful = require('contentful-management')
636 * const client = contentful.createClient({
637 * accessToken: '<content_management_api_key>'
638 * })
639 *
640 * client.getOrganization('<org_id>')
641 * .then((org) => org.deleteAppDetails('app_definition_id'))
642 * .then((result) => console.log(result))
643 * .catch(console.error)
644 * ```
645 */
646 deleteAppDetails(appDefinitionId: string): Promise<void>;
647 /**
648 * Creates an app action entity.
649 * @return Promise that resolves an App Action entity
650 * @example ```javascript
651 * const contentful = require('contentful-management')
652 * const client = contentful.createClient({
653 * accessToken: '<content_management_api_key>'
654 * })
655 *
656 * client.getOrganization('<org_id>')
657 * .then((org) => org.createAppAction('app_definition_id', {
658 * type: 'endpoint',
659 * name: 'my nice new app action',
660 * url: 'https://www.somewhere.com/action'
661 * }))
662 * .then((appAction) => console.log(appAction))
663 * .catch(console.error)
664 * ```
665 */
666 createAppAction(appDefinitionId: string, data: CreateAppActionProps): Promise<({
667 category: "Entries.v1.0" | "Notification.v1.0";
668 } & {
669 sys: {
670 type: string;
671 id: string;
672 createdBy?: import("./common-types").SysLink | undefined;
673 createdAt: string;
674 updatedBy?: import("./common-types").SysLink | undefined;
675 updatedAt: string;
676 } & {
677 appDefinition: import("./common-types").SysLink;
678 organization: import("./common-types").SysLink;
679 };
680 url: string;
681 name: string;
682 description?: string;
683 type?: import("./entities/app-action").AppActionType;
684 } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
685 delete(): Promise<void>;
686 }) | ({
687 category: "Custom";
688 parameters: import("./entities/app-action").AppActionParameterDefinition[];
689 } & {
690 sys: {
691 type: string;
692 id: string;
693 createdBy?: import("./common-types").SysLink | undefined;
694 createdAt: string;
695 updatedBy?: import("./common-types").SysLink | undefined;
696 updatedAt: string;
697 } & {
698 appDefinition: import("./common-types").SysLink;
699 organization: import("./common-types").SysLink;
700 };
701 url: string;
702 name: string;
703 description?: string;
704 type?: import("./entities/app-action").AppActionType;
705 } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
706 delete(): Promise<void>;
707 })>;
708 /**
709 * Updates an existing app action entity.
710 * @return Promise that resolves an App Action entity
711 * @example ```javascript
712 * const contentful = require('contentful-management')
713 * const client = contentful.createClient({
714 * accessToken: '<content_management_api_key>'
715 * })
716 *
717 * client.getOrganization('<org_id>')
718 * .then((org) => org.updateAppAction('app_definition_id', 'app_action_id', {
719 * type: 'endpoint',
720 * name: 'my nice updated app action',
721 * url: 'https://www.somewhere-else.com/action'
722 * }))
723 * .then((appAction) => console.log(appAction))
724 * .catch(console.error)
725 * ```
726 */
727 updateAppAction(appDefinitionId: string, appActionId: string, data: CreateAppActionProps): Promise<({
728 category: "Entries.v1.0" | "Notification.v1.0";
729 } & {
730 sys: {
731 type: string;
732 id: string;
733 createdBy?: import("./common-types").SysLink | undefined;
734 createdAt: string;
735 updatedBy?: import("./common-types").SysLink | undefined;
736 updatedAt: string;
737 } & {
738 appDefinition: import("./common-types").SysLink;
739 organization: import("./common-types").SysLink;
740 };
741 url: string;
742 name: string;
743 description?: string;
744 type?: import("./entities/app-action").AppActionType;
745 } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
746 delete(): Promise<void>;
747 }) | ({
748 category: "Custom";
749 parameters: import("./entities/app-action").AppActionParameterDefinition[];
750 } & {
751 sys: {
752 type: string;
753 id: string;
754 createdBy?: import("./common-types").SysLink | undefined;
755 createdAt: string;
756 updatedBy?: import("./common-types").SysLink | undefined;
757 updatedAt: string;
758 } & {
759 appDefinition: import("./common-types").SysLink;
760 organization: import("./common-types").SysLink;
761 };
762 url: string;
763 name: string;
764 description?: string;
765 type?: import("./entities/app-action").AppActionType;
766 } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
767 delete(): Promise<void>;
768 })>;
769 /**
770 * Deletes an app action entity.
771 * @return Promise for the deletion. It contains no data, but the Promise error case should be handled.
772 * @example ```javascript
773 * const contentful = require('contentful-management')
774 * const client = contentful.createClient({
775 * accessToken: '<content_management_api_key>'
776 * })
777 *
778 * client.getOrganization('<org_id>')
779 * .then((org) => org.deleteAppAction('app_definition_id', 'app_action_id'))
780 * .then((result) => console.log(result))
781 * .catch(console.error)
782 * ```
783 */
784 deleteAppAction(appDefinitionId: string, appActionId: string): Promise<void>;
785 /**
786 * Gets an existing app action entity.
787 * @return Promise that resolves an App Action entity
788 * @example ```javascript
789 * const contentful = require('contentful-management')
790 * const client = contentful.createClient({
791 * accessToken: '<content_management_api_key>'
792 * })
793 *
794 * client.getOrganization('<org_id>')
795 * .then((org) => org.getAppAction('app_definition_id', 'app_action_id'))
796 * .then((appAction) => console.log(appAction))
797 * .catch(console.error)
798 * ```
799 */
800 getAppAction(appDefinitionId: string, appActionId: string): Promise<({
801 category: "Entries.v1.0" | "Notification.v1.0";
802 } & {
803 sys: {
804 type: string;
805 id: string;
806 createdBy?: import("./common-types").SysLink | undefined;
807 createdAt: string;
808 updatedBy?: import("./common-types").SysLink | undefined;
809 updatedAt: string;
810 } & {
811 appDefinition: import("./common-types").SysLink;
812 organization: import("./common-types").SysLink;
813 };
814 url: string;
815 name: string;
816 description?: string;
817 type?: import("./entities/app-action").AppActionType;
818 } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
819 delete(): Promise<void>;
820 }) | ({
821 category: "Custom";
822 parameters: import("./entities/app-action").AppActionParameterDefinition[];
823 } & {
824 sys: {
825 type: string;
826 id: string;
827 createdBy?: import("./common-types").SysLink | undefined;
828 createdAt: string;
829 updatedBy?: import("./common-types").SysLink | undefined;
830 updatedAt: string;
831 } & {
832 appDefinition: import("./common-types").SysLink;
833 organization: import("./common-types").SysLink;
834 };
835 url: string;
836 name: string;
837 description?: string;
838 type?: import("./entities/app-action").AppActionType;
839 } & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
840 delete(): Promise<void>;
841 })>;
842 /**
843 * Gets existing app actions for an App Definition.
844 * @return Promise that resolves an App Action entity
845 * @example ```javascript
846 * const contentful = require('contentful-management')
847 * const client = contentful.createClient({
848 * accessToken: '<content_management_api_key>'
849 * })
850 *
851 * client.getOrganization('<org_id>')
852 * .then((org) => org.getAppActions('app_definition_id'))
853 * .then((appActions) => console.log(appActions))
854 * .catch(console.error)
855 * ```
856 */
857 getAppActions(appDefinitionId: string): Promise<import("./common-types").Collection<import("./entities/app-action").AppAction, import("./entities/app-action").AppActionProps>>;
858};