@activepieces/piece-ibm-cognose 0.1.4 → 0.1.6

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.
Files changed (38) hide show
  1. package/package.json +7 -22
  2. package/src/index.js +14 -105
  3. package/README.md +0 -7
  4. package/src/index.d.ts +0 -12
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/copy-content-object.d.ts +0 -38
  7. package/src/lib/actions/copy-content-object.js +0 -69
  8. package/src/lib/actions/copy-content-object.js.map +0 -1
  9. package/src/lib/actions/create-data-source.d.ts +0 -13
  10. package/src/lib/actions/create-data-source.js +0 -100
  11. package/src/lib/actions/create-data-source.js.map +0 -1
  12. package/src/lib/actions/delete-data-source.d.ts +0 -13
  13. package/src/lib/actions/delete-data-source.js +0 -46
  14. package/src/lib/actions/delete-data-source.js.map +0 -1
  15. package/src/lib/actions/get-content-object.d.ts +0 -14
  16. package/src/lib/actions/get-content-object.js +0 -53
  17. package/src/lib/actions/get-content-object.js.map +0 -1
  18. package/src/lib/actions/get-data-source.d.ts +0 -14
  19. package/src/lib/actions/get-data-source.js +0 -53
  20. package/src/lib/actions/get-data-source.js.map +0 -1
  21. package/src/lib/actions/move-content-object.d.ts +0 -37
  22. package/src/lib/actions/move-content-object.js +0 -61
  23. package/src/lib/actions/move-content-object.js.map +0 -1
  24. package/src/lib/actions/update-content-object.d.ts +0 -17
  25. package/src/lib/actions/update-content-object.js +0 -79
  26. package/src/lib/actions/update-content-object.js.map +0 -1
  27. package/src/lib/actions/update-data-source.d.ts +0 -16
  28. package/src/lib/actions/update-data-source.js +0 -77
  29. package/src/lib/actions/update-data-source.js.map +0 -1
  30. package/src/lib/common/cognos-client.d.ts +0 -14
  31. package/src/lib/common/cognos-client.js +0 -71
  32. package/src/lib/common/cognos-client.js.map +0 -1
  33. package/src/lib/common/content-object-dropdown.d.ts +0 -6
  34. package/src/lib/common/content-object-dropdown.js +0 -61
  35. package/src/lib/common/content-object-dropdown.js.map +0 -1
  36. package/src/lib/common/data-source-dropdown.d.ts +0 -6
  37. package/src/lib/common/data-source-dropdown.js +0 -61
  38. package/src/lib/common/data-source-dropdown.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"copy-content-object.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/actions/copy-content-object.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,uCAA6C;AAC7C,2DAAuD;AACvD,+EAA0E;AAE7D,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,sBAAc;IACpB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,oDAAoD;IACjE,KAAK,EAAE;QACL,QAAQ,EAAE,+CAAqB;QAC/B,aAAa,kCACR,+CAAqB,KACxB,WAAW,EAAE,uBAAuB,EACpC,WAAW,EAAE,uDAAuD,GACrE;QACD,SAAS,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC3B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,IAAI;SACnB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;YAE1D,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACtE,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE5C,MAAM,WAAW,GAAG;oBAClB,SAAS,EAAE,QAAQ;oBACnB,cAAc,EAAE,aAAa;oBAC7B,SAAS,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,C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e,EAAE,CAC7F,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const createDataSourceAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
