1
| {"name":"PROMPTS_READ","id":"/providers/Microsoft.Flow/flows/PROMPTS_READ","type":"Microsoft.Flow/flows","properties":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_logicflows","displayName":"PROMPTS_READ","definition":{"metadata":{"workflowEntityId":null,"processAdvisorMetadata":null,"flowChargedByPaygo":null,"flowclientsuspensionreason":"None","flowclientsuspensiontime":null,"flowclientsuspensionreasondetails":null,"creator":{"id":"JUHEON","type":"User","tenantId":"JUHEON.com"},"provisioningMethod":"FromDefinition","failureAlertSubscription":true,"clientLastModifiedTime":"2026-05-19T08:03:09.9094401Z","connectionKeySavedTimeKey":"2026-05-19T08:03:09.9094401Z","creationSource":"Portal","modifiedSources":"Portal"},"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"undefined","parameters":{"$authentication":{"defaultValue":{},"type":"SecureObject"},"$connections":{"defaultValue":{},"type":"Object"}},"triggers":{"manual":{"metadata":{},"type":"Request","kind":"Http","inputs":{"schema":{"type":"object","properties":{"action":{"type":"string"},"folder":{"type":"string"},"path":{"type":"string"},"empNo":{"type":"string"},"hash":{"type":"string"},"name":{"type":"string"},"rank":{"type":"string"},"isAdmin":{"type":"boolean"},"empHash":{"type":"string"}}},"method":"POST","triggerAuthenticationType":"All"}}},"actions":{"SALT":{"runAfter":{},"type":"InitializeVariable","inputs":{"variables":[{"name":"SALT","type":"string","value":"{SALT값}"}]}},"Switch":{"runAfter":{"MatchedUser":["Succeeded"]},"cases":{"get-salt":{"case":"get-salt","actions":{"Response":{"type":"Response","kind":"Http","inputs":{"statusCode":200,"headers":{"Content-Type":"application/json"},"body":{"salt":"@{variables('SALT')}"}}}}},"verify-empno":{"case":"verify-empno","actions":{"Get_file_content_using_path_1":{"type":"OpenApiConnection","inputs":{"parameters":{"dataset":"https://{회사도메인}.sharepoint.com/sites/{사이트명}","path":"/Shared Documents/프롬프트 라이브러리/auth.json","inferContentType":false},"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline","connectionName":"shared_sharepointonline","operationId":"GetFileContentByPath"},"authentication":"@parameters('$authentication')"}},"Compose_authText":{"runAfter":{"Get_file_content_using_path_1":["Succeeded"]},"type":"Compose","inputs":"@base64ToString(body('Get_file_content_using_path_1')?['$content'])"},"Parse_JSON":{"runAfter":{"Compose_authText":["Succeeded"]},"type":"ParseJson","inputs":{"content":"@outputs('Compose_authText')","schema":{"type":"object","properties":{"users":{"type":"array","items":{"type":"object","properties":{"hash":{"type":"string"},"name":{"type":"string"},"rank":{"type":"string"},"isAdmin":{"type":"boolean"}},"required":["hash","name","rank","isAdmin"]}}}}}},"Filter_array":{"runAfter":{"Parse_JSON":["Succeeded"]},"type":"Query","inputs":{"from":"@body('Parse_JSON')?['users']","where":"@equals(\n item()?['hash'],\n triggerBody()?['hash']\n)"}},"Select_userList":{"runAfter":{"Filter_array":["Succeeded"]},"type":"Select","inputs":{"from":"@body('Parse_JSON')?['users']","select":{"name":"@item()?['name']","rank":"@item()?['rank']","isAdmin":"@item()?['isAdmin']"}}},"Condition":{"actions":{"Compose_Matched":{"type":"Compose","inputs":"@first(body('Filter_array'))"},"Response_ok":{"runAfter":{"Compose_Matched":["Succeeded"]},"type":"Response","kind":"Http","inputs":{"statusCode":200,"headers":{"Content-Type":"application/json"},"body":{"ok":true,"name":"@{outputs('Compose_Matched')?['name']}","rank":"@{outputs('Compose_Matched')?['rank']}","isAdmin":"@{outputs('Compose_Matched')?['isAdmin']}","userList":"@{body('Select_userList')}"}}}},"runAfter":{"Select_userList":["Succeeded"]},"else":{"actions":{"Response_fail":{"type":"Response","kind":"Http","inputs":{"statusCode":200,"headers":{"Content-Type":"application/json"},"body":{"ok":false,"userList":"@{body('Select_userList')}"}}}}},"expression":{"and":[{"greater":["@length(body('Filter_array'))",0]}]},"type":"If"}}},"gen-user-hash":{"case":"gen-user-hash","actions":{"Compose":{"type":"Compose","inputs":"@concat(variables('SALT'),':',triggerBody()?['empNo'])"},"Compose_1":{"runAfter":{"Compose":["Succeeded"]},"type":"Compose","inputs":"@base64(sha256HashValue(outputs('Compose')))"},"Compose_2":{"runAfter":{"Compose_1":["Succeeded"]},"type":"Compose","inputs":{"empHash":"@{outputs('Compose_1')}","name":"@{triggerBody()?['name']}","rank":"@{triggerBody()?['rank']}","isAdmin":"@triggerBody()?['isAdmin']"}},"Response_3":{"runAfter":{"Compose_2":["Succeeded"]},"type":"Response","kind":"Http","inputs":{"statusCode":200,"headers":{"Content-Type":"application/json"},"body":{"user":"@outputs('Compose_2')"}}}}},"list-files":{"case":"list-files","actions":{"Send_an_HTTP_request_to_SharePoint_1":{"type":"OpenApiConnection","inputs":{"parameters":{"dataset":"https://{회사도메인}.sharepoint.com/sites/{사이트명}","parameters/method":"GET","parameters/uri":"@concat('_api/web/GetFolderByServerRelativeUrl(''',triggerBody()?['folder'],''')/Files?$select=Name&$orderby=Name')","parameters/headers":{"Accept":"application/json;odata=nometadata"}},"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline","connectionName":"shared_sharepointonline","operationId":"HttpRequest"},"authentication":"@parameters('$authentication')"}},"Parse_JSON_1":{"runAfter":{"Send_an_HTTP_request_to_SharePoint_1":["Succeeded"]},"type":"ParseJson","inputs":{"content":"@body('Send_an_HTTP_request_to_SharePoint_1')","schema":{"type":"object","properties":{"value":{"type":"array","items":{"type":"object","properties":{"Name":{"type":"string"}}}}}}}},"Select_FileNames":{"runAfter":{"Parse_JSON_1":["Succeeded"]},"type":"Select","inputs":{"from":"@body('Parse_JSON_1')?['value']","select":{"Name":"@item()?['Name']"}}},"Response_4":{"runAfter":{"Select_FileNames":["Succeeded"]},"type":"Response","kind":"Http","inputs":{"statusCode":200,"headers":{"Content-Type":"application/json"},"body":"@body('Select_FileNames')"}}}},"read-json":{"case":"read-json","actions":{"Send_an_HTTP_request_to_SharePoint_2":{"type":"OpenApiConnection","inputs":{"parameters":{"dataset":"https://{회사도메인}.sharepoint.com/sites/{사이트명}","parameters/method":"GET","parameters/uri":"@concat('_api/web/GetFileByServerRelativeUrl(''',triggerBody()?['path'],''')/$value')","parameters/headers":{"Accept":"application/json"}},"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline","connectionName":"shared_sharepointonline","operationId":"HttpRequest"},"authentication":"@parameters('$authentication')"}},"Response_5":{"runAfter":{"Send_an_HTTP_request_to_SharePoint_2":["Succeeded"]},"type":"Response","kind":"Http","inputs":{"statusCode":200,"headers":{"Content-Type":"application/json"},"body":"@body('Send_an_HTTP_request_to_SharePoint_2')"}}}},"get-auth":{"case":"get-auth","actions":{"Get_file_content_using_path":{"type":"OpenApiConnection","inputs":{"parameters":{"dataset":"https://{회사도메인}.sharepoint.com/sites/{사이트명}","path":"/Shared Documents/프롬프트 라이브러리/auth.json","inferContentType":false},"host":{"apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline","connectionName":"shared_sharepointonline","operationId":"GetFileContentByPath"},"authentication":"@parameters('$authentication')"}},"Compose_getAuth":{"runAfter":{"Get_file_content_using_path":["Succeeded"]},"type":"Compose","inputs":"@base64ToString(body('Get_file_content_using_path')?['$content'])"},"Response_6":{"runAfter":{"Compose_getAuth":["Succeeded"]},"type":"Response","kind":"Http","inputs":{"statusCode":200,"headers":{"Content-Type":"application/json"},"body":"@json(outputs('Compose_getAuth'))"}}}}},"default":{"actions":{"Response_7":{"type":"Response","kind":"Http","inputs":{"statusCode":400,"body":{"error":"unknown action"}}}}},"expression":"@triggerBody()?['action']","type":"Switch"},"MatchedUser":{"runAfter":{"UserList":["Succeeded"]},"type":"InitializeVariable","inputs":{"variables":[{"name":"MatchedUser","type":"object"}]}},"UserList":{"runAfter":{"SALT":["Succeeded"]},"type":"InitializeVariable","inputs":{"variables":[{"name":"UserList","type":"array"}]}}}},"connectionReferences":{"shared_sharepointonline":{"connectionName":"shared-sharepointonl-c9dd6a08-056b-4063-a4be-c4c1f822e170","source":"Embedded","id":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline","tier":"NotSpecified","apiName":"sharepointonline","isProcessSimpleApiReferenceConversionAlreadyDone":false}},"flowFailureAlertSubscribed":false,"isManaged":false}}
|