contentful-management 11.42.0 → 11.43.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contentful-management.browser.js +356 -132
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +347 -132
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/function.js +16 -0
- package/dist/es-modules/adapters/REST/endpoints/index.js +2 -0
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/create-function-api.js +115 -0
- package/dist/es-modules/entities/function.js +24 -1
- package/dist/es-modules/entities/index.js +2 -0
- package/dist/es-modules/plain/entities/function.js +1 -0
- package/dist/es-modules/plain/plain-client.js +3 -1
- package/dist/typings/adapters/REST/endpoints/function.d.ts +4 -0
- package/dist/typings/adapters/REST/endpoints/index.d.ts +2 -0
- package/dist/typings/common-types.d.ts +24 -6
- package/dist/typings/create-function-api.d.ts +78 -0
- package/dist/typings/entities/function.d.ts +23 -1
- package/dist/typings/entities/index.d.ts +2 -0
- package/dist/typings/plain/common-types.d.ts +3 -5
- package/dist/typings/plain/entities/function.d.ts +49 -0
- package/package.json +1 -1
|
@@ -2490,6 +2490,39 @@ const del = (http, params) => {
|
|
|
2490
2490
|
|
|
2491
2491
|
/***/ }),
|
|
2492
2492
|
|
|
2493
|
+
/***/ "./adapters/REST/endpoints/function.ts":
|
|
2494
|
+
/*!*********************************************!*\
|
|
2495
|
+
!*** ./adapters/REST/endpoints/function.ts ***!
|
|
2496
|
+
\*********************************************/
|
|
2497
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2498
|
+
|
|
2499
|
+
"use strict";
|
|
2500
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2501
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2502
|
+
/* harmony export */ get: () => (/* binding */ get),
|
|
2503
|
+
/* harmony export */ getMany: () => (/* binding */ getMany),
|
|
2504
|
+
/* harmony export */ getManyForEnvironment: () => (/* binding */ getManyForEnvironment)
|
|
2505
|
+
/* harmony export */ });
|
|
2506
|
+
/* harmony import */ var _raw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raw */ "./adapters/REST/endpoints/raw.ts");
|
|
2507
|
+
|
|
2508
|
+
// Base URL
|
|
2509
|
+
const getManyUrl = params => `/organizations/${params.organizationId}/app_definitions/${params.appDefinitionId}/functions`;
|
|
2510
|
+
const getFunctionUrl = params => `${getManyUrl(params)}/${params.functionId}`;
|
|
2511
|
+
const getFunctionsEnvURL = params => {
|
|
2512
|
+
return `/spaces/${params.spaceId}/environments/${params.environmentId}/app_installations/${params.appInstallationId}/functions`;
|
|
2513
|
+
};
|
|
2514
|
+
const get = (http, params) => {
|
|
2515
|
+
return _raw__WEBPACK_IMPORTED_MODULE_0__.get(http, getFunctionUrl(params));
|
|
2516
|
+
};
|
|
2517
|
+
const getMany = (http, params) => {
|
|
2518
|
+
return _raw__WEBPACK_IMPORTED_MODULE_0__.get(http, getManyUrl(params));
|
|
2519
|
+
};
|
|
2520
|
+
const getManyForEnvironment = (http, params) => {
|
|
2521
|
+
return _raw__WEBPACK_IMPORTED_MODULE_0__.get(http, getFunctionsEnvURL(params));
|
|
2522
|
+
};
|
|
2523
|
+
|
|
2524
|
+
/***/ }),
|
|
2525
|
+
|
|
2493
2526
|
/***/ "./adapters/REST/endpoints/http.ts":
|
|
2494
2527
|
/*!*****************************************!*\
|
|
2495
2528
|
!*** ./adapters/REST/endpoints/http.ts ***!
|
|
@@ -2588,39 +2621,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2588
2621
|
/* harmony import */ var _environment_template__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./environment-template */ "./adapters/REST/endpoints/environment-template.ts");
|
|
2589
2622
|
/* harmony import */ var _environment_template_installation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./environment-template-installation */ "./adapters/REST/endpoints/environment-template-installation.ts");
|
|
2590
2623
|
/* harmony import */ var _extension__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./extension */ "./adapters/REST/endpoints/extension.ts");
|
|
2591
|
-
/* harmony import */ var
|
|
2592
|
-
/* harmony import */ var
|
|
2593
|
-
/* harmony import */ var
|
|
2594
|
-
/* harmony import */ var
|
|
2595
|
-
/* harmony import */ var
|
|
2596
|
-
/* harmony import */ var
|
|
2597
|
-
/* harmony import */ var
|
|
2598
|
-
/* harmony import */ var
|
|
2599
|
-
/* harmony import */ var
|
|
2600
|
-
/* harmony import */ var
|
|
2601
|
-
/* harmony import */ var
|
|
2602
|
-
/* harmony import */ var
|
|
2603
|
-
/* harmony import */ var
|
|
2604
|
-
/* harmony import */ var
|
|
2605
|
-
/* harmony import */ var
|
|
2606
|
-
/* harmony import */ var
|
|
2607
|
-
/* harmony import */ var
|
|
2608
|
-
/* harmony import */ var
|
|
2609
|
-
/* harmony import */ var
|
|
2610
|
-
/* harmony import */ var
|
|
2611
|
-
/* harmony import */ var
|
|
2612
|
-
/* harmony import */ var
|
|
2613
|
-
/* harmony import */ var
|
|
2614
|
-
/* harmony import */ var
|
|
2615
|
-
/* harmony import */ var
|
|
2616
|
-
/* harmony import */ var
|
|
2617
|
-
/* harmony import */ var
|
|
2618
|
-
/* harmony import */ var
|
|
2619
|
-
/* harmony import */ var
|
|
2620
|
-
/* harmony import */ var
|
|
2621
|
-
/* harmony import */ var
|
|
2622
|
-
/* harmony import */ var
|
|
2623
|
-
/* harmony import */ var
|
|
2624
|
+
/* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./function */ "./adapters/REST/endpoints/function.ts");
|
|
2625
|
+
/* harmony import */ var _http__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./http */ "./adapters/REST/endpoints/http.ts");
|
|
2626
|
+
/* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./locale */ "./adapters/REST/endpoints/locale.ts");
|
|
2627
|
+
/* harmony import */ var _organization__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./organization */ "./adapters/REST/endpoints/organization.ts");
|
|
2628
|
+
/* harmony import */ var _organization_invitation__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./organization-invitation */ "./adapters/REST/endpoints/organization-invitation.ts");
|
|
2629
|
+
/* harmony import */ var _organization_membership__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./organization-membership */ "./adapters/REST/endpoints/organization-membership.ts");
|
|
2630
|
+
/* harmony import */ var _personal_access_token__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./personal-access-token */ "./adapters/REST/endpoints/personal-access-token.ts");
|
|
2631
|
+
/* harmony import */ var _preview_api_key__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./preview-api-key */ "./adapters/REST/endpoints/preview-api-key.ts");
|
|
2632
|
+
/* harmony import */ var _release__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./release */ "./adapters/REST/endpoints/release.ts");
|
|
2633
|
+
/* harmony import */ var _release_action__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./release-action */ "./adapters/REST/endpoints/release-action.ts");
|
|
2634
|
+
/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./resource */ "./adapters/REST/endpoints/resource.ts");
|
|
2635
|
+
/* harmony import */ var _resource_provider__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./resource-provider */ "./adapters/REST/endpoints/resource-provider.ts");
|
|
2636
|
+
/* harmony import */ var _resource_type__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./resource-type */ "./adapters/REST/endpoints/resource-type.ts");
|
|
2637
|
+
/* harmony import */ var _role__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./role */ "./adapters/REST/endpoints/role.ts");
|
|
2638
|
+
/* harmony import */ var _scheduled_action__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./scheduled-action */ "./adapters/REST/endpoints/scheduled-action.ts");
|
|
2639
|
+
/* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./snapshot */ "./adapters/REST/endpoints/snapshot.ts");
|
|
2640
|
+
/* harmony import */ var _space__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./space */ "./adapters/REST/endpoints/space.ts");
|
|
2641
|
+
/* harmony import */ var _space_member__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./space-member */ "./adapters/REST/endpoints/space-member.ts");
|
|
2642
|
+
/* harmony import */ var _space_membership__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./space-membership */ "./adapters/REST/endpoints/space-membership.ts");
|
|
2643
|
+
/* harmony import */ var _tag__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./tag */ "./adapters/REST/endpoints/tag.ts");
|
|
2644
|
+
/* harmony import */ var _task__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./task */ "./adapters/REST/endpoints/task.ts");
|
|
2645
|
+
/* harmony import */ var _team__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./team */ "./adapters/REST/endpoints/team.ts");
|
|
2646
|
+
/* harmony import */ var _team_membership__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./team-membership */ "./adapters/REST/endpoints/team-membership.ts");
|
|
2647
|
+
/* harmony import */ var _team_space_membership__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./team-space-membership */ "./adapters/REST/endpoints/team-space-membership.ts");
|
|
2648
|
+
/* harmony import */ var _ui_config__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./ui-config */ "./adapters/REST/endpoints/ui-config.ts");
|
|
2649
|
+
/* harmony import */ var _upload__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./upload */ "./adapters/REST/endpoints/upload.ts");
|
|
2650
|
+
/* harmony import */ var _upload_credentials__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./upload-credentials */ "./adapters/REST/endpoints/upload-credentials.ts");
|
|
2651
|
+
/* harmony import */ var _usage__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./usage */ "./adapters/REST/endpoints/usage.ts");
|
|
2652
|
+
/* harmony import */ var _user__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./user */ "./adapters/REST/endpoints/user.ts");
|
|
2653
|
+
/* harmony import */ var _user_ui_config__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./user-ui-config */ "./adapters/REST/endpoints/user-ui-config.ts");
|
|
2654
|
+
/* harmony import */ var _webhook__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./webhook */ "./adapters/REST/endpoints/webhook.ts");
|
|
2655
|
+
/* harmony import */ var _workflow__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./workflow */ "./adapters/REST/endpoints/workflow.ts");
|
|
2656
|
+
/* harmony import */ var _workflow_definition__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./workflow-definition */ "./adapters/REST/endpoints/workflow-definition.ts");
|
|
2657
|
+
/* harmony import */ var _workflows_changelog__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./workflows-changelog */ "./adapters/REST/endpoints/workflows-changelog.ts");
|
|
2658
|
+
|
|
2624
2659
|
|
|
2625
2660
|
|
|
2626
2661
|
|
|
@@ -2710,40 +2745,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2710
2745
|
EnvironmentTemplate: _environment_template__WEBPACK_IMPORTED_MODULE_25__,
|
|
2711
2746
|
EnvironmentTemplateInstallation: _environment_template_installation__WEBPACK_IMPORTED_MODULE_26__,
|
|
2712
2747
|
Extension: _extension__WEBPACK_IMPORTED_MODULE_27__,
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2748
|
+
Function: _function__WEBPACK_IMPORTED_MODULE_28__,
|
|
2749
|
+
Http: _http__WEBPACK_IMPORTED_MODULE_29__,
|
|
2750
|
+
Locale: _locale__WEBPACK_IMPORTED_MODULE_30__,
|
|
2751
|
+
Organization: _organization__WEBPACK_IMPORTED_MODULE_31__,
|
|
2752
|
+
OrganizationInvitation: _organization_invitation__WEBPACK_IMPORTED_MODULE_32__,
|
|
2753
|
+
OrganizationMembership: _organization_membership__WEBPACK_IMPORTED_MODULE_33__,
|
|
2754
|
+
PersonalAccessToken: _personal_access_token__WEBPACK_IMPORTED_MODULE_34__,
|
|
2719
2755
|
AccessToken: _access_token__WEBPACK_IMPORTED_MODULE_0__,
|
|
2720
|
-
PreviewApiKey:
|
|
2721
|
-
Release:
|
|
2722
|
-
ReleaseAction:
|
|
2723
|
-
Resource:
|
|
2724
|
-
ResourceProvider:
|
|
2725
|
-
ResourceType:
|
|
2726
|
-
Role:
|
|
2727
|
-
ScheduledAction:
|
|
2728
|
-
Snapshot:
|
|
2729
|
-
Space:
|
|
2730
|
-
SpaceMember:
|
|
2731
|
-
SpaceMembership:
|
|
2732
|
-
Tag:
|
|
2733
|
-
Task:
|
|
2734
|
-
Team:
|
|
2735
|
-
TeamMembership:
|
|
2736
|
-
TeamSpaceMembership:
|
|
2737
|
-
UIConfig:
|
|
2738
|
-
Upload:
|
|
2739
|
-
UploadCredential:
|
|
2740
|
-
Usage:
|
|
2741
|
-
User:
|
|
2742
|
-
UserUIConfig:
|
|
2743
|
-
Webhook:
|
|
2744
|
-
WorkflowDefinition:
|
|
2745
|
-
Workflow:
|
|
2746
|
-
WorkflowsChangelog:
|
|
2756
|
+
PreviewApiKey: _preview_api_key__WEBPACK_IMPORTED_MODULE_35__,
|
|
2757
|
+
Release: _release__WEBPACK_IMPORTED_MODULE_36__,
|
|
2758
|
+
ReleaseAction: _release_action__WEBPACK_IMPORTED_MODULE_37__,
|
|
2759
|
+
Resource: _resource__WEBPACK_IMPORTED_MODULE_38__,
|
|
2760
|
+
ResourceProvider: _resource_provider__WEBPACK_IMPORTED_MODULE_39__,
|
|
2761
|
+
ResourceType: _resource_type__WEBPACK_IMPORTED_MODULE_40__,
|
|
2762
|
+
Role: _role__WEBPACK_IMPORTED_MODULE_41__,
|
|
2763
|
+
ScheduledAction: _scheduled_action__WEBPACK_IMPORTED_MODULE_42__,
|
|
2764
|
+
Snapshot: _snapshot__WEBPACK_IMPORTED_MODULE_43__,
|
|
2765
|
+
Space: _space__WEBPACK_IMPORTED_MODULE_44__,
|
|
2766
|
+
SpaceMember: _space_member__WEBPACK_IMPORTED_MODULE_45__,
|
|
2767
|
+
SpaceMembership: _space_membership__WEBPACK_IMPORTED_MODULE_46__,
|
|
2768
|
+
Tag: _tag__WEBPACK_IMPORTED_MODULE_47__,
|
|
2769
|
+
Task: _task__WEBPACK_IMPORTED_MODULE_48__,
|
|
2770
|
+
Team: _team__WEBPACK_IMPORTED_MODULE_49__,
|
|
2771
|
+
TeamMembership: _team_membership__WEBPACK_IMPORTED_MODULE_50__,
|
|
2772
|
+
TeamSpaceMembership: _team_space_membership__WEBPACK_IMPORTED_MODULE_51__,
|
|
2773
|
+
UIConfig: _ui_config__WEBPACK_IMPORTED_MODULE_52__,
|
|
2774
|
+
Upload: _upload__WEBPACK_IMPORTED_MODULE_53__,
|
|
2775
|
+
UploadCredential: _upload_credentials__WEBPACK_IMPORTED_MODULE_54__,
|
|
2776
|
+
Usage: _usage__WEBPACK_IMPORTED_MODULE_55__,
|
|
2777
|
+
User: _user__WEBPACK_IMPORTED_MODULE_56__,
|
|
2778
|
+
UserUIConfig: _user_ui_config__WEBPACK_IMPORTED_MODULE_57__,
|
|
2779
|
+
Webhook: _webhook__WEBPACK_IMPORTED_MODULE_58__,
|
|
2780
|
+
WorkflowDefinition: _workflow_definition__WEBPACK_IMPORTED_MODULE_60__,
|
|
2781
|
+
Workflow: _workflow__WEBPACK_IMPORTED_MODULE_59__,
|
|
2782
|
+
WorkflowsChangelog: _workflows_changelog__WEBPACK_IMPORTED_MODULE_61__
|
|
2747
2783
|
});
|
|
2748
2784
|
|
|
2749
2785
|
/***/ }),
|
|
@@ -9269,6 +9305,136 @@ function createEnvironmentTemplateApi(makeRequest, organizationId) {
|
|
|
9269
9305
|
|
|
9270
9306
|
/***/ }),
|
|
9271
9307
|
|
|
9308
|
+
/***/ "./create-function-api.ts":
|
|
9309
|
+
/*!********************************!*\
|
|
9310
|
+
!*** ./create-function-api.ts ***!
|
|
9311
|
+
\********************************/
|
|
9312
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9313
|
+
|
|
9314
|
+
"use strict";
|
|
9315
|
+
__webpack_require__.r(__webpack_exports__);
|
|
9316
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9317
|
+
/* harmony export */ "default": () => (/* binding */ createFunctionApi)
|
|
9318
|
+
/* harmony export */ });
|
|
9319
|
+
/* harmony import */ var _entities__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./entities */ "./entities/index.ts");
|
|
9320
|
+
|
|
9321
|
+
|
|
9322
|
+
/**
|
|
9323
|
+
* @private
|
|
9324
|
+
*/
|
|
9325
|
+
|
|
9326
|
+
/**
|
|
9327
|
+
* @private
|
|
9328
|
+
*/
|
|
9329
|
+
function createFunctionApi(makeRequest) {
|
|
9330
|
+
const {
|
|
9331
|
+
wrapFunction,
|
|
9332
|
+
wrapFunctionCollection
|
|
9333
|
+
} = _entities__WEBPACK_IMPORTED_MODULE_0__["default"].func;
|
|
9334
|
+
return {
|
|
9335
|
+
/**
|
|
9336
|
+
* Gets all Functions for an App Definition
|
|
9337
|
+
* @Param organizationId - Organization ID
|
|
9338
|
+
* @Param appDefinitionId - App Definition ID
|
|
9339
|
+
* @returns a collection of Functions
|
|
9340
|
+
* ```javascript
|
|
9341
|
+
* const contentful = require('contentful-management')
|
|
9342
|
+
*
|
|
9343
|
+
* const client = contentful.createClient({
|
|
9344
|
+
* accessToken: '<content_management_api_key>'
|
|
9345
|
+
* })
|
|
9346
|
+
*
|
|
9347
|
+
* client.function.getMany({
|
|
9348
|
+
* organizationId: <organizationId>,
|
|
9349
|
+
* appDefinitionId: <appDefinitionId>
|
|
9350
|
+
* })
|
|
9351
|
+
* .then((response) => console.log(response.items))
|
|
9352
|
+
* .catch(console.error)
|
|
9353
|
+
* ```
|
|
9354
|
+
*/
|
|
9355
|
+
getManyFunctions() {
|
|
9356
|
+
const raw = this.toPlainObject();
|
|
9357
|
+
return makeRequest({
|
|
9358
|
+
entityType: 'Function',
|
|
9359
|
+
action: 'getMany',
|
|
9360
|
+
params: {
|
|
9361
|
+
appDefinitionId: raw.sys.appDefinition.sys.id,
|
|
9362
|
+
organizationId: raw.sys.organization.sys.id
|
|
9363
|
+
}
|
|
9364
|
+
}).then(data => wrapFunctionCollection(makeRequest, data));
|
|
9365
|
+
},
|
|
9366
|
+
/**
|
|
9367
|
+
* Gets a Function by ID
|
|
9368
|
+
* @Param organizationId - Organization ID
|
|
9369
|
+
* @Param appDefinitionId - App Definition ID
|
|
9370
|
+
* @Param functionId - Function ID
|
|
9371
|
+
* @returns a collection of Functions
|
|
9372
|
+
* ```javascript
|
|
9373
|
+
* const contentful = require('contentful-management')
|
|
9374
|
+
*
|
|
9375
|
+
* const client = contentful.createClient({
|
|
9376
|
+
* accessToken: '<content_management_api_key>'
|
|
9377
|
+
* })
|
|
9378
|
+
*
|
|
9379
|
+
* client.function.get({
|
|
9380
|
+
* organizationId: <organizationId>,
|
|
9381
|
+
* appDefinitionId: <appDefinitionId>,
|
|
9382
|
+
* functionId: <functionId>
|
|
9383
|
+
* })
|
|
9384
|
+
* .then((response) => console.log(response.items))
|
|
9385
|
+
* .catch(console.error)
|
|
9386
|
+
* ```
|
|
9387
|
+
*/
|
|
9388
|
+
getFunction(functionId) {
|
|
9389
|
+
const raw = this.toPlainObject();
|
|
9390
|
+
return makeRequest({
|
|
9391
|
+
entityType: 'Function',
|
|
9392
|
+
action: 'get',
|
|
9393
|
+
params: {
|
|
9394
|
+
appDefinitionId: raw.sys.appDefinition.sys.id,
|
|
9395
|
+
organizationId: raw.sys.organization.sys.id,
|
|
9396
|
+
functionId
|
|
9397
|
+
}
|
|
9398
|
+
}).then(data => wrapFunction(makeRequest, data));
|
|
9399
|
+
},
|
|
9400
|
+
/**
|
|
9401
|
+
* Gets all Functions for an Environment
|
|
9402
|
+
* @Param organizationId - Organization ID
|
|
9403
|
+
* @Param appDefinitionId - App Definition ID
|
|
9404
|
+
* @Param functionId - Function ID
|
|
9405
|
+
* @returns a collection of Functions
|
|
9406
|
+
* ```javascript
|
|
9407
|
+
* const contentful = require('contentful-management')
|
|
9408
|
+
*
|
|
9409
|
+
* const client = contentful.createClient({
|
|
9410
|
+
* accessToken: '<content_management_api_key>'
|
|
9411
|
+
* })
|
|
9412
|
+
*
|
|
9413
|
+
* client.function.get({
|
|
9414
|
+
* environmentId: <environmentId>,
|
|
9415
|
+
* spaceId: <spaceId>,
|
|
9416
|
+
* appInstallationId: <appInstallationId>
|
|
9417
|
+
* })
|
|
9418
|
+
* .then((response) => console.log(response.items))
|
|
9419
|
+
* .catch(console.error)
|
|
9420
|
+
* ```
|
|
9421
|
+
*/
|
|
9422
|
+
getManyFunctionsForEnvironment(spaceId, environmentId, appInstallationId) {
|
|
9423
|
+
return makeRequest({
|
|
9424
|
+
entityType: 'Function',
|
|
9425
|
+
action: 'getManyForEnvironment',
|
|
9426
|
+
params: {
|
|
9427
|
+
spaceId: spaceId,
|
|
9428
|
+
environmentId: environmentId,
|
|
9429
|
+
appInstallationId: appInstallationId
|
|
9430
|
+
}
|
|
9431
|
+
}).then(data => wrapFunctionCollection(makeRequest, data));
|
|
9432
|
+
}
|
|
9433
|
+
};
|
|
9434
|
+
}
|
|
9435
|
+
|
|
9436
|
+
/***/ }),
|
|
9437
|
+
|
|
9272
9438
|
/***/ "./create-organization-api.ts":
|
|
9273
9439
|
/*!************************************!*\
|
|
9274
9440
|
!*** ./create-organization-api.ts ***!
|
|
@@ -13998,6 +14164,50 @@ const wrapExtensionCollection = (0,_common_utils__WEBPACK_IMPORTED_MODULE_3__.wr
|
|
|
13998
14164
|
|
|
13999
14165
|
/***/ }),
|
|
14000
14166
|
|
|
14167
|
+
/***/ "./entities/function.ts":
|
|
14168
|
+
/*!******************************!*\
|
|
14169
|
+
!*** ./entities/function.ts ***!
|
|
14170
|
+
\******************************/
|
|
14171
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
14172
|
+
|
|
14173
|
+
"use strict";
|
|
14174
|
+
__webpack_require__.r(__webpack_exports__);
|
|
14175
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
14176
|
+
/* harmony export */ wrapFunction: () => (/* binding */ wrapFunction),
|
|
14177
|
+
/* harmony export */ wrapFunctionCollection: () => (/* binding */ wrapFunctionCollection)
|
|
14178
|
+
/* harmony export */ });
|
|
14179
|
+
/* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.js");
|
|
14180
|
+
/* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/esm/index.mjs");
|
|
14181
|
+
/* harmony import */ var _common_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common-utils */ "./common-utils.ts");
|
|
14182
|
+
/* harmony import */ var _enhance_with_methods__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enhance-with-methods */ "./enhance-with-methods.ts");
|
|
14183
|
+
/* harmony import */ var _create_function_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../create-function-api */ "./create-function-api.ts");
|
|
14184
|
+
|
|
14185
|
+
|
|
14186
|
+
|
|
14187
|
+
|
|
14188
|
+
|
|
14189
|
+
/**
|
|
14190
|
+
* @private
|
|
14191
|
+
* @param makeRequest - (real) function to make requests via an adapter
|
|
14192
|
+
* @param data - raw contentful-Function data
|
|
14193
|
+
* @return Wrapped Function data
|
|
14194
|
+
*/
|
|
14195
|
+
function wrapFunction(makeRequest, data) {
|
|
14196
|
+
const appAction = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.toPlainObject)((0,fast_copy__WEBPACK_IMPORTED_MODULE_1__["default"])(data));
|
|
14197
|
+
const appActionWithMethods = (0,_enhance_with_methods__WEBPACK_IMPORTED_MODULE_3__["default"])(appAction, (0,_create_function_api__WEBPACK_IMPORTED_MODULE_4__["default"])(makeRequest));
|
|
14198
|
+
return (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.freezeSys)(appActionWithMethods);
|
|
14199
|
+
}
|
|
14200
|
+
|
|
14201
|
+
/**
|
|
14202
|
+
* @private
|
|
14203
|
+
* @param makeRequest - real) function to make requests via an adapter
|
|
14204
|
+
* @param data - raw contentful-function data
|
|
14205
|
+
* @return Wrapped App Function collection data
|
|
14206
|
+
*/
|
|
14207
|
+
const wrapFunctionCollection = (0,_common_utils__WEBPACK_IMPORTED_MODULE_2__.wrapCollection)(wrapFunction);
|
|
14208
|
+
|
|
14209
|
+
/***/ }),
|
|
14210
|
+
|
|
14001
14211
|
/***/ "./entities/index.ts":
|
|
14002
14212
|
/*!***************************!*\
|
|
14003
14213
|
!*** ./entities/index.ts ***!
|
|
@@ -14034,38 +14244,40 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14034
14244
|
/* harmony import */ var _environment_template__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./environment-template */ "./entities/environment-template.ts");
|
|
14035
14245
|
/* harmony import */ var _environment_template_installation__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./environment-template-installation */ "./entities/environment-template-installation.ts");
|
|
14036
14246
|
/* harmony import */ var _extension__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./extension */ "./entities/extension.ts");
|
|
14037
|
-
/* harmony import */ var
|
|
14038
|
-
/* harmony import */ var
|
|
14039
|
-
/* harmony import */ var
|
|
14040
|
-
/* harmony import */ var
|
|
14041
|
-
/* harmony import */ var
|
|
14042
|
-
/* harmony import */ var
|
|
14043
|
-
/* harmony import */ var
|
|
14044
|
-
/* harmony import */ var
|
|
14045
|
-
/* harmony import */ var
|
|
14046
|
-
/* harmony import */ var
|
|
14047
|
-
/* harmony import */ var
|
|
14048
|
-
/* harmony import */ var
|
|
14049
|
-
/* harmony import */ var
|
|
14050
|
-
/* harmony import */ var
|
|
14051
|
-
/* harmony import */ var
|
|
14052
|
-
/* harmony import */ var
|
|
14053
|
-
/* harmony import */ var
|
|
14054
|
-
/* harmony import */ var
|
|
14055
|
-
/* harmony import */ var
|
|
14056
|
-
/* harmony import */ var
|
|
14057
|
-
/* harmony import */ var
|
|
14058
|
-
/* harmony import */ var
|
|
14059
|
-
/* harmony import */ var
|
|
14060
|
-
/* harmony import */ var
|
|
14061
|
-
/* harmony import */ var
|
|
14062
|
-
/* harmony import */ var
|
|
14063
|
-
/* harmony import */ var
|
|
14064
|
-
/* harmony import */ var
|
|
14065
|
-
/* harmony import */ var
|
|
14066
|
-
/* harmony import */ var
|
|
14067
|
-
/* harmony import */ var
|
|
14068
|
-
/* harmony import */ var
|
|
14247
|
+
/* harmony import */ var _function__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./function */ "./entities/function.ts");
|
|
14248
|
+
/* harmony import */ var _locale__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./locale */ "./entities/locale.ts");
|
|
14249
|
+
/* harmony import */ var _organization__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./organization */ "./entities/organization.ts");
|
|
14250
|
+
/* harmony import */ var _organization_invitation__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./organization-invitation */ "./entities/organization-invitation.ts");
|
|
14251
|
+
/* harmony import */ var _organization_membership__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./organization-membership */ "./entities/organization-membership.ts");
|
|
14252
|
+
/* harmony import */ var _personal_access_token__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./personal-access-token */ "./entities/personal-access-token.ts");
|
|
14253
|
+
/* harmony import */ var _access_token__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./access-token */ "./entities/access-token.ts");
|
|
14254
|
+
/* harmony import */ var _preview_api_key__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./preview-api-key */ "./entities/preview-api-key.ts");
|
|
14255
|
+
/* harmony import */ var _release__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./release */ "./entities/release.ts");
|
|
14256
|
+
/* harmony import */ var _release_action__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./release-action */ "./entities/release-action.ts");
|
|
14257
|
+
/* harmony import */ var _role__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./role */ "./entities/role.ts");
|
|
14258
|
+
/* harmony import */ var _scheduled_action__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./scheduled-action */ "./entities/scheduled-action.ts");
|
|
14259
|
+
/* harmony import */ var _snapshot__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./snapshot */ "./entities/snapshot.ts");
|
|
14260
|
+
/* harmony import */ var _space__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./space */ "./entities/space.ts");
|
|
14261
|
+
/* harmony import */ var _space_member__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./space-member */ "./entities/space-member.ts");
|
|
14262
|
+
/* harmony import */ var _space_membership__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./space-membership */ "./entities/space-membership.ts");
|
|
14263
|
+
/* harmony import */ var _tag__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./tag */ "./entities/tag.ts");
|
|
14264
|
+
/* harmony import */ var _task__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./task */ "./entities/task.ts");
|
|
14265
|
+
/* harmony import */ var _team__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./team */ "./entities/team.ts");
|
|
14266
|
+
/* harmony import */ var _team_membership__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./team-membership */ "./entities/team-membership.ts");
|
|
14267
|
+
/* harmony import */ var _team_space_membership__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./team-space-membership */ "./entities/team-space-membership.ts");
|
|
14268
|
+
/* harmony import */ var _ui_config__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./ui-config */ "./entities/ui-config.ts");
|
|
14269
|
+
/* harmony import */ var _upload__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./upload */ "./entities/upload.ts");
|
|
14270
|
+
/* harmony import */ var _usage__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./usage */ "./entities/usage.ts");
|
|
14271
|
+
/* harmony import */ var _user__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./user */ "./entities/user.ts");
|
|
14272
|
+
/* harmony import */ var _user_ui_config__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./user-ui-config */ "./entities/user-ui-config.ts");
|
|
14273
|
+
/* harmony import */ var _webhook__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./webhook */ "./entities/webhook.ts");
|
|
14274
|
+
/* harmony import */ var _workflow_definition__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./workflow-definition */ "./entities/workflow-definition.ts");
|
|
14275
|
+
/* harmony import */ var _concept__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./concept */ "./entities/concept.ts");
|
|
14276
|
+
/* harmony import */ var _concept_scheme__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./concept-scheme */ "./entities/concept-scheme.ts");
|
|
14277
|
+
/* harmony import */ var _resource_provider__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./resource-provider */ "./entities/resource-provider.ts");
|
|
14278
|
+
/* harmony import */ var _resource_type__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./resource-type */ "./entities/resource-type.ts");
|
|
14279
|
+
/* harmony import */ var _resource__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./resource */ "./entities/resource.ts");
|
|
14280
|
+
|
|
14069
14281
|
|
|
14070
14282
|
|
|
14071
14283
|
|
|
@@ -14124,7 +14336,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14124
14336
|
|
|
14125
14337
|
|
|
14126
14338
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
14127
|
-
accessToken:
|
|
14339
|
+
accessToken: _access_token__WEBPACK_IMPORTED_MODULE_31__,
|
|
14128
14340
|
appAction: _app_action__WEBPACK_IMPORTED_MODULE_1__,
|
|
14129
14341
|
appActionCall: _app_action_call__WEBPACK_IMPORTED_MODULE_2__,
|
|
14130
14342
|
appBundle: _app_bundle__WEBPACK_IMPORTED_MODULE_3__,
|
|
@@ -14142,8 +14354,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14142
14354
|
assetKey: _asset_key__WEBPACK_IMPORTED_MODULE_14__,
|
|
14143
14355
|
bulkAction: _bulk_action__WEBPACK_IMPORTED_MODULE_15__,
|
|
14144
14356
|
comment: _comment__WEBPACK_IMPORTED_MODULE_16__,
|
|
14145
|
-
concept:
|
|
14146
|
-
conceptScheme:
|
|
14357
|
+
concept: _concept__WEBPACK_IMPORTED_MODULE_53__,
|
|
14358
|
+
conceptScheme: _concept_scheme__WEBPACK_IMPORTED_MODULE_54__,
|
|
14147
14359
|
contentType: _content_type__WEBPACK_IMPORTED_MODULE_17__,
|
|
14148
14360
|
editorInterface: _editor_interface__WEBPACK_IMPORTED_MODULE_18__,
|
|
14149
14361
|
entry: _entry__WEBPACK_IMPORTED_MODULE_19__,
|
|
@@ -14152,35 +14364,36 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
14152
14364
|
environmentTemplate: _environment_template__WEBPACK_IMPORTED_MODULE_22__,
|
|
14153
14365
|
environmentTemplateInstallation: _environment_template_installation__WEBPACK_IMPORTED_MODULE_23__,
|
|
14154
14366
|
extension: _extension__WEBPACK_IMPORTED_MODULE_24__,
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14173
|
-
|
|
14174
|
-
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14367
|
+
func: _function__WEBPACK_IMPORTED_MODULE_25__,
|
|
14368
|
+
locale: _locale__WEBPACK_IMPORTED_MODULE_26__,
|
|
14369
|
+
organization: _organization__WEBPACK_IMPORTED_MODULE_27__,
|
|
14370
|
+
organizationInvitation: _organization_invitation__WEBPACK_IMPORTED_MODULE_28__,
|
|
14371
|
+
organizationMembership: _organization_membership__WEBPACK_IMPORTED_MODULE_29__,
|
|
14372
|
+
personalAccessToken: _personal_access_token__WEBPACK_IMPORTED_MODULE_30__,
|
|
14373
|
+
previewApiKey: _preview_api_key__WEBPACK_IMPORTED_MODULE_32__,
|
|
14374
|
+
release: _release__WEBPACK_IMPORTED_MODULE_33__,
|
|
14375
|
+
releaseAction: _release_action__WEBPACK_IMPORTED_MODULE_34__,
|
|
14376
|
+
resourceProvider: _resource_provider__WEBPACK_IMPORTED_MODULE_55__,
|
|
14377
|
+
resourceType: _resource_type__WEBPACK_IMPORTED_MODULE_56__,
|
|
14378
|
+
resource: _resource__WEBPACK_IMPORTED_MODULE_57__,
|
|
14379
|
+
role: _role__WEBPACK_IMPORTED_MODULE_35__,
|
|
14380
|
+
scheduledAction: _scheduled_action__WEBPACK_IMPORTED_MODULE_36__,
|
|
14381
|
+
snapshot: _snapshot__WEBPACK_IMPORTED_MODULE_37__,
|
|
14382
|
+
space: _space__WEBPACK_IMPORTED_MODULE_38__,
|
|
14383
|
+
spaceMember: _space_member__WEBPACK_IMPORTED_MODULE_39__,
|
|
14384
|
+
spaceMembership: _space_membership__WEBPACK_IMPORTED_MODULE_40__,
|
|
14385
|
+
tag: _tag__WEBPACK_IMPORTED_MODULE_41__,
|
|
14386
|
+
task: _task__WEBPACK_IMPORTED_MODULE_42__,
|
|
14387
|
+
team: _team__WEBPACK_IMPORTED_MODULE_43__,
|
|
14388
|
+
teamMembership: _team_membership__WEBPACK_IMPORTED_MODULE_44__,
|
|
14389
|
+
teamSpaceMembership: _team_space_membership__WEBPACK_IMPORTED_MODULE_45__,
|
|
14390
|
+
uiConfig: _ui_config__WEBPACK_IMPORTED_MODULE_46__,
|
|
14391
|
+
upload: _upload__WEBPACK_IMPORTED_MODULE_47__,
|
|
14392
|
+
usage: _usage__WEBPACK_IMPORTED_MODULE_48__,
|
|
14393
|
+
user: _user__WEBPACK_IMPORTED_MODULE_49__,
|
|
14394
|
+
userUIConfig: _user_ui_config__WEBPACK_IMPORTED_MODULE_50__,
|
|
14395
|
+
webhook: _webhook__WEBPACK_IMPORTED_MODULE_51__,
|
|
14396
|
+
workflowDefinition: _workflow_definition__WEBPACK_IMPORTED_MODULE_52__
|
|
14184
14397
|
});
|
|
14185
14398
|
|
|
14186
14399
|
/***/ }),
|
|
@@ -16728,7 +16941,9 @@ const createPlainClient = (makeRequest, defaults) => {
|
|
|
16728
16941
|
updatePut: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'ConceptScheme', 'updatePut')
|
|
16729
16942
|
},
|
|
16730
16943
|
function: {
|
|
16731
|
-
|
|
16944
|
+
get: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Function', 'get'),
|
|
16945
|
+
getMany: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Function', 'getMany'),
|
|
16946
|
+
getManyForEnvironment: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Function', 'getManyForEnvironment')
|
|
16732
16947
|
},
|
|
16733
16948
|
editorInterface: {
|
|
16734
16949
|
get: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'EditorInterface', 'get'),
|
|
@@ -30754,7 +30969,7 @@ function createClient(params, opts = {}) {
|
|
|
30754
30969
|
const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
30755
30970
|
const userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)(
|
|
30756
30971
|
// @ts-expect-error
|
|
30757
|
-
`${sdkMain}/${"11.
|
|
30972
|
+
`${sdkMain}/${"11.43.0-beta.1"}`, params.application, params.integration, params.feature);
|
|
30758
30973
|
const adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(_objectSpread(_objectSpread({}, params), {}, {
|
|
30759
30974
|
userAgent
|
|
30760
30975
|
}));
|