@activepieces/piece-ibm-cognose 0.0.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.
Files changed (38) hide show
  1. package/README.md +7 -0
  2. package/package.json +32 -0
  3. package/src/index.d.ts +12 -0
  4. package/src/index.js +110 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/copy-content-object.d.ts +20 -0
  7. package/src/lib/actions/copy-content-object.js +69 -0
  8. package/src/lib/actions/copy-content-object.js.map +1 -0
  9. package/src/lib/actions/create-data-source.d.ts +13 -0
  10. package/src/lib/actions/create-data-source.js +100 -0
  11. package/src/lib/actions/create-data-source.js.map +1 -0
  12. package/src/lib/actions/delete-data-source.d.ts +8 -0
  13. package/src/lib/actions/delete-data-source.js +46 -0
  14. package/src/lib/actions/delete-data-source.js.map +1 -0
  15. package/src/lib/actions/get-content-object.d.ts +9 -0
  16. package/src/lib/actions/get-content-object.js +53 -0
  17. package/src/lib/actions/get-content-object.js.map +1 -0
  18. package/src/lib/actions/get-data-source.d.ts +9 -0
  19. package/src/lib/actions/get-data-source.js +53 -0
  20. package/src/lib/actions/get-data-source.js.map +1 -0
  21. package/src/lib/actions/move-content-object.d.ts +19 -0
  22. package/src/lib/actions/move-content-object.js +61 -0
  23. package/src/lib/actions/move-content-object.js.map +1 -0
  24. package/src/lib/actions/update-content-object.d.ts +12 -0
  25. package/src/lib/actions/update-content-object.js +79 -0
  26. package/src/lib/actions/update-content-object.js.map +1 -0
  27. package/src/lib/actions/update-data-source.d.ts +11 -0
  28. package/src/lib/actions/update-data-source.js +77 -0
  29. package/src/lib/actions/update-data-source.js.map +1 -0
  30. package/src/lib/common/cognos-client.d.ts +14 -0
  31. package/src/lib/common/cognos-client.js +71 -0
  32. package/src/lib/common/cognos-client.js.map +1 -0
  33. package/src/lib/common/content-object-dropdown.d.ts +1 -0
  34. package/src/lib/common/content-object-dropdown.js +59 -0
  35. package/src/lib/common/content-object-dropdown.js.map +1 -0
  36. package/src/lib/common/data-source-dropdown.d.ts +1 -0
  37. package/src/lib/common/data-source-dropdown.js +59 -0
  38. package/src/lib/common/data-source-dropdown.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # pieces-ibm-cognose
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running lint
6
+
7
+ Run `nx lint pieces-ibm-cognose` to execute the lint via [ESLint](https://eslint.org/).
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@activepieces/piece-ibm-cognose",
3
+ "version": "0.0.1",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@sinclair/typebox": "0.34.11",
9
+ "axios": "1.8.3",
10
+ "axios-retry": "4.4.1",
11
+ "deepmerge-ts": "7.1.0",
12
+ "mime-types": "2.1.35",
13
+ "nanoid": "3.3.8",
14
+ "semver": "7.6.0",
15
+ "tslib": "^2.3.0",
16
+ "zod": "3.25.76",
17
+ "@activepieces/pieces-common": "0.8.1",
18
+ "@activepieces/pieces-framework": "0.20.1",
19
+ "@activepieces/shared": "0.24.1"
20
+ },
21
+ "overrides": {
22
+ "@tryfabric/martian": {
23
+ "@notionhq/client": "$@notionhq/client"
24
+ },
25
+ "vite": {
26
+ "rollup": "npm:@rollup/wasm-node"
27
+ }
28
+ },
29
+ "resolutions": {
30
+ "rollup": "npm:@rollup/wasm-node"
31
+ }
32
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ export declare const ibmCognoseAuth: 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
+ export declare const ibmCognose: import("@activepieces/pieces-framework").Piece<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
+ }>>;
package/src/index.js ADDED
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ibmCognose = exports.ibmCognoseAuth = 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 shared_1 = require("@activepieces/shared");
8
+ const cognos_client_1 = require("./lib/common/cognos-client");
9
+ const create_data_source_1 = require("./lib/actions/create-data-source");
10
+ const update_data_source_1 = require("./lib/actions/update-data-source");
11
+ const delete_data_source_1 = require("./lib/actions/delete-data-source");
12
+ const get_data_source_1 = require("./lib/actions/get-data-source");
13
+ const update_content_object_1 = require("./lib/actions/update-content-object");
14
+ const get_content_object_1 = require("./lib/actions/get-content-object");
15
+ const move_content_object_1 = require("./lib/actions/move-content-object");
16
+ const copy_content_object_1 = require("./lib/actions/copy-content-object");
17
+ exports.ibmCognoseAuth = pieces_framework_1.PieceAuth.CustomAuth({
18
+ required: true,
19
+ description: `
20
+ ## IBM Cognos Analytics Authentication
21
+
22
+ Enter your Cognos Analytics credentials:
23
+ - **Username**: Your Cognos username
24
+ - **Password**: Your Cognos password
25
+ `,
26
+ props: {
27
+ baseurl: pieces_framework_1.Property.ShortText({
28
+ displayName: 'Base URL',
29
+ description: 'Cognos server URL (e.g., https://your-cognos-server.com)',
30
+ required: true
31
+ }),
32
+ CAMNamespace: pieces_framework_1.Property.ShortText({
33
+ displayName: 'CAM Namespace',
34
+ description: 'CAM namespace for authentication (e.g., LDAP)',
35
+ required: true
36
+ }),
37
+ username: pieces_framework_1.Property.ShortText({
38
+ displayName: 'Username',
39
+ description: 'Cognos username',
40
+ required: true
41
+ }),
42
+ password: pieces_framework_1.PieceAuth.SecretText({
43
+ displayName: 'Password',
44
+ description: 'Cognos password',
45
+ required: true
46
+ })
47
+ },
48
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
49
+ const { username, password, CAMNamespace, baseurl } = auth;
50
+ if (!username || !password || !CAMNamespace || !baseurl) {
51
+ return {
52
+ valid: false,
53
+ error: 'All fields are required'
54
+ };
55
+ }
56
+ try {
57
+ const client = new cognos_client_1.CognosClient(auth);
58
+ yield client.createSession();
59
+ return {
60
+ valid: true
61
+ };
62
+ }
63
+ catch (error) {
64
+ return {
65
+ valid: false,
66
+ error: `Authentication failed: ${error instanceof Error ? error.message : 'Unknown error'}`
67
+ };
68
+ }
69
+ })
70
+ });
71
+ exports.ibmCognose = (0, pieces_framework_1.createPiece)({
72
+ displayName: 'IBM Cognos Analytics',
73
+ description: 'Business intelligence and performance management suite for data analysis and reporting',
74
+ auth: exports.ibmCognoseAuth,
75
+ minimumSupportedRelease: '0.36.1',
76
+ logoUrl: 'https://cdn.activepieces.com/pieces/ibm-cognose.png',
77
+ categories: [shared_1.PieceCategory.BUSINESS_INTELLIGENCE],
78
+ authors: ['fortunamide', 'onyedikachi-david'],
79
+ actions: [
80
+ create_data_source_1.createDataSourceAction,
81
+ get_data_source_1.getDataSourceAction,
82
+ update_data_source_1.updateDataSourceAction,
83
+ delete_data_source_1.deleteDataSourceAction,
84
+ get_content_object_1.getContentObjectAction,
85
+ update_content_object_1.updateContentObjectAction,
86
+ move_content_object_1.moveContentObjectAction,
87
+ copy_content_object_1.copyContentObjectAction,
88
+ (0, pieces_common_1.createCustomApiCallAction)({
89
+ baseUrl: (auth) => `${auth.baseurl}/api/v1`,
90
+ auth: exports.ibmCognoseAuth,
91
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
92
+ try {
93
+ const client = new cognos_client_1.CognosClient(auth);
94
+ yield client.createSession();
95
+ if (client['sessionCookies']) {
96
+ return {
97
+ Cookie: client['sessionCookies']
98
+ };
99
+ }
100
+ return {};
101
+ }
102
+ catch (error) {
103
+ throw new Error(`Failed to authenticate: ${error instanceof Error ? error.message : 'Unknown error'}`);
104
+ }
105
+ })
106
+ })
107
+ ],
108
+ triggers: []
109
+ });
110
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/ibm-cognose/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAIqC;AACrC,iDAAqD;AACrD,8DAA0D;AAC1D,yEAA0E;AAC1E,yEAA0E;AAC1E,yEAA0E;AAC1E,mEAAoE;AACpE,+EAAgF;AAChF,yEAA0E;AAC1E,2EAA4E;AAC5E,2EAA4E;AAE/D,QAAA,cAAc,GAAG,4BAAS,CAAC,UAAU,CAAC;IACjD,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE;;;;;;GAMZ;IACD,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,+CAA+C;YAC5D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC7B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,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,sBAAc;YACpB,WAAW,EAAE,CAAO,IAAS,EAAE,EAAE;gBAC/B,IAAI,CAAC;oBACH,MAAM,MAAM,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,CAAC;oBACtC,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC;oBAE7B,IAAI,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;wBAC7B,OAAO;4BACL,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC;yBACjC,CAAC;oBACJ,CAAC;oBAED,OAAO,EAAE,CAAC;gBACZ,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CACb,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CACtF,CAAC;gBACJ,CAAC;YACH,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const copyContentObjectAction: 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>;
8
+ destinationId: {
9
+ displayName: string;
10
+ description: string;
11
+ refreshers: string[];
12
+ refreshOnSearch?: boolean;
13
+ options: (propsValue: Record<string, unknown>, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").DropdownState<unknown>>;
14
+ valueSchema: unknown;
15
+ type: import("@activepieces/pieces-framework").PropertyType.DROPDOWN;
16
+ required: true;
17
+ defaultValue?: unknown;
18
+ };
19
+ recursive: import("@activepieces/pieces-framework").CheckboxProperty<false>;
20
+ }>;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.copyContentObjectAction = 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.copyContentObjectAction = (0, pieces_framework_1.createAction)({
11
+ auth: index_1.ibmCognoseAuth,
12
+ name: 'copy_content_object',
13
+ displayName: 'Copy Content Object',
14
+ description: 'Copy an object optionally 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 copied' }),
18
+ recursive: pieces_framework_1.Property.Checkbox({
19
+ displayName: 'Recursive Copy',
20
+ description: 'Copy all descendants (child objects)',
21
+ required: false,
22
+ defaultValue: true,
23
+ }),
24
+ },
25
+ run(_a) {
26
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
27
+ var _b;
28
+ const { sourceId, destinationId, recursive } = propsValue;
29
+ if (sourceId === destinationId) {
30
+ throw new Error('Source and destination cannot be the same object');
31
+ }
32
+ try {
33
+ const client = new cognos_client_1.CognosClient(auth);
34
+ const copyRequest = {
35
+ source_id: sourceId,
36
+ destination_id: destinationId,
37
+ recursive: recursive !== undefined ? recursive : true,
38
+ };
39
+ const response = yield client.makeAuthenticatedRequest('/content/copy', pieces_common_1.HttpMethod.POST, copyRequest);
40
+ if (response.status === 201) {
41
+ return {
42
+ success: true,
43
+ message: `Content object copied successfully${recursive ? ' (including descendants)' : ''}`,
44
+ copiedObject: response.body,
45
+ };
46
+ }
47
+ else if (response.status === 400) {
48
+ throw new Error(`Bad request: ${((_b = response.body) === null || _b === void 0 ? void 0 : _b.message) || 'Invalid copy operation'}`);
49
+ }
50
+ else if (response.status === 401) {
51
+ throw new Error('Authentication failed. Check your credentials.');
52
+ }
53
+ else if (response.status === 403) {
54
+ throw new Error('Permission denied. Insufficient permissions to copy this object.');
55
+ }
56
+ else if (response.status === 404) {
57
+ throw new Error('Object or parent object not found.');
58
+ }
59
+ else {
60
+ throw new Error(`Failed to copy: ${response.status} ${response.body}`);
61
+ }
62
+ }
63
+ catch (error) {
64
+ throw new Error(`Failed to copy content object: ${error instanceof Error ? error.message : 'Unknown error'}`);
65
+ }
66
+ });
67
+ },
68
+ });
69
+ //# sourceMappingURL=copy-content-object.js.map
@@ -0,0 +1 @@
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,EAA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BACxD,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"}
@@ -0,0 +1,13 @@
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
+ }>;
@@ -0,0 +1,100 @@
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);
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
@@ -0,0 +1 @@
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,2BAA2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AM,MAAM,CAAC,wBAAwB,CAAC,cAAc,EAAE,0BAAU,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;gBAE9G,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBAC5B,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,gBAAgB,WAAW,wBAAwB;wBAC5D,UAAU,EAAE,QAAQ,CAAC,IAAI;qBAC1B,CAAC;gBACJ,CAAC;qBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CAAC,gBAAgB,WAAW,wCAAwC,CAAC,CAAC;gBACvF,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"}
@@ -0,0 +1,8 @@
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>;
8
+ }>;
@@ -0,0 +1,46 @@
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);
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
@@ -0,0 +1 @@
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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;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
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>;
8
+ fields: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ }>;
@@ -0,0 +1,53 @@
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);
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
@@ -0,0 +1 @@
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,CAAC;gBAEtC,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"}
@@ -0,0 +1,9 @@
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>;
8
+ fields: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ }>;
@@ -0,0 +1,53 @@
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);
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
@@ -0,0 +1 @@
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,CAAC;gBAEtC,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"}
@@ -0,0 +1,19 @@
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>;
8
+ destinationId: {
9
+ displayName: string;
10
+ description: string;
11
+ refreshers: string[];
12
+ refreshOnSearch?: boolean;
13
+ options: (propsValue: Record<string, unknown>, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").DropdownState<unknown>>;
14
+ valueSchema: unknown;
15
+ type: import("@activepieces/pieces-framework").PropertyType.DROPDOWN;
16
+ required: true;
17
+ defaultValue?: unknown;
18
+ };
19
+ }>;
@@ -0,0 +1,61 @@
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);
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
@@ -0,0 +1 @@
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,CAA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AY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAC7F,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
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>;
8
+ type: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ defaultName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ defaultDescriptions: import("@activepieces/pieces-framework").LongTextProperty<false>;
11
+ version: import("@activepieces/pieces-framework").NumberProperty<false>;
12
+ }>;
@@ -0,0 +1,79 @@
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);
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
@@ -0,0 +1 @@
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;AAC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: 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>;
8
+ defaultName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ disabled: import("@activepieces/pieces-framework").CheckboxProperty<false>;
10
+ hidden: import("@activepieces/pieces-framework").CheckboxProperty<false>;
11
+ }>;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateDataSourceAction = 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.updateDataSourceAction = (0, pieces_framework_1.createAction)({
11
+ auth: index_1.ibmCognoseAuth,
12
+ name: 'update_data_source',
13
+ displayName: 'Update Data Source',
14
+ description: 'Update an existing data source',
15
+ props: {
16
+ datasourceId: data_source_dropdown_1.dataSourceDropdown,
17
+ defaultName: pieces_framework_1.Property.ShortText({
18
+ displayName: 'Data Source Name',
19
+ description: 'New name for the data source',
20
+ required: false,
21
+ }),
22
+ disabled: pieces_framework_1.Property.Checkbox({
23
+ displayName: 'Disabled',
24
+ description: 'Disable the data source',
25
+ required: false,
26
+ defaultValue: false,
27
+ }),
28
+ hidden: pieces_framework_1.Property.Checkbox({
29
+ displayName: 'Hidden',
30
+ description: 'Hide the data source',
31
+ required: false,
32
+ defaultValue: false,
33
+ }),
34
+ },
35
+ run(_a) {
36
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
37
+ const { datasourceId, defaultName, disabled, hidden } = propsValue;
38
+ try {
39
+ const client = new cognos_client_1.CognosClient(auth);
40
+ const updateDefinition = {};
41
+ if (defaultName) {
42
+ updateDefinition.defaultName = defaultName;
43
+ }
44
+ if (disabled !== undefined) {
45
+ updateDefinition.disabled = disabled;
46
+ }
47
+ if (hidden !== undefined) {
48
+ updateDefinition.hidden = hidden;
49
+ }
50
+ if (Object.keys(updateDefinition).length === 0) {
51
+ throw new Error('At least one field must be provided to update');
52
+ }
53
+ const response = yield client.makeAuthenticatedRequest(`/dataSources/${datasourceId}`, pieces_common_1.HttpMethod.PUT, updateDefinition);
54
+ if (response.status === 204 || response.status === 200) {
55
+ return {
56
+ success: true,
57
+ message: `Data source updated successfully`,
58
+ updatedFields: updateDefinition,
59
+ };
60
+ }
61
+ else if (response.status === 401) {
62
+ throw new Error('Authentication failed. Check your credentials.');
63
+ }
64
+ else if (response.status === 404) {
65
+ throw new Error(`Data source not found`);
66
+ }
67
+ else {
68
+ throw new Error(`Failed to update: ${response.status} ${response.body}`);
69
+ }
70
+ }
71
+ catch (error) {
72
+ throw new Error(`Failed to update data source: ${error instanceof Error ? error.message : 'Unknown error'}`);
73
+ }
74
+ });
75
+ },
76
+ });
77
+ //# sourceMappingURL=update-data-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-data-source.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/actions/update-data-source.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+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,gCAAgC;IAC7C,KAAK,EAAE;QACL,YAAY,EAAE,yCAAkB;QAChC,W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EAAE,EAC9B,0BAAU,CAAC,GAAG,EACd,gBAAgB,CACjB,CAAC;gBAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;oBACvD,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,kCAAkC;wBAC3C,aAAa,EAAE,gBAAgB;qBAChC,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"}
@@ -0,0 +1,14 @@
1
+ import { HttpMethod } from '@activepieces/pieces-common';
2
+ export interface CognosAuth {
3
+ baseurl: string;
4
+ CAMNamespace: string;
5
+ username: string;
6
+ password: string;
7
+ }
8
+ export declare class CognosClient {
9
+ private auth;
10
+ private sessionCookies?;
11
+ constructor(auth: CognosAuth);
12
+ createSession(): Promise<string>;
13
+ makeAuthenticatedRequest(endpoint: string, method?: HttpMethod, body?: any): Promise<import("@activepieces/pieces-common").HttpResponse<any>>;
14
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CognosClient = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ class CognosClient {
7
+ constructor(auth) {
8
+ this.auth = auth;
9
+ }
10
+ createSession() {
11
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
+ var _a;
13
+ const parameters = [
14
+ { name: 'CAMNamespace', value: this.auth.CAMNamespace },
15
+ { name: 'CAMUsername', value: this.auth.username },
16
+ { name: 'CAMPassword', value: this.auth.password },
17
+ ];
18
+ try {
19
+ const response = yield pieces_common_1.httpClient.sendRequest({
20
+ method: pieces_common_1.HttpMethod.PUT,
21
+ url: `${this.auth.baseurl}/api/v1/session`,
22
+ headers: {
23
+ 'Content-Type': 'application/json',
24
+ },
25
+ body: {
26
+ parameters,
27
+ },
28
+ });
29
+ if (response.status >= 200 && response.status < 300) {
30
+ const cookies = (_a = response.headers) === null || _a === void 0 ? void 0 : _a['set-cookie'];
31
+ this.sessionCookies = cookies
32
+ ? Array.isArray(cookies)
33
+ ? cookies.join('; ')
34
+ : cookies
35
+ : '';
36
+ return this.sessionCookies;
37
+ }
38
+ else {
39
+ throw new Error(`Authentication failed: ${response.status} ${response.body}`);
40
+ }
41
+ }
42
+ catch (error) {
43
+ throw new Error(`Failed to create session: ${error instanceof Error ? error.message : 'Unknown error'}`);
44
+ }
45
+ });
46
+ }
47
+ makeAuthenticatedRequest(endpoint_1) {
48
+ return tslib_1.__awaiter(this, arguments, void 0, function* (endpoint, method = pieces_common_1.HttpMethod.GET, body) {
49
+ try {
50
+ if (!this.sessionCookies) {
51
+ yield this.createSession();
52
+ }
53
+ const response = yield pieces_common_1.httpClient.sendRequest({
54
+ method,
55
+ url: `${this.auth.baseurl}/api/v1${endpoint}`,
56
+ headers: {
57
+ 'Content-Type': 'application/json',
58
+ Cookie: this.sessionCookies || '',
59
+ },
60
+ body,
61
+ });
62
+ return response;
63
+ }
64
+ catch (error) {
65
+ throw new Error(`Request failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
66
+ }
67
+ });
68
+ }
69
+ }
70
+ exports.CognosClient = CognosClient;
71
+ //# sourceMappingURL=cognos-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cognos-client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/common/cognos-client.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AASrE,MAAa,YAAY;IAIvB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEK,aAAa;;;YACjB,MAAM,UAAU,GAAG;gBACjB,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;gBACvD,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClD,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;aACnD,CAAC;YAEF,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;oBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,iBAAiB;oBAC1C,OAAO,EAAE;wBACP,cAAc,EAAE,kBAAkB;qBACnC;oBACD,IAAI,EAAE;wBACJ,UAAU;qBACX;iBACF,CAAC,CAAC;gBAEH,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;oBACpD,MAAM,OAAO,GAAG,MAAA,QAAQ,CAAC,OAAO,0CAAG,YAAY,CAAC,CAAC;oBACjD,IAAI,CAAC,cAAc,GAAG,OAAO;wBAC3B,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;4BACtB,CAAC,CAAC,OAAO,CAA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: import("@activepieces/pieces-framework").DropdownProperty<unknown, true>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contentObjectDropdown = 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 cognos_client_1 = require("./cognos-client");
8
+ exports.contentObjectDropdown = pieces_framework_1.Property.Dropdown({
9
+ displayName: 'Content Object',
10
+ description: 'Select a content object',
11
+ required: true,
12
+ refreshers: [],
13
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
14
+ if (!auth) {
15
+ return {
16
+ disabled: true,
17
+ options: [],
18
+ placeholder: 'Connect your account first'
19
+ };
20
+ }
21
+ try {
22
+ const client = new cognos_client_1.CognosClient(auth);
23
+ const response = yield client.makeAuthenticatedRequest('/content', pieces_common_1.HttpMethod.GET);
24
+ if (response.status === 200) {
25
+ const data = response.body;
26
+ const contentObjects = data.content || [];
27
+ if (contentObjects.length === 0) {
28
+ return {
29
+ disabled: true,
30
+ options: [],
31
+ placeholder: 'No content objects found'
32
+ };
33
+ }
34
+ return {
35
+ disabled: false,
36
+ options: contentObjects.map((obj) => ({
37
+ label: `${obj.defaultName || 'Unnamed'} (${obj.type || 'Unknown'})`,
38
+ value: obj.id
39
+ }))
40
+ };
41
+ }
42
+ else {
43
+ return {
44
+ disabled: true,
45
+ options: [],
46
+ placeholder: 'Failed to load content objects'
47
+ };
48
+ }
49
+ }
50
+ catch (error) {
51
+ return {
52
+ disabled: true,
53
+ options: [],
54
+ placeholder: 'Error loading content objects'
55
+ };
56
+ }
57
+ })
58
+ });
59
+ //# sourceMappingURL=content-object-dropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-object-dropdown.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/common/content-object-dropdown.ts"],"names":[],"mappings":";;;;AAA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gBACN,OAAO;oBACL,QAAQ,EAAE,IAAI;oBACd,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,gCAAgC;iBAC9C,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,+BAA+B;aAC7C,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const dataSourceDropdown: import("@activepieces/pieces-framework").DropdownProperty<unknown, true>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataSourceDropdown = 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 cognos_client_1 = require("./cognos-client");
8
+ exports.dataSourceDropdown = pieces_framework_1.Property.Dropdown({
9
+ displayName: 'Data Source',
10
+ description: 'Select a data source',
11
+ required: true,
12
+ refreshers: [],
13
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
14
+ if (!auth) {
15
+ return {
16
+ disabled: true,
17
+ options: [],
18
+ placeholder: 'Connect your account first'
19
+ };
20
+ }
21
+ try {
22
+ const client = new cognos_client_1.CognosClient(auth);
23
+ const response = yield client.makeAuthenticatedRequest('/dataSources', pieces_common_1.HttpMethod.GET);
24
+ if (response.status === 200) {
25
+ const data = response.body;
26
+ const dataSources = data.dataSources || [];
27
+ if (dataSources.length === 0) {
28
+ return {
29
+ disabled: true,
30
+ options: [],
31
+ placeholder: 'No data sources found'
32
+ };
33
+ }
34
+ return {
35
+ disabled: false,
36
+ options: dataSources.map((ds) => ({
37
+ label: ds.defaultName || ds.id,
38
+ value: ds.id
39
+ }))
40
+ };
41
+ }
42
+ else {
43
+ return {
44
+ disabled: true,
45
+ options: [],
46
+ placeholder: 'Failed to load data sources'
47
+ };
48
+ }
49
+ }
50
+ catch (error) {
51
+ return {
52
+ disabled: true,
53
+ options: [],
54
+ placeholder: 'Error loading data sources'
55
+ };
56
+ }
57
+ })
58
+ });
59
+ //# sourceMappingURL=data-source-dropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-source-dropdown.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/ibm-cognose/src/lib/common/data-source-dropdown.ts"],"names":[],"mappings":";;;;AAAA,qEAA0D;AAC1D,+DAAyD;AACzD,mDAA+C;AAElC,QAAA,kBAAkB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAClD,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,sBAAsB;IACnC,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACtB,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,4BAA4B;aAC1C,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,4BAAY,CAAC,IAAW,CAAC,CAAC;YAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,cAAc,EAAE,0BAAU,CAAC,GAAG,CAAC,CAAC;YAEvF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;gBAC3B,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;gBAE3C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBAC7B,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,uBAAuB;qBACrC,CAAC;gBACJ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