diff --git a/docsfera.json b/docsfera.json index c6ab573..8a386a4 100644 --- a/docsfera.json +++ b/docsfera.json @@ -40,7 +40,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/sso/snowflake": { @@ -59,7 +61,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/refresh-access-token": { @@ -87,7 +91,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/change-password": { @@ -106,7 +112,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/reset-password": { @@ -125,7 +133,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/verify-reset-password-code": { @@ -144,7 +154,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/confirm-reset-password": { @@ -163,7 +175,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/enable-totp": { @@ -182,7 +196,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/disable-totp": { @@ -201,7 +217,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/dismiss-totp": { @@ -220,7 +238,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/verify-totp": { @@ -239,7 +259,9 @@ } } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/auth/verify-access-token": { @@ -251,7 +273,9 @@ "description": "" } }, - "tags": ["Auth"] + "tags": [ + "Auth" + ] } }, "/connectors": { @@ -280,7 +304,9 @@ } } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -328,7 +354,9 @@ "description": "" } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -355,7 +383,9 @@ } } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -372,7 +402,9 @@ "description": "" } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -396,7 +428,9 @@ } } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -430,7 +464,9 @@ "description": "" } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -464,7 +500,9 @@ "description": "" } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -496,7 +534,9 @@ "description": "" } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -530,7 +570,9 @@ "description": "" } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -566,7 +608,9 @@ "description": "" } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -602,7 +646,9 @@ "description": "" } }, - "tags": ["connectors"], + "tags": [ + "connectors" + ], "security": [ { "bearer": [] @@ -620,7 +666,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -637,7 +686,9 @@ } } }, - "tags": ["Permissions"] + "tags": [ + "Permissions" + ] } }, "/terms-of-use/token": { @@ -665,7 +716,9 @@ } } }, - "tags": ["TermsOfUse"] + "tags": [ + "TermsOfUse" + ] } }, "/terms-of-use/accept": { @@ -684,7 +737,9 @@ } } }, - "tags": ["TermsOfUse"] + "tags": [ + "TermsOfUse" + ] } }, "/connections/connections-migration": { @@ -705,7 +760,9 @@ "description": "" } }, - "tags": ["connections"], + "tags": [ + "connections" + ], "security": [ { "bearer": [] @@ -739,7 +796,9 @@ } } }, - "tags": ["connections"], + "tags": [ + "connections" + ], "security": [ { "bearer": [] @@ -761,7 +820,9 @@ } } }, - "tags": ["connections"], + "tags": [ + "connections" + ], "security": [ { "bearer": [] @@ -812,7 +873,9 @@ } } }, - "tags": ["connections"], + "tags": [ + "connections" + ], "security": [ { "bearer": [] @@ -843,7 +906,9 @@ } } }, - "tags": ["connections"], + "tags": [ + "connections" + ], "security": [ { "bearer": [] @@ -865,7 +930,9 @@ } } }, - "tags": ["connections"], + "tags": [ + "connections" + ], "security": [ { "bearer": [] @@ -883,7 +950,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -900,7 +970,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] }, "post": { "operationId": "UsersController_createUser", @@ -911,7 +983,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -938,7 +1013,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/hierarchies": { @@ -951,7 +1028,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -968,7 +1048,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/departments": { @@ -981,7 +1063,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -998,7 +1083,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/jobTitles": { @@ -1011,7 +1098,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1028,7 +1118,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/{id}": { @@ -1041,7 +1133,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1066,7 +1161,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] }, "delete": { "operationId": "UsersController_deleteUser", @@ -1077,7 +1174,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1102,7 +1202,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] }, "patch": { "operationId": "UsersController_updateUser", @@ -1113,7 +1215,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1148,7 +1253,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/batch": { @@ -1161,7 +1268,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1188,7 +1298,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/{id}/resend-invite": { @@ -1201,7 +1313,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1226,7 +1341,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/role": { @@ -1239,7 +1356,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1272,7 +1392,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] }, "put": { "operationId": "UsersController_assignRoleToUser", @@ -1283,7 +1405,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1310,7 +1435,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/roles": { @@ -1323,7 +1450,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1350,7 +1480,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/users/synchronize/{id}": { @@ -1363,7 +1495,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1398,7 +1533,9 @@ } } }, - "tags": ["Users"] + "tags": [ + "Users" + ] } }, "/roles": { @@ -1411,7 +1548,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1431,7 +1571,10 @@ "required": false, "in": "query", "schema": { - "enum": ["true", "false"], + "enum": [ + "true", + "false" + ], "type": "string" } } @@ -1448,7 +1591,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] }, "post": { "operationId": "RolesController_createRole", @@ -1459,7 +1604,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1486,7 +1634,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] } }, "/roles/permissions": { @@ -1499,7 +1649,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1526,7 +1679,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] }, "delete": { "operationId": "RolesController_revokePermissionsFromRole", @@ -1537,7 +1692,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1564,7 +1722,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] }, "patch": { "operationId": "RolesController_setRolePermissions", @@ -1575,7 +1735,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1602,7 +1765,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] } }, "/roles/users": { @@ -1615,7 +1780,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } } @@ -1642,7 +1810,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] } }, "/roles/{id}": { @@ -1655,7 +1825,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1680,7 +1853,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] }, "delete": { "operationId": "RolesController_deleteRole", @@ -1691,7 +1866,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1716,7 +1894,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] }, "patch": { "operationId": "RolesController_updateRole", @@ -1727,7 +1907,10 @@ "description": "Defaults to pt-br", "required": false, "schema": { - "enum": ["pt-br", "en-us"], + "enum": [ + "pt-br", + "en-us" + ], "type": "string" } }, @@ -1762,7 +1945,9 @@ } } }, - "tags": ["Roles"] + "tags": [ + "Roles" + ] } }, "/network-config": { @@ -1781,7 +1966,9 @@ } } }, - "tags": ["Network Config"] + "tags": [ + "Network Config" + ] }, "post": { "operationId": "NetworkConfigController_createNetworkConfigs", @@ -1818,7 +2005,9 @@ } } }, - "tags": ["Network Config"] + "tags": [ + "Network Config" + ] } }, "/network-config/{id}": { @@ -1846,7 +2035,9 @@ } } }, - "tags": ["Network Config"] + "tags": [ + "Network Config" + ] } }, "/network-config/{id}/details": { @@ -1874,7 +2065,9 @@ } } }, - "tags": ["Network Config"] + "tags": [ + "Network Config" + ] } }, "/connection-test/ping": { @@ -1903,7 +2096,9 @@ } } }, - "tags": ["Connection Test"] + "tags": [ + "Connection Test" + ] } }, "/connection-test/credentials": { @@ -1932,7 +2127,9 @@ } } }, - "tags": ["Connection Test"] + "tags": [ + "Connection Test" + ] } }, "/connection-test/schemas": { @@ -1961,7 +2158,9 @@ } } }, - "tags": ["Connection Test"] + "tags": [ + "Connection Test" + ] } }, "/connection-test/tables": { @@ -1990,7 +2189,9 @@ } } }, - "tags": ["Connection Test"] + "tags": [ + "Connection Test" + ] } }, "/connection-test/table-metadata": { @@ -2019,7 +2220,9 @@ } } }, - "tags": ["Connection Test"] + "tags": [ + "Connection Test" + ] } }, "/pipelines/start/{id}": { @@ -2038,7 +2241,9 @@ } } }, - "tags": ["Pipelines"] + "tags": [ + "Pipelines" + ] } }, "/pipelines/{id}/status": { @@ -2057,7 +2262,9 @@ } } }, - "tags": ["Pipelines"] + "tags": [ + "Pipelines" + ] } }, "/pipelinesV2": { @@ -2086,7 +2293,9 @@ } } }, - "tags": ["PipelinesV2"] + "tags": [ + "PipelinesV2" + ] }, "get": { "operationId": "PipelinesController_findAll", @@ -2096,7 +2305,9 @@ "description": "" } }, - "tags": ["PipelinesV2"] + "tags": [ + "PipelinesV2" + ] } }, "/pipelinesV2/{id}/config": { @@ -2108,7 +2319,9 @@ "description": "" } }, - "tags": ["PipelinesV2"] + "tags": [ + "PipelinesV2" + ] } }, "/pipelinesV2/{id}": { @@ -2127,7 +2340,9 @@ } } }, - "tags": ["PipelinesV2"] + "tags": [ + "PipelinesV2" + ] }, "put": { "operationId": "PipelinesController_update", @@ -2144,7 +2359,9 @@ } } }, - "tags": ["PipelinesV2"] + "tags": [ + "PipelinesV2" + ] }, "patch": { "operationId": "PipelinesController_updateByPatch", @@ -2161,7 +2378,9 @@ } } }, - "tags": ["PipelinesV2"] + "tags": [ + "PipelinesV2" + ] }, "delete": { "operationId": "PipelinesController_delete", @@ -2171,7 +2390,40 @@ "description": "" } }, - "tags": ["PipelinesV2"] + "tags": [ + "PipelinesV2" + ] + } + }, + "/pipelinesV2/upload": { + "post": { + "operationId": "PipelinesController_uploadFile", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/IUploadCSVFile" + } + } + } + }, + "responses": { + "201": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + } + }, + "tags": [ + "PipelinesV2" + ] } }, "/inputs/available-entities/{plugin}": { @@ -2199,7 +2451,9 @@ } } }, - "tags": ["Inputs"] + "tags": [ + "Inputs" + ] } }, "/inputs": { @@ -2231,7 +2485,9 @@ "description": "" } }, - "tags": ["Inputs"] + "tags": [ + "Inputs" + ] }, "get": { "operationId": "InputsController_findAll", @@ -2241,7 +2497,9 @@ "description": "" } }, - "tags": ["Inputs"] + "tags": [ + "Inputs" + ] } }, "/inputs/{id}": { @@ -2260,7 +2518,9 @@ } } }, - "tags": ["Inputs"] + "tags": [ + "Inputs" + ] }, "patch": { "operationId": "InputsController_update", @@ -2277,7 +2537,9 @@ } } }, - "tags": ["Inputs"] + "tags": [ + "Inputs" + ] }, "delete": { "operationId": "InputsController_delete", @@ -2294,7 +2556,9 @@ } } }, - "tags": ["Inputs"] + "tags": [ + "Inputs" + ] } }, "/transformations": { @@ -2306,7 +2570,9 @@ "description": "" } }, - "tags": ["Transformations"] + "tags": [ + "Transformations" + ] }, "get": { "operationId": "TransformationsController_findAll", @@ -2316,7 +2582,9 @@ "description": "" } }, - "tags": ["Transformations"] + "tags": [ + "Transformations" + ] } }, "/transformations/{id}": { @@ -2335,7 +2603,9 @@ } } }, - "tags": ["Transformations"] + "tags": [ + "Transformations" + ] }, "put": { "operationId": "TransformationsController_update", @@ -2361,7 +2631,9 @@ } } }, - "tags": ["Transformations"] + "tags": [ + "Transformations" + ] }, "delete": { "operationId": "TransformationsController_delete", @@ -2378,7 +2650,9 @@ } } }, - "tags": ["Transformations"] + "tags": [ + "Transformations" + ] } }, "/health": { @@ -2390,7 +2664,9 @@ "description": "" } }, - "tags": ["Health"] + "tags": [ + "Health" + ] } }, "/catalog": { @@ -2409,7 +2685,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] }, "post": { "operationId": "CatalogController_createDataAsset", @@ -2429,7 +2707,9 @@ "description": "" } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/tags": { @@ -2448,7 +2728,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/data-asset/{id}": { @@ -2460,7 +2742,9 @@ "description": "" } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] }, "put": { "operationId": "CatalogController_updateDataAsset", @@ -2487,7 +2771,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] }, "delete": { "operationId": "CatalogController_deleteDataAsset", @@ -2513,7 +2799,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/data-asset/rls/{id}": { @@ -2525,7 +2813,9 @@ "description": "" } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/data-asset/{id}/columns-metadata": { @@ -2544,7 +2834,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/data-asset/{id}/preview": { @@ -2563,7 +2855,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/data-asset/{id}/docs": { @@ -2582,7 +2876,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] }, "post": { "operationId": "CatalogController_manageDataAssetDocs", @@ -2608,7 +2904,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/data-asset/{id}/manage-permissions": { @@ -2629,7 +2927,9 @@ "description": "" } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/data-asset/{id}/revoke-permissions": { @@ -2650,7 +2950,9 @@ "description": "" } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/catalog/data-asset/{id}/comment": { @@ -2688,7 +2990,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] }, "delete": { "operationId": "CatalogController_deleteComment", @@ -2724,7 +3028,9 @@ } } }, - "tags": ["Catalog"] + "tags": [ + "Catalog" + ] } }, "/oauth/hubspot": { @@ -2743,7 +3049,9 @@ } } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/hubspot/callback": { @@ -2755,7 +3063,9 @@ "description": "" } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/googleads": { @@ -2774,7 +3084,9 @@ } } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/googleads/callback": { @@ -2786,7 +3098,9 @@ "description": "" } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/google-sheets": { @@ -2805,7 +3119,9 @@ } } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/google-sheets/callback": { @@ -2817,7 +3133,9 @@ "description": "" } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/facebook": { @@ -2836,7 +3154,9 @@ } } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/facebook/callback": { @@ -2848,7 +3168,9 @@ "description": "" } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/mailchimp": { @@ -2867,7 +3189,9 @@ } } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/mailchimp/callback": { @@ -2879,7 +3203,9 @@ "description": "" } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/salesforce": { @@ -2898,7 +3224,9 @@ } } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/oauth/salesforce/callback": { @@ -2910,7 +3238,9 @@ "description": "" } }, - "tags": ["oauth"] + "tags": [ + "oauth" + ] } }, "/productboard/notes": { @@ -2939,7 +3269,9 @@ } } }, - "tags": ["Productboard"] + "tags": [ + "Productboard" + ] } }, "/trackEvent/{id}": { @@ -2955,7 +3287,7 @@ } }, "info": { - "title": "Maestro - feature/verify-refresh-token", + "title": "Maestro - feat/upload-csv", "description": "Documentation for Maestro gateway", "version": "1.0.0", "contact": {} @@ -2984,7 +3316,10 @@ "type": "string" } }, - "required": ["username", "password"] + "required": [ + "username", + "password" + ] }, "AuthCustomer": { "type": "object", @@ -3005,7 +3340,12 @@ "type": "string" } }, - "required": ["modules", "id", "name", "tier"] + "required": [ + "modules", + "id", + "name", + "tier" + ] }, "AuthUser": { "type": "object", @@ -3023,7 +3363,12 @@ "type": "string" } }, - "required": ["id", "name", "username", "createdAt"] + "required": [ + "id", + "name", + "username", + "createdAt" + ] }, "AuthTokens": { "type": "object", @@ -3042,7 +3387,11 @@ "deprecated": true } }, - "required": ["accessToken", "refreshToken", "idToken"] + "required": [ + "accessToken", + "refreshToken", + "idToken" + ] }, "TermsOfUse": { "type": "object", @@ -3060,14 +3409,23 @@ "type": "string" } }, - "required": ["version", "publicUrl", "enforceDate", "createdAt"] + "required": [ + "version", + "publicUrl", + "enforceDate", + "createdAt" + ] }, "TermsOfUseStatus": { "type": "object", "properties": { "status": { "type": "string", - "enum": ["pending", "required", "ok"] + "enum": [ + "pending", + "required", + "ok" + ] }, "lastSigned": { "$ref": "#/components/schemas/TermsOfUse" @@ -3076,7 +3434,9 @@ "$ref": "#/components/schemas/TermsOfUse" } }, - "required": ["status"] + "required": [ + "status" + ] }, "AuthSignInRes": { "type": "object", @@ -3089,7 +3449,11 @@ }, "mfaStatus": { "type": "string", - "enum": ["pending", "none", "totp"] + "enum": [ + "pending", + "none", + "totp" + ] }, "customer": { "$ref": "#/components/schemas/AuthCustomer" @@ -3104,7 +3468,10 @@ "$ref": "#/components/schemas/TermsOfUseStatus" } }, - "required": ["permissions", "mfaStatus"] + "required": [ + "permissions", + "mfaStatus" + ] }, "CreateConnectorDto": { "type": "object", @@ -3117,7 +3484,10 @@ "type": "string" } }, - "required": ["file", "connector"] + "required": [ + "file", + "connector" + ] }, "UpdateDto": { "type": "object", @@ -3155,7 +3525,9 @@ } } }, - "required": ["version"] + "required": [ + "version" + ] }, "AddTagDto": { "type": "object", @@ -3167,7 +3539,9 @@ } } }, - "required": ["tags"] + "required": [ + "tags" + ] }, "RemoveTagDto": { "type": "object", @@ -3179,7 +3553,9 @@ } } }, - "required": ["tags"] + "required": [ + "tags" + ] }, "PermissionGroupPermission": { "type": "object", @@ -3191,7 +3567,10 @@ "type": "number" } }, - "required": ["name", "id"] + "required": [ + "name", + "id" + ] }, "PermissionGroup": { "type": "object", @@ -3206,7 +3585,10 @@ } } }, - "required": ["title", "permissions"] + "required": [ + "title", + "permissions" + ] }, "GetPublicPermissionsRes": { "type": "object", @@ -3218,7 +3600,9 @@ } } }, - "required": ["permissionGroups"] + "required": [ + "permissionGroups" + ] }, "CreateConnectionDto": { "type": "object", @@ -3310,7 +3694,10 @@ "type": "string" } }, - "required": ["connection", "message"] + "required": [ + "connection", + "message" + ] }, "UpdateConnectionDto": { "type": "object", @@ -3328,7 +3715,11 @@ "type": "object" } }, - "required": ["name", "description", "properties"] + "required": [ + "name", + "description", + "properties" + ] }, "ConnectionsRes": { "type": "object", @@ -3343,7 +3734,10 @@ "type": "string" } }, - "required": ["connections", "message"] + "required": [ + "connections", + "message" + ] }, "ConnectionDto": { "type": "object", @@ -3425,7 +3819,10 @@ "type": "string" } }, - "required": ["connection", "message"] + "required": [ + "connection", + "message" + ] }, "PermissionDto": { "type": "object", @@ -3449,7 +3846,14 @@ "type": "string" } }, - "required": ["id", "seqid", "name", "claim", "createdAt", "updatedAt"] + "required": [ + "id", + "seqid", + "name", + "claim", + "createdAt", + "updatedAt" + ] }, "Customer": { "type": "object", @@ -3616,7 +4020,11 @@ } } }, - "required": ["users", "departments", "jobTitles"] + "required": [ + "users", + "departments", + "jobTitles" + ] }, "Hierarchy": { "type": "object", @@ -3628,7 +4036,10 @@ "type": "string" } }, - "required": ["id", "name"] + "required": [ + "id", + "name" + ] }, "GetAllHierarchiesRes": { "type": "object", @@ -3640,7 +4051,9 @@ } } }, - "required": ["hierarchies"] + "required": [ + "hierarchies" + ] }, "GetAllDepartmentsRes": { "type": "object", @@ -3652,7 +4065,9 @@ } } }, - "required": ["departments"] + "required": [ + "departments" + ] }, "CreateUserReq": { "type": "object", @@ -3679,7 +4094,9 @@ "type": "string" } }, - "required": ["email"] + "required": [ + "email" + ] }, "User": { "type": "object", @@ -3748,7 +4165,9 @@ "$ref": "#/components/schemas/User" } }, - "required": ["user"] + "required": [ + "user" + ] }, "BatchCreateUserReq": { "type": "object", @@ -3760,7 +4179,9 @@ } } }, - "required": ["users"] + "required": [ + "users" + ] }, "ErrorUsers": { "type": "object", @@ -3772,7 +4193,10 @@ "type": "string" } }, - "required": ["user", "error"] + "required": [ + "user", + "error" + ] }, "BatchCreateUserRes": { "type": "object", @@ -3790,7 +4214,10 @@ } } }, - "required": ["usersCreated", "errorUsers"] + "required": [ + "usersCreated", + "errorUsers" + ] }, "DeleteUserRes": { "type": "object", @@ -3799,7 +4226,9 @@ "type": "string" } }, - "required": ["id"] + "required": [ + "id" + ] }, "SetUserRolesReq": { "type": "object", @@ -3814,7 +4243,10 @@ } } }, - "required": ["userId", "roleNames"] + "required": [ + "userId", + "roleNames" + ] }, "SetUserRolesRes": { "type": "object", @@ -3823,7 +4255,9 @@ "$ref": "#/components/schemas/IUserByCustomer" } }, - "required": ["user"] + "required": [ + "user" + ] }, "AssignRoleToUserReq": { "type": "object", @@ -3835,7 +4269,10 @@ "type": "string" } }, - "required": ["userId", "roleId"] + "required": [ + "userId", + "roleId" + ] }, "UpdateUserReq": { "type": "object", @@ -3870,7 +4307,9 @@ "$ref": "#/components/schemas/IUserByCustomer" } }, - "required": ["user"] + "required": [ + "user" + ] }, "UserNoRolesAndCustomer": { "type": "object", @@ -3983,7 +4422,9 @@ } } }, - "required": ["roles"] + "required": [ + "roles" + ] }, "CreateRoleReq": { "type": "object", @@ -4007,7 +4448,11 @@ "type": "string" } }, - "required": ["name", "permissionIds", "description"] + "required": [ + "name", + "permissionIds", + "description" + ] }, "CustomerRole": { "type": "object", @@ -4063,7 +4508,9 @@ "$ref": "#/components/schemas/CustomerRole" } }, - "required": ["role"] + "required": [ + "role" + ] }, "GrantPermissionsToRoleReq": { "type": "object", @@ -4078,7 +4525,10 @@ } } }, - "required": ["roleId", "permissionIds"] + "required": [ + "roleId", + "permissionIds" + ] }, "GrantPermissionsToRoleRes": { "type": "object", @@ -4087,7 +4537,9 @@ "$ref": "#/components/schemas/RoleDto" } }, - "required": ["role"] + "required": [ + "role" + ] }, "RevokePermissionsFromRoleReq": { "type": "object", @@ -4102,7 +4554,10 @@ } } }, - "required": ["roleId", "permissionIds"] + "required": [ + "roleId", + "permissionIds" + ] }, "RevokePermissionsFromRoleRes": { "type": "object", @@ -4111,7 +4566,9 @@ "$ref": "#/components/schemas/RoleDto" } }, - "required": ["role"] + "required": [ + "role" + ] }, "SetRolePermissionsReq": { "type": "object", @@ -4126,7 +4583,10 @@ } } }, - "required": ["roleId", "permissionIds"] + "required": [ + "roleId", + "permissionIds" + ] }, "SetRolePermissionsRes": { "type": "object", @@ -4135,7 +4595,9 @@ "$ref": "#/components/schemas/RoleDto" } }, - "required": ["role"] + "required": [ + "role" + ] }, "SetRoleUsersReq": { "type": "object", @@ -4150,7 +4612,10 @@ } } }, - "required": ["roleId", "userIds"] + "required": [ + "roleId", + "userIds" + ] }, "SetRoleUsersRes": { "type": "object", @@ -4159,7 +4624,9 @@ "$ref": "#/components/schemas/RoleDto" } }, - "required": ["role"] + "required": [ + "role" + ] }, "UpdateRoleReq": { "type": "object", @@ -4179,7 +4646,9 @@ "$ref": "#/components/schemas/RoleDto" } }, - "required": ["role"] + "required": [ + "role" + ] }, "NetworkConfigToCatalogDto": { "type": "object", @@ -4241,7 +4710,10 @@ "type": "string" } }, - "required": ["network_configs", "message"] + "required": [ + "network_configs", + "message" + ] }, "CreateNetworkConfigReq": { "type": "object", @@ -4278,7 +4750,9 @@ "$ref": "#/components/schemas/NetworkConfigToCatalogDto" } }, - "required": ["network_config"] + "required": [ + "network_config" + ] }, "ConnectionTestPingReq": { "type": "object", @@ -4307,7 +4781,9 @@ "type": "boolean" } }, - "required": ["operation_result"] + "required": [ + "operation_result" + ] }, "ConnectionTestCredentialsProperties": { "type": "object", @@ -4328,7 +4804,13 @@ "type": "string" } }, - "required": ["host", "port", "username", "password", "database"] + "required": [ + "host", + "port", + "username", + "password", + "database" + ] }, "ConnectionTestCredentialsReq": { "type": "object", @@ -4385,7 +4867,10 @@ "type": "string" } }, - "required": ["operation_result", "connection_id"] + "required": [ + "operation_result", + "connection_id" + ] }, "ConnectionTestListSchemasReq": { "type": "object", @@ -4397,7 +4882,10 @@ "type": "string" } }, - "required": ["plugin", "connection_id"] + "required": [ + "plugin", + "connection_id" + ] }, "ConnectionTestListSchemasRes": { "type": "object", @@ -4412,7 +4900,10 @@ } } }, - "required": ["operation_result", "schema_list"] + "required": [ + "operation_result", + "schema_list" + ] }, "ConnectionTestListTablesReq": { "type": "object", @@ -4427,7 +4918,11 @@ "type": "string" } }, - "required": ["plugin", "connection_id", "schema"] + "required": [ + "plugin", + "connection_id", + "schema" + ] }, "ConnectionTestListTablesRes": { "type": "object", @@ -4442,7 +4937,10 @@ } } }, - "required": ["operation_result", "table_list"] + "required": [ + "operation_result", + "table_list" + ] }, "GetTableMetadataReq": { "type": "object", @@ -4463,7 +4961,12 @@ } } }, - "required": ["connection_id", "plugin", "schema", "table_list"] + "required": [ + "connection_id", + "plugin", + "schema", + "table_list" + ] }, "ColumnDto": { "type": "object", @@ -4475,7 +4978,10 @@ "type": "string" } }, - "required": ["name", "type"] + "required": [ + "name", + "type" + ] }, "TableMetadataDto": { "type": "object", @@ -4496,7 +5002,11 @@ } } }, - "required": ["table_name", "columns", "references"] + "required": [ + "table_name", + "columns", + "references" + ] }, "GetTableMetadataRes": { "type": "object", @@ -4511,7 +5021,10 @@ } } }, - "required": ["operation_result", "tables_metadata"] + "required": [ + "operation_result", + "tables_metadata" + ] }, "ICreatePipelineV2Req": { "type": "object", @@ -4639,6 +5152,38 @@ "updated_at" ] }, + "IUploadCSVFile": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "encoding": { + "type": "string" + }, + "sep": { + "type": "string" + }, + "header": { + "type": "boolean" + } + }, + "required": [ + "file", + "name", + "description", + "encoding", + "sep", + "header" + ] + }, "AvailableEntity": { "type": "object", "properties": { @@ -4652,7 +5197,10 @@ } } }, - "required": ["name", "replication_methods"] + "required": [ + "name", + "replication_methods" + ] }, "GetAvailableEntitiesRes": { "type": "object", @@ -4664,7 +5212,9 @@ } } }, - "required": ["entities"] + "required": [ + "entities" + ] }, "TableColumns": { "type": "object", @@ -4688,7 +5238,12 @@ "type": "string" } }, - "required": ["name", "columns", "references", "type"] + "required": [ + "name", + "columns", + "references", + "type" + ] }, "CreateInputReq": { "type": "object", @@ -4712,7 +5267,12 @@ "type": "string" } }, - "required": ["tables", "name", "description", "plugin"] + "required": [ + "tables", + "name", + "description", + "plugin" + ] }, "Input": { "type": "object", @@ -4765,7 +5325,10 @@ "type": "string" } }, - "required": ["name", "id"] + "required": [ + "name", + "id" + ] }, "IUser": { "type": "object", @@ -4777,7 +5340,10 @@ "type": "string" } }, - "required": ["username", "id"] + "required": [ + "username", + "id" + ] }, "IComment": { "type": "object", @@ -4795,7 +5361,12 @@ "type": "string" } }, - "required": ["id", "message", "created_at", "username"] + "required": [ + "id", + "message", + "created_at", + "username" + ] }, "EmbedObject": { "type": "object", @@ -4804,7 +5375,9 @@ "type": "string" } }, - "required": ["url"] + "required": [ + "url" + ] }, "IDataAsset": { "type": "object", @@ -4937,7 +5510,10 @@ "type": "number" } }, - "required": ["data_assets", "total"] + "required": [ + "data_assets", + "total" + ] }, "IColumnMetadata": { "type": "object", @@ -5027,7 +5603,9 @@ } } }, - "required": ["columns_metadata"] + "required": [ + "columns_metadata" + ] }, "IData": { "type": "object", @@ -5079,7 +5657,12 @@ } } }, - "required": ["id", "database_name", "table_name", "data"] + "required": [ + "id", + "database_name", + "table_name", + "data" + ] }, "IPreviewResponse": { "type": "object", @@ -5088,7 +5671,9 @@ "$ref": "#/components/schemas/IPreview" } }, - "required": ["preview"] + "required": [ + "preview" + ] }, "IDocs": { "type": "object", @@ -5106,7 +5691,12 @@ "type": "string" } }, - "required": ["id", "docs", "updated_at", "table_id"] + "required": [ + "id", + "docs", + "updated_at", + "table_id" + ] }, "IDocsResponse": { "type": "object", @@ -5115,7 +5705,9 @@ "$ref": "#/components/schemas/IDocs" } }, - "required": ["docs"] + "required": [ + "docs" + ] }, "IUpdateDataRequest": { "type": "object", @@ -5136,7 +5728,11 @@ "$ref": "#/components/schemas/EmbedObject" } }, - "required": ["name", "description", "tags"] + "required": [ + "name", + "description", + "tags" + ] }, "IOneDataAsset": { "type": "object", @@ -5145,7 +5741,9 @@ "$ref": "#/components/schemas/IDataAsset" } }, - "required": ["data_asset"] + "required": [ + "data_asset" + ] }, "ICreateDataAsset": { "type": "object", @@ -5184,7 +5782,9 @@ "type": "string" } }, - "required": ["message"] + "required": [ + "message" + ] }, "IDeleteComment": { "type": "object", @@ -5193,7 +5793,9 @@ "$ref": "#/components/schemas/IComment" } }, - "required": ["comment"] + "required": [ + "comment" + ] }, "INote": { "type": "object", @@ -5211,9 +5813,13 @@ } } }, - "required": ["title", "content", "tags"] + "required": [ + "title", + "content", + "tags" + ] } } } } -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9a43465..8400e52 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "dependencies": { "@aws-sdk/client-secrets-manager": "^3.112.0", "@dadosfera/dadosfera-logs": "^1.0.0-beta.4", - "@dadosfera/protospack-v2": "3.22.0", + "@dadosfera/protospack-v2": "3.23.0", "@grpc/grpc-js": "^1.6.7", "@grpc/proto-loader": "^0.6.13", "@nestjs/common": "^8.4.7", @@ -1727,9 +1727,9 @@ } }, "node_modules/@dadosfera/protospack-v2": { - "version": "3.22.0", - "resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.22.0.tgz", - "integrity": "sha512-tkHqNiSeuiGtuFieOOaTTaB1OOKzcFd+7bTlDXj6FdorIHXt+FtHxslWX5b9XERzkQg7nseak1gFw2w4krOdbg==", + "version": "3.23.0", + "resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.23.0.tgz", + "integrity": "sha512-pe2s7aJYaNlUhQ+QoMGkJoFjTS8Dh+xSgUClSJuCsTia17oidRAucfpeMUX9ws1a3+tDrXTpH519CxeHzuZQPA==", "dependencies": { "@grpc/grpc-js": "^1.6.7", "rxjs": "^7.5.5", @@ -12324,9 +12324,9 @@ } }, "@dadosfera/protospack-v2": { - "version": "3.22.0", - "resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.22.0.tgz", - "integrity": "sha512-tkHqNiSeuiGtuFieOOaTTaB1OOKzcFd+7bTlDXj6FdorIHXt+FtHxslWX5b9XERzkQg7nseak1gFw2w4krOdbg==", + "version": "3.23.0", + "resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/@dadosfera/protospack-v2/-/protospack-v2-3.23.0.tgz", + "integrity": "sha512-pe2s7aJYaNlUhQ+QoMGkJoFjTS8Dh+xSgUClSJuCsTia17oidRAucfpeMUX9ws1a3+tDrXTpH519CxeHzuZQPA==", "requires": { "@grpc/grpc-js": "^1.6.7", "rxjs": "^7.5.5", diff --git a/package.json b/package.json index 0174280..f556239 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "dependencies": { "@aws-sdk/client-secrets-manager": "^3.112.0", "@dadosfera/dadosfera-logs": "^1.0.0-beta.4", - "@dadosfera/protospack-v2": "3.22.0", + "@dadosfera/protospack-v2": "3.23.0", "@grpc/grpc-js": "^1.6.7", "@grpc/proto-loader": "^0.6.13", "@nestjs/common": "^8.4.7", diff --git a/src/modules/pipelinesV2/interfaces.ts b/src/modules/pipelinesV2/interfaces.ts index 5553c1a..2759545 100644 --- a/src/modules/pipelinesV2/interfaces.ts +++ b/src/modules/pipelinesV2/interfaces.ts @@ -66,3 +66,23 @@ export interface IGetPipelineLogsRequest { id: string; details: string; } + +export class IUploadCSVFile { + @ApiProperty({ format: 'binary' }) + file: string; + + @ApiProperty() + name: string; + + @ApiProperty() + description: string; + + @ApiProperty() + encoding: string; + + @ApiProperty() + sep: string; + + @ApiProperty() + header: boolean; +} diff --git a/src/modules/pipelinesV2/pipelines.controller.ts b/src/modules/pipelinesV2/pipelines.controller.ts index c2d828a..56baed6 100644 --- a/src/modules/pipelinesV2/pipelines.controller.ts +++ b/src/modules/pipelinesV2/pipelines.controller.ts @@ -13,13 +13,19 @@ import { HttpCode, HttpStatus, Patch, + UseInterceptors, + UploadedFile, } from '@nestjs/common'; import { + ApiConsumes, ApiCreatedResponse, ApiNoContentResponse, ApiTags, } from '@nestjs/swagger'; -import { AuthenticateCondition } from 'src/authentication/authentication.decorator'; +import { + AuthenticateCondition, + RequireAllPermissions, +} from 'src/authentication/authentication.decorator'; import { PERMISSIONS_GROUPS } from '../../authentication/permissions.enum'; import { PipelinesService } from './pipelines.service'; import { DadosferaLogger } from '@dadosfera/dadosfera-logs'; @@ -28,8 +34,13 @@ import { RequestUser, User } from 'src/authentication/user.decorator'; import { PackTheMetadata } from 'src/utils/ PackTheMetadata'; import { PipelinesService as OldPipelineService } from 'src/modules/pipelines/pipelines.service'; -import { ICreatePipelineV2Req, IPipelineV2 } from './interfaces'; +import { + ICreatePipelineV2Req, + IPipelineV2, + IUploadCSVFile, +} from './interfaces'; import { GrpcToHttpExceptionFilter } from 'src/error/grpc-to-http-exception.filter'; +import { FileInterceptor } from '@nestjs/platform-express'; @UseFilters(new GrpcToHttpExceptionFilter()) @ApiTags('PipelinesV2') @@ -240,4 +251,61 @@ export class PipelinesController { await this.pipelinesClientService.remove({ id, metadata, user }); this.logger.info('PipelinesController - delete: OK'); } + + @Post('/upload') + @RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.CREATE) + @ApiConsumes('multipart/form-data') + @UseInterceptors( + FileInterceptor('file', { limits: { fileSize: 50 * 1000 * 1000 + 1 } }), + ) + async uploadFile( + @User() user: RequestUser, + @UploadedFile() file, + @Body() body: IUploadCSVFile, + ) { + this.logger.info('/upload - Upload Connector Route'); + const metadata = PackTheMetadata({ ...user }); + let name = `${new Date().getTime()}_${file.originalname.split('.')[0]}`; + body.name ? (name = `${new Date().getTime()}_${body.name}`) : name; + const response = await this.pipelinesClientService.uploadFile( + { + file, + name, + }, + metadata, + ); + + const { sep, header, encoding, description } = body; + + const [file_name, file_format] = file.originalname.split('.'); + + const upload_pipeline = { + connection_id: process.env.UPLOAD_FILE_AGENT_CONNECTION, + connector_name: 'Amazon S3', + connector_plugin: 'aws_s3', + connector_version: '1.0.0', + image_url: 'https://assets.dadosfera.ai/images/connectors/csv.svg', + name: body.name || file_name, + description, + transformations_ids: [], + tags: [], + cron: '@once', + config: { cron: '@once', tables: [] }, + properties: { + engine: 'csv', + source_bucket: process.env.BUCKET_CUSTOMER_CSV_ASSETS, + source_prefix: `${user.customer_name}/${name}.${file_format}`, + file_format_params: { sep, encoding, header: Boolean(header) }, + is_a_upload_csv: true, + }, + input_id: undefined, + }; + + const pipeline = await this.pipelinesClientService.create( + upload_pipeline, + metadata, + ); + + return pipeline; + } } diff --git a/src/modules/pipelinesV2/pipelines.service.ts b/src/modules/pipelinesV2/pipelines.service.ts index 030c6a1..042a06b 100644 --- a/src/modules/pipelinesV2/pipelines.service.ts +++ b/src/modules/pipelinesV2/pipelines.service.ts @@ -1,4 +1,10 @@ -import { BadRequestException, Inject, OnModuleInit } from '@nestjs/common'; +import { + BadRequestException, + HttpException, + HttpStatus, + Inject, + OnModuleInit, +} from '@nestjs/common'; import { ClientGrpc } from '@nestjs/microservices'; import { Messages, @@ -243,4 +249,23 @@ export class PipelinesService implements OnModuleInit { }, }; } + + async uploadFile(uploadFile, metadata) { + const body: Messages.PipelineV2UploadFileRequest = { + file: { + buffer: uploadFile.file.buffer, + mimetypes: uploadFile.file.mimetype, + }, + name: uploadFile.name, + }; + + return lastValueFrom( + this.pipelineWriteService.PipelineV2UploadFile(body, metadata), + ).catch((err) => { + throw new HttpException( + err.details, + err.code === 6 ? HttpStatus.CONFLICT : 400, + ); + }); + } }