@activepieces/piece-ibm-cognose 0.1.5 → 0.1.7

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 (53) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +19 -57
  3. package/src/index.d.ts +0 -7
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/copy-content-object.d.ts +0 -39
  7. package/src/lib/actions/copy-content-object.d.ts.map +0 -1
  8. package/src/lib/actions/copy-content-object.js +0 -71
  9. package/src/lib/actions/copy-content-object.js.map +0 -1
  10. package/src/lib/actions/create-data-source.d.ts +0 -14
  11. package/src/lib/actions/create-data-source.d.ts.map +0 -1
  12. package/src/lib/actions/create-data-source.js +0 -102
  13. package/src/lib/actions/create-data-source.js.map +0 -1
  14. package/src/lib/actions/delete-data-source.d.ts +0 -14
  15. package/src/lib/actions/delete-data-source.d.ts.map +0 -1
  16. package/src/lib/actions/delete-data-source.js +0 -48
  17. package/src/lib/actions/delete-data-source.js.map +0 -1
  18. package/src/lib/actions/get-content-object.d.ts +0 -15
  19. package/src/lib/actions/get-content-object.d.ts.map +0 -1
  20. package/src/lib/actions/get-content-object.js +0 -55
  21. package/src/lib/actions/get-content-object.js.map +0 -1
  22. package/src/lib/actions/get-data-source.d.ts +0 -15
  23. package/src/lib/actions/get-data-source.d.ts.map +0 -1
  24. package/src/lib/actions/get-data-source.js +0 -55
  25. package/src/lib/actions/get-data-source.js.map +0 -1
  26. package/src/lib/actions/move-content-object.d.ts +0 -38
  27. package/src/lib/actions/move-content-object.d.ts.map +0 -1
  28. package/src/lib/actions/move-content-object.js +0 -63
  29. package/src/lib/actions/move-content-object.js.map +0 -1
  30. package/src/lib/actions/update-content-object.d.ts +0 -18
  31. package/src/lib/actions/update-content-object.d.ts.map +0 -1
  32. package/src/lib/actions/update-content-object.js +0 -81
  33. package/src/lib/actions/update-content-object.js.map +0 -1
  34. package/src/lib/actions/update-data-source.d.ts +0 -17
  35. package/src/lib/actions/update-data-source.d.ts.map +0 -1
  36. package/src/lib/actions/update-data-source.js +0 -79
  37. package/src/lib/actions/update-data-source.js.map +0 -1
  38. package/src/lib/auth.d.ts +0 -7
  39. package/src/lib/auth.d.ts.map +0 -1
  40. package/src/lib/auth.js +0 -61
  41. package/src/lib/auth.js.map +0 -1
  42. package/src/lib/common/cognos-client.d.ts +0 -15
  43. package/src/lib/common/cognos-client.d.ts.map +0 -1
  44. package/src/lib/common/cognos-client.js +0 -71
  45. package/src/lib/common/cognos-client.js.map +0 -1
  46. package/src/lib/common/content-object-dropdown.d.ts +0 -7
  47. package/src/lib/common/content-object-dropdown.d.ts.map +0 -1
  48. package/src/lib/common/content-object-dropdown.js +0 -61
  49. package/src/lib/common/content-object-dropdown.js.map +0 -1
  50. package/src/lib/common/data-source-dropdown.d.ts +0 -7
  51. package/src/lib/common/data-source-dropdown.d.ts.map +0 -1
  52. package/src/lib/common/data-source-dropdown.js +0 -61
  53. package/src/lib/common/data-source-dropdown.js.map +0 -1
