@agnocon/piece-bika 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 (52) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +44 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/create-record.d.ts +14 -0
  7. package/dist/lib/actions/create-record.d.ts.map +1 -0
  8. package/dist/lib/actions/create-record.js +51 -0
  9. package/dist/lib/actions/create-record.js.map +1 -0
  10. package/dist/lib/actions/delete-record.d.ts +12 -0
  11. package/dist/lib/actions/delete-record.d.ts.map +1 -0
  12. package/dist/lib/actions/delete-record.js +40 -0
  13. package/dist/lib/actions/delete-record.js.map +1 -0
  14. package/dist/lib/actions/find-record.d.ts +12 -0
  15. package/dist/lib/actions/find-record.d.ts.map +1 -0
  16. package/dist/lib/actions/find-record.js +39 -0
  17. package/dist/lib/actions/find-record.js.map +1 -0
  18. package/dist/lib/actions/find-records.d.ts +14 -0
  19. package/dist/lib/actions/find-records.d.ts.map +1 -0
  20. package/dist/lib/actions/find-records.js +58 -0
  21. package/dist/lib/actions/find-records.js.map +1 -0
  22. package/dist/lib/actions/update-record.d.ts +15 -0
  23. package/dist/lib/actions/update-record.d.ts.map +1 -0
  24. package/dist/lib/actions/update-record.js +53 -0
  25. package/dist/lib/actions/update-record.js.map +1 -0
  26. package/dist/lib/auth.d.ts +4 -0
  27. package/dist/lib/auth.d.ts.map +1 -0
  28. package/dist/lib/auth.js +45 -0
  29. package/dist/lib/auth.js.map +1 -0
  30. package/dist/lib/common/client.d.ts +63 -0
  31. package/dist/lib/common/client.d.ts.map +1 -0
  32. package/dist/lib/common/client.js +91 -0
  33. package/dist/lib/common/client.js.map +1 -0
  34. package/dist/lib/common/constants.d.ts +28 -0
  35. package/dist/lib/common/constants.d.ts.map +1 -0
  36. package/dist/lib/common/constants.js +10 -0
  37. package/dist/lib/common/constants.js.map +1 -0
  38. package/dist/lib/common/index.d.ts +17 -0
  39. package/dist/lib/common/index.d.ts.map +1 -0
  40. package/dist/lib/common/index.js +235 -0
  41. package/dist/lib/common/index.js.map +1 -0
  42. package/package.json +46 -0
  43. package/src/index.ts +41 -0
  44. package/src/lib/actions/create-record.ts +61 -0
  45. package/src/lib/actions/delete-record.ts +44 -0
  46. package/src/lib/actions/find-record.ts +44 -0
  47. package/src/lib/actions/find-records.ts +62 -0
  48. package/src/lib/actions/update-record.ts +65 -0
  49. package/src/lib/auth.ts +40 -0
  50. package/src/lib/common/client.ts +147 -0
  51. package/src/lib/common/constants.ts +33 -0
  52. package/src/lib/common/index.ts +250 -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,4 @@
