@pega/dx-component-builder-sdk 0.1.24 → 0.1.26

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.
@@ -0,0 +1,132 @@
1
+ export const pyReviewRaw = {
2
+ name: 'CollectInformation',
3
+ type: 'View',
4
+ config: {
5
+ template: 'DefaultForm',
6
+ ruleClass: 'OM5W9U-SampleApp-Work-Test',
7
+ localeReference: '@LR OM5W9U-SAMPLEAPP-WORK-TEST!VIEW!COLLECTINFORMATION',
8
+ context: '@P .pyViewContext'
9
+ },
10
+ children: [
11
+ {
12
+ name: 'A',
13
+ type: 'Region',
14
+ children: [
15
+ {
16
+ type: 'TextInput',
17
+ config: {
18
+ value: '@P .FirstName',
19
+ label: '@L First Name'
20
+ }
21
+ },
22
+ {
23
+ type: 'TextInput',
24
+ config: {
25
+ value: '@P .MiddleName',
26
+ label: '@L Middle Name'
27
+ }
28
+ },
29
+ {
30
+ type: 'TextInput',
31
+ config: {
32
+ value: '@P .LastName',
33
+ label: '@L Last Name'
34
+ }
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ name: 'B',
40
+ type: 'Region',
41
+ children: [
42
+ {
43
+ type: 'Email',
44
+ config: {
45
+ value: '@P .Email',
46
+ label: '@L Email'
47
+ }
48
+ },
49
+ {
50
+ type: 'Phone',
51
+ config: {
52
+ value: '@P .PhoneNumber',
53
+ label: '@L Phone Number',
54
+ datasource: {
55
+ source: '@DATASOURCE D_pyCountryCallingCodeList.pxResults',
56
+ fields: {
57
+ value: '@P .pyCallingCode'
58
+ }
59
+ }
60
+ }
61
+ },
62
+ {
63
+ type: 'Date',
64
+ config: {
65
+ value: '@P .ServiceDate',
66
+ label: '@L Service Date'
67
+ }
68
+ }
69
+ ]
70
+ }
71
+ ],
72
+ classID: 'OM5W9U-SampleApp-Work-Test'
73
+ };
74
+
75
+ export const regionChildrenResolved = [
76
+ {
77
+ readOnly: undefined,
78
+ value: 'John',
79
+ label: 'First Name',
80
+ hasSuggestions: false
81
+ },
82
+ {
83
+ readOnly: undefined,
84
+ value: 'Din',
85
+ label: 'Middle Name',
86
+ hasSuggestions: false
87
+ },
88
+ {
89
+ readOnly: undefined,
90
+ value: 'Doe',
91
+ label: 'Last Name',
92
+ hasSuggestions: false
93
+ },
94
+ {
95
+ readOnly: undefined,
96
+ value: 'John@doe.com',
97
+ label: 'Email',
98
+ hasSuggestions: false
99
+ },
100
+ {
101
+ readOnly: undefined,
102
+ value: '+16397975093',
103
+ label: 'Phone Number',
104
+ datasource: {
105
+ fields: {
106
+ value: undefined
107
+ },
108
+ source: [
109
+ {
110
+ value: '+1'
111
+ },
112
+ {
113
+ value: '+91'
114
+ },
115
+ {
116
+ value: '+48'
117
+ },
118
+ {
119
+ value: '+44'
120
+ }
121
+ ]
122
+ },
123
+ hasSuggestions: false
124
+ },
125
+ {
126
+ readOnly: undefined,
127
+ value: '2023-01-25',
128
+ label: 'Service Date',
129
+ hasSuggestions: false
130
+ }
131
+ ];
132
+
@@ -31,6 +31,12 @@ export const mapConfigJsonToCompanion = async ( componentKey ) => {
31
31
 
32
32
  }
33
33
 
34
+ export const removeCompanionConfigJson = async ( componentKey ) => {
35
+ const companionDirectory = await getComponentDirectoryPath(componentKey, CATEGORY_CONSTELLATION);
36
+
37
+ fs.rmSync(`${companionDirectory}/config.json`, { force: true });
38
+ }
39
+
34
40
  export const getBuildCategory = async (options) => {
35
41
  const categoryType = getOptionsCategory(options);
36
42
 
@@ -14,7 +14,8 @@ import { getPublishComponentQuestions,
14
14
  publishComponentToServer,
15
15
  zipComponent,
16
16
  getBuildCategory,
17
- mapConfigJsonToCompanion } from './helper.js';
17
+ mapConfigJsonToCompanion,
18
+ removeCompanionConfigJson} from './helper.js';
18
19
 
19
20
 
20
21
  export default async options => {
@@ -95,6 +96,12 @@ export default async options => {
95
96
  task: async () => {
96
97
  await publishComponentToServer(content);
97
98
  }
99
+ },
100
+ {
101
+ title: 'Clean up companion',
102
+ task: async () => {
103
+ removeCompanionConfigJson(componentKey);
104
+ }
98
105
  }
99
106
  ],
100
107
  {
@@ -31,6 +31,13 @@ export const mapConfigJsonToCompanion = async ( componentKey ) => {
31
31
 
32
32
  }
33
33
 
34
+ export const removeCompanionConfigJson = async ( componentKey ) => {
35
+ const companionDirectory = await getComponentDirectoryPath(componentKey, CATEGORY_CONSTELLATION);
36
+
37
+ fs.rmSync(`${companionDirectory}/config.json`, { force: true });
38
+ }
39
+
40
+
34
41
  export const getBuildCategory = async (options) => {
35
42
  const categoryType = getOptionsCategory(options);
36
43
 
@@ -14,7 +14,8 @@ import { getPublishComponentQuestions,
14
14
  publishComponentToServer,
15
15
  zipComponent,
16
16
  getBuildCategory,
17
- mapConfigJsonToCompanion } from './helper.js';
17
+ mapConfigJsonToCompanion,
18
+ removeCompanionConfigJson } from './helper.js';
18
19
 
19
20
 
20
21
 
@@ -94,6 +95,12 @@ export default async options => {
94
95
  task: async () => {
95
96
  await publishComponentToServer(content);
96
97
  }
98
+ },
99
+ {
100
+ title: 'Clean up companion',
101
+ task: async () => {
102
+ removeCompanionConfigJson(componentKey);
103
+ }
97
104
  }
98
105
  ],
99
106
  {
package/src/util.js CHANGED
@@ -19,7 +19,6 @@ import {
19
19
  OOTB_COMPONENT_SERVICE_REST_ENDPOINT,
20
20
  DELETE_COMPONENT_SERVICE_REST_ENDPOINT,
21
21
  OOTB_COMPONENTS,
22
- TOKEN_URL_V1,
23
22
  FIELD_PATH,
24
23
  WIDGET_PATH,
25
24
  TEMPLATE_PATH,
@@ -614,7 +613,3 @@ export const getOOTBComponents = async () => {
614
613
  });
615
614
  });
616
615
  };
617
-
618
- export const getTokenUrl = async (server) => {
619
- return server.endsWith('/') ? `${server}${TOKEN_URL_V1}` : `${server}/${TOKEN_URL_V1}`;
620
- };