@memberjunction/core-actions 2.103.0 → 2.104.0
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/dist/config.d.ts +82 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +83 -0
- package/dist/config.js.map +1 -0
- package/dist/custom/files/base-file-storage.action.d.ts +70 -0
- package/dist/custom/files/base-file-storage.action.d.ts.map +1 -0
- package/dist/custom/files/base-file-storage.action.js +140 -0
- package/dist/custom/files/base-file-storage.action.js.map +1 -0
- package/dist/custom/files/copy-object.action.d.ts +38 -0
- package/dist/custom/files/copy-object.action.d.ts.map +1 -0
- package/dist/custom/files/copy-object.action.js +84 -0
- package/dist/custom/files/copy-object.action.js.map +1 -0
- package/dist/custom/files/create-directory.action.d.ts +34 -0
- package/dist/custom/files/create-directory.action.d.ts.map +1 -0
- package/dist/custom/files/create-directory.action.js +75 -0
- package/dist/custom/files/create-directory.action.js.map +1 -0
- package/dist/custom/files/delete-directory.action.d.ts +38 -0
- package/dist/custom/files/delete-directory.action.d.ts.map +1 -0
- package/dist/custom/files/delete-directory.action.js +82 -0
- package/dist/custom/files/delete-directory.action.js.map +1 -0
- package/dist/custom/files/delete-object.action.d.ts +34 -0
- package/dist/custom/files/delete-object.action.d.ts.map +1 -0
- package/dist/custom/files/delete-object.action.js +75 -0
- package/dist/custom/files/delete-object.action.js.map +1 -0
- package/dist/custom/files/directory-exists.action.d.ts +34 -0
- package/dist/custom/files/directory-exists.action.d.ts.map +1 -0
- package/dist/custom/files/directory-exists.action.js +75 -0
- package/dist/custom/files/directory-exists.action.js.map +1 -0
- package/dist/custom/files/get-download-url.action.d.ts +34 -0
- package/dist/custom/files/get-download-url.action.d.ts.map +1 -0
- package/dist/custom/files/get-download-url.action.js +75 -0
- package/dist/custom/files/get-download-url.action.js.map +1 -0
- package/dist/custom/files/get-metadata.action.d.ts +42 -0
- package/dist/custom/files/get-metadata.action.d.ts.map +1 -0
- package/dist/custom/files/get-metadata.action.js +95 -0
- package/dist/custom/files/get-metadata.action.js.map +1 -0
- package/dist/custom/files/get-object.action.d.ts +35 -0
- package/dist/custom/files/get-object.action.d.ts.map +1 -0
- package/dist/custom/files/get-object.action.js +80 -0
- package/dist/custom/files/get-object.action.js.map +1 -0
- package/dist/custom/files/get-upload-url.action.d.ts +35 -0
- package/dist/custom/files/get-upload-url.action.d.ts.map +1 -0
- package/dist/custom/files/get-upload-url.action.js +80 -0
- package/dist/custom/files/get-upload-url.action.js.map +1 -0
- package/dist/custom/files/index.d.ts +23 -0
- package/dist/custom/files/index.d.ts.map +1 -0
- package/dist/custom/files/index.js +39 -0
- package/dist/custom/files/index.js.map +1 -0
- package/dist/custom/files/list-objects.action.d.ts +50 -0
- package/dist/custom/files/list-objects.action.d.ts.map +1 -0
- package/dist/custom/files/list-objects.action.js +95 -0
- package/dist/custom/files/list-objects.action.js.map +1 -0
- package/dist/custom/files/move-object.action.d.ts +38 -0
- package/dist/custom/files/move-object.action.d.ts.map +1 -0
- package/dist/custom/files/move-object.action.js +84 -0
- package/dist/custom/files/move-object.action.js.map +1 -0
- package/dist/custom/files/object-exists.action.d.ts +34 -0
- package/dist/custom/files/object-exists.action.d.ts.map +1 -0
- package/dist/custom/files/object-exists.action.js +75 -0
- package/dist/custom/files/object-exists.action.js.map +1 -0
- package/dist/custom/integration/gamma-generate-presentation.action.d.ts +108 -0
- package/dist/custom/integration/gamma-generate-presentation.action.d.ts.map +1 -0
- package/dist/custom/integration/gamma-generate-presentation.action.js +315 -0
- package/dist/custom/integration/gamma-generate-presentation.action.js.map +1 -0
- package/dist/custom/web/perplexity-search.action.d.ts +98 -0
- package/dist/custom/web/perplexity-search.action.d.ts.map +1 -0
- package/dist/custom/web/perplexity-search.action.js +269 -0
- package/dist/custom/web/perplexity-search.action.js.map +1 -0
- package/dist/custom/web/web-page-content.action.d.ts +74 -27
- package/dist/custom/web/web-page-content.action.d.ts.map +1 -1
- package/dist/custom/web/web-page-content.action.js +458 -226
- package/dist/custom/web/web-page-content.action.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -1
- package/package.json +16 -10
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
2
|
+
import { BaseFileStorageAction } from "./base-file-storage.action";
|
|
3
|
+
/**
|
|
4
|
+
* Action for downloading file content from a storage provider.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* await runAction({
|
|
9
|
+
* ActionName: 'Get Storage Object',
|
|
10
|
+
* Params: [{
|
|
11
|
+
* Name: 'StorageProvider',
|
|
12
|
+
* Value: 'Google Cloud Storage'
|
|
13
|
+
* }, {
|
|
14
|
+
* Name: 'ObjectName',
|
|
15
|
+
* Value: 'data/export.json'
|
|
16
|
+
* }]
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class GetObjectAction extends BaseFileStorageAction {
|
|
21
|
+
/**
|
|
22
|
+
* Download file content from storage
|
|
23
|
+
*
|
|
24
|
+
* @param params - The action parameters:
|
|
25
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
26
|
+
* - ObjectName: Required - Name/path of the object
|
|
27
|
+
*
|
|
28
|
+
* @returns Operation result with:
|
|
29
|
+
* - Content: Base64-encoded file content
|
|
30
|
+
* - Size: File size in bytes
|
|
31
|
+
*/
|
|
32
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
33
|
+
}
|
|
34
|
+
export declare function LoadGetObjectAction(): void;
|
|
35
|
+
//# sourceMappingURL=get-object.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-object.action.d.ts","sourceRoot":"","sources":["../../../src/custom/files/get-object.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,eAAgB,SAAQ,qBAAqB;IAEtD;;;;;;;;;;OAUG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAuC1F;AACD,wBAAgB,mBAAmB,SAElC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LoadGetObjectAction = exports.GetObjectAction = void 0;
|
|
10
|
+
const global_1 = require("@memberjunction/global");
|
|
11
|
+
const actions_1 = require("@memberjunction/actions");
|
|
12
|
+
const base_file_storage_action_1 = require("./base-file-storage.action");
|
|
13
|
+
/**
|
|
14
|
+
* Action for downloading file content from a storage provider.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* await runAction({
|
|
19
|
+
* ActionName: 'Get Storage Object',
|
|
20
|
+
* Params: [{
|
|
21
|
+
* Name: 'StorageProvider',
|
|
22
|
+
* Value: 'Google Cloud Storage'
|
|
23
|
+
* }, {
|
|
24
|
+
* Name: 'ObjectName',
|
|
25
|
+
* Value: 'data/export.json'
|
|
26
|
+
* }]
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
let GetObjectAction = class GetObjectAction extends base_file_storage_action_1.BaseFileStorageAction {
|
|
31
|
+
/**
|
|
32
|
+
* Download file content from storage
|
|
33
|
+
*
|
|
34
|
+
* @param params - The action parameters:
|
|
35
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
36
|
+
* - ObjectName: Required - Name/path of the object
|
|
37
|
+
*
|
|
38
|
+
* @returns Operation result with:
|
|
39
|
+
* - Content: Base64-encoded file content
|
|
40
|
+
* - Size: File size in bytes
|
|
41
|
+
*/
|
|
42
|
+
async InternalRunAction(params) {
|
|
43
|
+
try {
|
|
44
|
+
// Get and initialize storage driver
|
|
45
|
+
const { driver, error } = await this.getDriverFromParams(params);
|
|
46
|
+
if (error)
|
|
47
|
+
return error;
|
|
48
|
+
// Get required parameter
|
|
49
|
+
const objectName = this.getStringParam(params, 'objectname');
|
|
50
|
+
if (!objectName) {
|
|
51
|
+
return this.createErrorResult("ObjectName parameter is required", "MISSING_OBJECTNAME");
|
|
52
|
+
}
|
|
53
|
+
// Execute the get object operation
|
|
54
|
+
const content = await driver.GetObject(objectName);
|
|
55
|
+
// Convert buffer to base64 for transport
|
|
56
|
+
const base64Content = content.toString('base64');
|
|
57
|
+
// Add output parameters
|
|
58
|
+
this.addOutputParam(params, 'Content', base64Content);
|
|
59
|
+
this.addOutputParam(params, 'Size', content.length);
|
|
60
|
+
return this.createSuccessResult({
|
|
61
|
+
operation: 'GetObject',
|
|
62
|
+
objectName,
|
|
63
|
+
size: content.length,
|
|
64
|
+
contentBase64: base64Content
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
return this.createErrorResult(`Get object operation failed: ${error instanceof Error ? error.message : String(error)}`, "OPERATION_FAILED");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.GetObjectAction = GetObjectAction;
|
|
73
|
+
exports.GetObjectAction = GetObjectAction = __decorate([
|
|
74
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "File Storage: Get Object")
|
|
75
|
+
], GetObjectAction);
|
|
76
|
+
function LoadGetObjectAction() {
|
|
77
|
+
// Stub function to prevent tree shaking
|
|
78
|
+
}
|
|
79
|
+
exports.LoadGetObjectAction = LoadGetObjectAction;
|
|
80
|
+
//# sourceMappingURL=get-object.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-object.action.js","sourceRoot":"","sources":["../../../src/custom/files/get-object.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AACvD,qDAAqD;AACrD,yEAAmE;AAEnE;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,gDAAqB;IAEtD;;;;;;;;;;OAUG;IACO,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,oCAAoC;YACpC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YACjE,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;YAExB,yBAAyB;YACzB,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAC7D,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,OAAO,IAAI,CAAC,iBAAiB,CACzB,kCAAkC,EAClC,oBAAoB,CACvB,CAAC;YACN,CAAC;YAED,mCAAmC;YACnC,MAAM,OAAO,GAAW,MAAM,MAAO,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YAE5D,yCAAyC;YACzC,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAEjD,wBAAwB;YACxB,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;YACtD,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YAEpD,OAAO,IAAI,CAAC,mBAAmB,CAAC;gBAC5B,SAAS,EAAE,WAAW;gBACtB,UAAU;gBACV,IAAI,EAAE,OAAO,CAAC,MAAM;gBACpB,aAAa,EAAE,aAAa;aAC/B,CAAC,CAAC;QAEP,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,iBAAiB,CACzB,gCAAgC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EACxF,kBAAkB,CACrB,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAA;AApDY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,sBAAa,EAAC,oBAAU,EAAE,0BAA0B,CAAC;GACzC,eAAe,CAoD3B;AACD,SAAgB,mBAAmB;IAC/B,wCAAwC;AAC5C,CAAC;AAFD,kDAEC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
2
|
+
import { BaseFileStorageAction } from "./base-file-storage.action";
|
|
3
|
+
/**
|
|
4
|
+
* Action for generating a pre-authenticated upload URL for a file.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* await runAction({
|
|
9
|
+
* ActionName: 'Get Storage Upload URL',
|
|
10
|
+
* Params: [{
|
|
11
|
+
* Name: 'StorageProvider',
|
|
12
|
+
* Value: 'AWS S3 Storage'
|
|
13
|
+
* }, {
|
|
14
|
+
* Name: 'ObjectName',
|
|
15
|
+
* Value: 'uploads/new-file.pdf'
|
|
16
|
+
* }]
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class GetUploadUrlAction extends BaseFileStorageAction {
|
|
21
|
+
/**
|
|
22
|
+
* Generate a pre-authenticated upload URL
|
|
23
|
+
*
|
|
24
|
+
* @param params - The action parameters:
|
|
25
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
26
|
+
* - ObjectName: Required - Name/path of the object to upload
|
|
27
|
+
*
|
|
28
|
+
* @returns Operation result with:
|
|
29
|
+
* - UploadUrl: Pre-authenticated URL for uploading the file
|
|
30
|
+
* - ProviderKey: Provider-specific key (if returned by provider)
|
|
31
|
+
*/
|
|
32
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
33
|
+
}
|
|
34
|
+
export declare function LoadGetUploadUrlAction(): void;
|
|
35
|
+
//# sourceMappingURL=get-upload-url.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-upload-url.action.d.ts","sourceRoot":"","sources":["../../../src/custom/files/get-upload-url.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,kBAAmB,SAAQ,qBAAqB;IAEzD;;;;;;;;;;OAUG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAuC1F;AACD,wBAAgB,sBAAsB,SAErC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LoadGetUploadUrlAction = exports.GetUploadUrlAction = void 0;
|
|
10
|
+
const global_1 = require("@memberjunction/global");
|
|
11
|
+
const actions_1 = require("@memberjunction/actions");
|
|
12
|
+
const base_file_storage_action_1 = require("./base-file-storage.action");
|
|
13
|
+
/**
|
|
14
|
+
* Action for generating a pre-authenticated upload URL for a file.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* await runAction({
|
|
19
|
+
* ActionName: 'Get Storage Upload URL',
|
|
20
|
+
* Params: [{
|
|
21
|
+
* Name: 'StorageProvider',
|
|
22
|
+
* Value: 'AWS S3 Storage'
|
|
23
|
+
* }, {
|
|
24
|
+
* Name: 'ObjectName',
|
|
25
|
+
* Value: 'uploads/new-file.pdf'
|
|
26
|
+
* }]
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
let GetUploadUrlAction = class GetUploadUrlAction extends base_file_storage_action_1.BaseFileStorageAction {
|
|
31
|
+
/**
|
|
32
|
+
* Generate a pre-authenticated upload URL
|
|
33
|
+
*
|
|
34
|
+
* @param params - The action parameters:
|
|
35
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
36
|
+
* - ObjectName: Required - Name/path of the object to upload
|
|
37
|
+
*
|
|
38
|
+
* @returns Operation result with:
|
|
39
|
+
* - UploadUrl: Pre-authenticated URL for uploading the file
|
|
40
|
+
* - ProviderKey: Provider-specific key (if returned by provider)
|
|
41
|
+
*/
|
|
42
|
+
async InternalRunAction(params) {
|
|
43
|
+
try {
|
|
44
|
+
// Get and initialize storage driver
|
|
45
|
+
const { driver, error } = await this.getDriverFromParams(params);
|
|
46
|
+
if (error)
|
|
47
|
+
return error;
|
|
48
|
+
// Get required parameter
|
|
49
|
+
const objectName = this.getStringParam(params, 'objectname');
|
|
50
|
+
if (!objectName) {
|
|
51
|
+
return this.createErrorResult("ObjectName parameter is required", "MISSING_OBJECTNAME");
|
|
52
|
+
}
|
|
53
|
+
// Execute the create upload URL operation
|
|
54
|
+
const result = await driver.CreatePreAuthUploadUrl(objectName);
|
|
55
|
+
// Add output parameters
|
|
56
|
+
this.addOutputParam(params, 'UploadUrl', result.UploadUrl);
|
|
57
|
+
if (result.ProviderKey) {
|
|
58
|
+
this.addOutputParam(params, 'ProviderKey', result.ProviderKey);
|
|
59
|
+
}
|
|
60
|
+
return this.createSuccessResult({
|
|
61
|
+
operation: 'GetUploadUrl',
|
|
62
|
+
objectName,
|
|
63
|
+
uploadUrl: result.UploadUrl,
|
|
64
|
+
providerKey: result.ProviderKey
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
return this.createErrorResult(`Get upload URL operation failed: ${error instanceof Error ? error.message : String(error)}`, "OPERATION_FAILED");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.GetUploadUrlAction = GetUploadUrlAction;
|
|
73
|
+
exports.GetUploadUrlAction = GetUploadUrlAction = __decorate([
|
|
74
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "File Storage: Get Upload URL")
|
|
75
|
+
], GetUploadUrlAction);
|
|
76
|
+
function LoadGetUploadUrlAction() {
|
|
77
|
+
// Stub function to prevent tree shaking
|
|
78
|
+
}
|
|
79
|
+
exports.LoadGetUploadUrlAction = LoadGetUploadUrlAction;
|
|
80
|
+
//# sourceMappingURL=get-upload-url.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-upload-url.action.js","sourceRoot":"","sources":["../../../src/custom/files/get-upload-url.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AACvD,qDAAqD;AACrD,yEAAmE;AAEnE;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,gDAAqB;IAEzD;;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AAA,sBAAa,EAAC,oBAAU,EAAE,8BAA8B,CAAC;GAC7C,kBAAkB,CAoD9B;AACD,SAAgB,sBAAsB;IAClC,wCAAwC;AAC5C,CAAC;AAFD,wDAEC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Storage Actions
|
|
3
|
+
*
|
|
4
|
+
* Granular actions for interacting with various cloud storage providers
|
|
5
|
+
* (Azure Blob Storage, AWS S3, Google Cloud Storage, Google Drive, Dropbox, Box.com, SharePoint).
|
|
6
|
+
*
|
|
7
|
+
* Each action performs a single, focused operation on a storage provider.
|
|
8
|
+
* All actions extend BaseFileStorageAction for shared functionality.
|
|
9
|
+
*/
|
|
10
|
+
export { BaseFileStorageAction } from './base-file-storage.action';
|
|
11
|
+
export { ListObjectsAction } from './list-objects.action';
|
|
12
|
+
export { GetMetadataAction } from './get-metadata.action';
|
|
13
|
+
export { GetObjectAction } from './get-object.action';
|
|
14
|
+
export { GetDownloadUrlAction } from './get-download-url.action';
|
|
15
|
+
export { GetUploadUrlAction } from './get-upload-url.action';
|
|
16
|
+
export { ObjectExistsAction } from './object-exists.action';
|
|
17
|
+
export { DirectoryExistsAction } from './directory-exists.action';
|
|
18
|
+
export { CopyObjectAction } from './copy-object.action';
|
|
19
|
+
export { MoveObjectAction } from './move-object.action';
|
|
20
|
+
export { DeleteObjectAction } from './delete-object.action';
|
|
21
|
+
export { CreateDirectoryAction } from './create-directory.action';
|
|
22
|
+
export { DeleteDirectoryAction } from './delete-directory.action';
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom/files/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* File Storage Actions
|
|
4
|
+
*
|
|
5
|
+
* Granular actions for interacting with various cloud storage providers
|
|
6
|
+
* (Azure Blob Storage, AWS S3, Google Cloud Storage, Google Drive, Dropbox, Box.com, SharePoint).
|
|
7
|
+
*
|
|
8
|
+
* Each action performs a single, focused operation on a storage provider.
|
|
9
|
+
* All actions extend BaseFileStorageAction for shared functionality.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DeleteDirectoryAction = exports.CreateDirectoryAction = exports.DeleteObjectAction = exports.MoveObjectAction = exports.CopyObjectAction = exports.DirectoryExistsAction = exports.ObjectExistsAction = exports.GetUploadUrlAction = exports.GetDownloadUrlAction = exports.GetObjectAction = exports.GetMetadataAction = exports.ListObjectsAction = exports.BaseFileStorageAction = void 0;
|
|
13
|
+
var base_file_storage_action_1 = require("./base-file-storage.action");
|
|
14
|
+
Object.defineProperty(exports, "BaseFileStorageAction", { enumerable: true, get: function () { return base_file_storage_action_1.BaseFileStorageAction; } });
|
|
15
|
+
var list_objects_action_1 = require("./list-objects.action");
|
|
16
|
+
Object.defineProperty(exports, "ListObjectsAction", { enumerable: true, get: function () { return list_objects_action_1.ListObjectsAction; } });
|
|
17
|
+
var get_metadata_action_1 = require("./get-metadata.action");
|
|
18
|
+
Object.defineProperty(exports, "GetMetadataAction", { enumerable: true, get: function () { return get_metadata_action_1.GetMetadataAction; } });
|
|
19
|
+
var get_object_action_1 = require("./get-object.action");
|
|
20
|
+
Object.defineProperty(exports, "GetObjectAction", { enumerable: true, get: function () { return get_object_action_1.GetObjectAction; } });
|
|
21
|
+
var get_download_url_action_1 = require("./get-download-url.action");
|
|
22
|
+
Object.defineProperty(exports, "GetDownloadUrlAction", { enumerable: true, get: function () { return get_download_url_action_1.GetDownloadUrlAction; } });
|
|
23
|
+
var get_upload_url_action_1 = require("./get-upload-url.action");
|
|
24
|
+
Object.defineProperty(exports, "GetUploadUrlAction", { enumerable: true, get: function () { return get_upload_url_action_1.GetUploadUrlAction; } });
|
|
25
|
+
var object_exists_action_1 = require("./object-exists.action");
|
|
26
|
+
Object.defineProperty(exports, "ObjectExistsAction", { enumerable: true, get: function () { return object_exists_action_1.ObjectExistsAction; } });
|
|
27
|
+
var directory_exists_action_1 = require("./directory-exists.action");
|
|
28
|
+
Object.defineProperty(exports, "DirectoryExistsAction", { enumerable: true, get: function () { return directory_exists_action_1.DirectoryExistsAction; } });
|
|
29
|
+
var copy_object_action_1 = require("./copy-object.action");
|
|
30
|
+
Object.defineProperty(exports, "CopyObjectAction", { enumerable: true, get: function () { return copy_object_action_1.CopyObjectAction; } });
|
|
31
|
+
var move_object_action_1 = require("./move-object.action");
|
|
32
|
+
Object.defineProperty(exports, "MoveObjectAction", { enumerable: true, get: function () { return move_object_action_1.MoveObjectAction; } });
|
|
33
|
+
var delete_object_action_1 = require("./delete-object.action");
|
|
34
|
+
Object.defineProperty(exports, "DeleteObjectAction", { enumerable: true, get: function () { return delete_object_action_1.DeleteObjectAction; } });
|
|
35
|
+
var create_directory_action_1 = require("./create-directory.action");
|
|
36
|
+
Object.defineProperty(exports, "CreateDirectoryAction", { enumerable: true, get: function () { return create_directory_action_1.CreateDirectoryAction; } });
|
|
37
|
+
var delete_directory_action_1 = require("./delete-directory.action");
|
|
38
|
+
Object.defineProperty(exports, "DeleteDirectoryAction", { enumerable: true, get: function () { return delete_directory_action_1.DeleteDirectoryAction; } });
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/custom/files/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,uEAAmE;AAA1D,iIAAA,qBAAqB,OAAA;AAC9B,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AACxB,qEAAiE;AAAxD,+HAAA,oBAAoB,OAAA;AAC7B,iEAA6D;AAApD,2HAAA,kBAAkB,OAAA;AAC3B,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAC3B,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAC3B,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
2
|
+
import { BaseFileStorageAction } from "./base-file-storage.action";
|
|
3
|
+
/**
|
|
4
|
+
* Action for listing objects (files and directories) in a storage provider path.
|
|
5
|
+
*
|
|
6
|
+
* Supported storage providers:
|
|
7
|
+
* - Azure Blob Storage (Active)
|
|
8
|
+
* - AWS S3 Storage (Inactive)
|
|
9
|
+
* - Google Cloud Storage (Inactive)
|
|
10
|
+
* - Google Drive (Active)
|
|
11
|
+
* - Dropbox (Active)
|
|
12
|
+
* - Box.com (Active)
|
|
13
|
+
* - SharePoint Storage (Active)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* await runAction({
|
|
18
|
+
* ActionName: 'File Storage: List Objects',
|
|
19
|
+
* Params: [{
|
|
20
|
+
* Name: 'StorageProvider',
|
|
21
|
+
* Value: 'Azure Blob Storage'
|
|
22
|
+
* }, {
|
|
23
|
+
* Name: 'Path',
|
|
24
|
+
* Value: 'documents/'
|
|
25
|
+
* }, {
|
|
26
|
+
* Name: 'Delimiter',
|
|
27
|
+
* Value: '/'
|
|
28
|
+
* }]
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare class ListObjectsAction extends BaseFileStorageAction {
|
|
33
|
+
/**
|
|
34
|
+
* List objects in a storage provider path
|
|
35
|
+
*
|
|
36
|
+
* @param params - The action parameters:
|
|
37
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
38
|
+
* - Path: Optional - Directory path to list (default: "/")
|
|
39
|
+
* - Delimiter: Optional - Path delimiter (default: "/")
|
|
40
|
+
*
|
|
41
|
+
* @returns Operation result with:
|
|
42
|
+
* - Objects: Array of file objects
|
|
43
|
+
* - Prefixes: Array of directory prefixes
|
|
44
|
+
* - ObjectCount: Number of objects
|
|
45
|
+
* - DirectoryCount: Number of directories
|
|
46
|
+
*/
|
|
47
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
48
|
+
}
|
|
49
|
+
export declare function LoadListObjectsAction(): void;
|
|
50
|
+
//# sourceMappingURL=list-objects.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-objects.action.d.ts","sourceRoot":"","sources":["../../../src/custom/files/list-objects.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAInF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBACa,iBAAkB,SAAQ,qBAAqB;IAExD;;;;;;;;;;;;;OAaG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAmC1F;AAED,wBAAgB,qBAAqB,SAEpC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LoadListObjectsAction = exports.ListObjectsAction = void 0;
|
|
10
|
+
const global_1 = require("@memberjunction/global");
|
|
11
|
+
const actions_1 = require("@memberjunction/actions");
|
|
12
|
+
const base_file_storage_action_1 = require("./base-file-storage.action");
|
|
13
|
+
/**
|
|
14
|
+
* Action for listing objects (files and directories) in a storage provider path.
|
|
15
|
+
*
|
|
16
|
+
* Supported storage providers:
|
|
17
|
+
* - Azure Blob Storage (Active)
|
|
18
|
+
* - AWS S3 Storage (Inactive)
|
|
19
|
+
* - Google Cloud Storage (Inactive)
|
|
20
|
+
* - Google Drive (Active)
|
|
21
|
+
* - Dropbox (Active)
|
|
22
|
+
* - Box.com (Active)
|
|
23
|
+
* - SharePoint Storage (Active)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* await runAction({
|
|
28
|
+
* ActionName: 'File Storage: List Objects',
|
|
29
|
+
* Params: [{
|
|
30
|
+
* Name: 'StorageProvider',
|
|
31
|
+
* Value: 'Azure Blob Storage'
|
|
32
|
+
* }, {
|
|
33
|
+
* Name: 'Path',
|
|
34
|
+
* Value: 'documents/'
|
|
35
|
+
* }, {
|
|
36
|
+
* Name: 'Delimiter',
|
|
37
|
+
* Value: '/'
|
|
38
|
+
* }]
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
let ListObjectsAction = class ListObjectsAction extends base_file_storage_action_1.BaseFileStorageAction {
|
|
43
|
+
/**
|
|
44
|
+
* List objects in a storage provider path
|
|
45
|
+
*
|
|
46
|
+
* @param params - The action parameters:
|
|
47
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
48
|
+
* - Path: Optional - Directory path to list (default: "/")
|
|
49
|
+
* - Delimiter: Optional - Path delimiter (default: "/")
|
|
50
|
+
*
|
|
51
|
+
* @returns Operation result with:
|
|
52
|
+
* - Objects: Array of file objects
|
|
53
|
+
* - Prefixes: Array of directory prefixes
|
|
54
|
+
* - ObjectCount: Number of objects
|
|
55
|
+
* - DirectoryCount: Number of directories
|
|
56
|
+
*/
|
|
57
|
+
async InternalRunAction(params) {
|
|
58
|
+
try {
|
|
59
|
+
// Get and initialize storage driver
|
|
60
|
+
const { driver, error } = await this.getDriverFromParams(params);
|
|
61
|
+
if (error)
|
|
62
|
+
return error;
|
|
63
|
+
// Get optional parameters with defaults
|
|
64
|
+
const path = this.getStringParamWithDefault(params, 'path', '/');
|
|
65
|
+
const delimiter = this.getStringParamWithDefault(params, 'delimiter', '/');
|
|
66
|
+
// Execute the list operation
|
|
67
|
+
const result = await driver.ListObjects(path, delimiter);
|
|
68
|
+
// Add output parameters
|
|
69
|
+
this.addOutputParam(params, 'Objects', result.objects);
|
|
70
|
+
this.addOutputParam(params, 'Prefixes', result.prefixes);
|
|
71
|
+
this.addOutputParam(params, 'ObjectCount', result.objects.length);
|
|
72
|
+
this.addOutputParam(params, 'DirectoryCount', result.prefixes.length);
|
|
73
|
+
return this.createSuccessResult({
|
|
74
|
+
operation: 'ListObjects',
|
|
75
|
+
path,
|
|
76
|
+
objectCount: result.objects.length,
|
|
77
|
+
directoryCount: result.prefixes.length,
|
|
78
|
+
objects: result.objects,
|
|
79
|
+
prefixes: result.prefixes
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return this.createErrorResult(`List objects operation failed: ${error instanceof Error ? error.message : String(error)}`, "OPERATION_FAILED");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
exports.ListObjectsAction = ListObjectsAction;
|
|
88
|
+
exports.ListObjectsAction = ListObjectsAction = __decorate([
|
|
89
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "File Storage: List Objects")
|
|
90
|
+
], ListObjectsAction);
|
|
91
|
+
function LoadListObjectsAction() {
|
|
92
|
+
// Stub function to prevent tree shaking
|
|
93
|
+
}
|
|
94
|
+
exports.LoadListObjectsAction = LoadListObjectsAction;
|
|
95
|
+
//# sourceMappingURL=list-objects.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-objects.action.js","sourceRoot":"","sources":["../../../src/custom/files/list-objects.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AAEvD,qDAAqD;AACrD,yEAAmE;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,gDAAqB;IAExD;;;;;;;;;;;;;OAaG;IACO,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,oCAAo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,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAC1F,kBAAkB,CACrB,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAA;AAnDY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,sBAAa,EAAC,oBAAU,EAAE,4BAA4B,CAAC;GAC3C,iBAAiB,CAmD7B;AAED,SAAgB,qBAAqB;IACjC,wCAAwC;AAC5C,CAAC;AAFD,sDAEC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
2
|
+
import { BaseFileStorageAction } from "./base-file-storage.action";
|
|
3
|
+
/**
|
|
4
|
+
* Action for moving/renaming a file object within a storage provider.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* await runAction({
|
|
9
|
+
* ActionName: 'Move Storage Object',
|
|
10
|
+
* Params: [{
|
|
11
|
+
* Name: 'StorageProvider',
|
|
12
|
+
* Value: 'Box.com'
|
|
13
|
+
* }, {
|
|
14
|
+
* Name: 'SourceObjectName',
|
|
15
|
+
* Value: 'temp/file.txt'
|
|
16
|
+
* }, {
|
|
17
|
+
* Name: 'DestinationObjectName',
|
|
18
|
+
* Value: 'permanent/file.txt'
|
|
19
|
+
* }]
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class MoveObjectAction extends BaseFileStorageAction {
|
|
24
|
+
/**
|
|
25
|
+
* Move/rename a file object
|
|
26
|
+
*
|
|
27
|
+
* @param params - The action parameters:
|
|
28
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
29
|
+
* - SourceObjectName: Required - Source file path
|
|
30
|
+
* - DestinationObjectName: Required - Destination file path
|
|
31
|
+
*
|
|
32
|
+
* @returns Operation result with:
|
|
33
|
+
* - Success: Boolean indicating if the move succeeded
|
|
34
|
+
*/
|
|
35
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
36
|
+
}
|
|
37
|
+
export declare function LoadMoveObjectAction(): void;
|
|
38
|
+
//# sourceMappingURL=move-object.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-object.action.d.ts","sourceRoot":"","sources":["../../../src/custom/files/move-object.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,gBAAiB,SAAQ,qBAAqB;IAEvD;;;;;;;;;;OAUG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2C1F;AACD,wBAAgB,oBAAoB,SAEnC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LoadMoveObjectAction = exports.MoveObjectAction = void 0;
|
|
10
|
+
const global_1 = require("@memberjunction/global");
|
|
11
|
+
const actions_1 = require("@memberjunction/actions");
|
|
12
|
+
const base_file_storage_action_1 = require("./base-file-storage.action");
|
|
13
|
+
/**
|
|
14
|
+
* Action for moving/renaming a file object within a storage provider.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* await runAction({
|
|
19
|
+
* ActionName: 'Move Storage Object',
|
|
20
|
+
* Params: [{
|
|
21
|
+
* Name: 'StorageProvider',
|
|
22
|
+
* Value: 'Box.com'
|
|
23
|
+
* }, {
|
|
24
|
+
* Name: 'SourceObjectName',
|
|
25
|
+
* Value: 'temp/file.txt'
|
|
26
|
+
* }, {
|
|
27
|
+
* Name: 'DestinationObjectName',
|
|
28
|
+
* Value: 'permanent/file.txt'
|
|
29
|
+
* }]
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
let MoveObjectAction = class MoveObjectAction extends base_file_storage_action_1.BaseFileStorageAction {
|
|
34
|
+
/**
|
|
35
|
+
* Move/rename a file object
|
|
36
|
+
*
|
|
37
|
+
* @param params - The action parameters:
|
|
38
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
39
|
+
* - SourceObjectName: Required - Source file path
|
|
40
|
+
* - DestinationObjectName: Required - Destination file path
|
|
41
|
+
*
|
|
42
|
+
* @returns Operation result with:
|
|
43
|
+
* - Success: Boolean indicating if the move succeeded
|
|
44
|
+
*/
|
|
45
|
+
async InternalRunAction(params) {
|
|
46
|
+
try {
|
|
47
|
+
// Get and initialize storage driver
|
|
48
|
+
const { driver, error } = await this.getDriverFromParams(params);
|
|
49
|
+
if (error)
|
|
50
|
+
return error;
|
|
51
|
+
// Get required parameters
|
|
52
|
+
const sourceObjectName = this.getStringParam(params, 'sourceobjectname');
|
|
53
|
+
if (!sourceObjectName) {
|
|
54
|
+
return this.createErrorResult("SourceObjectName parameter is required", "MISSING_SOURCE");
|
|
55
|
+
}
|
|
56
|
+
const destinationObjectName = this.getStringParam(params, 'destinationobjectname');
|
|
57
|
+
if (!destinationObjectName) {
|
|
58
|
+
return this.createErrorResult("DestinationObjectName parameter is required", "MISSING_DESTINATION");
|
|
59
|
+
}
|
|
60
|
+
// Execute the move operation
|
|
61
|
+
const success = await driver.MoveObject(sourceObjectName, destinationObjectName);
|
|
62
|
+
// Add output parameter
|
|
63
|
+
this.addOutputParam(params, 'Success', success);
|
|
64
|
+
return this.createSuccessResult({
|
|
65
|
+
operation: 'MoveObject',
|
|
66
|
+
sourceObjectName,
|
|
67
|
+
destinationObjectName,
|
|
68
|
+
success
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
return this.createErrorResult(`Move object operation failed: ${error instanceof Error ? error.message : String(error)}`, "OPERATION_FAILED");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.MoveObjectAction = MoveObjectAction;
|
|
77
|
+
exports.MoveObjectAction = MoveObjectAction = __decorate([
|
|
78
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "File Storage: Move Object")
|
|
79
|
+
], MoveObjectAction);
|
|
80
|
+
function LoadMoveObjectAction() {
|
|
81
|
+
// Stub function to prevent tree shaking
|
|
82
|
+
}
|
|
83
|
+
exports.LoadMoveObjectAction = LoadMoveObjectAction;
|
|
84
|
+
//# sourceMappingURL=move-object.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-object.action.js","sourceRoot":"","sources":["../../../src/custom/files/move-object.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AACvD,qDAAqD;AACrD,yEAAmE;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,gDAAqB;IAEvD;;;;;;;;;;OAUG;IACO,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,oCAAoC;YACpC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YACjE,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;YAExB,0BAA0B;YAC1B,MAAM,gBAAgB,GAAG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orageAction } from "./base-file-storage.action";
|
|
3
|
+
/**
|
|
4
|
+
* Action for checking if a file object exists in a storage provider.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* await runAction({
|
|
9
|
+
* ActionName: 'Check Storage Object Exists',
|
|
10
|
+
* Params: [{
|
|
11
|
+
* Name: 'StorageProvider',
|
|
12
|
+
* Value: 'Google Drive'
|
|
13
|
+
* }, {
|
|
14
|
+
* Name: 'ObjectName',
|
|
15
|
+
* Value: 'reports/monthly.xlsx'
|
|
16
|
+
* }]
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class ObjectExistsAction extends BaseFileStorageAction {
|
|
21
|
+
/**
|
|
22
|
+
* Check if a file object exists
|
|
23
|
+
*
|
|
24
|
+
* @param params - The action parameters:
|
|
25
|
+
* - StorageProvider: Required - Name of the storage provider
|
|
26
|
+
* - ObjectName: Required - Name/path of the object
|
|
27
|
+
*
|
|
28
|
+
* @returns Operation result with:
|
|
29
|
+
* - Exists: Boolean indicating if the object exists
|
|
30
|
+
*/
|
|
31
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
32
|
+
}
|
|
33
|
+
export declare function LoadObjectExistsAction(): void;
|
|
34
|
+
//# sourceMappingURL=object-exists.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-exists.action.d.ts","sourceRoot":"","sources":["../../../src/custom/files/object-exists.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,kBAAmB,SAAQ,qBAAqB;IAEzD;;;;;;;;;OASG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAkC1F;AACD,wBAAgB,sBAAsB,SAErC"}
|