@@ -1,102 +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 auth_1 = require("../auth");
8
- const cognos_client_1 = require("../common/cognos-client");
9
- exports.createDataSourceAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.ibmCognoseAuth,
11
- name: 'create_data_source',
12
- displayName: 'Create Data Source',
13
- description: 'Create a new data source',
14
- audience: 'both',
15
- aiMetadata: { description: 'Create a new data source in IBM Cognos Analytics from a JDBC connection string, optionally attaching a database driver and a signon (username/password) credential. Use when provisioning a database connection for reporting. Not idempotent: each call creates a new data source and fails if one with the same name already exists.', idempotent: false },
16
- props: {
17
- defaultName: pieces_framework_1.Property.ShortText({
18
- displayName: 'Data Source Name',
19
- description: 'Name for the new data source',
20
- required: true,
21
- }),
22
- connectionString: pieces_framework_1.Property.LongText({
23
- displayName: 'Connection String',
24
- description: 'JDBC URL or database connection string',
25
- required: true,
26
- defaultValue: 'jdbc:db2://localhost:50000/SAMPLE',
27
- }),
28
- driverName: pieces_framework_1.Property.ShortText({
29
- displayName: 'Driver Name',
30
- description: 'Database driver class name',
31
- required: false,
32
- defaultValue: 'com.ibm.db2.jcc.DB2Driver',
33
- }),
34
- username: pieces_framework_1.Property.ShortText({
35
- displayName: 'Database Username',
36
- description: 'Username for database connection',
37
- required: false,
38
- }),
39
- password: pieces_framework_1.Property.ShortText({
40
- displayName: 'Database Password',
41
- description: 'Password for database connection',
42
- required: false,
43
- }),
44
- signonDefaultName: pieces_framework_1.Property.ShortText({
45
- displayName: 'Signon Name',
46
- description: 'Name for the database credentials',
47
- required: false,
48
- }),
49
- },
50
- run(_a) {
51
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
52
- const { defaultName, connectionString, driverName, username, password, signonDefaultName } = propsValue;
53
- try {
54
- const client = new cognos_client_1.CognosClient(auth.props);
55
- const dataSourceDefinition = {
56
- defaultName,
57
- connections: [
58
- {
59
- connectionString,
60
- defaultName: defaultName + '_connection',
61
- }
62
- ]
63
- };
64
- if (driverName) {
65
- dataSourceDefinition.connections[0].connectionString += `;DRIVER_NAME=${driverName}`;
66
- }
67
- if (username && password) {
68
- dataSourceDefinition.connections[0].signons = [
69
- {
70
- defaultName: signonDefaultName || defaultName + '_signon',
71
- credentialsEx: {
72
- username,
73
- password
74
- }
75
- }
76
- ];
77
- }
78
- const response = yield client.makeAuthenticatedRequest('/dataSources', pieces_common_1.HttpMethod.POST, dataSourceDefinition);
79
- if (response.status === 201) {
80
- return {
81
- success: true,
82
- message: `Data source '${defaultName}' created successfully`,
83
- dataSource: response.body,
84
- };
85
- }
86
- else if (response.status === 400) {
87
- throw new Error(`Data source '${defaultName}' already exists or invalid parameters`);
88
- }
89
- else if (response.status === 401) {
90
- throw new Error('Authentication failed. Check your credentials.');
91
- }
92
- else {
93
- throw new Error(`Failed to create data source: ${response.status} ${response.body}`);
94
- }
95
- }
96
- catch (error) {
97
- throw new Error(`Failed to create data source: ${error instanceof Error ? error.message : 'Unknown error'}`);
98
- }
99
- });
100
- },
101
- });
102
- //# sourceMappingURL=create-data-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-data-source.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-data-source.ts"],"names":[],"mappings":";;;;AAAA,qEAAmF;AACnF,+DAAyD;AACzD,kCAAyC;AACzC,2DAAuD;AAE1C,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,wUAAwU,EAAE,UAAU,EAAE,KAAK,EAAE;IACxX,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;Q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AC;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"}
@@ -1,14 +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
- }>;
14
- //# sourceMappingURL=delete-data-source.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-data-source.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-data-source.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAuCjC,CAAC"}
@@ -1,48 +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 auth_1 = require("../auth");
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: auth_1.ibmCognoseAuth,
12
- name: 'delete_data_source',
13
- displayName: 'Delete Data Source',
14
- description: 'Delete a data source',
15
- audience: 'both',
16
- aiMetadata: { description: 'Permanently delete an IBM Cognos data source by its id. Use to remove a database connection that is no longer needed. Destructive and not idempotent: a repeat call on an already-deleted data source returns not-found.', idempotent: false },
17
- props: {
18
- datasourceId: data_source_dropdown_1.dataSourceDropdown,
19
- },
20
- run(_a) {
21
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
22
- const { datasourceId } = propsValue;
23
- try {
24
- const client = new cognos_client_1.CognosClient(auth.props);
25
- const response = yield client.makeAuthenticatedRequest(`/dataSources/${datasourceId}`, pieces_common_1.HttpMethod.DELETE);
26
- if (response.status === 204) {
27
- return {
28
- success: true,
29
- message: `Data source deleted successfully`,
30
- };
31
- }
32
- else if (response.status === 401) {
33
- throw new Error('Authentication failed. Check your credentials.');
34
- }
35
- else if (response.status === 404) {
36
- throw new Error(`Data source not found`);
37
- }
38
- else {
39
- throw new Error(`Failed to delete: ${response.status} ${response.body}`);
40
- }
41
- }
42
- catch (error) {
43
- throw new Error(`Failed to delete data source: ${error instanceof Error ? error.message : 'Unknown error'}`);
44
- }
45
- });
46
- },
47
- });
48
- //# sourceMappingURL=delete-data-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-data-source.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-data-source.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAyC;AACzC,2DAAuD;AACvD,yEAAoE;AAEvD,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,sBAAsB;IACnC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,0NAA0N,EAAE,UAAU,EAAE,KAAK,EAAE;IAC1Q,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,15 +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
- }>;
15
- //# sourceMappingURL=get-content-object.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-content-object.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-content-object.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;EAgDjC,CAAC"}
@@ -1,55 +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 auth_1 = require("../auth");
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: auth_1.ibmCognoseAuth,
12
- name: 'get_content_object',
13
- displayName: 'Get Content Object',
14
- description: 'Get content object details',
15
- audience: 'both',
16
- aiMetadata: { description: 'Fetch the details of a single content-store object (report, dashboard, folder, etc.) by its id from the IBM Cognos content tree. Use to inspect an object before moving, copying, or updating it; optionally request extra fields such as owner, permissions, or children. Idempotent read-only lookup.', idempotent: true },
17
- props: {
18
- objectId: content_object_dropdown_1.contentObjectDropdown,
19
- fields: pieces_framework_1.Property.ShortText({
20
- displayName: 'Extra Fields',
21
- description: 'Comma-separated list of extra fields (e.g., owner,permissions,children)',
22
- required: false,
23
- }),
24
- },
25
- run(_a) {
26
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
27
- const { objectId, fields } = propsValue;
28
- try {
29
- const client = new cognos_client_1.CognosClient(auth.props);
30
- const queryParams = [];
31
- if (fields && fields.trim()) {
32
- queryParams.push(`fields=${encodeURIComponent(fields.trim())}`);
33
- }
34
- const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
35
- const response = yield client.makeAuthenticatedRequest(`/content/${objectId}${queryString}`, pieces_common_1.HttpMethod.GET);
36
- if (response.status === 200) {
37
- return response.body;
38
- }
39
- else if (response.status === 401) {
40
- throw new Error('Authentication failed. Check your credentials.');
41
- }
42
- else if (response.status === 404) {
43
- throw new Error(`Content object not found`);
44
- }
45
- else {
46
- throw new Error(`Failed to retrieve: ${response.status} ${response.body}`);
47
- }
48
- }
49
- catch (error) {
50
- throw new Error(`Failed to retrieve content object: ${error instanceof Error ? error.message : 'Unknown error'}`);
51
- }
52
- });
53
- },
54
- });
55
- //# sourceMappingURL=get-content-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-content-object.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-content-object.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,2DAAuD;AACvD,+EAA0E;AAE7D,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,4BAA4B;IACzC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,ySAAyS,EAAE,UAAU,EAAE,IAAI,EAAE;IACxV,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,15 +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
- }>;
15
- //# sourceMappingURL=get-data-source.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-data-source.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-data-source.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;EAgD9B,CAAC"}
@@ -1,55 +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 auth_1 = require("../auth");
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: auth_1.ibmCognoseAuth,
12
- name: 'get_data_source',
13
- displayName: 'Get Data Source',
14
- description: 'Retrieve data source details',
15
- audience: 'both',
16
- aiMetadata: { description: 'Fetch the details of a single IBM Cognos data source by its id. Use to read or verify a data source\'s configuration before acting on it; optionally request extra fields such as connections or signons. Idempotent read-only lookup.', idempotent: true },
17
- props: {
18
- datasourceId: data_source_dropdown_1.dataSourceDropdown,
19
- fields: pieces_framework_1.Property.ShortText({
20
- displayName: 'Extra Fields',
21
- description: 'Comma-separated list of extra fields (e.g., connections,signons)',
22
- required: false,
23
- }),
24
- },
25
- run(_a) {
26
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
27
- const { datasourceId, fields } = propsValue;
28
- try {
29
- const client = new cognos_client_1.CognosClient(auth.props);
30
- const queryParams = [];
31
- if (fields && fields.trim()) {
32
- queryParams.push(`fields=${encodeURIComponent(fields.trim())}`);
33
- }
34
- const queryString = queryParams.length > 0 ? `?${queryParams.join('&')}` : '';
35
- const response = yield client.makeAuthenticatedRequest(`/dataSources/${datasourceId}${queryString}`, pieces_common_1.HttpMethod.GET);
36
- if (response.status === 200) {
37
- return response.body;
38
- }
39
- else if (response.status === 401) {
40
- throw new Error('Authentication failed. Check your credentials.');
41
- }
42
- else if (response.status === 404) {
43
- throw new Error(`Data source not found`);
44
- }
45
- else {
46
- throw new Error(`Failed to retrieve: ${response.status} ${response.body}`);
47
- }
48
- }
49
- catch (error) {
50
- throw new Error(`Failed to retrieve data source: ${error instanceof Error ? error.message : 'Unknown error'}`);
51
- }
52
- });
53
- },
54
- });
55
- //# sourceMappingURL=get-data-source.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-data-source.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-data-source.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,2DAAuD;AACvD,yEAAoE;AAEvD,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,8BAA8B;IAC3C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,wOAAwO,EAAE,UAAU,EAAE,IAAI,EAAE;IACvR,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,I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AAC;YACJ,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,38 +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("@activepieces/shared").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
- }>;
38
- //# sourceMappingURL=move-content-object.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"move-content-object.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/move-content-object.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DlC,CAAC"}
@@ -1,63 +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 auth_1 = require("../auth");
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: auth_1.ibmCognoseAuth,
12
- name: 'move_content_object',
13
- displayName: 'Move Content Object',
14
- description: 'Move an object with all its descendants',
15
- audience: 'both',
16
- aiMetadata: { description: 'Move a content-store object, together with all of its descendants, from its current location into a destination container within the IBM Cognos content tree. Use to reorganize reports, dashboards, or folders. Source and destination must differ. Not idempotent: a repeat call after the object has moved fails because the source no longer exists at its original location.', idempotent: false },
17
- props: {
18
- sourceId: content_object_dropdown_1.contentObjectDropdown,
19
- destinationId: Object.assign(Object.assign({}, content_object_dropdown_1.contentObjectDropdown), { displayName: 'Destination Container', description: 'Destination container where the object will be moved' }),
20
- },
21
- run(_a) {
22
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
23
- var _b;
24
- const { sourceId, destinationId } = propsValue;
25
- if (sourceId === destinationId) {
26
- throw new Error('Source and destination cannot be the same object');
27
- }
28
- try {
29
- const client = new cognos_client_1.CognosClient(auth.props);
30
- const moveRequest = {
31
- source_id: sourceId,
32
- destination_id: destinationId,
33
- };
34
- const response = yield client.makeAuthenticatedRequest('/content/move', pieces_common_1.HttpMethod.PUT, moveRequest);
35
- if (response.status === 204) {
36
- return {
37
- success: true,
38
- message: `Content object moved successfully`,
39
- };
40
- }
41
- else if (response.status === 400) {
42
- throw new Error(`Bad request: ${((_b = response.body) === null || _b === void 0 ? void 0 : _b.message) || 'Invalid move operation'}`);
43
- }
44
- else if (response.status === 401) {
45
- throw new Error('Authentication failed. Check your credentials.');
46
- }
47
- else if (response.status === 403) {
48
- throw new Error('Permission denied. Insufficient permissions to move this object.');
49
- }
50
- else if (response.status === 404) {
51
- throw new Error('Object or parent object not found.');
52
- }
53
- else {
54
- throw new Error(`Failed to move: ${response.status} ${response.body}`);
55
- }
56
- }
57
- catch (error) {
58
- throw new Error(`Failed to move content object: ${error instanceof Error ? error.message : 'Unknown error'}`);
59
- }
60
- });
61
- },
62
- });
63
- //# sourceMappingURL=move-content-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"move-content-object.js","sourceRoot":"","sources":["../../../../src/lib/actions/move-content-object.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,kCAAyC;AACzC,2DAAuD;AACvD,+EAA0E;AAE7D,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,mXAAmX,EAAE,UAAU,EAAE,KAAK,EAAE;IACna,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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,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,18 +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
- }>;
18
- //# sourceMappingURL=update-content-object.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-content-object.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-content-object.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;EA4EpC,CAAC"}
@@ -1,81 +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 auth_1 = require("../auth");
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: auth_1.ibmCognoseAuth,
12
- name: 'update_content_object',
13
- displayName: 'Update Content Object',
14
- description: 'Update an existing content object',
15
- audience: 'both',
16
- aiMetadata: { description: 'Update an existing content-store object (report, dashboard, folder, etc.) identified by its id, changing its name and/or description. The object type is required, and an optional version enables optimistic-concurrency checking that rejects the update if the object changed since it was fetched. Idempotent: re-applying the same values leaves the object in the same state.', idempotent: true },
17
- props: {
18
- objectId: content_object_dropdown_1.contentObjectDropdown,
19
- type: pieces_framework_1.Property.ShortText({
20
- displayName: 'Type',
21
- description: 'Object type (e.g., report, dashboard, folder)',
22
- required: true,
23
- }),
24
- defaultName: pieces_framework_1.Property.ShortText({
25
- displayName: 'Name',
26
- description: 'New name for the object',
27
- required: false,
28
- }),
29
- defaultDescriptions: pieces_framework_1.Property.LongText({
30
- displayName: 'Description',
31
- description: 'New description for the object',
32
- required: false,
33
- }),
34
- version: pieces_framework_1.Property.Number({
35
- displayName: 'Version',
36
- description: 'Current version for optimistic concurrency',
37
- required: false,
38
- }),
39
- },
40
- run(_a) {
41
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
42
- const { objectId, defaultName, defaultDescriptions, type, version } = propsValue;
43
- try {
44
- const client = new cognos_client_1.CognosClient(auth.props);
45
- const updateDefinition = { type };
46
- if (defaultName) {
47
- updateDefinition.defaultName = defaultName;
48
- }
49
- if (defaultDescriptions) {
50
- updateDefinition.defaultDescriptions = defaultDescriptions;
51
- }
52
- if (version !== undefined && version !== null) {
53
- updateDefinition.version = version;
54
- }
55
- const response = yield client.makeAuthenticatedRequest(`/content/${objectId}`, pieces_common_1.HttpMethod.PUT, updateDefinition);
56
- if (response.status === 204 || response.status === 200) {
57
- return {
58
- success: true,
59
- message: `Content object updated successfully`,
60
- };
61
- }
62
- else if (response.status === 401) {
63
- throw new Error('Authentication failed. Check your credentials.');
64
- }
65
- else if (response.status === 404) {
66
- throw new Error(`Content object not found`);
67
- }
68
- else if (response.status === 409) {
69
- throw new Error('Object has changed since you fetched it. Refresh and try again.');
70
- }
71
- else {
72
- throw new Error(`Failed to update: ${response.status} ${response.body}`);
73
- }
74
- }
75
- catch (error) {
76
- throw new Error(`Failed to update content object: ${error instanceof Error ? error.message : 'Unknown error'}`);
77
- }
78
- });
79
- },
80
- });
81
- //# sourceMappingURL=update-content-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-content-object.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-content-object.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAyC;AACzC,2DAAuD;AACvD,+EAA0E;AAE7D,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,qBAAc;IACpB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,mCAAmC;IAChD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,qXAAqX,EAAE,UAAU,EAAE,IAAI,EAAE;IACpa,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;YACtC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,mBAAmB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;Y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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,17 +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
- }>;
17
- //# sourceMappingURL=update-data-source.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-data-source.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-data-source.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EA4EjC,CAAC"}