@taskmagic/apps-flipando 0.0.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.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # apps-flipando
2
+
3
+ Flipando AI — Autonomous AI Agents Revolutionizing Compliance with Smart, Adaptive Workflows.
4
+
5
+ ## Building
6
+
7
+ Run `nx build apps-flipando` to build the library.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@taskmagic/apps-flipando",
3
+ "version": "0.0.6",
4
+ "dependencies": {
5
+ "@anthropic-ai/sdk": "0.33.1",
6
+ "@sinclair/typebox": "0.34.11",
7
+ "axios": "1.17.0",
8
+ "axios-retry": "4.4.1",
9
+ "deepmerge-ts": "7.1.0",
10
+ "mime-types": "2.1.35",
11
+ "nanoid": "3.3.8",
12
+ "openai": "4.67.1",
13
+ "replicate": "0.34.1",
14
+ "semver": "7.6.0",
15
+ "zod": "3.25.76",
16
+ "@taskmagic/pieces-common": "0.4.4",
17
+ "@taskmagic/pieces-framework": "0.7.46",
18
+ "@taskmagic/shared": "0.10.171",
19
+ "tslib": "1.14.1"
20
+ },
21
+ "overrides": {
22
+ "cross-spawn": "7.0.6",
23
+ "elliptic": "^6.6.1",
24
+ "fast-xml-parser": "^4.4.1",
25
+ "protobufjs": "^7.5.5",
26
+ "tmp": "^0.2.4",
27
+ "koa": "^2.16.4",
28
+ "picomatch": "^4.0.4",
29
+ "langsmith": "^0.6.0",
30
+ "serialize-javascript": "^6.0.2",
31
+ "elevenlabs": {
32
+ "form-data": "^4.0.4"
33
+ },
34
+ "@tryfabric/martian": {
35
+ "@notionhq/client": "$@notionhq/client"
36
+ },
37
+ "vite": {
38
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
39
+ }
40
+ },
41
+ "resolutions": {
42
+ "rollup": "npm:@rollup/wasm-node@^4.61.1"
43
+ },
44
+ "types": "./src/index.d.ts",
45
+ "main": "./src/index.js",
46
+ "type": "commonjs"
47
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const flipando: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flipando = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const shared_1 = require("@taskmagic/shared");
7
+ const pieces_common_1 = require("@taskmagic/pieces-common");
8
+ const auth_1 = require("./lib/common/auth");
9
+ const client_1 = require("./lib/common/client");
10
+ const get_all_apps_1 = require("./lib/actions/get-all-apps");
11
+ const run_app_1 = require("./lib/actions/run-app");
12
+ const get_task_1 = require("./lib/actions/get-task");
13
+ const run_app_generator_1 = require("./lib/actions/run-app-generator");
14
+ exports.flipando = (0, pieces_framework_1.createPiece)({
15
+ displayName: 'Flipando AI',
16
+ auth: auth_1.flipandoAuth,
17
+ minimumSupportedRelease: '0.30.0',
18
+ logoUrl: 'https://cdn.activepieces.com/pieces/flipando.png',
19
+ description: 'Autonomous AI Agents Revolutionizing Compliance with Smart, Adaptive Workflows.',
20
+ categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
21
+ authors: ['sanket-a11y'],
22
+ actions: [
23
+ get_all_apps_1.getAllApps,
24
+ run_app_1.runApp,
25
+ get_task_1.getTask,
26
+ run_app_generator_1.runAppGenerator,
27
+ (0, pieces_common_1.createCustomApiCallAction)({
28
+ auth: auth_1.flipandoAuth,
29
+ baseUrl: () => client_1.BASE_URL,
30
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
31
+ return {
32
+ Authorization: `Bearer ${auth}`,
33
+ };
34
+ }),
35
+ }),
36
+ ],
37
+ triggers: [],
38
+ });
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/flipando/src/index.ts"],"names":[],"mappings":";;;;AAAA,kEAA0D;AAC1D,8CAAkD;AAClD,4DAAqE;AACrE,4CAAiD;AACjD,gDAA+C;AAC/C,6DAAwD;AACxD,mDAA+C;AAC/C,qDAAiD;AACjD,uEAAkE;AAErD,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,mBAAY;IAClB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,WAAW,EACT,iFAAiF;IACnF,UAAU,EAAE,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IACnD,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE;QACP,yBAAU;QACV,gBAAM;QACN,kBAAO;QACP,mCAAe;QACf,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,mBAAY;YAClB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAQ;YACvB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAc,EAAE;iBAC1C,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const getAllApps: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {}>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllApps = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.getAllApps = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.flipandoAuth,
11
+ name: 'getAllApps',
12
+ displayName: 'Get All Apps',
13
+ description: 'Retrieves all the applications created by the authenticated user.',
14
+ props: {},
15
+ run(context) {
16
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
17
+ const apiKey = context.auth;
18
+ return yield (0, client_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.GET, '/integrations/applications', {
19
+ max_results: 20,
20
+ });
21
+ });
22
+ },
23
+ });
24
+ //# sourceMappingURL=get-all-apps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-all-apps.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/flipando/src/lib/actions/get-all-apps.ts"],"names":[],"mappings":";;;;AAAA,kEAA2D;AAC3D,4DAAsD;AACtD,yCAA8C;AAC9C,6CAA+C;AAElC,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,cAAc;IAC3B,WAAW,EACT,mEAAmE;IACrE,KAAK,EAAE,EAAE;IACH,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,OAAO,CAAC,IAAc,CAAC;YACtC,OAAO,MAAM,IAAA,oBAAW,EACtB,MAAM,EACN,0BAAU,CAAC,GAAG,EACd,4BAA4B,EAC5B;gBACE,WAAW,EAAE,EAAE;aAChB,CACF,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const getTask: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ task_id: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
3
+ }>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTask = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.getTask = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.flipandoAuth,
11
+ name: 'getTask',
12
+ displayName: 'Get Task',
13
+ description: 'Retrieves the result of a specific Flipando application task by its task ID.',
14
+ props: {
15
+ task_id: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Task ID',
17
+ description: 'ID of the task to be retrieved.',
18
+ required: true,
19
+ }),
20
+ },
21
+ run(context) {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
+ const apiKey = context.auth;
24
+ const taskId = context.propsValue.task_id;
25
+ return yield (0, client_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.GET, `/integrations/tasks/${taskId}`);
26
+ });
27
+ },
28
+ });
29
+ //# sourceMappingURL=get-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-task.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/flipando/src/lib/actions/get-task.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAsD;AACtD,yCAA8C;AAC9C,6CAA+C;AAElC,QAAA,OAAO,GAAG,IAAA,+BAAY,EAAC;IAClC,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,UAAU;IACvB,WAAW,EACT,8EAA8E;IAChF,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,OAAO,CAAC,IAAc,CAAC;YACtC,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;YAE1C,OAAO,MAAM,IAAA,oBAAW,EACtB,MAAM,EACN,0BAAU,CAAC,GAAG,EACd,uBAAuB,MAAM,EAAE,CAChC,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const runAppGenerator: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ inputs_data: import("@taskmagic/pieces-framework").LongTextProperty<false>;
3
+ is_new_app_private: import("@taskmagic/pieces-framework").CheckboxProperty<true>;
4
+ }>;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runAppGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.runAppGenerator = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.flipandoAuth,
11
+ name: 'runAppGenerator',
12
+ displayName: 'Run App Generator',
13
+ description: "Triggers the execution of Flipando's Special App Generator, initiating a background job for application completion.",
14
+ props: {
15
+ inputs_data: pieces_framework_1.Property.LongText({
16
+ displayName: 'Inputs Data',
17
+ description: 'JSON string of key-value pairs for application input variables.',
18
+ required: false,
19
+ }),
20
+ is_new_app_private: pieces_framework_1.Property.Checkbox({
21
+ displayName: 'Is New App Private',
22
+ description: 'Whether the new app to be created should be private or public.',
23
+ required: true,
24
+ defaultValue: true,
25
+ }),
26
+ },
27
+ run(context) {
28
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
+ const apiKey = context.auth;
30
+ const inputsData = context.propsValue.inputs_data;
31
+ const isNewAppPrivate = context.propsValue.is_new_app_private;
32
+ const formData = new FormData();
33
+ if (inputsData) {
34
+ formData.append('inputs_data', inputsData);
35
+ }
36
+ formData.append('is_new_app_private', String(isNewAppPrivate));
37
+ return yield (0, client_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.POST, '/integrations/applications/app-generator/completion', undefined, formData);
38
+ });
39
+ },
40
+ });
41
+ //# sourceMappingURL=run-app-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-app-generator.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/flipando/src/lib/actions/run-app-generator.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAsD;AACtD,yCAA8C;AAC9C,6CAA+C;AAElC,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EACT,qHAAqH;IACvH,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,iEAAiE;YACnE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,kBAAkB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACpC,WAAW,EAAE,oBAAoB;YACjC,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;SACnB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,OAAO,CAAC,IAAc,CAAC;YACtC,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;YAClD,MAAM,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;YAE9D,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;YAChC,IAAI,UAAU,EAAE,CAAC;gBACf,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;YAC7C,CAAC;YACD,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;YAE/D,OAAO,MAAM,IAAA,oBAAW,EACtB,MAAM,EACN,0BAAU,CAAC,IAAI,EACf,qDAAqD,EACrD,SAAS,EACT,QAAQ,CACT,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare const runApp: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").SecretTextProperty<true>, {
2
+ application_id: import("@taskmagic/pieces-framework").NumberProperty<true>;
3
+ inputs_data: import("@taskmagic/pieces-framework").LongTextProperty<false>;
4
+ file: import("@taskmagic/pieces-framework").FileProperty<false>;
5
+ file_description: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
6
+ }>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runApp = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ const auth_1 = require("../common/auth");
8
+ const client_1 = require("../common/client");
9
+ exports.runApp = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.flipandoAuth,
11
+ name: 'runApp',
12
+ displayName: 'Run App',
13
+ description: 'Triggers the execution of a specific Flipando application by ID, initiating a background job for application completion.',
14
+ props: {
15
+ application_id: pieces_framework_1.Property.Number({
16
+ displayName: 'Application ID',
17
+ description: 'ID of the application to be completed.',
18
+ required: true,
19
+ }),
20
+ inputs_data: pieces_framework_1.Property.LongText({
21
+ displayName: 'Inputs Data',
22
+ description: 'JSON string of key-value pairs for application input variables.',
23
+ required: false,
24
+ }),
25
+ file: pieces_framework_1.Property.File({
26
+ displayName: 'File',
27
+ description: 'File to be uploaded, if the application requires documents. Supports PDF, DOCX, images, and other document formats.',
28
+ required: false,
29
+ }),
30
+ file_description: pieces_framework_1.Property.ShortText({
31
+ displayName: 'File Description',
32
+ description: 'Description of the file being uploaded. Required when uploading a file.',
33
+ required: false,
34
+ }),
35
+ },
36
+ run(context) {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
+ const apiKey = context.auth;
39
+ const applicationId = context.propsValue.application_id;
40
+ const inputsData = context.propsValue.inputs_data;
41
+ const file = context.propsValue.file;
42
+ const fileDescription = context.propsValue.file_description;
43
+ if (file && !fileDescription) {
44
+ throw new Error('file_description is required when uploading a file.');
45
+ }
46
+ const formData = new FormData();
47
+ if (inputsData) {
48
+ formData.append('inputs_data', inputsData);
49
+ }
50
+ if (file) {
51
+ const blob = new Blob([file.data], {
52
+ type: 'application/octet-stream',
53
+ });
54
+ formData.append('file', blob, file.filename);
55
+ if (fileDescription) {
56
+ formData.append('file_description', fileDescription);
57
+ }
58
+ }
59
+ return yield (0, client_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.POST, `/integrations/applications/${applicationId}/completion`, undefined, formData);
60
+ });
61
+ },
62
+ });
63
+ //# sourceMappingURL=run-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-app.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/flipando/src/lib/actions/run-app.ts"],"names":[],"mappings":";;;;AAAA,kEAAqE;AACrE,4DAAsD;AACtD,yCAA8C;AAC9C,6CAA+C;AAElC,QAAA,MAAM,GAAG,IAAA,+BAAY,EAAC;IACjC,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,SAAS;IACtB,WAAW,EACT,0HAA0H;IAC5H,KAAK,EAAE;QACL,cAAc,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC9B,WAAW,EAAE,gBAAgB;YAC7B,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,iEAAiE;YACnE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,qHAAqH;YACvH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,gBAAgB,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACnC,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACT,yEAAyE;YAC3E,QAAQ,EAAE,KAAK;SAChB,CAAC;KAC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ports, "__esModule", { value: true });
3
+ exports.flipandoAuth = void 0;
4
+ const pieces_framework_1 = require("@taskmagic/pieces-framework");
5
+ exports.flipandoAuth = pieces_framework_1.PieceAuth.SecretText({
6
+ displayName: 'API Key',
7
+ description: 'Flipando API Key',
8
+ required: true,
9
+ });
10
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/flipando/src/lib/common/auth.ts"],"names":[],"mappings":";;;AAAA,kEAAwD;AAE3C,QAAA,YAAY,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC/C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,kBAAkB;IAC/B,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { HttpMethod } from '@taskmagic/pieces-common';
2
+ export declare const BASE_URL = "https://flipando-backend.herokuapp.com/api/v1";
3
+ export declare function makeRequest(apiKey: string, method: HttpMethod, path: string, queryParams?: Record<string, any>, body?: unknown): Promise<any>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BASE_URL = void 0;
4
+ exports.makeRequest = makeRequest;
5
+ const tslib_1 = require("tslib");
6
+ const pieces_common_1 = require("@taskmagic/pieces-common");
7
+ exports.BASE_URL = 'https://flipando-backend.herokuapp.com/api/v1';
8
+ function makeRequest(apiKey, method, path, queryParams, body) {
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
+ var _a, _b, _c, _d;
11
+ try {
12
+ const response = yield pieces_common_1.httpClient.sendRequest({
13
+ method,
14
+ url: `${exports.BASE_URL}${path}`,
15
+ headers: {
16
+ Authorization: `Bearer ${apiKey}`,
17
+ },
18
+ queryParams,
19
+ body,
20
+ });
21
+ return response.body;
22
+ }
23
+ catch (error) {
24
+ if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
25
+ throw new Error('Invalid API Key. Please check your authentication credentials.');
26
+ }
27
+ if (((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 403) {
28
+ throw new Error('Access denied. Please check your API key permissions.');
29
+ }
30
+ if (((_c = error.response) === null || _c === void 0 ? void 0 : _c.status) === 404) {
31
+ throw new Error('Resource not found. Please check the form ID or submission ID.');
32
+ }
33
+ if (((_d = error.response) === null || _d === void 0 ? void 0 : _d.status) >= 500) {
34
+ throw new Error('Fillout service error. Please try again later.');
35
+ }
36
+ throw new Error(`Request failed: ${error.message || 'Unknown error'}`);
37
+ }
38
+ });
39
+ }
40
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/flipando/src/lib/common/client.ts"],"names":[],"mappings":";;;AAIA,kCAsCC;;AA1CD,4DAAkE;AAErD,QAAA,QAAQ,GAAG,+CAA+C,CAAC;AAExE,SAAsB,WAAW,CAC/B,MAAc,EACd,MAAkB,EAClB,IAAY,EACZ,WAAiC,EACjC,IAAc;;;QAEd,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM;gBACN,GAAG,EAAE,GAAG,gBAAQ,GAAG,IAAI,EAAE;gBACzB,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,MAAM,EAAE;iBAClC;gBACD,WAAW;gBACX,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;YACJ,CAAC;YACD,IAAI,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,MAAK,GAAG,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,uDAAu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