@divyacon/piece-mysql 0.0.0-stage → 0.1.0

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 (48) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +15 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +52 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/delete-row.d.ts +27 -0
  7. package/dist/lib/actions/delete-row.d.ts.map +1 -0
  8. package/dist/lib/actions/delete-row.js +46 -0
  9. package/dist/lib/actions/delete-row.js.map +1 -0
  10. package/dist/lib/actions/execute-query.d.ts +14 -0
  11. package/dist/lib/actions/execute-query.d.ts.map +1 -0
  12. package/dist/lib/actions/execute-query.js +43 -0
  13. package/dist/lib/actions/execute-query.js.map +1 -0
  14. package/dist/lib/actions/find-rows.d.ts +28 -0
  15. package/dist/lib/actions/find-rows.d.ts.map +1 -0
  16. package/dist/lib/actions/find-rows.js +54 -0
  17. package/dist/lib/actions/find-rows.js.map +1 -0
  18. package/dist/lib/actions/get-tables.d.ts +9 -0
  19. package/dist/lib/actions/get-tables.d.ts.map +1 -0
  20. package/dist/lib/actions/get-tables.js +30 -0
  21. package/dist/lib/actions/get-tables.js.map +1 -0
  22. package/dist/lib/actions/index.d.ts +115 -0
  23. package/dist/lib/actions/index.d.ts.map +1 -0
  24. package/dist/lib/actions/index.js +20 -0
  25. package/dist/lib/actions/index.js.map +1 -0
  26. package/dist/lib/actions/insert-row.d.ts +25 -0
  27. package/dist/lib/actions/insert-row.d.ts.map +1 -0
  28. package/dist/lib/actions/insert-row.js +42 -0
  29. package/dist/lib/actions/insert-row.js.map +1 -0
  30. package/dist/lib/actions/update-row.d.ts +27 -0
  31. package/dist/lib/actions/update-row.d.ts.map +1 -0
  32. package/dist/lib/actions/update-row.js +52 -0
  33. package/dist/lib/actions/update-row.js.map +1 -0
  34. package/dist/lib/common/index.d.ts +24 -0
  35. package/dist/lib/common/index.d.ts.map +1 -0
  36. package/dist/lib/common/index.js +79 -0
  37. package/dist/lib/common/index.js.map +1 -0
  38. package/package.json +46 -3
  39. package/src/index.ts +52 -0
  40. package/src/lib/actions/delete-row.ts +41 -0
  41. package/src/lib/actions/execute-query.ts +38 -0
  42. package/src/lib/actions/find-rows.ts +49 -0
  43. package/src/lib/actions/get-tables.ts +22 -0
  44. package/src/lib/actions/index.ts +15 -0
  45. package/src/lib/actions/insert-row.ts +35 -0
  46. package/src/lib/actions/update-row.ts +44 -0
  47. package/src/lib/common/index.ts +83 -0
  48. package/README.md +0 -3
