@agnocon/piece-bubble 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +30 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/create-thing.d.ts +8 -0
  7. package/dist/lib/actions/create-thing.d.ts.map +1 -0
  8. package/dist/lib/actions/create-thing.js +44 -0
  9. package/dist/lib/actions/create-thing.js.map +1 -0
  10. package/dist/lib/actions/delete-thing.d.ts +8 -0
  11. package/dist/lib/actions/delete-thing.d.ts.map +1 -0
  12. package/dist/lib/actions/delete-thing.js +43 -0
  13. package/dist/lib/actions/delete-thing.js.map +1 -0
  14. package/dist/lib/actions/get-thing.d.ts +8 -0
  15. package/dist/lib/actions/get-thing.d.ts.map +1 -0
  16. package/dist/lib/actions/get-thing.js +46 -0
  17. package/dist/lib/actions/get-thing.js.map +1 -0
  18. package/dist/lib/actions/list-things.d.ts +12 -0
  19. package/dist/lib/actions/list-things.d.ts.map +1 -0
  20. package/dist/lib/actions/list-things.js +101 -0
  21. package/dist/lib/actions/list-things.js.map +1 -0
  22. package/dist/lib/actions/update-thing.d.ts +9 -0
  23. package/dist/lib/actions/update-thing.d.ts.map +1 -0
  24. package/dist/lib/actions/update-thing.js +45 -0
  25. package/dist/lib/actions/update-thing.js.map +1 -0
  26. package/dist/lib/auth.d.ts +5 -0
  27. package/dist/lib/auth.d.ts.map +1 -0
  28. package/dist/lib/auth.js +40 -0
  29. package/dist/lib/auth.js.map +1 -0
  30. package/dist/lib/common/index.d.ts +6 -0
  31. package/dist/lib/common/index.d.ts.map +1 -0
  32. package/dist/lib/common/index.js +21 -0
  33. package/dist/lib/common/index.js.map +1 -0
  34. package/package.json +46 -0
  35. package/src/index.ts +32 -0
  36. package/src/lib/actions/create-thing.ts +44 -0
  37. package/src/lib/actions/delete-thing.ts +43 -0
  38. package/src/lib/actions/get-thing.ts +46 -0
  39. package/src/lib/actions/list-things.ts +103 -0
  40. package/src/lib/actions/update-thing.ts +45 -0
  41. package/src/lib/auth.ts +34 -0
  42. package/src/lib/common/index.ts +16 -0
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,2 @@
1
+ export declare const bubble: import("@agnocon/pieces-framework").Piece<undefined>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,MAAM,sDAiBjB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bubble = void 0;
4
+ // Vendored from Activepieces packages/pieces/community/bubble/src/index.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 pieces_framework_2 = require("@agnocon/pieces-framework");
8
+ const create_thing_1 = require("./lib/actions/create-thing");
9
+ const delete_thing_1 = require("./lib/actions/delete-thing");
10
+ const get_thing_1 = require("./lib/actions/get-thing");
11
+ const list_things_1 = require("./lib/actions/list-things");
12
+ const update_thing_1 = require("./lib/actions/update-thing");
13
+ exports.bubble = (0, pieces_framework_1.createPiece)({
14
+ displayName: 'Bubble',
15
+ description: 'No-code platform for web and mobile apps',
16
+ auth: pieces_framework_1.PieceAuth.None(),
17
+ minimumSupportedRelease: '0.30.0',
18
+ logoUrl: 'https://cdn.activepieces.com/pieces/bubble.png',
19
+ categories: [pieces_framework_2.PieceCategory.DEVELOPER_TOOLS],
20
+ authors: ["TaskMagicKyle", "kishanprmr", "abuaboud"],
21
+ actions: [
22
+ create_thing_1.bubbleCreateThingAction,
23
+ delete_thing_1.bubbleDeleteThingAction,
24
+ update_thing_1.bubbleUpdateThingAction,
25
+ get_thing_1.bubbleGetThingAction,
26
+ list_things_1.bubbleListThingsAction,
27
+ ],
28
+ triggers: [],
29
+ });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,kFAAkF;AAClF,qEAAqE;AACrE,gEAImC;AAEnC,gEAA0D;AAC1D,6DAAqE;AACrE,6DAAqE;AACrE,uDAA+D;AAC/D,2DAAmE;AACnE,6DAAqE;AAGxD,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAChC,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,0CAA0C;IAEvD,IAAI,EAAE,4BAAS,CAAC,IAAI,EAAE;IACtB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,gDAAgD;IACzD,UAAU,EAAE,CAAC,gCAAa,CAAC,eAAe,CAAC;IAC3C,OAAO,EAAE,CAAC,eAAe,EAAC,YAAY,EAAC,UAAU,CAAC;IAClD,OAAO,EAAE;QACP,sCAAuB;QACvB,sCAAuB;QACvB,sCAAuB;QACvB,gCAAoB;QACpB,oCAAsB;KACvB;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const bubbleCreateThingAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ appname: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ typename: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ fields: import("@agnocon/pieces-framework").JsonProperty<false>;
7
+ }>;
8
+ //# sourceMappingURL=create-thing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-thing.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-thing.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,uBAAuB;;;;;;EAiClC,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bubbleCreateThingAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bubble/src/lib/actions/create-thing.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_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const common_1 = require("../common");
11
+ exports.bubbleCreateThingAction = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.bubbleAuth,
13
+ name: 'bubble_create_thing',
14
+ displayName: 'Create Thing',
15
+ description: 'Create a thing',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Create a new record ("thing") of a given data type in a Bubble app via the Bubble Data API. Use to add a new entry; supply the type name and a fields object with the values to set. Not idempotent — each call creates a separate record.', idempotent: false },
18
+ props: {
19
+ typename: common_1.bubbleCommon.typename,
20
+ fields: common_1.bubbleCommon.fields,
21
+ },
22
+ run(context) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const { appname, token } = context.auth.props;
25
+ const { typename, fields } = context.propsValue;
26
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}`;
27
+ const response = yield pieces_common_1.httpClient.sendRequest({
28
+ method: pieces_common_1.HttpMethod.POST,
29
+ url: server_url,
30
+ headers: {
31
+ 'user-agent': 'activepieces',
32
+ Authorization: `Bearer ${token}`,
33
+ },
34
+ authentication: {
35
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
36
+ token,
37
+ },
38
+ body: fields,
39
+ });
40
+ return response.body;
41
+ });
42
+ },
43
+ });
44
+ //# sourceMappingURL=create-thing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-thing.js","sourceRoot":"","sources":["../../../src/lib/actions/create-thing.ts"],"names":[],"mappings":";;;;AAAA,qGAAqG;AACrG,qEAAqE;AACrE,gEAAyD;AACzD,0DAIgC;AAEhC,kCAAqC;AACrC,sCAAyC;AAE5B,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4OAA4O,EAAE,UAAU,EAAE,KAAK,EAAE;IAC5R,KAAK,EAAE;QACL,QAAQ,EAAE,qBAAY,CAAC,QAAQ;QAC/B,MAAM,EAAE,qBAAY,CAAC,MAAM;KAC5B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC9C,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEhD,MAAM,UAAU,GAAG,WAAW,OAAO,8BAA8B,QAAQ,EAAE,CAAC;YAE9E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,UAAU;gBACf,OAAO,EAAE;oBACP,YAAY,EAAE,cAAc;oBAC5B,aAAa,EAAE,UAAU,KAAK,EAAE;iBACjC;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACN;gBACD,IAAI,EAAE,MAAM;aACb,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const bubbleDeleteThingAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ appname: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ typename: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ thing_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ }>;
8
+ //# sourceMappingURL=delete-thing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-thing.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/delete-thing.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,uBAAuB;;;;;;EAgClC,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bubbleDeleteThingAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bubble/src/lib/actions/delete-thing.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_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const common_1 = require("../common");
11
+ exports.bubbleDeleteThingAction = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.bubbleAuth,
13
+ name: 'bubble_delete_thing',
14
+ displayName: 'Delete Thing',
15
+ description: 'Delete a thing',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Permanently delete a single record ("thing") from a Bubble app by its unique id and data type, via the Bubble Data API. Use when an agent must remove a specific record it already knows the id of. Effectively idempotent (deleting an already-deleted id is a no-op) but destructive — verify the id before calling.', idempotent: true },
18
+ props: {
19
+ typename: common_1.bubbleCommon.typename,
20
+ thing_id: common_1.bubbleCommon.thing_id,
21
+ },
22
+ run(context) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const { appname, token } = context.auth.props;
25
+ const { typename, thing_id } = context.propsValue;
26
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}/${thing_id}`;
27
+ const response = yield pieces_common_1.httpClient.sendRequest({
28
+ method: pieces_common_1.HttpMethod.DELETE,
29
+ url: server_url,
30
+ headers: {
31
+ 'user-agent': 'activepieces',
32
+ Authorization: `Bearer ${token}`,
33
+ },
34
+ authentication: {
35
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
36
+ token,
37
+ },
38
+ });
39
+ return response.body;
40
+ });
41
+ },
42
+ });
43
+ //# sourceMappingURL=delete-thing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-thing.js","sourceRoot":"","sources":["../../../src/lib/actions/delete-thing.ts"],"names":[],"mappings":";;;;AAAA,qGAAqG;AACrG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAEhC,kCAAqC;AACrC,sCAAyC;AAE5B,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,gBAAgB;IAC7B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,wTAAwT,EAAE,UAAU,EAAE,IAAI,EAAE;IACvW,KAAK,EAAE;QACL,QAAQ,EAAE,qBAAY,CAAC,QAAQ;QAC/B,QAAQ,EAAE,qBAAY,CAAC,QAAQ;KAChC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC9C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAElD,MAAM,UAAU,GAAG,WAAW,OAAO,8BAA8B,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAE1F,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,GAAG,EAAE,UAAU;gBACf,OAAO,EAAE;oBACP,YAAY,EAAE,cAAc;oBAC5B,aAAa,EAAE,UAAU,KAAK,EAAE;iBACjC;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACN;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const bubbleGetThingAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ appname: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ typename: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ thing_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ }>;
8
+ //# sourceMappingURL=get-thing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-thing.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/get-thing.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,oBAAoB;;;;;;EAmC/B,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bubbleGetThingAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bubble/src/lib/actions/get-thing.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_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const common_1 = require("../common");
11
+ exports.bubbleGetThingAction = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.bubbleAuth,
13
+ name: 'bubble_get_thing',
14
+ displayName: 'Get Thing',
15
+ description: 'Get a thing by id',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Fetch a single record ("thing") of a given data type from a Bubble app by its unique id, via the Bubble Data API. Use to read the current values of one known record. Read-only and idempotent.', idempotent: true },
18
+ props: {
19
+ typename: common_1.bubbleCommon.typename,
20
+ thing_id: common_1.bubbleCommon.thing_id,
21
+ },
22
+ run(context) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const { appname, token } = context.auth.props;
25
+ const { typename, thing_id } = context.propsValue;
26
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}`;
27
+ const response = yield pieces_common_1.httpClient.sendRequest({
28
+ method: pieces_common_1.HttpMethod.GET,
29
+ url: server_url,
30
+ headers: {
31
+ 'user-agent': 'activepieces',
32
+ Authorization: `Bearer ${token}`,
33
+ },
34
+ authentication: {
35
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
36
+ token,
37
+ },
38
+ body: {
39
+ constraint: `id = ${thing_id}`,
40
+ },
41
+ });
42
+ return response.body;
43
+ });
44
+ },
45
+ });
46
+ //# sourceMappingURL=get-thing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-thing.js","sourceRoot":"","sources":["../../../src/lib/actions/get-thing.ts"],"names":[],"mappings":";;;;AAAA,kGAAkG;AAClG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAEhC,kCAAqC;AACrC,sCAAyC;AAE5B,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,mBAAmB;IAChC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,iMAAiM,EAAE,UAAU,EAAE,IAAI,EAAE;IAChP,KAAK,EAAE;QACL,QAAQ,EAAE,qBAAY,CAAC,QAAQ;QAC/B,QAAQ,EAAE,qBAAY,CAAC,QAAQ;KAChC;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC9C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAElD,MAAM,UAAU,GAAG,WAAW,OAAO,8BAA8B,QAAQ,EAAE,CAAC;YAE9E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,UAAU;gBACf,OAAO,EAAE;oBACP,YAAY,EAAE,cAAc;oBAC5B,aAAa,EAAE,UAAU,KAAK,EAAE;iBACjC;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACN;gBACD,IAAI,EAAE;oBACJ,UAAU,EAAE,QAAQ,QAAQ,EAAE;iBAC/B;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const bubbleListThingsAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ appname: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ typename: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ constraint: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
7
+ field: import("@agnocon/pieces-framework").ShortTextProperty<true>;
8
+ value: import("@agnocon/pieces-framework").ShortTextProperty<true>;
9
+ cursor: import("@agnocon/pieces-framework").NumberProperty<true>;
10
+ limit: import("@agnocon/pieces-framework").NumberProperty<true>;
11
+ }>;
12
+ //# sourceMappingURL=list-things.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-things.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/list-things.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,sBAAsB;;;;;;;;;;EA4FjC,CAAC"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bubbleListThingsAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bubble/src/lib/actions/list-things.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_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const common_1 = require("../common");
11
+ exports.bubbleListThingsAction = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.bubbleAuth,
13
+ name: 'bubble_list_things',
14
+ displayName: 'List Thing',
15
+ description: 'List things by type',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Search and list records ("things") of a given data type in a Bubble app via the Bubble Data API, filtering by a single constraint (e.g. equals, text contains, greater/less than, in, empty, geographic_search) on a chosen field and value, with cursor and limit for pagination. Use to find records matching a condition or to page through a type. Read-only and idempotent.', idempotent: true },
18
+ props: {
19
+ typename: common_1.bubbleCommon.typename,
20
+ constraint: pieces_framework_1.Property.StaticDropdown({
21
+ displayName: 'Constraint',
22
+ required: true,
23
+ options: {
24
+ options: [
25
+ {
26
+ label: 'equals or not equal',
27
+ value: 'equals or not equal',
28
+ },
29
+ {
30
+ label: 'text contains or not text contains',
31
+ value: 'text contains or not text contains',
32
+ },
33
+ {
34
+ label: 'greater than or less than',
35
+ value: 'greater than or less than',
36
+ },
37
+ {
38
+ label: 'in or not in',
39
+ value: 'in or not in',
40
+ },
41
+ {
42
+ label: 'contains or not contains',
43
+ value: 'contains or not contains',
44
+ },
45
+ {
46
+ label: 'empty or not empty',
47
+ value: 'empty or not empty',
48
+ },
49
+ {
50
+ label: 'geographic_search',
51
+ value: 'geographic_search',
52
+ },
53
+ ],
54
+ },
55
+ }),
56
+ field: pieces_framework_1.Property.ShortText({
57
+ displayName: 'Field',
58
+ required: true,
59
+ }),
60
+ value: pieces_framework_1.Property.ShortText({
61
+ displayName: 'Value',
62
+ required: true,
63
+ }),
64
+ cursor: pieces_framework_1.Property.Number({
65
+ displayName: 'Start from',
66
+ required: true,
67
+ }),
68
+ limit: pieces_framework_1.Property.Number({
69
+ displayName: 'Limit',
70
+ required: true,
71
+ }),
72
+ },
73
+ run(context) {
74
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
+ const { appname, token } = context.auth.props;
76
+ const { typename, constraint, field, value, cursor, limit } = context.propsValue;
77
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}`;
78
+ const response = yield pieces_common_1.httpClient.sendRequest({
79
+ method: pieces_common_1.HttpMethod.POST,
80
+ url: server_url,
81
+ headers: {
82
+ 'user-agent': 'activepieces',
83
+ Authorization: `Bearer ${token}`,
84
+ },
85
+ authentication: {
86
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
87
+ token,
88
+ },
89
+ body: {
90
+ constraint: constraint,
91
+ field: field,
92
+ value: value,
93
+ cursor: cursor,
94
+ limit: limit,
95
+ },
96
+ });
97
+ return response.body;
98
+ });
99
+ },
100
+ });
101
+ //# sourceMappingURL=list-things.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-things.js","sourceRoot":"","sources":["../../../src/lib/actions/list-things.ts"],"names":[],"mappings":";;;;AAAA,oGAAoG;AACpG,qEAAqE;AACrE,gEAAmE;AACnE,0DAIgC;AAEhC,kCAAqC;AACrC,sCAAyC;AAE5B,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,qBAAqB;IAClC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kXAAkX,EAAE,UAAU,EAAE,IAAI,EAAE;IACja,KAAK,EAAE;QACL,QAAQ,EAAE,qBAAY,CAAC,QAAQ;QAC/B,UAAU,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAClC,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,qBAAqB;wBAC5B,KAAK,EAAE,qBAAqB;qBAC7B;oBACD;wBACE,KAAK,EAAE,oCAAoC;wBAC3C,KAAK,EAAE,oCAAoC;qBAC5C;oBACD;wBACE,KAAK,EAAE,2BAA2B;wBAClC,KAAK,EAAE,2BAA2B;qBACnC;oBACD;wBACE,KAAK,EAAE,cAAc;wBACrB,KAAK,EAAE,cAAc;qBACtB;oBACD;wBACE,KAAK,EAAE,0BAA0B;wBACjC,KAAK,EAAE,0BAA0B;qBAClC;oBACD;wBACE,KAAK,EAAE,oBAAoB;wBAC3B,KAAK,EAAE,oBAAoB;qBAC5B;oBACD;wBACE,KAAK,EAAE,mBAAmB;wBAC1B,KAAK,EAAE,mBAAmB;qBAC3B;iBACF;aACF;SACF,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;SACf,CAAC;QAEF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC9C,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GACzD,OAAO,CAAC,UAAU,CAAC;YAErB,MAAM,UAAU,GAAG,WAAW,OAAO,8BAA8B,QAAQ,EAAE,CAAC;YAE9E,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,UAAU;gBACf,OAAO,EAAE;oBACP,YAAY,EAAE,cAAc;oBAC5B,aAAa,EAAE,UAAU,KAAK,EAAE;iBACjC;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACN;gBACD,IAAI,EAAE;oBACJ,UAAU,EAAE,UAAU;oBACtB,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,KAAK;iBACb;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const bubbleUpdateThingAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ appname: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
4
+ }>, {
5
+ typename: import("@agnocon/pieces-framework").ShortTextProperty<true>;
6
+ thing_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ fields: import("@agnocon/pieces-framework").JsonProperty<false>;
8
+ }>;
9
+ //# sourceMappingURL=update-thing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-thing.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/update-thing.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,uBAAuB;;;;;;;EAkClC,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bubbleUpdateThingAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bubble/src/lib/actions/update-thing.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_common_1 = require("@agnocon/pieces-common");
9
+ const auth_1 = require("../auth");
10
+ const common_1 = require("../common");
11
+ exports.bubbleUpdateThingAction = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.bubbleAuth,
13
+ name: 'bubble_update_thing',
14
+ displayName: 'Update Thing',
15
+ description: 'Updates a thing',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Update an existing record ("thing") in a Bubble app, identified by its unique id and data type, by patching the supplied fields via the Bubble Data API. Use to modify specific fields of a known record; only the provided fields are changed. Targets one record so repeats with the same input converge, but it mutates server state on each call.', idempotent: false },
18
+ props: {
19
+ typename: common_1.bubbleCommon.typename,
20
+ thing_id: common_1.bubbleCommon.thing_id,
21
+ fields: common_1.bubbleCommon.fields,
22
+ },
23
+ run(context) {
24
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
+ const { appname, token } = context.auth.props;
26
+ const { typename, thing_id } = context.propsValue;
27
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}/${thing_id}`;
28
+ const response = yield pieces_common_1.httpClient.sendRequest({
29
+ method: pieces_common_1.HttpMethod.PATCH,
30
+ url: server_url,
31
+ headers: {
32
+ 'user-agent': 'activepieces',
33
+ Authorization: `Bearer ${token}`,
34
+ },
35
+ authentication: {
36
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
37
+ token,
38
+ },
39
+ body: context.propsValue.fields,
40
+ });
41
+ return response.body;
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=update-thing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-thing.js","sourceRoot":"","sources":["../../../src/lib/actions/update-thing.ts"],"names":[],"mappings":";;;;AAAA,qGAAqG;AACrG,qEAAqE;AACrE,gEAAyD;AACzD,0DAIgC;AAEhC,kCAAqC;AACrC,sCAAyC;AAE5B,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,iBAAiB;IAC9B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,uVAAuV,EAAE,UAAU,EAAE,KAAK,EAAE;IACvY,KAAK,EAAE;QACL,QAAQ,EAAE,qBAAY,CAAC,QAAQ;QAC/B,QAAQ,EAAE,qBAAY,CAAC,QAAQ;QAC/B,MAAM,EAAE,qBAAY,CAAC,MAAM;KAC5B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAC9C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAElD,MAAM,UAAU,GAAG,WAAW,OAAO,8BAA8B,QAAQ,IAAI,QAAQ,EAAE,CAAC;YAE1F,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,KAAK;gBACxB,GAAG,EAAE,UAAU;gBACf,OAAO,EAAE;oBACP,YAAY,EAAE,cAAc;oBAC5B,aAAa,EAAE,UAAU,KAAK,EAAE;iBACjC;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACN;gBACD,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;aAChC,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const bubbleAuth: import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ appname: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
4
+ }>;
5
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU;;;EA+BrB,CAAC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bubbleAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bubble/src/lib/auth.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
+ exports.bubbleAuth = pieces_framework_1.PieceAuth.CustomAuth({
9
+ description: `Enter Bubble Connection Details
10
+ In the bubble editor click Settings > API
11
+ 1. Your app name is https://appname.bubbleapps.io
12
+ 2. Enter/Generate an API key
13
+ `,
14
+ props: {
15
+ appname: pieces_framework_1.Property.ShortText({
16
+ displayName: 'App name',
17
+ description: 'Enter the app name',
18
+ required: true,
19
+ }),
20
+ token: pieces_framework_1.PieceAuth.SecretText({
21
+ displayName: 'API Token',
22
+ description: 'Enter the access token',
23
+ required: true,
24
+ }),
25
+ },
26
+ // Optional Validation
27
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
28
+ if (auth) {
29
+ return {
30
+ valid: true,
31
+ };
32
+ }
33
+ return {
34
+ valid: false,
35
+ error: 'Please enter a valid app name and token',
36
+ };
37
+ }),
38
+ required: true,
39
+ });
40
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qFAAqF;AACrF,qEAAqE;AACrE,gEAAgE;AAEnD,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC7C,WAAW,EAAE;;;;GAIZ;IACD,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC1B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,wBAAwB;YACrC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,sBAAsB;IACtB,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,IAAI,EAAE,CAAC;YACT,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;QACD,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,yCAAyC;SACjD,CAAC;IACJ,CAAC,CAAA;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const bubbleCommon: {
2
+ typename: import("@agnocon/pieces-framework").ShortTextProperty<true>;
3
+ fields: import("@agnocon/pieces-framework").JsonProperty<false>;
4
+ thing_id: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ };
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/common/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY;;;;CAaxB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bubbleCommon = void 0;
4
+ // Vendored from Activepieces packages/pieces/community/bubble/src/lib/common/index.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
+ exports.bubbleCommon = {
8
+ typename: pieces_framework_1.Property.ShortText({
9
+ displayName: 'Typename',
10
+ required: true,
11
+ }),
12
+ fields: pieces_framework_1.Property.Json({
13
+ displayName: 'Body',
14
+ required: false,
15
+ }),
16
+ thing_id: pieces_framework_1.Property.ShortText({
17
+ displayName: 'Thing ID',
18
+ required: true,
19
+ }),
20
+ };
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/common/index.ts"],"names":[],"mappings":";;;AAAA,6FAA6F;AAC7F,qEAAqE;AACrE,gEAAqD;AAExC,QAAA,YAAY,GAAG;IAC1B,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;QAC3B,WAAW,EAAE,UAAU;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,MAAM,EAAE,2BAAQ,CAAC,IAAI,CAAC;QACpB,WAAW,EAAE,MAAM;QACnB,QAAQ,EAAE,KAAK;KAChB,CAAC;IACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;QAC3B,WAAW,EAAE,UAAU;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@agnocon/piece-bubble",
3
+ "version": "0.1.6",
4
+ "description": "AgnoCon bubble connector",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "require": "./dist/index.js",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "src",
17
+ "LICENSE.MIT-AP"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc -p tsconfig.json",
21
+ "vendor": "node ../scripts/vendor-ap.mjs piece-bubble"
22
+ },
23
+ "dependencies": {
24
+ "@agnocon/core-utils": "0.2.0",
25
+ "@agnocon/piece-types": "0.3.1",
26
+ "@agnocon/pieces-common": "0.12.8",
27
+ "@agnocon/pieces-framework": "0.36.0",
28
+ "tslib": "2.6.2"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "20.17.6",
32
+ "typescript": "5.5.4"
33
+ },
34
+ "license": "MIT",
35
+ "agnocon": {
36
+ "originVersion": "0.1.6"
37
+ },
38
+ "publishConfig": {
39
+ "access": "restricted",
40
+ "tag": "latest"
41
+ },
42
+ "keywords": [
43
+ "agnocon",
44
+ "connector"
45
+ ]
46
+ }
package/src/index.ts ADDED
@@ -0,0 +1,32 @@
1
+ import {
2
+ createPiece,
3
+ PieceAuth,
4
+ Property,
5
+ } from '@agnocon/pieces-framework';
6
+
7
+ import { PieceCategory } from '@agnocon/pieces-framework';
8
+ import { bubbleCreateThingAction } from './lib/actions/create-thing';
9
+ import { bubbleDeleteThingAction } from './lib/actions/delete-thing';
10
+ import { bubbleGetThingAction } from './lib/actions/get-thing';
11
+ import { bubbleListThingsAction } from './lib/actions/list-things';
12
+ import { bubbleUpdateThingAction } from './lib/actions/update-thing';
13
+ import { bubbleAuth } from './lib/auth';
14
+
15
+ export const bubble = createPiece({
16
+ displayName: 'Bubble',
17
+ description: 'No-code platform for web and mobile apps',
18
+
19
+ auth: PieceAuth.None(),
20
+ minimumSupportedRelease: '0.30.0',
21
+ logoUrl: 'https://cdn.activepieces.com/pieces/bubble.png',
22
+ categories: [PieceCategory.DEVELOPER_TOOLS],
23
+ authors: ["TaskMagicKyle","kishanprmr","abuaboud"],
24
+ actions: [
25
+ bubbleCreateThingAction,
26
+ bubbleDeleteThingAction,
27
+ bubbleUpdateThingAction,
28
+ bubbleGetThingAction,
29
+ bubbleListThingsAction,
30
+ ],
31
+ triggers: [],
32
+ });
@@ -0,0 +1,44 @@
1
+ import { createAction } from '@agnocon/pieces-framework';
2
+ import {
3
+ AuthenticationType,
4
+ httpClient,
5
+ HttpMethod,
6
+ } from '@agnocon/pieces-common';
7
+
8
+ import { bubbleAuth } from '../auth';
9
+ import { bubbleCommon } from '../common';
10
+
11
+ export const bubbleCreateThingAction = createAction({
12
+ auth: bubbleAuth,
13
+ name: 'bubble_create_thing',
14
+ displayName: 'Create Thing',
15
+ description: 'Create a thing',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Create a new record ("thing") of a given data type in a Bubble app via the Bubble Data API. Use to add a new entry; supply the type name and a fields object with the values to set. Not idempotent — each call creates a separate record.', idempotent: false },
18
+ props: {
19
+ typename: bubbleCommon.typename,
20
+ fields: bubbleCommon.fields,
21
+ },
22
+ async run(context) {
23
+ const { appname, token } = context.auth.props;
24
+ const { typename, fields } = context.propsValue;
25
+
26
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}`;
27
+
28
+ const response = await httpClient.sendRequest({
29
+ method: HttpMethod.POST,
30
+ url: server_url,
31
+ headers: {
32
+ 'user-agent': 'activepieces',
33
+ Authorization: `Bearer ${token}`,
34
+ },
35
+ authentication: {
36
+ type: AuthenticationType.BEARER_TOKEN,
37
+ token,
38
+ },
39
+ body: fields,
40
+ });
41
+
42
+ return response.body;
43
+ },
44
+ });
@@ -0,0 +1,43 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import {
3
+ AuthenticationType,
4
+ httpClient,
5
+ HttpMethod,
6
+ } from '@agnocon/pieces-common';
7
+
8
+ import { bubbleAuth } from '../auth';
9
+ import { bubbleCommon } from '../common';
10
+
11
+ export const bubbleDeleteThingAction = createAction({
12
+ auth: bubbleAuth,
13
+ name: 'bubble_delete_thing',
14
+ displayName: 'Delete Thing',
15
+ description: 'Delete a thing',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Permanently delete a single record ("thing") from a Bubble app by its unique id and data type, via the Bubble Data API. Use when an agent must remove a specific record it already knows the id of. Effectively idempotent (deleting an already-deleted id is a no-op) but destructive — verify the id before calling.', idempotent: true },
18
+ props: {
19
+ typename: bubbleCommon.typename,
20
+ thing_id: bubbleCommon.thing_id,
21
+ },
22
+ async run(context) {
23
+ const { appname, token } = context.auth.props;
24
+ const { typename, thing_id } = context.propsValue;
25
+
26
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}/${thing_id}`;
27
+
28
+ const response = await httpClient.sendRequest({
29
+ method: HttpMethod.DELETE,
30
+ url: server_url,
31
+ headers: {
32
+ 'user-agent': 'activepieces',
33
+ Authorization: `Bearer ${token}`,
34
+ },
35
+ authentication: {
36
+ type: AuthenticationType.BEARER_TOKEN,
37
+ token,
38
+ },
39
+ });
40
+
41
+ return response.body;
42
+ },
43
+ });
@@ -0,0 +1,46 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import {
3
+ AuthenticationType,
4
+ httpClient,
5
+ HttpMethod,
6
+ } from '@agnocon/pieces-common';
7
+
8
+ import { bubbleAuth } from '../auth';
9
+ import { bubbleCommon } from '../common';
10
+
11
+ export const bubbleGetThingAction = createAction({
12
+ auth: bubbleAuth,
13
+ name: 'bubble_get_thing',
14
+ displayName: 'Get Thing',
15
+ description: 'Get a thing by id',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Fetch a single record ("thing") of a given data type from a Bubble app by its unique id, via the Bubble Data API. Use to read the current values of one known record. Read-only and idempotent.', idempotent: true },
18
+ props: {
19
+ typename: bubbleCommon.typename,
20
+ thing_id: bubbleCommon.thing_id,
21
+ },
22
+ async run(context) {
23
+ const { appname, token } = context.auth.props;
24
+ const { typename, thing_id } = context.propsValue;
25
+
26
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}`;
27
+
28
+ const response = await httpClient.sendRequest({
29
+ method: HttpMethod.GET,
30
+ url: server_url,
31
+ headers: {
32
+ 'user-agent': 'activepieces',
33
+ Authorization: `Bearer ${token}`,
34
+ },
35
+ authentication: {
36
+ type: AuthenticationType.BEARER_TOKEN,
37
+ token,
38
+ },
39
+ body: {
40
+ constraint: `id = ${thing_id}`,
41
+ },
42
+ });
43
+
44
+ return response.body;
45
+ },
46
+ });
@@ -0,0 +1,103 @@
1
+ import { createAction, Property } from '@agnocon/pieces-framework';
2
+ import {
3
+ AuthenticationType,
4
+ httpClient,
5
+ HttpMethod,
6
+ } from '@agnocon/pieces-common';
7
+
8
+ import { bubbleAuth } from '../auth';
9
+ import { bubbleCommon } from '../common';
10
+
11
+ export const bubbleListThingsAction = createAction({
12
+ auth: bubbleAuth,
13
+ name: 'bubble_list_things',
14
+ displayName: 'List Thing',
15
+ description: 'List things by type',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Search and list records ("things") of a given data type in a Bubble app via the Bubble Data API, filtering by a single constraint (e.g. equals, text contains, greater/less than, in, empty, geographic_search) on a chosen field and value, with cursor and limit for pagination. Use to find records matching a condition or to page through a type. Read-only and idempotent.', idempotent: true },
18
+ props: {
19
+ typename: bubbleCommon.typename,
20
+ constraint: Property.StaticDropdown({
21
+ displayName: 'Constraint',
22
+ required: true,
23
+ options: {
24
+ options: [
25
+ {
26
+ label: 'equals or not equal',
27
+ value: 'equals or not equal',
28
+ },
29
+ {
30
+ label: 'text contains or not text contains',
31
+ value: 'text contains or not text contains',
32
+ },
33
+ {
34
+ label: 'greater than or less than',
35
+ value: 'greater than or less than',
36
+ },
37
+ {
38
+ label: 'in or not in',
39
+ value: 'in or not in',
40
+ },
41
+ {
42
+ label: 'contains or not contains',
43
+ value: 'contains or not contains',
44
+ },
45
+ {
46
+ label: 'empty or not empty',
47
+ value: 'empty or not empty',
48
+ },
49
+ {
50
+ label: 'geographic_search',
51
+ value: 'geographic_search',
52
+ },
53
+ ],
54
+ },
55
+ }),
56
+ field: Property.ShortText({
57
+ displayName: 'Field',
58
+ required: true,
59
+ }),
60
+ value: Property.ShortText({
61
+ displayName: 'Value',
62
+ required: true,
63
+ }),
64
+ cursor: Property.Number({
65
+ displayName: 'Start from',
66
+ required: true,
67
+ }),
68
+
69
+ limit: Property.Number({
70
+ displayName: 'Limit',
71
+ required: true,
72
+ }),
73
+ },
74
+ async run(context) {
75
+ const { appname, token } = context.auth.props;
76
+ const { typename, constraint, field, value, cursor, limit } =
77
+ context.propsValue;
78
+
79
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}`;
80
+
81
+ const response = await httpClient.sendRequest({
82
+ method: HttpMethod.POST,
83
+ url: server_url,
84
+ headers: {
85
+ 'user-agent': 'activepieces',
86
+ Authorization: `Bearer ${token}`,
87
+ },
88
+ authentication: {
89
+ type: AuthenticationType.BEARER_TOKEN,
90
+ token,
91
+ },
92
+ body: {
93
+ constraint: constraint,
94
+ field: field,
95
+ value: value,
96
+ cursor: cursor,
97
+ limit: limit,
98
+ },
99
+ });
100
+
101
+ return response.body;
102
+ },
103
+ });
@@ -0,0 +1,45 @@
1
+ import { createAction } from '@agnocon/pieces-framework';
2
+ import {
3
+ AuthenticationType,
4
+ httpClient,
5
+ HttpMethod,
6
+ } from '@agnocon/pieces-common';
7
+
8
+ import { bubbleAuth } from '../auth';
9
+ import { bubbleCommon } from '../common';
10
+
11
+ export const bubbleUpdateThingAction = createAction({
12
+ auth: bubbleAuth,
13
+ name: 'bubble_update_thing',
14
+ displayName: 'Update Thing',
15
+ description: 'Updates a thing',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Update an existing record ("thing") in a Bubble app, identified by its unique id and data type, by patching the supplied fields via the Bubble Data API. Use to modify specific fields of a known record; only the provided fields are changed. Targets one record so repeats with the same input converge, but it mutates server state on each call.', idempotent: false },
18
+ props: {
19
+ typename: bubbleCommon.typename,
20
+ thing_id: bubbleCommon.thing_id,
21
+ fields: bubbleCommon.fields,
22
+ },
23
+ async run(context) {
24
+ const { appname, token } = context.auth.props;
25
+ const { typename, thing_id } = context.propsValue;
26
+
27
+ const server_url = `https://${appname}.bubbleapps.io/api/1.1/obj/${typename}/${thing_id}`;
28
+
29
+ const response = await httpClient.sendRequest({
30
+ method: HttpMethod.PATCH,
31
+ url: server_url,
32
+ headers: {
33
+ 'user-agent': 'activepieces',
34
+ Authorization: `Bearer ${token}`,
35
+ },
36
+ authentication: {
37
+ type: AuthenticationType.BEARER_TOKEN,
38
+ token,
39
+ },
40
+ body: context.propsValue.fields,
41
+ });
42
+
43
+ return response.body;
44
+ },
45
+ });
@@ -0,0 +1,34 @@
1
+ import { PieceAuth, Property } from '@agnocon/pieces-framework';
2
+
3
+ export const bubbleAuth = PieceAuth.CustomAuth({
4
+ description: `Enter Bubble Connection Details
5
+ In the bubble editor click Settings > API
6
+ 1. Your app name is https://appname.bubbleapps.io
7
+ 2. Enter/Generate an API key
8
+ `,
9
+ props: {
10
+ appname: Property.ShortText({
11
+ displayName: 'App name',
12
+ description: 'Enter the app name',
13
+ required: true,
14
+ }),
15
+ token: PieceAuth.SecretText({
16
+ displayName: 'API Token',
17
+ description: 'Enter the access token',
18
+ required: true,
19
+ }),
20
+ },
21
+ // Optional Validation
22
+ validate: async ({ auth }) => {
23
+ if (auth) {
24
+ return {
25
+ valid: true,
26
+ };
27
+ }
28
+ return {
29
+ valid: false,
30
+ error: 'Please enter a valid app name and token',
31
+ };
32
+ },
33
+ required: true,
34
+ });
@@ -0,0 +1,16 @@
1
+ import { Property } from '@agnocon/pieces-framework';
2
+
3
+ export const bubbleCommon = {
4
+ typename: Property.ShortText({
5
+ displayName: 'Typename',
6
+ required: true,
7
+ }),
8
+ fields: Property.Json({
9
+ displayName: 'Body',
10
+ required: false,
11
+ }),
12
+ thing_id: Property.ShortText({
13
+ displayName: 'Thing ID',
14
+ required: true,
15
+ }),
16
+ };