Skip to content

Commit 7f9318f

Browse files
committed
Update FlowSynx.PluginCore and refactoring the code to adapt new changes as well as add Icon and ReadMe file
#5
1 parent 3f6788c commit 7f9318f

File tree

5 files changed

+117
-28
lines changed

5 files changed

+117
-28
lines changed

README.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,42 @@
1-
# plugin-azure-files
2-
FlowSynx Plugin for managing Microsoft Azure File storage system.
1+
# Azure Files plugin for FlowSynx engine
2+
3+
The **Azure Files Plugin** is a pre-packaged, plug-and-play integration component for the FlowSynx engine. It enables secure and configurable access to Azure Files storage as part of FlowSynx no-code/low-code automation workflows.
4+
5+
This plugin can be installed automatically by the FlowSynx engine when selected within the platform. It is not intended for manual installation or developer use outside the FlowSynx environment.
6+
7+
---
8+
9+
## Purpose
10+
11+
This plugin allows FlowSynx users to interact with Azure Files for a variety of storage-related operations without writing code. Once installed, the plugin becomes available as a storage connector within the platform's workflow builder.
12+
13+
---
14+
15+
## Supported Operations
16+
17+
The plugin supports the following operations, which can be selected and configured within the FlowSynx UI:
18+
19+
| Operation| Description |
20+
|----------|-------------------------------------------|
21+
| `create` | Upload a new object to the blob container.|
22+
| `delete` | Remove an object from the container. |
23+
| `exist` | Check if an object exists. |
24+
| `list` | List all objects in the container. |
25+
| `purge` | Remove all contents in the container. |
26+
| `read` | Read and return the contents of an object.|
27+
| `write` | Overwrite or write new data to an object. |
28+
29+
---
30+
31+
## Notes
32+
33+
- This plugin is only supported on the FlowSynx platform.
34+
- It is installed automatically by the FlowSynx engine.
35+
- All operational logic is encapsulated and executed under FlowSynx control.
36+
- Credentials are configured through platform-managed settings.
37+
38+
---
39+
40+
## License
41+
42+
Copyright FlowSynx. All rights reserved.

src/AzureFilePlugin.cs

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ public PluginMetadata Metadata
2222
Name = "Azure.Files",
2323
CompanyName = "FlowSynx",
2424
Description = Resources.PluginDescription,
25-
Version = new PluginVersion(1, 1, 1),
25+
Version = new PluginVersion(1, 0, 0),
2626
Namespace = PluginNamespace.Connectors,
2727
Authors = new List<string> { "FlowSynx" },
2828
Copyright = "© FlowSynx. All rights reserved.",
29+
Icon = "flowsynx.png",
30+
ReadMe = "README.md",
31+
RepositoryUrl = "https://github.com/flowsynx/plugin-azure-blobs",
32+
ProjectUrl = "https://flowsynx.io",
2933
Tags = new List<string>() { "FlowSynx", "Azure", "Files", "Cloud" }
3034
};
3135
}
@@ -48,7 +52,7 @@ public Task Initialize(IPluginLogger logger)
4852
return Task.CompletedTask;
4953
}
5054