package/LICENSE.MIT-AP ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) Activepieces AB
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ Derived helpers in this folder are adapted from Activepieces (MIT) for use
24
+ inside CX without depending on @activepieces/* packages at runtime.
@@ -0,0 +1,15 @@
1
+ export declare const mysqlAuth: import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
4
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>;
8
+ export declare const mysql: import("@agnocon/pieces-framework").Piece<import("@agnocon/pieces-framework").CustomAuthProperty<{
9
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
10
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
11
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
12
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
13
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
14
+ }>>;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,SAAS;;;;;;EA8BpB,CAAC;AAEH,eAAO,MAAM,KAAK;;;;;;GAWhB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mysql = exports.mysqlAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/mysql/src/index.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const pieces_framework_2 = require("@agnocon/pieces-framework");
9
+ const actions_1 = tslib_1.__importDefault(require("./lib/actions"));
10
+ exports.mysqlAuth = pieces_framework_1.PieceAuth.CustomAuth({
11
+ props: {
12
+ host: pieces_framework_1.Property.ShortText({
13
+ displayName: 'Host',
14
+ required: true,
15
+ description: 'The hostname or address of the mysql server',
16
+ }),
17
+ port: pieces_framework_1.Property.Number({
18
+ displayName: 'Port',
19
+ defaultValue: 3306,
20
+ description: 'The port to use for connecting to the mysql server',
21
+ required: true,
22
+ }),
23
+ user: pieces_framework_1.Property.ShortText({
24
+ displayName: 'Username',
25
+ required: true,
26
+ description: 'The username to use for connecting to the mysql server',
27
+ }),
28
+ password: pieces_framework_1.PieceAuth.SecretText({
29
+ displayName: 'Password',
30
+ description: 'The password to use to identify at the mysql server',
31
+ required: true,
32
+ }),
33
+ database: pieces_framework_1.Property.ShortText({
34
+ displayName: 'Database',
35
+ description: 'The name of the database to use. Required if you are not using the "Execute Query" Action',
36
+ required: false,
37
+ }),
38
+ },
39
+ required: true,
40
+ });
41
+ exports.mysql = (0, pieces_framework_1.createPiece)({
42
+ displayName: 'MySQL',
43
+ description: "The world's most popular open-source database",
44
+ minimumSupportedRelease: '0.30.0',
45
+ logoUrl: 'https://cdn.activepieces.com/pieces/mysql.png',
46
+ categories: [pieces_framework_2.PieceCategory.DEVELOPER_TOOLS],
47
+ authors: ["JanHolger", "kishanprmr", "khaledmashaly", "abuaboud"],
48
+ auth: exports.mysqlAuth,
49
+ actions: actions_1.default,
50
+ triggers: [],
51
+ });
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,iFAAiF;AACjF,qEAAqE;AACrE,gEAImC;AACnC,gEAA0D;AAC1D,oEAAoC;AAEvB,QAAA,SAAS,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC5C,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,6CAA6C;SAC3D,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM;YACnB,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wDAAwD;SACtE,CAAC;QACF,QAAQ,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC7B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,2FAA2F;YACxG,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,KAAK,GAAG,IAAA,8BAAW,EAAC;IAC/B,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,+CAA+C;IAE5D,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,+CAA+C;IACxD,UAAU,EAAE,CAAC,gCAAa,CAAC,eAAe,CAAC;IAC3C,OAAO,EAAE,CAAC,WAAW,EAAC,YAAY,EAAC,eAAe,EAAC,UAAU,CAAC;IAC9D,IAAI,EAAE,iBAAS;IACf,OAAO,EAAP,iBAAO;IACP,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ declare const _default: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
4
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>, {
8
+ markdown: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
9
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
10
+ table: import("@agnocon/pieces-framework").DropdownProperty<string, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
11
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
12
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
13
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
14
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
15
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
16
+ }>> | import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
17
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
18
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
19
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
20
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
21
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
22
+ }>>;
23
+ search_column: import("@agnocon/pieces-framework").ShortTextProperty<true>;
24
+ search_value: import("@agnocon/pieces-framework").ShortTextProperty<true>;
25
+ }>;
26
+ export default _default;
27
+ //# sourceMappingURL=delete-row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-row.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/delete-row.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wBAmCG"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ // Vendored from Activepieces packages/pieces/community/mysql/src/lib/actions/delete-row.ts (MIT).
5
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
6
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const __1 = require("../..");
9
+ exports.default = (0, pieces_framework_1.createAction)({
10
+ auth: __1.mysqlAuth,
11
+ name: 'delete_row',
12
+ displayName: 'Delete Row',
13
+ description: 'Deletes one or more rows from a table',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Deletes every row in a MySQL table whose search column equals a given value. Use to remove records matched by a single column. Idempotent: once the matching rows are gone, re-running with the same input deletes nothing further.', idempotent: true },
16
+ props: {
17
+ markdown: common_1.warningMarkdown,
18
+ timezone: common_1.mysqlCommon.timezone,
19
+ table: common_1.mysqlCommon.table(),
20
+ search_column: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Search Column',
22
+ required: true,
23
+ }),
24
+ search_value: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Search Value',
26
+ required: true,
27
+ }),
28
+ },
29
+ run(context) {
30
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
+ const tableName = (0, common_1.sanitizeColumnName)(context.propsValue.table);
32
+ const searchColumn = (0, common_1.sanitizeColumnName)(context.propsValue.search_column);
33
+ const searchValue = context.propsValue.search_value;
34
+ const queryString = `DELETE FROM ${tableName} WHERE ${searchColumn}=?;`;
35
+ const connection = yield (0, common_1.mysqlConnect)(context.auth, context.propsValue);
36
+ try {
37
+ const result = yield connection.query(queryString, [searchValue]);
38
+ return result;
39
+ }
40
+ finally {
41
+ yield connection.end();
42
+ }
43
+ });
44
+ },
45
+ });
46
+ //# sourceMappingURL=delete-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-row.js","sourceRoot":"","sources":["../../../src/lib/actions/delete-row.ts"],"names":[],"mappings":";;;AAAA,kGAAkG;AAClG,qEAAqE;AACrE,gEAAmE;AACnE,sCAA2F;AAC3F,6BAAkC;AAGlC,kBAAe,IAAA,+BAAY,EAAC;IAC1B,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,qOAAqO,EAAE,UAAU,EAAE,IAAI,EAAE;IACpR,KAAK,EAAE;QACL,QAAQ,EAAE,wBAAe;QACzB,QAAQ,EAAE,oBAAW,CAAC,QAAQ;QAC9B,KAAK,EAAE,oBAAW,CAAC,KAAK,EAAE;QAC1B,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,SAAS,GAAG,IAAA,2BAAkB,EAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC/D,MAAM,YAAY,GAAG,IAAA,2BAAkB,EAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YAC1E,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;YAEpD,MAAM,WAAW,GAAG,eAAe,SAAS,UAAU,YAAY,KAAK,CAAC;YAExE,MAAM,UAAU,GAAG,MAAM,IAAA,qBAAY,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;YACxE,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;gBAClE,OAAO,MAAM,CAAC;YAChB,CAAC;oBAAS,CAAC;gBACT,MAAM,UAAU,CAAC,GAAG,EAAE,CAAC;YACzB,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ declare const _default: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
4
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>, {
8
+ markdown: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
9
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
10
+ query: import("@agnocon/pieces-framework").ShortTextProperty<true>;
11
+ args: import("@agnocon/pieces-framework").ArrayProperty<false>;
12
+ }>;
13
+ export default _default;
14
+ //# sourceMappingURL=execute-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-query.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/execute-query.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,wBAiCG"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ // Vendored from Activepieces packages/pieces/community/mysql/src/lib/actions/execute-query.ts (MIT).
5
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
6
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const __1 = require("../..");
9
+ exports.default = (0, pieces_framework_1.createAction)({
10
+ auth: __1.mysqlAuth,
11
+ name: 'execute_query',
12
+ displayName: 'Execute Query',
13
+ description: 'Executes a query on the mysql database and returns the results',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Runs an arbitrary SQL statement against the MySQL database and returns its results. Use as the escape hatch when the dedicated find/insert/update/delete actions cannot express the operation (joins, DDL, multi-table writes, aggregates). Pass dynamic values through the args array as ? placeholders to avoid SQL injection. Not idempotent in general: the effect and repeat-safety depend entirely on the SQL you supply (a SELECT is safe to repeat, an INSERT or UPDATE may not be).', idempotent: false },
16
+ props: {
17
+ markdown: common_1.warningMarkdown,
18
+ timezone: common_1.mysqlCommon.timezone,
19
+ query: pieces_framework_1.Property.ShortText({
20
+ displayName: 'Query',
21
+ description: 'The query string to execute, use ? for arguments to avoid SQL injection.',
22
+ required: true,
23
+ }),
24
+ args: pieces_framework_1.Property.Array({
25
+ displayName: 'Arguments',
26
+ description: 'Arguments to use in the query, if any. Should be in the same order as the ? in the query string..',
27
+ required: false,
28
+ }),
29
+ },
30
+ run(context) {
31
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
+ const conn = yield (0, common_1.mysqlConnect)(context.auth, context.propsValue);
33
+ try {
34
+ const results = yield conn.query(context.propsValue.query, context.propsValue.args || []);
35
+ return Array.isArray(results) ? { results } : results;
36
+ }
37
+ finally {
38
+ yield conn.end();
39
+ }
40
+ });
41
+ },
42
+ });
43
+ //# sourceMappingURL=execute-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute-query.js","sourceRoot":"","sources":["../../../src/lib/actions/execute-query.ts"],"names":[],"mappings":";;;AAAA,qGAAqG;AACrG,qEAAqE;AACrE,gEAAmE;AACnE,sCAAuE;AACvE,6BAAkC;AAElC,kBAAe,IAAA,+BAAY,EAAC;IAC1B,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,gEAAgE;IAC7E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,8dAA8d,EAAE,UAAU,EAAE,KAAK,EAAE;IAC9gB,KAAK,EAAE;QACL,QAAQ,EAAE,wBAAe;QACzB,QAAQ,EAAE,oBAAW,CAAC,QAAQ;QAC9B,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,0EAA0E;YACvF,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACnB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,mGAAmG;YAChH,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;YAClE,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAC9B,OAAO,CAAC,UAAU,CAAC,KAAK,EACxB,OAAO,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAC9B,CAAC;gBACF,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YACxD,CAAC;oBAAS,CAAC;gBACT,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YACnB,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ declare const _default: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
4
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>, {
8
+ markdown: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
9
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
10
+ table: import("@agnocon/pieces-framework").DropdownProperty<string, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
11
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
12
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
13
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
14
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
15
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
16
+ }>> | import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
17
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
18
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
19
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
20
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
21
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
22
+ }>>;
23
+ condition: import("@agnocon/pieces-framework").ShortTextProperty<true>;
24
+ args: import("@agnocon/pieces-framework").ArrayProperty<false>;
25
+ columns: import("@agnocon/pieces-framework").ArrayProperty<false>;
26
+ }>;
27
+ export default _default;
28
+ //# sourceMappingURL=find-rows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-rows.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/find-rows.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBA4CG"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ // Vendored from Activepieces packages/pieces/community/mysql/src/lib/actions/find-rows.ts (MIT).
5
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
6
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const __1 = require("../..");
9
+ exports.default = (0, pieces_framework_1.createAction)({
10
+ auth: __1.mysqlAuth,
11
+ name: 'find_rows',
12
+ displayName: 'Find Rows',
13
+ description: 'Reads rows from a table',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Reads rows from a MySQL table that match a SQL WHERE condition, optionally limited to specific columns. Use to look up or filter records by arbitrary criteria. The condition is required and is interpolated raw into the query, so pass dynamic values through the args array (referenced as ? placeholders) to avoid SQL injection. Read-only and idempotent.', idempotent: true },
16
+ props: {
17
+ markdown: common_1.warningMarkdown,
18
+ timezone: common_1.mysqlCommon.timezone,
19
+ table: common_1.mysqlCommon.table(),
20
+ condition: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Condition',
22
+ description: 'SQL condition, can also include logic operators, etc.',
23
+ required: true,
24
+ }),
25
+ args: pieces_framework_1.Property.Array({
26
+ displayName: 'Arguments',
27
+ description: 'Arguments can be used using ? in the condition',
28
+ required: false,
29
+ }),
30
+ columns: pieces_framework_1.Property.Array({
31
+ displayName: 'Columns',
32
+ description: 'Specify the columns you want to select',
33
+ required: false,
34
+ }),
35
+ },
36
+ run(context) {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
+ const columns = context.propsValue.columns || ['*'];
39
+ const qsColumns = columns
40
+ .map((c) => (0, common_1.sanitizeColumnName)(c))
41
+ .join(',');
42
+ const qs = `SELECT ${qsColumns} FROM ${(0, common_1.sanitizeColumnName)(context.propsValue.table)} WHERE ${context.propsValue.condition};`;
43
+ const conn = yield (0, common_1.mysqlConnect)(context.auth, context.propsValue);
44
+ try {
45
+ const results = yield conn.query(qs, context.propsValue.args);
46
+ return { results };
47
+ }
48
+ finally {
49
+ yield conn.end();
50
+ }
51
+ });
52
+ },
53
+ });
54
+ //# sourceMappingURL=find-rows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-rows.js","sourceRoot":"","sources":["../../../src/lib/actions/find-rows.ts"],"names":[],"mappings":";;;AAAA,iGAAiG;AACjG,qEAAqE;AACrE,gEAAmE;AACnE,sCAA2F;AAC3F,6BAAkC;AAElC,kBAAe,IAAA,+BAAY,EAAC;IAC1B,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,yBAAyB;IACtC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kWAAkW,EAAE,UAAU,EAAE,IAAI,EAAE;IACjZ,KAAK,EAAE;QACL,QAAQ,EAAE,wBAAe;QACzB,QAAQ,EAAE,oBAAW,CAAC,QAAQ;QAC9B,KAAK,EAAE,oBAAW,CAAC,KAAK,EAAE;QAC1B,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACnB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACtB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAI,OAAO,CAAC,UAAU,CAAC,OAAoB,IAAI,CAAC,GAAG,CAAC,CAAC;YAClE,MAAM,SAAS,GAAG,OAAO;iBACtB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,2BAAkB,EAAC,CAAC,CAAC,CAAC;iBACjC,IAAI,CAAC,GAAG,CAAC,CAAC;YAEb,MAAM,EAAE,GAAG,UAAU,SAAS,SAAS,IAAA,2BAAkB,EAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,OAAO,CAAC,UAAU,CAAC,SAAS,GAAG,CAAC;YAE7H,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;YAElE,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAC9D,OAAO,EAAE,OAAO,EAAE,CAAC;YACrB,CAAC;oBAAS,CAAC;gBACT,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YACnB,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ declare const _default: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
4
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>, {}>;
8
+ export default _default;
9
+ //# sourceMappingURL=get-tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-tables.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/get-tables.ts"],"names":[],"mappings":";;;;;;;AAMA,wBAiBG"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ // Vendored from Activepieces packages/pieces/community/mysql/src/lib/actions/get-tables.ts (MIT).
5
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
6
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const __1 = require("../..");
9
+ exports.default = (0, pieces_framework_1.createAction)({
10
+ auth: __1.mysqlAuth,
11
+ name: 'get_tables',
12
+ displayName: 'Get Tables',
13
+ description: 'Returns a list of tables in the database',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Lists the names of all tables in the connected MySQL database (SHOW TABLES). Use to discover the schema before reading or writing rows. Takes no input; read-only and idempotent.', idempotent: true },
16
+ props: {},
17
+ run(context) {
18
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
+ const conn = yield (0, common_1.mysqlConnect)(context.auth, context.propsValue);
20
+ try {
21
+ const tables = yield (0, common_1.mysqlGetTableNames)(conn);
22
+ return { tables };
23
+ }
24
+ finally {
25
+ yield conn.end();
26
+ }
27
+ });
28
+ },
29
+ });
30
+ //# sourceMappingURL=get-tables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-tables.js","sourceRoot":"","sources":["../../../src/lib/actions/get-tables.ts"],"names":[],"mappings":";;;AAAA,kGAAkG;AAClG,qEAAqE;AACrE,gEAAyD;AACzD,sCAA6D;AAC7D,6BAAkC;AAElC,kBAAe,IAAA,+BAAY,EAAC;IAC1B,IAAI,EAAE,aAAS;IACf,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,0CAA0C;IACvD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,mLAAmL,EAAE,UAAU,EAAE,IAAI,EAAE;IAClO,KAAK,EAAE,EAAE;IACH,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,MAAM,IAAA,qBAAY,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;YAClE,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC;gBAC9C,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,CAAC;oBAAS,CAAC;gBACT,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;YACnB,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,115 @@
1
+ declare const _default: (import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
4
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>, {
8
+ markdown: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
9
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
10
+ query: import("@agnocon/pieces-framework").ShortTextProperty<true>;
11
+ args: import("@agnocon/pieces-framework").ArrayProperty<false>;
12
+ }> | import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
13
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
14
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
15
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
16
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
17
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
18
+ }>, {}> | import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
19
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
20
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
21
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
22
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
23
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
24
+ }>, {
25
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
26
+ table: import("@agnocon/pieces-framework").DropdownProperty<string, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
27
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
28
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
29
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
30
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
31
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
32
+ }>> | import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
33
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
34
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
35
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
36
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
37
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
38
+ }>>;
39
+ values: import("@agnocon/pieces-framework").ObjectProperty<true>;
40
+ }> | import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
41
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
42
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
43
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
44
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
45
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
46
+ }>, {
47
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
48
+ table: import("@agnocon/pieces-framework").DropdownProperty<string, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
49
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
50
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
51
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
52
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
53
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
54
+ }>> | import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
55
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
56
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
57
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
58
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
59
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
60
+ }>>;
61
+ values: import("@agnocon/pieces-framework").ObjectProperty<true>;
62
+ search_column: import("@agnocon/pieces-framework").ShortTextProperty<true>;
63
+ search_value: import("@agnocon/pieces-framework").ShortTextProperty<true>;
64
+ }> | import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
65
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
66
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
67
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
68
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
69
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
70
+ }>, {
71
+ markdown: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
72
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
73
+ table: import("@agnocon/pieces-framework").DropdownProperty<string, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
74
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
75
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
76
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
77
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
78
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
79
+ }>> | import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
80
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
81
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
82
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
83
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
84
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
85
+ }>>;
86
+ search_column: import("@agnocon/pieces-framework").ShortTextProperty<true>;
87
+ search_value: import("@agnocon/pieces-framework").ShortTextProperty<true>;
88
+ }> | import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
89
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
90
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
91
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
92
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
93
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
94
+ }>, {
95
+ markdown: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
96
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
97
+ table: import("@agnocon/pieces-framework").DropdownProperty<string, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
98
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
99
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
100
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
101
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
102
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
103
+ }>> | import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
104
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
105
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
106
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
107
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
108
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
109
+ }>>;
110
+ condition: import("@agnocon/pieces-framework").ShortTextProperty<true>;
111
+ args: import("@agnocon/pieces-framework").ArrayProperty<false>;
112
+ columns: import("@agnocon/pieces-framework").ArrayProperty<false>;
113
+ }>)[];
114
+ export default _default;
115
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,wBAOE"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ // Vendored from Activepieces packages/pieces/community/mysql/src/lib/actions/index.ts (MIT).
5
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
6
+ const execute_query_1 = tslib_1.__importDefault(require("./execute-query"));
7
+ const get_tables_1 = tslib_1.__importDefault(require("./get-tables"));
8
+ const insert_row_1 = tslib_1.__importDefault(require("./insert-row"));
9
+ const update_row_1 = tslib_1.__importDefault(require("./update-row"));
10
+ const delete_row_1 = tslib_1.__importDefault(require("./delete-row"));
11
+ const find_rows_1 = tslib_1.__importDefault(require("./find-rows"));
12
+ exports.default = [
13
+ find_rows_1.default,
14
+ insert_row_1.default,
15
+ update_row_1.default,
16
+ delete_row_1.default,
17
+ get_tables_1.default,
18
+ execute_query_1.default,
19
+ ];
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/actions/index.ts"],"names":[],"mappings":";;;AAAA,6FAA6F;AAC7F,qEAAqE;AACrE,4EAA2C;AAC3C,sEAAqC;AACrC,sEAAqC;AACrC,sEAAsC;AACtC,sEAAsC;AACtC,oEAAqC;AAErC,kBAAe;IACb,mBAAU;IACV,oBAAS;IACT,oBAAU;IACV,oBAAU;IACV,oBAAS;IACT,uBAAY;CACb,CAAC"}
@@ -0,0 +1,25 @@
1
+ declare const _default: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
4
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>, {
8
+ timezone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
9
+ table: import("@agnocon/pieces-framework").DropdownProperty<string, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
10
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
11
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
12
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
13
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
14
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
15
+ }>> | import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
16
+ host: import("@agnocon/pieces-framework").ShortTextProperty<true>;
17
+ port: import("@agnocon/pieces-framework").NumberProperty<true>;
18
+ user: import("@agnocon/pieces-framework").ShortTextProperty<true>;
19
+ password: import("@agnocon/pieces-framework").SecretTextProperty<true>;
20
+ database: import("@agnocon/pieces-framework").ShortTextProperty<false>;
21
+ }>>;
22
+ values: import("@agnocon/pieces-framework").ObjectProperty<true>;
23
+ }>;
24
+ export default _default;
25
+ //# sourceMappingURL=insert-row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert-row.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/insert-row.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,wBA6BG"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ // Vendored from Activepieces packages/pieces/community/mysql/src/lib/actions/insert-row.ts (MIT).
5
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
6
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
7
+ const common_1 = require("../common");
8
+ const __1 = require("../..");
9
+ exports.default = (0, pieces_framework_1.createAction)({
10
+ auth: __1.mysqlAuth,
11
+ name: 'insert_row',
12
+ displayName: 'Insert Row',
13
+ description: 'Inserts a new row into a table',
14
+ audience: 'both',
15
+ aiMetadata: { description: 'Inserts a new row into a MySQL table from a map of column names to values. Use to add a record. Not idempotent: each call performs a fresh INSERT, so repeating it adds duplicate rows (or errors on a unique-key collision).', idempotent: false },
16
+ props: {
17
+ timezone: common_1.mysqlCommon.timezone,
18
+ table: common_1.mysqlCommon.table(),
19
+ values: pieces_framework_1.Property.Object({
20
+ displayName: 'Values',
21
+ required: true,
22
+ }),
23
+ },
24
+ run(context) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
+ const fields = Object.keys(context.propsValue.values);
27
+ const qsFields = fields.map((f) => (0, common_1.sanitizeColumnName)(f)).join(',');
28
+ const qsValues = fields.map(() => '?').join(',');
29
+ const qs = `INSERT INTO ${(0, common_1.sanitizeColumnName)(context.propsValue.table)} (${qsFields}) VALUES (${qsValues});`;
30
+ const conn = yield (0, common_1.mysqlConnect)(context.auth, context.propsValue);
31
+ try {
32
+ const values = fields.map((f) => context.propsValue.values[f]);
33
+ const result = yield conn.query(qs, values);
34
+ return result;
35
+ }
36
+ finally {
37
+ yield conn.end();
38
+ }
39
+ });
40
+ },
41
+ });
42
+ //# sourceMappingURL=insert-row.js.map