contentful-management 11.47.2 → 11.47.3
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 +10 -1
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +10 -1
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/entities/app-action.js +9 -0
- package/dist/typings/create-organization-api.d.ts +264 -6
- package/dist/typings/entities/app-action.d.ts +59 -14
- package/dist/typings/plain/entities/app-action.d.ts +46 -0
- package/package.json +7 -2
|
@@ -47,7 +47,7 @@ function createClient(params, opts = {}) {
|
|
|
47
47
|
const sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
48
48
|
const userAgent = getUserAgentHeader(
|
|
49
49
|
// @ts-expect-error
|
|
50
|
-
`${sdkMain}/${"11.47.
|
|
50
|
+
`${sdkMain}/${"11.47.3"}`, params.application, params.integration, params.feature);
|
|
51
51
|
const adapter = createAdapter(_objectSpread(_objectSpread({}, params), {}, {
|
|
52
52
|
userAgent
|
|
53
53
|
}));
|
|
@@ -2,6 +2,15 @@ import { freezeSys, toPlainObject } from 'contentful-sdk-core';
|
|
|
2
2
|
import copy from 'fast-copy';
|
|
3
3
|
import { wrapCollection } from '../common-utils';
|
|
4
4
|
import enhanceWithMethods from '../enhance-with-methods';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 'function' is deprecated, use 'function-invocation' instead
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use FunctionAppActionProps instead
|
|
12
|
+
*/
|
|
13
|
+
|
|
5
14
|
/**
|
|
6
15
|
* @private
|
|
7
16
|
*/
|
|
@@ -677,10 +677,52 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
|
|
|
677
677
|
appDefinition: import("./common-types").SysLink;
|
|
678
678
|
organization: import("./common-types").SysLink;
|
|
679
679
|
};
|
|
680
|
+
name: string;
|
|
681
|
+
description?: string;
|
|
682
|
+
} & Record<string, unknown> & {
|
|
683
|
+
type: "function";
|
|
684
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
685
|
+
delete(): Promise<void>;
|
|
686
|
+
}) | ({
|
|
687
|
+
category: "Entries.v1.0" | "Notification.v1.0";
|
|
688
|
+
} & {
|
|
689
|
+
sys: {
|
|
690
|
+
type: string;
|
|
691
|
+
id: string;
|
|
692
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
693
|
+
createdAt: string;
|
|
694
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
695
|
+
updatedAt: string;
|
|
696
|
+
} & {
|
|
697
|
+
appDefinition: import("./common-types").SysLink;
|
|
698
|
+
organization: import("./common-types").SysLink;
|
|
699
|
+
};
|
|
700
|
+
name: string;
|
|
701
|
+
description?: string;
|
|
702
|
+
} & {
|
|
703
|
+
type: "endpoint";
|
|
680
704
|
url: string;
|
|
705
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
706
|
+
delete(): Promise<void>;
|
|
707
|
+
}) | ({
|
|
708
|
+
category: "Entries.v1.0" | "Notification.v1.0";
|
|
709
|
+
} & {
|
|
710
|
+
sys: {
|
|
711
|
+
type: string;
|
|
712
|
+
id: string;
|
|
713
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
714
|
+
createdAt: string;
|
|
715
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
716
|
+
updatedAt: string;
|
|
717
|
+
} & {
|
|
718
|
+
appDefinition: import("./common-types").SysLink;
|
|
719
|
+
organization: import("./common-types").SysLink;
|
|
720
|
+
};
|
|
681
721
|
name: string;
|
|
682
722
|
description?: string;
|
|
683
|
-
|
|
723
|
+
} & {
|
|
724
|
+
type: "function-invocation";
|
|
725
|
+
function: import("./common-types").Link<"Function">;
|
|
684
726
|
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
685
727
|
delete(): Promise<void>;
|
|
686
728
|
}) | ({
|
|
@@ -698,10 +740,54 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
|
|
|
698
740
|
appDefinition: import("./common-types").SysLink;
|
|
699
741
|
organization: import("./common-types").SysLink;
|
|
700
742
|
};
|
|
743
|
+
name: string;
|
|
744
|
+
description?: string;
|
|
745
|
+
} & Record<string, unknown> & {
|
|
746
|
+
type: "function";
|
|
747
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
748
|
+
delete(): Promise<void>;
|
|
749
|
+
}) | ({
|
|
750
|
+
category: "Custom";
|
|
751
|
+
parameters: import("./entities/app-action").AppActionParameterDefinition[];
|
|
752
|
+
} & {
|
|
753
|
+
sys: {
|
|
754
|
+
type: string;
|
|
755
|
+
id: string;
|
|
756
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
757
|
+
createdAt: string;
|
|
758
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
759
|
+
updatedAt: string;
|
|
760
|
+
} & {
|
|
761
|
+
appDefinition: import("./common-types").SysLink;
|
|
762
|
+
organization: import("./common-types").SysLink;
|
|
763
|
+
};
|
|
764
|
+
name: string;
|
|
765
|
+
description?: string;
|
|
766
|
+
} & {
|
|
767
|
+
type: "endpoint";
|
|
701
768
|
url: string;
|
|
769
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
770
|
+
delete(): Promise<void>;
|
|
771
|
+
}) | ({
|
|
772
|
+
category: "Custom";
|
|
773
|
+
parameters: import("./entities/app-action").AppActionParameterDefinition[];
|
|
774
|
+
} & {
|
|
775
|
+
sys: {
|
|
776
|
+
type: string;
|
|
777
|
+
id: string;
|
|
778
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
779
|
+
createdAt: string;
|
|
780
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
781
|
+
updatedAt: string;
|
|
782
|
+
} & {
|
|
783
|
+
appDefinition: import("./common-types").SysLink;
|
|
784
|
+
organization: import("./common-types").SysLink;
|
|
785
|
+
};
|
|
702
786
|
name: string;
|
|
703
787
|
description?: string;
|
|
704
|
-
|
|
788
|
+
} & {
|
|
789
|
+
type: "function-invocation";
|
|
790
|
+
function: import("./common-types").Link<"Function">;
|
|
705
791
|
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
706
792
|
delete(): Promise<void>;
|
|
707
793
|
})>;
|
|
@@ -738,10 +824,73 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
|
|
|
738
824
|
appDefinition: import("./common-types").SysLink;
|
|
739
825
|
organization: import("./common-types").SysLink;
|
|
740
826
|
};
|
|
827
|
+
name: string;
|
|
828
|
+
description?: string;
|
|
829
|
+
} & Record<string, unknown> & {
|
|
830
|
+
type: "function";
|
|
831
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
832
|
+
delete(): Promise<void>;
|
|
833
|
+
}) | ({
|
|
834
|
+
category: "Entries.v1.0" | "Notification.v1.0";
|
|
835
|
+
} & {
|
|
836
|
+
sys: {
|
|
837
|
+
type: string;
|
|
838
|
+
id: string;
|
|
839
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
840
|
+
createdAt: string;
|
|
841
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
842
|
+
updatedAt: string;
|
|
843
|
+
} & {
|
|
844
|
+
appDefinition: import("./common-types").SysLink;
|
|
845
|
+
organization: import("./common-types").SysLink;
|
|
846
|
+
};
|
|
847
|
+
name: string;
|
|
848
|
+
description?: string;
|
|
849
|
+
} & {
|
|
850
|
+
type: "endpoint";
|
|
741
851
|
url: string;
|
|
852
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
853
|
+
delete(): Promise<void>;
|
|
854
|
+
}) | ({
|
|
855
|
+
category: "Entries.v1.0" | "Notification.v1.0";
|
|
856
|
+
} & {
|
|
857
|
+
sys: {
|
|
858
|
+
type: string;
|
|
859
|
+
id: string;
|
|
860
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
861
|
+
createdAt: string;
|
|
862
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
863
|
+
updatedAt: string;
|
|
864
|
+
} & {
|
|
865
|
+
appDefinition: import("./common-types").SysLink;
|
|
866
|
+
organization: import("./common-types").SysLink;
|
|
867
|
+
};
|
|
868
|
+
name: string;
|
|
869
|
+
description?: string;
|
|
870
|
+
} & {
|
|
871
|
+
type: "function-invocation";
|
|
872
|
+
function: import("./common-types").Link<"Function">;
|
|
873
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
874
|
+
delete(): Promise<void>;
|
|
875
|
+
}) | ({
|
|
876
|
+
category: "Custom";
|
|
877
|
+
parameters: import("./entities/app-action").AppActionParameterDefinition[];
|
|
878
|
+
} & {
|
|
879
|
+
sys: {
|
|
880
|
+
type: string;
|
|
881
|
+
id: string;
|
|
882
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
883
|
+
createdAt: string;
|
|
884
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
885
|
+
updatedAt: string;
|
|
886
|
+
} & {
|
|
887
|
+
appDefinition: import("./common-types").SysLink;
|
|
888
|
+
organization: import("./common-types").SysLink;
|
|
889
|
+
};
|
|
742
890
|
name: string;
|
|
743
891
|
description?: string;
|
|
744
|
-
|
|
892
|
+
} & Record<string, unknown> & {
|
|
893
|
+
type: "function";
|
|
745
894
|
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
746
895
|
delete(): Promise<void>;
|
|
747
896
|
}) | ({
|
|
@@ -759,10 +908,33 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
|
|
|
759
908
|
appDefinition: import("./common-types").SysLink;
|
|
760
909
|
organization: import("./common-types").SysLink;
|
|
761
910
|
};
|
|
911
|
+
name: string;
|
|
912
|
+
description?: string;
|
|
913
|
+
} & {
|
|
914
|
+
type: "endpoint";
|
|
762
915
|
url: string;
|
|
916
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
917
|
+
delete(): Promise<void>;
|
|
918
|
+
}) | ({
|
|
919
|
+
category: "Custom";
|
|
920
|
+
parameters: import("./entities/app-action").AppActionParameterDefinition[];
|
|
921
|
+
} & {
|
|
922
|
+
sys: {
|
|
923
|
+
type: string;
|
|
924
|
+
id: string;
|
|
925
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
926
|
+
createdAt: string;
|
|
927
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
928
|
+
updatedAt: string;
|
|
929
|
+
} & {
|
|
930
|
+
appDefinition: import("./common-types").SysLink;
|
|
931
|
+
organization: import("./common-types").SysLink;
|
|
932
|
+
};
|
|
763
933
|
name: string;
|
|
764
934
|
description?: string;
|
|
765
|
-
|
|
935
|
+
} & {
|
|
936
|
+
type: "function-invocation";
|
|
937
|
+
function: import("./common-types").Link<"Function">;
|
|
766
938
|
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
767
939
|
delete(): Promise<void>;
|
|
768
940
|
})>;
|
|
@@ -811,10 +983,73 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
|
|
|
811
983
|
appDefinition: import("./common-types").SysLink;
|
|
812
984
|
organization: import("./common-types").SysLink;
|
|
813
985
|
};
|
|
986
|
+
name: string;
|
|
987
|
+
description?: string;
|
|
988
|
+
} & Record<string, unknown> & {
|
|
989
|
+
type: "function";
|
|
990
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
991
|
+
delete(): Promise<void>;
|
|
992
|
+
}) | ({
|
|
993
|
+
category: "Entries.v1.0" | "Notification.v1.0";
|
|
994
|
+
} & {
|
|
995
|
+
sys: {
|
|
996
|
+
type: string;
|
|
997
|
+
id: string;
|
|
998
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
999
|
+
createdAt: string;
|
|
1000
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
1001
|
+
updatedAt: string;
|
|
1002
|
+
} & {
|
|
1003
|
+
appDefinition: import("./common-types").SysLink;
|
|
1004
|
+
organization: import("./common-types").SysLink;
|
|
1005
|
+
};
|
|
1006
|
+
name: string;
|
|
1007
|
+
description?: string;
|
|
1008
|
+
} & {
|
|
1009
|
+
type: "endpoint";
|
|
814
1010
|
url: string;
|
|
1011
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
1012
|
+
delete(): Promise<void>;
|
|
1013
|
+
}) | ({
|
|
1014
|
+
category: "Entries.v1.0" | "Notification.v1.0";
|
|
1015
|
+
} & {
|
|
1016
|
+
sys: {
|
|
1017
|
+
type: string;
|
|
1018
|
+
id: string;
|
|
1019
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
1020
|
+
createdAt: string;
|
|
1021
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
1022
|
+
updatedAt: string;
|
|
1023
|
+
} & {
|
|
1024
|
+
appDefinition: import("./common-types").SysLink;
|
|
1025
|
+
organization: import("./common-types").SysLink;
|
|
1026
|
+
};
|
|
1027
|
+
name: string;
|
|
1028
|
+
description?: string;
|
|
1029
|
+
} & {
|
|
1030
|
+
type: "function-invocation";
|
|
1031
|
+
function: import("./common-types").Link<"Function">;
|
|
1032
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
1033
|
+
delete(): Promise<void>;
|
|
1034
|
+
}) | ({
|
|
1035
|
+
category: "Custom";
|
|
1036
|
+
parameters: import("./entities/app-action").AppActionParameterDefinition[];
|
|
1037
|
+
} & {
|
|
1038
|
+
sys: {
|
|
1039
|
+
type: string;
|
|
1040
|
+
id: string;
|
|
1041
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
1042
|
+
createdAt: string;
|
|
1043
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
1044
|
+
updatedAt: string;
|
|
1045
|
+
} & {
|
|
1046
|
+
appDefinition: import("./common-types").SysLink;
|
|
1047
|
+
organization: import("./common-types").SysLink;
|
|
1048
|
+
};
|
|
815
1049
|
name: string;
|
|
816
1050
|
description?: string;
|
|
817
|
-
|
|
1051
|
+
} & Record<string, unknown> & {
|
|
1052
|
+
type: "function";
|
|
818
1053
|
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
819
1054
|
delete(): Promise<void>;
|
|
820
1055
|
}) | ({
|
|
@@ -832,10 +1067,33 @@ export default function createOrganizationApi(makeRequest: MakeRequest): {
|
|
|
832
1067
|
appDefinition: import("./common-types").SysLink;
|
|
833
1068
|
organization: import("./common-types").SysLink;
|
|
834
1069
|
};
|
|
1070
|
+
name: string;
|
|
1071
|
+
description?: string;
|
|
1072
|
+
} & {
|
|
1073
|
+
type: "endpoint";
|
|
835
1074
|
url: string;
|
|
1075
|
+
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
1076
|
+
delete(): Promise<void>;
|
|
1077
|
+
}) | ({
|
|
1078
|
+
category: "Custom";
|
|
1079
|
+
parameters: import("./entities/app-action").AppActionParameterDefinition[];
|
|
1080
|
+
} & {
|
|
1081
|
+
sys: {
|
|
1082
|
+
type: string;
|
|
1083
|
+
id: string;
|
|
1084
|
+
createdBy?: import("./common-types").SysLink | undefined;
|
|
1085
|
+
createdAt: string;
|
|
1086
|
+
updatedBy?: import("./common-types").SysLink | undefined;
|
|
1087
|
+
updatedAt: string;
|
|
1088
|
+
} & {
|
|
1089
|
+
appDefinition: import("./common-types").SysLink;
|
|
1090
|
+
organization: import("./common-types").SysLink;
|
|
1091
|
+
};
|
|
836
1092
|
name: string;
|
|
837
1093
|
description?: string;
|
|
838
|
-
|
|
1094
|
+
} & {
|
|
1095
|
+
type: "function-invocation";
|
|
1096
|
+
function: import("./common-types").Link<"Function">;
|
|
839
1097
|
} & import("./common-types").DefaultElements<import("./entities/app-action").AppActionProps> & {
|
|
840
1098
|
delete(): Promise<void>;
|
|
841
1099
|
})>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Except } from 'type-fest';
|
|
2
|
-
import type { BasicMetaSysProps, DefaultElements, MakeRequest, SysLink } from '../common-types';
|
|
2
|
+
import type { BasicMetaSysProps, DefaultElements, Link, MakeRequest, SysLink } from '../common-types';
|
|
3
3
|
import type { ParameterDefinition } from './widget-parameters';
|
|
4
4
|
type AppActionSys = Except<BasicMetaSysProps, 'version'> & {
|
|
5
5
|
appDefinition: SysLink;
|
|
@@ -31,22 +31,15 @@ type CustomAppActionProps = {
|
|
|
31
31
|
};
|
|
32
32
|
type AppActionCategory = BuiltInCategoriesProps | CustomAppActionProps;
|
|
33
33
|
export type AppActionCategoryType = AppActionCategory['category'];
|
|
34
|
+
/**
|
|
35
|
+
* 'function' is deprecated, use 'function-invocation' instead
|
|
36
|
+
*/
|
|
34
37
|
export type AppActionType = 'endpoint' | 'function' | 'function-invocation';
|
|
35
|
-
|
|
36
|
-
url: string;
|
|
37
|
-
name: string;
|
|
38
|
-
description?: string;
|
|
39
|
-
type?: AppActionType;
|
|
40
|
-
};
|
|
41
|
-
export type AppActionProps = AppActionCategory & {
|
|
38
|
+
type BaseAppActionProps = AppActionCategory & {
|
|
42
39
|
/**
|
|
43
40
|
* System metadata
|
|
44
41
|
*/
|
|
45
42
|
sys: AppActionSys;
|
|
46
|
-
/**
|
|
47
|
-
* Url that will be called when the action is invoked
|
|
48
|
-
*/
|
|
49
|
-
url: string;
|
|
50
43
|
/**
|
|
51
44
|
* Human readable name for the action
|
|
52
45
|
*/
|
|
@@ -55,14 +48,66 @@ export type AppActionProps = AppActionCategory & {
|
|
|
55
48
|
* Human readable description of the action
|
|
56
49
|
*/
|
|
57
50
|
description?: string;
|
|
51
|
+
};
|
|
52
|
+
type CreateEndpointAppActionProps = {
|
|
58
53
|
/**
|
|
59
54
|
* Type of the action, defaults to endpoint if not provided
|
|
60
55
|
* endpoint: action is sent to specified URL
|
|
61
|
-
|
|
56
|
+
*/
|
|
57
|
+
type?: 'endpoint';
|
|
58
|
+
/**
|
|
59
|
+
* Url that will be called when the action is invoked
|
|
60
|
+
*/
|
|
61
|
+
url: string;
|
|
62
|
+
};
|
|
63
|
+
type EndpointAppActionProps = {
|
|
64
|
+
/**
|
|
65
|
+
* Type of the action
|
|
66
|
+
* endpoint: action is sent to specified URL
|
|
67
|
+
*/
|
|
68
|
+
type: 'endpoint';
|
|
69
|
+
/**
|
|
70
|
+
* Url that will be called when the action is invoked
|
|
71
|
+
*/
|
|
72
|
+
url: string;
|
|
73
|
+
};
|
|
74
|
+
type CreateFunctionAppActionProps = {
|
|
75
|
+
/**
|
|
76
|
+
* Type of the action
|
|
62
77
|
* function-invocation: action invokes a contentful function
|
|
63
78
|
*/
|
|
64
|
-
type
|
|
79
|
+
type: 'function-invocation';
|
|
80
|
+
/**
|
|
81
|
+
* Link to a Function
|
|
82
|
+
*/
|
|
83
|
+
function: Link<'Function'>;
|
|
84
|
+
/**
|
|
85
|
+
* ID of the action
|
|
86
|
+
*/
|
|
87
|
+
id?: string;
|
|
65
88
|
};
|
|
89
|
+
type FunctionAppActionProps = {
|
|
90
|
+
/**
|
|
91
|
+
* Type of the action
|
|
92
|
+
* function-invocation: action invokes a contentful function
|
|
93
|
+
*/
|
|
94
|
+
type: 'function-invocation';
|
|
95
|
+
/**
|
|
96
|
+
* Link to a Function
|
|
97
|
+
*/
|
|
98
|
+
function: Link<'Function'>;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* @deprecated Use FunctionAppActionProps instead
|
|
102
|
+
*/
|
|
103
|
+
type LegacyFunctionAppActionProps = Record<string, unknown> & {
|
|
104
|
+
type: 'function';
|
|
105
|
+
};
|
|
106
|
+
export type CreateAppActionProps = AppActionCategory & {
|
|
107
|
+
name: string;
|
|
108
|
+
description?: string;
|
|
109
|
+
} & (CreateEndpointAppActionProps | CreateFunctionAppActionProps | LegacyFunctionAppActionProps);
|
|
110
|
+
export type AppActionProps = BaseAppActionProps & (EndpointAppActionProps | FunctionAppActionProps | LegacyFunctionAppActionProps);
|
|
66
111
|
export type AppAction = AppActionProps & DefaultElements<AppActionProps> & {
|
|
67
112
|
/**
|
|
68
113
|
* Deletes this object on the server.
|
|
@@ -68,6 +68,7 @@ export type AppActionPlainClientAPI = {
|
|
|
68
68
|
* @throws if the request fails, an entity is not found, or the payload is malformed
|
|
69
69
|
* @example
|
|
70
70
|
* ```javascript
|
|
71
|
+
* // app action that targets an endpoint url
|
|
71
72
|
* const appAction = await client.appAction.create(
|
|
72
73
|
* {
|
|
73
74
|
* organizationId: "<org_id>",
|
|
@@ -81,6 +82,28 @@ export type AppActionPlainClientAPI = {
|
|
|
81
82
|
* name: "My Notification",
|
|
82
83
|
* }
|
|
83
84
|
* );
|
|
85
|
+
*
|
|
86
|
+
* // app action that invokes a Contentful Function
|
|
87
|
+
* const functionAppAction = await client.appAction.create(
|
|
88
|
+
* {
|
|
89
|
+
* organizationId: '<org_id>',
|
|
90
|
+
* appDefinitionId: '<app_definition_id>',
|
|
91
|
+
* appActionId: '<app_action_id>',
|
|
92
|
+
* },
|
|
93
|
+
* {
|
|
94
|
+
* type: "function-invocation",
|
|
95
|
+
* function: {
|
|
96
|
+
* sys: {
|
|
97
|
+
* type: "Link",
|
|
98
|
+
* linkType: "Function",
|
|
99
|
+
* id: '<function_id>'
|
|
100
|
+
* }
|
|
101
|
+
* },
|
|
102
|
+
* category: "Notification.v1.0",
|
|
103
|
+
* description: "sends a notification",
|
|
104
|
+
* name: "Notification (Function Example)",
|
|
105
|
+
* }
|
|
106
|
+
*);
|
|
84
107
|
* ```
|
|
85
108
|
*/
|
|
86
109
|
create(params: OptionalDefaults<GetAppDefinitionParams>, payload: CreateAppActionProps): Promise<AppActionProps>;
|
|
@@ -92,6 +115,7 @@ export type AppActionPlainClientAPI = {
|
|
|
92
115
|
* @throws if the request fails, the App Action is not found, or the payload is malformed
|
|
93
116
|
* @example
|
|
94
117
|
* ```javascript
|
|
118
|
+
* // app action that targets an endpoint url
|
|
95
119
|
* const appAction = await client.appAction.update(
|
|
96
120
|
* {
|
|
97
121
|
* organizationId: "<org_id>",
|
|
@@ -105,6 +129,28 @@ export type AppActionPlainClientAPI = {
|
|
|
105
129
|
* name: "My Notification",
|
|
106
130
|
* }
|
|
107
131
|
* );
|
|
132
|
+
*
|
|
133
|
+
* // app action that invokes a Contentful Function
|
|
134
|
+
* const functionAppAction = await client.appAction.update(
|
|
135
|
+
* {
|
|
136
|
+
* organizationId: '<org_id>',
|
|
137
|
+
* appDefinitionId: '<app_definition_id>',
|
|
138
|
+
* appActionId: '<app_action_id>',
|
|
139
|
+
* },
|
|
140
|
+
* {
|
|
141
|
+
* type: "function-invocation",
|
|
142
|
+
* function: {
|
|
143
|
+
* sys: {
|
|
144
|
+
* type: "Link",
|
|
145
|
+
* linkType: "Function",
|
|
146
|
+
* id: '<function_id>'
|
|
147
|
+
* }
|
|
148
|
+
* },
|
|
149
|
+
* category: "Notification.v1.0",
|
|
150
|
+
* description: "sends a notification",
|
|
151
|
+
* name: "Notification (Function Example)",
|
|
152
|
+
* }
|
|
153
|
+
*);
|
|
108
154
|
* ```
|
|
109
155
|
*/
|
|
110
156
|
update(params: OptionalDefaults<GetAppActionParams>, payload: CreateAppActionProps): Promise<AppActionProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contentful-management",
|
|
3
|
-
"version": "11.47.
|
|
3
|
+
"version": "11.47.3",
|
|
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",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"clean": "rimraf dist",
|
|
28
28
|
"build": "npm run clean && npm run build:modules && npm run build:standalone && npm run build:types",
|
|
29
|
+
"postbuild": "npm run test:demo-projects",
|
|
29
30
|
"build:modules": "BABEL_ENV=modules babel --extensions \".ts\" --extensions \".js\" lib -d dist/es-modules/",
|
|
30
31
|
"build:standalone": "webpack && NODE_ENV=production webpack",
|
|
31
32
|
"build:standalone:log": "NODE_ENV=production WEBPACK_MODE=log webpack --json --profile --progress > webpack-build-log.json && webpack-bundle-analyzer webpack-build-log.json",
|
|
@@ -48,6 +49,9 @@
|
|
|
48
49
|
"test:browser": "npx playwright install && npx vitest --project browser-unit --run && npx vitest --project browser-integration --run",
|
|
49
50
|
"test:version": "grep -r \"0.0.0-determined-by-semantic-release\" ./dist > /dev/null && echo \"version 0.0.0-determined-by-semantic-release found in output\" && exit 1 || exit 0",
|
|
50
51
|
"test:size": "size-limit",
|
|
52
|
+
"test:demo-projects": "npm run test:demo-node && npm run test:demo-browser",
|
|
53
|
+
"test:demo-node": "rimraf ./test/output-integration/node/node-modules && npm --prefix ./test/output-integration/node ci && vitest --run ./test/output-integration/node",
|
|
54
|
+
"test:demo-browser": "rimraf ./test/output-integration/browser/node-modules && npm --prefix ./test/output-integration/browser ci && npm --prefix ./test/output-integration/browser run test",
|
|
51
55
|
"test:prepush": "npm run build && npm run test:unit && npm run test:size",
|
|
52
56
|
"prettier": "prettier --write '**/*.{jsx,js,ts,tsx}'",
|
|
53
57
|
"prettier:check": "prettier --check '**/*.{jsx,js,ts,tsx}'",
|
|
@@ -65,7 +69,8 @@
|
|
|
65
69
|
"@contentful/rich-text-types": "^16.6.1",
|
|
66
70
|
"axios": "^1.7.9",
|
|
67
71
|
"contentful-sdk-core": "^9.0.1",
|
|
68
|
-
"fast-copy": "^3.0.0"
|
|
72
|
+
"fast-copy": "^3.0.0",
|
|
73
|
+
"globals": "^15.15.0"
|
|
69
74
|
},
|
|
70
75
|
"devDependencies": {
|
|
71
76
|
"@babel/cli": "^7.24.6",
|