1
+ export declare const bika: import("@agnocon/pieces-framework").Piece<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
3
+ }>>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,IAAI;;GAyBf,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bika = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bika/src/index.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_common_1 = require("@agnocon/pieces-common");
8
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
9
+ const pieces_framework_2 = require("@agnocon/pieces-framework");
10
+ const create_record_1 = require("./lib/actions/create-record");
11
+ const find_records_1 = require("./lib/actions/find-records");
12
+ const find_record_1 = require("./lib/actions/find-record");
13
+ const delete_record_1 = require("./lib/actions/delete-record");
14
+ const update_record_1 = require("./lib/actions/update-record");
15
+ const auth_1 = require("./lib/auth");
16
+ exports.bika = (0, pieces_framework_1.createPiece)({
17
+ displayName: 'Bika.ai',
18
+ auth: auth_1.BikaAuth,
19
+ description: `Interactive spreadsheets with collaboration`,
20
+ minimumSupportedRelease: '0.30.0',
21
+ logoUrl: 'https://cdn.activepieces.com/pieces/bika.png',
22
+ categories: [pieces_framework_2.PieceCategory.PRODUCTIVITY],
23
+ authors: [
24
+ 'codegino'
25
+ ],
26
+ actions: [
27
+ create_record_1.createRecordAction,
28
+ find_records_1.findRecordsAction,
29
+ find_record_1.findRecordAction,
30
+ update_record_1.updateRecordAction,
31
+ delete_record_1.deleteRecordAction,
32
+ (0, pieces_common_1.createCustomApiCallAction)({
33
+ baseUrl: () => 'https://bika.ai/api/openapi/bika',
34
+ auth: auth_1.BikaAuth,
35
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
36
+ return ({
37
+ Authorization: `Bearer ${(auth).props.token}`,
38
+ });
39
+ }),
40
+ }),
41
+ ],
42
+ triggers: [],
43
+ });
44
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,qEAAqE;AACrE,0DAAmE;AACnE,gEAImC;AACnC,gEAA0D;AAC1D,+DAAiE;AACjE,6DAA+D;AAC/D,2DAA4D;AAC5D,+DAAgE;AAChE,+DAAiE;AAEjE,qCAAsC;AAEzB,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC9B,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,eAAQ;IACd,WAAW,EAAE,6CAA6C;IAC1D,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,8CAA8C;IACvD,UAAU,EAAE,CAAC,gCAAa,CAAC,YAAY,CAAC;IACxC,OAAO,EAAE;QACP,UAAU;KACX;IACD,OAAO,EAAE;QACP,kCAAkB;QAClB,gCAAiB;QACjB,8BAAgB;QAChB,kCAAkB;QAClB,kCAAkB;QAClB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,kCAAkC;YACjD,IAAI,EAAE,eAAQ;YACd,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE;iBAC9C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const createRecordAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
3
+ }>, {
4
+ space_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
5
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ }>>;
7
+ database_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
8
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
9
+ }>>;
10
+ fields: import("@agnocon/pieces-framework").DynamicProperties<true, import("@agnocon/pieces-framework").CustomAuthProperty<{
11
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
12
+ }>>;
13
+ }>;
14
+ //# sourceMappingURL=create-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-record.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/create-record.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAqD7B,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRecordAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bika/src/lib/actions/create-record.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 common_1 = require("../common");
9
+ const auth_1 = require("../auth");
10
+ exports.createRecordAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.BikaAuth,
12
+ name: 'bika_create_record',
13
+ displayName: 'Create Record',
14
+ description: 'Creates a new record in database.',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Creates a new record in a Bika.ai database table, populating its fields. Requires a space and database (table) to target; field values must match the database schema (read-only field types like formulas and autonumber are ignored). Not idempotent: each call appends a new record.', idempotent: false },
17
+ props: {
18
+ space_id: common_1.BikaCommon.space_id,
19
+ database_id: common_1.BikaCommon.database_id,
20
+ fields: common_1.BikaCommon.fields,
21
+ },
22
+ run(context) {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
+ const auth = context.auth;
25
+ const databaseId = context.propsValue.database_id;
26
+ const spaceId = context.propsValue.space_id;
27
+ const dynamicFields = context.propsValue.fields;
28
+ const fields = {};
29
+ const props = Object.entries(dynamicFields);
30
+ for (const [propertyKey, propertyValue] of props) {
31
+ if (propertyValue !== undefined && propertyValue !== '') {
32
+ fields[propertyKey] = propertyValue;
33
+ }
34
+ }
35
+ const newFields = yield (0, common_1.createNewFields)(auth, spaceId, databaseId, fields);
36
+ const client = (0, common_1.makeClient)(context.auth.props);
37
+ const response = yield client.createRecord(spaceId, databaseId, {
38
+ records: [
39
+ {
40
+ fields: Object.assign({}, newFields),
41
+ },
42
+ ],
43
+ });
44
+ if (!response.success) {
45
+ throw new Error(JSON.stringify(response, undefined, 2));
46
+ }
47
+ return response;
48
+ });
49
+ },
50
+ });
51
+ //# sourceMappingURL=create-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-record.js","sourceRoot":"","sources":["../../../src/lib/actions/create-record.ts"],"names":[],"mappings":";;;;AAAA,oGAAoG;AACpG,qEAAqE;AACrE,gEAGmC;AACnC,sCAAoE;AACpE,kCAAmC;AAEtB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,mCAAmC;IAChD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,yRAAyR,EAAE,UAAU,EAAE,KAAK,EAAE;IACzU,KAAK,EAAE;QACL,QAAQ,EAAE,mBAAU,CAAC,QAAQ;QAC7B,WAAW,EAAE,mBAAU,CAAC,WAAW;QACnC,MAAM,EAAE,mBAAU,CAAC,MAAM;KAC1B;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;YAC1B,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;YAClD,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5C,MAAM,aAAa,GAAsB,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YACnE,MAAM,MAAM,GAER,EAAE,CAAC;YAEP,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YAC5C,KAAK,MAAM,CAAC,WAAW,EAAE,aAAa,CAAC,IAAI,KAAK,EAAE,CAAC;gBACjD,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,KAAK,EAAE,EAAE,CAAC;oBACxD,MAAM,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC;gBACtC,CAAC;YACH,CAAC;YAED,MAAM,SAAS,GAA4B,MAAM,IAAA,wBAAe,EAC9D,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,CACP,CAAC;YAEF,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CACnB,CAAC;YACF,MAAM,QAAQ,GAAQ,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,EAAG;gBACpE,OAAO,EAAE;oBACP;wBACE,MAAM,oBACD,SAAS,CACb;qBACF;iBACF;aACF,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1D,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const deleteRecordAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
3
+ }>, {
4
+ space_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
5
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ }>>;
7
+ database_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
8
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
9
+ }>>;
10
+ recordId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
11
+ }>;
12
+ //# sourceMappingURL=delete-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-record.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/delete-record.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,kBAAkB;;;;;;;;;;EAoC7B,CAAC"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteRecordAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bika/src/lib/actions/delete-record.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 common_1 = require("../common");
9
+ const auth_1 = require("../auth");
10
+ exports.deleteRecordAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.BikaAuth,
12
+ name: 'bika_delete_record',
13
+ displayName: 'Delete Record',
14
+ description: 'Deletes a record in database by ID.',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Deletes a single record from a Bika.ai database by its record ID, within a given space and database. Use to permanently remove a known record. Idempotent in effect: once removed, repeating the call leaves the record absent.', idempotent: true },
17
+ props: {
18
+ space_id: common_1.BikaCommon.space_id,
19
+ database_id: common_1.BikaCommon.database_id,
20
+ recordId: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Record ID',
22
+ description: 'The ID of the record to delete.',
23
+ required: true,
24
+ }),
25
+ },
26
+ run(context) {
27
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
+ const databaseId = context.propsValue.database_id;
29
+ const spaceId = context.propsValue.space_id;
30
+ const recordId = context.propsValue.recordId;
31
+ const client = (0, common_1.makeClient)(context.auth.props);
32
+ const response = yield client.deleteRecord(spaceId, databaseId, recordId);
33
+ if (!response.success) {
34
+ throw new Error(JSON.stringify(response, undefined, 2));
35
+ }
36
+ return response;
37
+ });
38
+ },
39
+ });
40
+ //# sourceMappingURL=delete-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-record.js","sourceRoot":"","sources":["../../../src/lib/actions/delete-record.ts"],"names":[],"mappings":";;;;AAAA,oGAAoG;AACpG,qEAAqE;AACrE,gEAGmC;AACnC,sCAAmD;AACnD,kCAAmC;AAEtB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,qCAAqC;IAClD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,iOAAiO,EAAE,UAAU,EAAE,IAAI,EAAE;IAChR,KAAK,EAAE;QACL,QAAQ,EAAE,mBAAU,CAAC,QAAQ;QAC7B,WAAW,EAAE,mBAAU,CAAC,WAAW;QACjC,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;YAClD,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;YAE7C,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CACnB,CAAC;YAEF,MAAM,QAAQ,GAAQ,MAAM,MAAM,CAAC,YAAY,CAC7C,OAAO,EACP,UAAU,EACV,QAAQ,CACT,CAAC;YAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1D,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const findRecordAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
3
+ }>, {
4
+ space_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
5
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ }>>;
7
+ database_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
8
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
9
+ }>>;
10
+ recordId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
11
+ }>;
12
+ //# sourceMappingURL=find-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-record.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/find-record.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB;;;;;;;;;;EAmC3B,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findRecordAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bika/src/lib/actions/find-record.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 common_1 = require("../common");
9
+ const auth_1 = require("../auth");
10
+ exports.findRecordAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.BikaAuth,
12
+ name: 'bika_find_record',
13
+ displayName: 'Get Record',
14
+ description: 'Retrieves a record in database by ID.',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Retrieves a single record from a Bika.ai database by its record ID. Use when you already know the exact record ID; to search by field values or fetch multiple rows use Find Records instead. Read-only and idempotent.', idempotent: true },
17
+ props: {
18
+ space_id: common_1.BikaCommon.space_id,
19
+ database_id: common_1.BikaCommon.database_id,
20
+ recordId: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Record ID',
22
+ required: true,
23
+ }),
24
+ },
25
+ run(context) {
26
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
+ const databaseId = context.propsValue.database_id;
28
+ const spaceId = context.propsValue.space_id;
29
+ const recordId = context.propsValue.recordId;
30
+ const client = (0, common_1.makeClient)(context.auth.props);
31
+ const response = yield client.findRecord(spaceId, databaseId, recordId);
32
+ if (!response.success) {
33
+ throw new Error(JSON.stringify(response, undefined, 2));
34
+ }
35
+ return response;
36
+ });
37
+ },
38
+ });
39
+ //# sourceMappingURL=find-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-record.js","sourceRoot":"","sources":["../../../src/lib/actions/find-record.ts"],"names":[],"mappings":";;;;AAAA,kGAAkG;AAClG,qEAAqE;AACrE,gEAImC;AACnC,sCAAmD;AACnD,kCAAmC;AAEtB,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,yNAAyN,EAAE,UAAU,EAAE,IAAI,EAAE;IACxQ,KAAK,EAAE;QACL,QAAQ,EAAE,mBAAU,CAAC,QAAQ;QAC7B,WAAW,EAAE,mBAAU,CAAC,WAAW;QACjC,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;YAClD,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;YAE7C,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CACnB,CAAC;YAEF,MAAM,QAAQ,GAAQ,MAAM,MAAM,CAAC,UAAU,CAC3C,OAAO,EACP,UAAU,EACV,QAAQ,CACT,CAAC;YAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1D,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const findRecordsAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
3
+ }>, {
4
+ space_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
5
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ }>>;
7
+ database_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
8
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
9
+ }>>;
10
+ maxRecords: import("@agnocon/pieces-framework").NumberProperty<false>;
11
+ pageSize: import("@agnocon/pieces-framework").NumberProperty<false>;
12
+ filter: import("@agnocon/pieces-framework").LongTextProperty<false>;
13
+ }>;
14
+ //# sourceMappingURL=find-records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-records.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/find-records.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAoD5B,CAAC"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findRecordsAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bika/src/lib/actions/find-records.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 common_1 = require("../common");
9
+ const auth_1 = require("../auth");
10
+ const client_1 = require("../common/client");
11
+ exports.findRecordsAction = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.BikaAuth,
13
+ name: 'bika_find_records',
14
+ displayName: 'Find Records',
15
+ description: 'Finds records in database.',
16
+ audience: 'both',
17
+ aiMetadata: { description: 'Lists records from a Bika.ai database, optionally narrowed by a filter expression (Bika filter-query-language); with no filter it returns all records up to the configured limits. Use to search or page through a table when you need multiple matching rows rather than a single known ID. Read-only and idempotent.', idempotent: true },
18
+ props: {
19
+ space_id: common_1.BikaCommon.space_id,
20
+ database_id: common_1.BikaCommon.database_id,
21
+ maxRecords: pieces_framework_1.Property.Number({
22
+ displayName: 'Max Records',
23
+ description: 'How many records are returned in total.',
24
+ required: false,
25
+ }),
26
+ pageSize: pieces_framework_1.Property.Number({
27
+ displayName: 'Page Size',
28
+ description: 'How many records are returned per page (max 1000).',
29
+ required: false,
30
+ }),
31
+ filter: pieces_framework_1.Property.LongText({
32
+ displayName: 'Filter',
33
+ description: 'The filter to apply to the records (see https://bika.ai/help/guide/developer/filter-query-language).',
34
+ required: false,
35
+ }),
36
+ },
37
+ run(context) {
38
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
39
+ var _a;
40
+ const databaseId = context.propsValue.database_id;
41
+ const spaceId = context.propsValue.space_id;
42
+ const maxRecords = context.propsValue.maxRecords;
43
+ const pageSize = (_a = context.propsValue.pageSize) !== null && _a !== void 0 ? _a : 100;
44
+ const filter = context.propsValue.filter;
45
+ const client = (0, common_1.makeClient)(context.auth.props);
46
+ const response = yield client.listRecords(spaceId, databaseId, (0, client_1.prepareQuery)({
47
+ pageSize,
48
+ maxRecords,
49
+ filter,
50
+ }));
51
+ if (!response.success) {
52
+ throw new Error(JSON.stringify(response, undefined, 2));
53
+ }
54
+ return response;
55
+ });
56
+ },
57
+ });
58
+ //# sourceMappingURL=find-records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-records.js","sourceRoot":"","sources":["../../../src/lib/actions/find-records.ts"],"names":[],"mappings":";;;;AAAA,mGAAmG;AACnG,qEAAqE;AACrE,gEAImC;AACnC,sCAAmD;AACnD,kCAAmC;AACnC,6CAAgD;AAEnC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,4BAA4B;IACzC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,wTAAwT,EAAE,UAAU,EAAE,IAAI,EAAE;IACvW,KAAK,EAAE;QACL,QAAQ,EAAE,mBAAU,CAAC,QAAQ;QAC7B,WAAW,EAAE,mBAAU,CAAC,WAAW;QACnC,UAAU,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC1B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,sGAAsG;YACxG,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;YAClD,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC5C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC;YACjD,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,UAAU,CAAC,QAAQ,mCAAI,GAAG,CAAC;YACpD,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YAEzC,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CACnB,CAAC;YACF,MAAM,QAAQ,GAAQ,MAAM,MAAM,CAAC,WAAW,CAC5C,OAAO,EACP,UAAU,EACV,IAAA,qBAAY,EAAC;gBACX,QAAQ;gBACR,UAAU;gBACV,MAAM;aACP,CAAC,CACH,CAAC;YAEF,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;YAC1D,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ export declare const updateRecordAction: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
3
+ }>, {
4
+ space_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
5
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
6
+ }>>;
7
+ database_id: import("@agnocon/pieces-framework").DropdownProperty<string, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
8
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
9
+ }>>;
10
+ recordId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
11
+ fields: import("@agnocon/pieces-framework").DynamicProperties<true, import("@agnocon/pieces-framework").CustomAuthProperty<{
12
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
13
+ }>>;
14
+ }>;
15
+ //# sourceMappingURL=update-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-record.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/update-record.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;EAuD7B,CAAC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateRecordAction = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bika/src/lib/actions/update-record.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 common_1 = require("../common");
9
+ const auth_1 = require("../auth");
10
+ exports.updateRecordAction = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.BikaAuth,
12
+ name: 'bika_update_record',
13
+ displayName: 'Update Record',
14
+ description: 'Updates an existing record in database.',
15
+ audience: 'both',
16
+ aiMetadata: { description: 'Updates the fields of an existing Bika.ai record identified by its record ID, within a given space and database. Use when modifying a known record; provide only the fields to change (read-only field types are ignored). Idempotent: repeating with the same input leaves the record in the same state.', idempotent: true },
17
+ props: {
18
+ space_id: common_1.BikaCommon.space_id,
19
+ database_id: common_1.BikaCommon.database_id,
20
+ recordId: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Record ID',
22
+ description: 'The ID of the record to update.',
23
+ required: true,
24
+ }),
25
+ fields: common_1.BikaCommon.fields,
26
+ },
27
+ run(context) {
28
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
+ const auth = context.auth;
30
+ const databaseId = context.propsValue.database_id;
31
+ const spaceId = context.propsValue.space_id;
32
+ const recordId = context.propsValue.recordId;
33
+ const dynamicFields = context.propsValue.fields;
34
+ const fields = {};
35
+ const props = Object.entries(dynamicFields);
36
+ for (const [propertyKey, propertyValue] of props) {
37
+ if (propertyValue !== undefined && propertyValue !== '') {
38
+ fields[propertyKey] = propertyValue;
39
+ }
40
+ }
41
+ const newFields = yield (0, common_1.createNewFields)(auth, spaceId, databaseId, fields);
42
+ const client = (0, common_1.makeClient)(context.auth.props);
43
+ const response = yield client.updateRecord(spaceId, databaseId, recordId, {
44
+ fields: Object.assign({}, newFields),
45
+ });
46
+ if (!response.success) {
47
+ throw new Error(JSON.stringify(response, undefined, 2));
48
+ }
49
+ return response;
50
+ });
51
+ },
52
+ });
53
+ //# sourceMappingURL=update-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-record.js","sourceRoot":"","sources":["../../../src/lib/actions/update-record.ts"],"names":[],"mappings":";;;;AAAA,oGAAoG;AACpG,qEAAqE;AACrE,gEAKmC;AACnC,sCAAoE;AACpE,kCAAmC;AAEtB,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,2SAA2S,EAAE,UAAU,EAAE,IAAI,EAAE;IAC1V,KAAK,EAAE;QACN,QAAQ,EAAE,mBAAU,CAAC,QAAQ;QAC7B,WAAW,EAAE,mBAAU,CAAC,WAAW;QACnC,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;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,CAAC;YAED,OAAO,QAAQ,CAAC;QACjB,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const BikaAuth: import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ token: import("@agnocon/pieces-framework").SecretTextProperty<true>;
3
+ }>;
4
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;EAoCnB,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BikaAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bika/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
+ const common_1 = require("./common");
9
+ exports.BikaAuth = pieces_framework_1.PieceAuth.CustomAuth({
10
+ required: true,
11
+ description: `
12
+ To obtain your Bika token, follow these steps:
13
+
14
+ 1. Log in to your Bika account.
15
+ 2. Visit https://bika.com.
16
+ 3. Click on your profile picture (Bottom left).
17
+ 4. Click on "My Settings".
18
+ 5. Click on "Developer".
19
+ 6. Click on "Generate new token".
20
+ 7. Copy the token.
21
+ `,
22
+ props: {
23
+ token: pieces_framework_1.PieceAuth.SecretText({
24
+ displayName: 'Token',
25
+ description: 'The token of the Bika account',
26
+ required: true,
27
+ }),
28
+ },
29
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
30
+ try {
31
+ const client = (0, common_1.makeClient)(auth);
32
+ yield client.listSpaces();
33
+ return {
34
+ valid: true,
35
+ };
36
+ }
37
+ catch (e) {
38
+ return {
39
+ valid: false,
40
+ error: 'Invalid Token.',
41
+ };
42
+ }
43
+ }),
44
+ });
45
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,mFAAmF;AACnF,qEAAqE;AACrE,gEAA4E;AAC5E,qCAAsC;AAEzB,QAAA,QAAQ,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC3C,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE;;;;;;;;;;KAUV;IACH,KAAK,EAAE;QACL,KAAK,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC1B,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAA,mBAAU,EACvB,IAA6C,CAC9C,CAAC;YACF,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;YAC1B,OAAO;gBACL,KAAK,EAAE,IAAI;aACZ,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,gBAAgB;aACxB,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { HttpMessageBody, HttpMethod, QueryParams } from '@agnocon/pieces-common';
2
+ import { BikaFieldType } from './constants';
3
+ export declare function prepareQuery(request?: Record<string, any>): QueryParams;
4
+ export declare class BikaClient {
5
+ private token;
6
+ private bikaUrl;
7
+ constructor(token: string, bikaUrl?: string);
8
+ makeRequest<T extends HttpMessageBody>(method: HttpMethod, resourceUri: string, query?: QueryParams, body?: any | undefined): Promise<T>;
9
+ listSpaces(): Promise<{
10
+ data: {
11
+ id: string;
12
+ name: string;
13
+ }[];
14
+ }>;
15
+ listDatabases(space_id: string): Promise<{
16
+ data: {
17
+ id: string;
18
+ name: string;
19
+ }[];
20
+ }>;
21
+ getDatabaseFields(space_id: string, database_id: string): Promise<{
22
+ data: {
23
+ id: string;
24
+ name: string;
25
+ type: BikaFieldType;
26
+ desc: string;
27
+ property?: {
28
+ format?: string;
29
+ defaultValue?: string;
30
+ options?: {
31
+ name: string;
32
+ id?: string;
33
+ }[];
34
+ };
35
+ }[];
36
+ }>;
37
+ createRecord(space_id: string, database_id: string, request: object): Promise<unknown>;
38
+ deleteRecord(space_id: string, database_id: string, record_id: string): Promise<unknown>;
39
+ updateRecord(space_id: string, database_id: string, record_id: string, request: object): Promise<unknown>;
40
+ findRecord(space_id: string, database_id: string, record_id: string, query?: QueryParams): Promise<{
41
+ data: {
42
+ total: number;
43
+ records: {
44
+ recordId: string;
45
+ createdAt: number;
46
+ updatedAt: number;
47
+ fields: Record<string, unknown>;
48
+ }[];
49
+ };
50
+ }>;
51
+ listRecords(space_id: string, database_id: string, query?: QueryParams): Promise<{
52
+ data: {
53
+ total: number;
54
+ records: {
55
+ recordId: string;
56
+ createdAt: number;
57
+ updatedAt: number;
58
+ fields: Record<string, unknown>;
59
+ }[];
60
+ };
61
+ }>;
62
+ }
63
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/lib/common/client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,UAAU,EACV,WAAW,EAGZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAe5C,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,WAAW,CASvE;AAGD,qBAAa,UAAU;IACR,OAAO,CAAC,KAAK;IAAU,OAAO,CAAC,OAAO;gBAA9B,KAAK,EAAE,MAAM,EAAU,OAAO,SAAoB;IAEjE,WAAW,CAAC,CAAC,SAAS,eAAe,EACzC,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,M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