- }>, {
7
- defaultName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- connectionString: import("@activepieces/pieces-framework").LongTextProperty<true>;
9
- driverName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- password: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
- signonDefaultName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- }>;
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDataSourceAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const index_1 = require("../../index");
8
- const cognos_client_1 = require("../common/cognos-client");
9
- exports.createDataSourceAction = (0, pieces_framework_1.createAction)({
10
- auth: index_1.ibmCognoseAuth,
11
- name: 'create_data_source',
12
- displayName: 'Create Data Source',
13
- description: 'Create a new data source',
14
- props: {
15
- defaultName: pieces_framework_1.Property.ShortText({
16
- displayName: 'Data Source Name',
17
- description: 'Name for the new data source',
18
- required: true,
19
- }),
20
- connectionString: pieces_framework_1.Property.LongText({
21
- displayName: 'Connection String',
22
- description: 'JDBC URL or database connection string',
23
- required: true,
24
- defaultValue: 'jdbc:db2://localhost:50000/SAMPLE',
25
- }),
26
- driverName: pieces_framework_1.Property.ShortText({
27
- displayName: 'Driver Name',
28
- description: 'Database driver class name',
29
- required: false,
30
- defaultValue: 'com.ibm.db2.jcc.DB2Driver',
31
- }),
32
- username: pieces_framework_1.Property.ShortText({
33
- displayName: 'Database Username',
34
- description: 'Username for database connection',
35
- required: false,
36
- }),
37
- password: pieces_framework_1.Property.ShortText({
38
- displayName: 'Database Password',
39
- description: 'Password for database connection',
40
- required: false,
41
- }),
42
- signonDefaultName: pieces_framework_1.Property.ShortText({
43
- displayName: 'Signon Name',
44
- description: 'Name for the database credentials',
45
- required: false,
46
- }),
47
- },
48
- run(_a) {
49
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
50
- const { defaultName, connectionString, driverName, username, password, signonDefaultName } = propsValue;
51
- try {
52
- const client = new cognos_client_1.CognosClient(auth.props);
53
- const dataSourceDefinition = {
54
- defaultName,
55
- connections: [
56
- {
57
- connectionString,
58
- defaultName: defaultName + '_connection',
59
- }
60
- ]
61
- };
62
- if (driverName) {
63
- dataSourceDefinition.connections[0].connectionString += `;DRIVER_NAME=${driverName}`;
64
- }
65
- if (username && password) {
66
- dataSourceDefinition.connections[0].signons = [
67
- {
68
- defaultName: signonDefaultName || defaultName + '_signon',
69
- credentialsEx: {
70
- username,
71
- password
72
- }
73
- }
74
- ];
75
- }
76
- const response = yield client.makeAuthenticatedRequest('/dataSources', pieces_common_1.HttpMethod.POST, dataSourceDefinition);
77
- if (response.status === 201) {
78
- return {
79
- success: true,
80
- message: `Data source '${defaultName}' created successfully`,
81
- dataSource: response.body,
82
- };
83
- }
84
- else if (response.status === 400) {
85
- throw new Error(`Data source '${defaultName}' already exists or invalid parameters`);
86
- }
87
- else if (response.status === 401) {
88
- throw new Error('Authentication failed. Check your credentials.');
89
- }
90
- else {
91
- throw new Error(`Failed to create data source: ${response.status} ${response.body}`);
92
- }
93
- }
94
- catch (error) {
95
- throw new Error(`Failed to create data source: ${error instanceof Error ? error.message : 'Unknown error'}`);
96
- }
97
- });
98
- },
99
- });
100
- //# sourceMappingURL=create-data-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-data-source.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/actions/create-data-source.ts"],"names":[],"mappings":";;;;AAAA,qEAAmF;AACnF,+DAAyD;AACzD,uCAA6C;AAC7C,2DAAuD;AAE1C,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,sBAAc;IACpB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,0BAA0B;IACvC,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,gBAAgB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAClC,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,mCAAmC;SAClD,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,4BAA4B;YACzC,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,2BAA2B;SAC1C,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,iBAAiB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACpC,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH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BACvF,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACpE,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,iCAAiC,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;gBACvF,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CACb,iCAAiC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC5F,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const deleteDataSourceAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
- }>, {
7
- datasourceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- }>>;
13
- }>;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteDataSourceAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const index_1 = require("../../index");
8
- const cognos_client_1 = require("../common/cognos-client");
9
- const data_source_dropdown_1 = require("../common/data-source-dropdown");
10
- exports.deleteDataSourceAction = (0, pieces_framework_1.createAction)({
11
- auth: index_1.ibmCognoseAuth,
12
- name: 'delete_data_source',
13
- displayName: 'Delete Data Source',
14
- description: 'Delete a data source',
15
- props: {
16
- datasourceId: data_source_dropdown_1.dataSourceDropdown,
17
- },
18
- run(_a) {
19
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
20
- const { datasourceId } = propsValue;
21
- try {
22
- const client = new cognos_client_1.CognosClient(auth.props);
23
- const response = yield client.makeAuthenticatedRequest(`/dataSources/${datasourceId}`, pieces_common_1.HttpMethod.DELETE);
24
- if (response.status === 204) {
25
- return {
26
- success: true,
27
- message: `Data source deleted successfully`,
28
- };
29
- }
30
- else if (response.status === 401) {
31
- throw new Error('Authentication failed. Check your credentials.');
32
- }
33
- else if (response.status === 404) {
34
- throw new Error(`Data source not found`);
35
- }
36
- else {
37
- throw new Error(`Failed to delete: ${response.status} ${response.body}`);
38
- }
39
- }
40
- catch (error) {
41
- throw new Error(`Failed to delete data source: ${error instanceof Error ? error.message : 'Unknown error'}`);
42
- }
43
- });
44
- },
45
- });
46
- //# sourceMappingURL=delete-data-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-data-source.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/actions/delete-data-source.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,uCAA6C;AAC7C,2DAAuD;AACvD,yEAAoE;AAEvD,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,sBAAc;IACpB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE;QACL,YAAY,EAAE,yCAAkB;KACjC;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC;YAEpC,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE5C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CACpD,gBAAgB,YAAY,EAAE,EAC9B,0BAAU,CAAC,MAAM,CAClB,CAAC;gBAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBAC5B,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,kCAAkC;qBAC5C,CAAC;gBACJ,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACpE,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBAC3C,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC3E,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CACb,iCAAiC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC5F,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const getContentObjectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
- }>, {
7
- objectId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- }>>;
13
- fields: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- }>;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getContentObjectAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const index_1 = require("../../index");
8
- const cognos_client_1 = require("../common/cognos-client");
9
- const content_object_dropdown_1 = require("../common/content-object-dropdown");
10
- exports.getContentObjectAction = (0, pieces_framework_1.createAction)({
11
- auth: index_1.ibmCognoseAuth,
12
- name: 'get_content_object',
13
- displayName: 'Get Content Object',
14
- description: 'Get content object details',
15
- props: {
16
- objectId: content_object_dropdown_1.contentObjectDropdown,
17
- fields: pieces_framework_1.Property.ShortText({
18
- displayName: 'Extra Fields',
19
- description: 'Comma-separated list of extra fields (e.g., owner,permissions,children)',
20
- required: false,
21
- }),
22
- },
23
- run(_a) {
24
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
25
- const { objectId, fields } = propsValue;
26
- try {
27
- const client = new cognos_client_1.CognosClient(auth.props);
28
- const queryParams = [];
29
- if (fields && fields.trim()) {
30
- queryParams.push(`fields=${encodeURIComponent(fields.trim())}`);
31
- }
32
- const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
33
- const response = yield client.makeAuthenticatedRequest(`/content/${objectId}${queryString}`, pieces_common_1.HttpMethod.GET);
34
- if (response.status === 200) {
35
- return response.body;
36
- }
37
- else if (response.status === 401) {
38
- throw new Error('Authentication failed. Check your credentials.');
39
- }
40
- else if (response.status === 404) {
41
- throw new Error(`Content object not found`);
42
- }
43
- else {
44
- throw new Error(`Failed to retrieve: ${response.status} ${response.body}`);
45
- }
46
- }
47
- catch (error) {
48
- throw new Error(`Failed to retrieve content object: ${error instanceof Error ? error.message : 'Unknown error'}`);
49
- }
50
- });
51
- },
52
- });
53
- //# sourceMappingURL=get-content-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-content-object.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/actions/get-content-object.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,uCAA6C;AAC7C,2DAAuD;AACvD,+EAA0E;AAE7D,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,sBAAc;IACpB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,4BAA4B;IACzC,KAAK,EAAE;QACL,QAAQ,EAAE,+CAAqB;QAC/B,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,yEAAyE;YACtF,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;YAExC,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE5C,MAAM,WAAW,GAAG,EAAE,CAAC;gBACvB,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;oBAC5B,WAAW,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;gBAClE,CAAC;gBAED,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAE9E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CACpD,YAAY,QAAQ,GAAG,WAAW,EAAE,EACpC,0BAAU,CAAC,GAAG,CACf,CAAC;gBAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC;gBACvB,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACpE,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC9C,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC7E,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CACb,sCAAsC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CACjG,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const getDataSourceAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
- }>, {
7
- datasourceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- }>>;
13
- fields: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- }>;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDataSourceAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const index_1 = require("../../index");
8
- const cognos_client_1 = require("../common/cognos-client");
9
- const data_source_dropdown_1 = require("../common/data-source-dropdown");
10
- exports.getDataSourceAction = (0, pieces_framework_1.createAction)({
11
- auth: index_1.ibmCognoseAuth,
12
- name: 'get_data_source',
13
- displayName: 'Get Data Source',
14
- description: 'Retrieve data source details',
15
- props: {
16
- datasourceId: data_source_dropdown_1.dataSourceDropdown,
17
- fields: pieces_framework_1.Property.ShortText({
18
- displayName: 'Extra Fields',
19
- description: 'Comma-separated list of extra fields (e.g., connections,signons)',
20
- required: false,
21
- }),
22
- },
23
- run(_a) {
24
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
25
- const { datasourceId, fields } = propsValue;
26
- try {
27
- const client = new cognos_client_1.CognosClient(auth.props);
28
- const queryParams = [];
29
- if (fields && fields.trim()) {
30
- queryParams.push(`fields=${encodeURIComponent(fields.trim())}`);
31
- }
32
- const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
33
- const response = yield client.makeAuthenticatedRequest(`/dataSources/${datasourceId}${queryString}`, pieces_common_1.HttpMethod.GET);
34
- if (response.status === 200) {
35
- return response.body;
36
- }
37
- else if (response.status === 401) {
38
- throw new Error('Authentication failed. Check your credentials.');
39
- }
40
- else if (response.status === 404) {
41
- throw new Error(`Data source not found`);
42
- }
43
- else {
44
- throw new Error(`Failed to retrieve: ${response.status} ${response.body}`);
45
- }
46
- }
47
- catch (error) {
48
- throw new Error(`Failed to retrieve data source: ${error instanceof Error ? error.message : 'Unknown error'}`);
49
- }
50
- });
51
- },
52
- });
53
- //# sourceMappingURL=get-data-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-data-source.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/actions/get-data-source.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,uCAA6C;AAC7C,2DAAuD;AACvD,yEAAoE;AAEvD,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,sBAAc;IACpB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE;QACL,YAAY,EAAE,yCAAkB;QAChC,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,kEAAkE;YAC/E,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;YAE5C,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE5C,MAAM,WAAW,GAAG,EAAE,CAAC;gBACvB,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;oBAC5B,WAAW,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;gBAClE,CAAC;gBAED,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAE9E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CACpD,gBAAgB,YAAY,GAAG,WAAW,EAAE,EAC5C,0BAAU,CAAC,GAAG,CACf,CAAC;gBAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC;gBACvB,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACpE,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;gBAC3C,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC7E,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CACb,mCAAmC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC9F,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,37 +0,0 @@
1
- export declare const moveContentObjectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
- }>, {
7
- sourceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- }>>;
13
- destinationId: {
14
- displayName: string;
15
- description: string;
16
- auth: import("@activepieces/pieces-framework").CustomAuthProperty<{
17
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
18
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
19
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
20
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
21
- }>;
22
- refreshers: string[];
23
- refreshOnSearch?: boolean;
24
- options: (propsValue: Record<string, unknown> & {
25
- auth?: import("dist/packages/shared/src").CustomAuthConnectionValue<import("@activepieces/pieces-framework").StaticPropsValue<{
26
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
27
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
28
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
29
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
30
- }>> | undefined;
31
- }, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").DropdownState<unknown>>;
32
- valueSchema: unknown;
33
- type: import("@activepieces/pieces-framework").PropertyType.DROPDOWN;
34
- required: true;
35
- defaultValue?: unknown;
36
- };
37
- }>;
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.moveContentObjectAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const index_1 = require("../../index");
8
- const cognos_client_1 = require("../common/cognos-client");
9
- const content_object_dropdown_1 = require("../common/content-object-dropdown");
10
- exports.moveContentObjectAction = (0, pieces_framework_1.createAction)({
11
- auth: index_1.ibmCognoseAuth,
12
- name: 'move_content_object',
13
- displayName: 'Move Content Object',
14
- description: 'Move an object with all its descendants',
15
- props: {
16
- sourceId: content_object_dropdown_1.contentObjectDropdown,
17
- destinationId: Object.assign(Object.assign({}, content_object_dropdown_1.contentObjectDropdown), { displayName: 'Destination Container', description: 'Destination container where the object will be moved' }),
18
- },
19
- run(_a) {
20
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
21
- var _b;
22
- const { sourceId, destinationId } = propsValue;
23
- if (sourceId === destinationId) {
24
- throw new Error('Source and destination cannot be the same object');
25
- }
26
- try {
27
- const client = new cognos_client_1.CognosClient(auth.props);
28
- const moveRequest = {
29
- source_id: sourceId,
30
- destination_id: destinationId,
31
- };
32
- const response = yield client.makeAuthenticatedRequest('/content/move', pieces_common_1.HttpMethod.PUT, moveRequest);
33
- if (response.status === 204) {
34
- return {
35
- success: true,
36
- message: `Content object moved successfully`,
37
- };
38
- }
39
- else if (response.status === 400) {
40
- throw new Error(`Bad request: ${((_b = response.body) === null || _b === void 0 ? void 0 : _b.message) || 'Invalid move operation'}`);
41
- }
42
- else if (response.status === 401) {
43
- throw new Error('Authentication failed. Check your credentials.');
44
- }
45
- else if (response.status === 403) {
46
- throw new Error('Permission denied. Insufficient permissions to move this object.');
47
- }
48
- else if (response.status === 404) {
49
- throw new Error('Object or parent object not found.');
50
- }
51
- else {
52
- throw new Error(`Failed to move: ${response.status} ${response.body}`);
53
- }
54
- }
55
- catch (error) {
56
- throw new Error(`Failed to move content object: ${error instanceof Error ? error.message : 'Unknown error'}`);
57
- }
58
- });
59
- },
60
- });
61
- //# sourceMappingURL=move-content-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"move-content-object.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/actions/move-content-object.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,uCAA6C;AAC7C,2DAAuD;AACvD,+EAA0E;AAE7D,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,sBAAc;IACpB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,yCAAyC;IACtD,KAAK,EAAE;QACL,QAAQ,EAAE,+CAAqB;QAC/B,aAAa,kCACR,+CAAqB,KACxB,WAAW,EAAE,uBAAuB,EACpC,WAAW,EAAE,sDAAsD,GACpE;KACF;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;;YAC5B,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC;YAE/C,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;YACtE,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAE5C,MAAM,WAAW,GAAG;oBAClB,SAAS,EAAE,QAAQ;oBACnB,cAAc,EAAE,aAAa;iBAC9B,CAAC;gBAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CACpD,eAAe,EACf,0BAAU,CAAC,GAAG,EACd,WAAW,CACZ,CAAC;gBAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBAC5B,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,mCAAmC;qBAC7C,CAAC;gBACJ,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,OAAO,KAAI,wBAAwB,EAAE,CAAC,CAAC;gBACxF,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACpE,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;gBACtF,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;gBACxD,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;gBACzE,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CACb,kCAAkC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC7F,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- export declare const updateContentObjectAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
- }>, {
7
- objectId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- }>>;
13
- type: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
- defaultName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
- defaultDescriptions: import("@activepieces/pieces-framework").LongTextProperty<false>;
16
- version: import("@activepieces/pieces-framework").NumberProperty<false>;
17
- }>;
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateContentObjectAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const index_1 = require("../../index");
8
- const cognos_client_1 = require("../common/cognos-client");
9
- const content_object_dropdown_1 = require("../common/content-object-dropdown");
10
- exports.updateContentObjectAction = (0, pieces_framework_1.createAction)({
11
- auth: index_1.ibmCognoseAuth,
12
- name: 'update_content_object',
13
- displayName: 'Update Content Object',
14
- description: 'Update an existing content object',
15
- props: {
16
- objectId: content_object_dropdown_1.contentObjectDropdown,
17
- type: pieces_framework_1.Property.ShortText({
18
- displayName: 'Type',
19
- description: 'Object type (e.g., report, dashboard, folder)',
20
- required: true,
21
- }),
22
- defaultName: pieces_framework_1.Property.ShortText({
23
- displayName: 'Name',
24
- description: 'New name for the object',
25
- required: false,
26
- }),
27
- defaultDescriptions: pieces_framework_1.Property.LongText({
28
- displayName: 'Description',
29
- description: 'New description for the object',
30
- required: false,
31
- }),
32
- version: pieces_framework_1.Property.Number({
33
- displayName: 'Version',
34
- description: 'Current version for optimistic concurrency',
35
- required: false,
36
- }),
37
- },
38
- run(_a) {
39
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
40
- const { objectId, defaultName, defaultDescriptions, type, version } = propsValue;
41
- try {
42
- const client = new cognos_client_1.CognosClient(auth.props);
43
- const updateDefinition = { type };
44
- if (defaultName) {
45
- updateDefinition.defaultName = defaultName;
46
- }
47
- if (defaultDescriptions) {
48
- updateDefinition.defaultDescriptions = defaultDescriptions;
49
- }
50
- if (version !== undefined && version !== null) {
51
- updateDefinition.version = version;
52
- }
53
- const response = yield client.makeAuthenticatedRequest(`/content/${objectId}`, pieces_common_1.HttpMethod.PUT, updateDefinition);
54
- if (response.status === 204 || response.status === 200) {
55
- return {
56
- success: true,
57
- message: `Content object updated successfully`,
58
- };
59
- }
60
- else if (response.status === 401) {
61
- throw new Error('Authentication failed. Check your credentials.');
62
- }
63
- else if (response.status === 404) {
64
- throw new Error(`Content object not found`);
65
- }
66
- else if (response.status === 409) {
67
- throw new Error('Object has changed since you fetched it. Refresh and try again.');
68
- }
69
- else {
70
- throw new Error(`Failed to update: ${response.status} ${response.body}`);
71
- }
72
- }
73
- catch (error) {
74
- throw new Error(`Failed to update content object: ${error instanceof Error ? error.message : 'Unknown error'}`);
75
- }
76
- });
77
- },
78
- });
79
- //# sourceMappingURL=update-content-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-content-object.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/actions/update-content-object.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,uCAA6C;AAC7C,2DAAuD;AACvD,+EAA0E;AAE7D,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,sBAAc;IACpB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,mCAAmC;IAChD,KAAK,EAAE;QACL,QAAQ,EAAE,+CAAqB;QAC/B,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,yBAAyB;YACt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qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACpE,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC9C,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;gBACrF,CAAC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CAAC,qBAAqB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC3E,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CACb,oCAAoC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC/F,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- export declare const updateDataSourceAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
6
- }>, {
7
- datasourceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- baseurl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- CAMNamespace: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- username: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- password: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- }>>;
13
- defaultName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- disabled: import("@activepieces/pieces-framework").CheckboxProperty<false>;
15
- hidden: import("@activepieces/pieces-framework").CheckboxProperty<false>;
16
- }>;