51-
public async Task<object?> ExecuteAsync(PluginParameters parameters, CancellationToken cancellationToken)
55+
public Task<object?> ExecuteAsync(PluginParameters parameters, CancellationToken cancellationToken)
5256
{
5357
if (ReflectionHelper.IsCalledViaReflection())
5458
throw new InvalidOperationException(Resources.ReflectionBasedAccessIsNotAllowed);
@@ -59,28 +63,22 @@ public Task Initialize(IPluginLogger logger)
5963
var operationParameter = parameters.ToObject<OperationParameter>();
6064
var operation = operationParameter.Operation;
6165

62-
switch (operation.ToLower())
63-
{
64-
case "create":
65-
await _manager.Create(parameters, cancellationToken).ConfigureAwait(false);
66-
return null;
67-
case "delete":
68-
await _manager.Delete(parameters, cancellationToken).ConfigureAwait(false);
69-
return null;
70-
case "exist":
71-
return await _manager.Exist(parameters, cancellationToken).ConfigureAwait(false);
72-
case "list":
73-
return await _manager.List(parameters, cancellationToken).ConfigureAwait(false);
74-
case "purge":
75-
await _manager.Purge(parameters, cancellationToken).ConfigureAwait(false);
76-
return null;
77-
case "read":
78-
return await _manager.Read(parameters, cancellationToken).ConfigureAwait(false);
79-
case "write":
80-
await _manager.Write(parameters, cancellationToken).ConfigureAwait(false);
81-
return null;
82-
default:
83-
throw new NotSupportedException($"Microsoft Azure Files plugin: Operation '{operation}' is not supported.");
84-
}
66+
if (OperationMap.TryGetValue(operation, out var handler))
67+
return handler(parameters, cancellationToken);
68+
69+
throw new NotSupportedException($"Microsoft Azure Files plugin: Operation '{operation}' is not supported.");
8570
}
71+
72+
private Dictionary<string, Func<PluginParameters, CancellationToken, Task<object?>>> OperationMap => new(StringComparer.OrdinalIgnoreCase)
73+
{
74+
["create"] = async (parameters, cancellationToken) => { await _manager.Create(parameters, cancellationToken); return null; },
75+
["delete"] = async (parameters, cancellationToken) => { await _manager.Delete(parameters, cancellationToken); return null; },
76+
["exist"] = async (parameters, cancellationToken) => await _manager.Exist(parameters, cancellationToken),
77+
["list"] = async (parameters, cancellationToken) => await _manager.List(parameters, cancellationToken),
78+
["purge"] = async (parameters, cancellationToken) => { await _manager.Purge(parameters, cancellationToken); return null; },
79+
["read"] = async (parameters, cancellationToken) => await _manager.Read(parameters, cancellationToken),
80+
["write"] = async (parameters, cancellationToken) => { await _manager.Write(parameters, cancellationToken); return null; },
81+
};
82+
83+
public IReadOnlyCollection<string> SupportedOperations => OperationMap.Keys;
8684
}

src/FlowSynx.Plugins.Azure.Files.csproj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="Azure.Storage.Files.Shares" Version="12.22.0" />
16-
<PackageReference Include="FlowSynx.PluginCore" Version="1.2.2" />
16+
<PackageReference Include="FlowSynx.PluginCore" Version="1.2.5" />
1717
</ItemGroup>
1818

1919
<ItemGroup>
@@ -35,4 +35,13 @@
3535
</EmbeddedResource>
3636
</ItemGroup>
3737

38+
<ItemGroup>
39+
<None Update="flowsynx.png">
40+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
41+
</None>
42+
<None Update="README.md">
43+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
44+
</None>
45+
</ItemGroup>
46+
3847
</Project>

src/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Azure Files plugin for FlowSynx engine
2+
3+
The **Azure Files Plugin** is a pre-packaged, plug-and-play integration component for the FlowSynx engine. It enables secure and configurable access to Azure Files storage as part of FlowSynx no-code/low-code automation workflows.
4+
5+
This plugin can be installed automatically by the FlowSynx engine when selected within the platform. It is not intended for manual installation or developer use outside the FlowSynx environment.
6+
7+
---
8+
9+
## Purpose
10+
11+
This plugin allows FlowSynx users to interact with Azure Files for a variety of storage-related operations without writing code. Once installed, the plugin becomes available as a storage connector within the platform's workflow builder.
12+
13+
---
14+
15+
## Supported Operations
16+
17+
The plugin supports the following operations, which can be selected and configured within the FlowSynx UI:
18+
19+
| Operation| Description |
20+
|----------|-------------------------------------------|
21+
| `create` | Upload a new object to the blob container.|
22+
| `delete` | Remove an object from the container. |
23+
| `exist` | Check if an object exists. |
24+
| `list` | List all objects in the container. |
25+
| `purge` | Remove all contents in the container. |
26+
| `read` | Read and return the contents of an object.|
27+
| `write` | Overwrite or write new data to an object. |
28+
29+
---
30+
31+
## Notes
32+
33+
- This plugin is only supported on the FlowSynx platform.
34+
- It is installed automatically by the FlowSynx engine.
35+
- All operational logic is encapsulated and executed under FlowSynx control.
36+
- Credentials are configured through platform-managed settings.
37+
38+
---
39+
40+
## License
41+
42+
Copyright FlowSynx. All rights reserved.

src/flowsynx.png

20 KB
Loading

0 commit comments

Comments
 (0)