170 lines
6.4 KiB
JavaScript
170 lines
6.4 KiB
JavaScript
|
|
"use strict";
|
||
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
|
exports.SecloreProtect = void 0;
|
||
|
|
const protectWithHotFolder_1 = require("./operations/protectWithHotFolder");
|
||
|
|
const unprotect_1 = require("./operations/unprotect");
|
||
|
|
class SecloreProtect {
|
||
|
|
constructor() {
|
||
|
|
this.description = {
|
||
|
|
displayName: 'Seclore',
|
||
|
|
name: 'secloreProtect',
|
||
|
|
icon: 'file:../../icons/seclore.svg',
|
||
|
|
usableAsTool: true,
|
||
|
|
group: ['transform'],
|
||
|
|
version: 1,
|
||
|
|
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
|
||
|
|
description: 'Protect files using Seclore DRM',
|
||
|
|
defaults: {
|
||
|
|
name: 'Seclore',
|
||
|
|
},
|
||
|
|
inputs: ['main'],
|
||
|
|
outputs: ['main'],
|
||
|
|
credentials: [
|
||
|
|
{
|
||
|
|
name: 'secloreProtectApi',
|
||
|
|
required: true,
|
||
|
|
},
|
||
|
|
],
|
||
|
|
properties: [
|
||
|
|
{
|
||
|
|
displayName: 'Resource',
|
||
|
|
name: 'resource',
|
||
|
|
type: 'options',
|
||
|
|
noDataExpression: true,
|
||
|
|
options: [
|
||
|
|
{
|
||
|
|
name: 'DRM Protection',
|
||
|
|
value: 'drmProtection',
|
||
|
|
description: 'DRM file protection operations',
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name: 'DRM Unprotection',
|
||
|
|
value: 'drmUnprotection',
|
||
|
|
description: 'DRM file unprotection operations',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
default: 'drmProtection',
|
||
|
|
},
|
||
|
|
{
|
||
|
|
displayName: 'Operation',
|
||
|
|
name: 'operation',
|
||
|
|
type: 'options',
|
||
|
|
noDataExpression: true,
|
||
|
|
displayOptions: {
|
||
|
|
show: {
|
||
|
|
resource: ['drmProtection'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
options: [
|
||
|
|
{
|
||
|
|
name: 'Protect Using Policy',
|
||
|
|
value: 'protectWithHotFolder',
|
||
|
|
description: 'Protect a file using HotFolder ID configuration',
|
||
|
|
action: 'Protect file using policy',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
default: 'protectWithHotFolder',
|
||
|
|
},
|
||
|
|
{
|
||
|
|
displayName: 'Operation',
|
||
|
|
name: 'operation',
|
||
|
|
type: 'options',
|
||
|
|
noDataExpression: true,
|
||
|
|
displayOptions: {
|
||
|
|
show: {
|
||
|
|
resource: ['drmUnprotection'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
options: [
|
||
|
|
{
|
||
|
|
name: 'Unprotect',
|
||
|
|
value: 'unprotect',
|
||
|
|
description: 'Unprotect a protected file',
|
||
|
|
action: 'Unprotect file',
|
||
|
|
},
|
||
|
|
],
|
||
|
|
default: 'unprotect',
|
||
|
|
},
|
||
|
|
{
|
||
|
|
displayName: 'HotFolder ID',
|
||
|
|
name: 'hotfolderId',
|
||
|
|
type: 'string',
|
||
|
|
required: true,
|
||
|
|
default: '',
|
||
|
|
placeholder: '',
|
||
|
|
description: 'The ID of the HotFolder configuration to use for protection',
|
||
|
|
displayOptions: {
|
||
|
|
show: {
|
||
|
|
resource: ['drmProtection'],
|
||
|
|
operation: ['protectWithHotFolder'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
displayName: 'Input Binary Property',
|
||
|
|
name: 'binaryPropertyName',
|
||
|
|
type: 'string',
|
||
|
|
default: 'data',
|
||
|
|
required: true,
|
||
|
|
description: 'Name of the binary property that contains the file to protect',
|
||
|
|
displayOptions: {
|
||
|
|
show: {
|
||
|
|
resource: ['drmProtection'],
|
||
|
|
operation: ['protectWithHotFolder'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
displayName: 'Retry Count',
|
||
|
|
name: 'retryCount',
|
||
|
|
type: 'number',
|
||
|
|
default: 3,
|
||
|
|
description: 'Number of retry attempts for failed requests',
|
||
|
|
displayOptions: {
|
||
|
|
show: {
|
||
|
|
resource: ['drmProtection'],
|
||
|
|
operation: ['protectWithHotFolder'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
displayName: 'Input Binary Property',
|
||
|
|
name: 'binaryPropertyName',
|
||
|
|
type: 'string',
|
||
|
|
default: 'data',
|
||
|
|
required: true,
|
||
|
|
description: 'Name of the binary property that contains the protected file to unprotect',
|
||
|
|
displayOptions: {
|
||
|
|
show: {
|
||
|
|
resource: ['drmUnprotection'],
|
||
|
|
operation: ['unprotect'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
{
|
||
|
|
displayName: 'Retry Count',
|
||
|
|
name: 'retryCount',
|
||
|
|
type: 'number',
|
||
|
|
default: 3,
|
||
|
|
description: 'Number of retry attempts for failed requests',
|
||
|
|
displayOptions: {
|
||
|
|
show: {
|
||
|
|
resource: ['drmUnprotection'],
|
||
|
|
operation: ['unprotect'],
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
],
|
||
|
|
};
|
||
|
|
this.customOperations = {
|
||
|
|
drmProtection: {
|
||
|
|
protectWithHotFolder: protectWithHotFolder_1.protectWithHotFolder,
|
||
|
|
},
|
||
|
|
drmUnprotection: {
|
||
|
|
unprotect: unprotect_1.unprotect,
|
||
|
|
},
|
||
|
|
};
|
||
|
|
}
|
||
|
|
}
|
||
|
|
exports.SecloreProtect = SecloreProtect;
|
||
|
|
//# sourceMappingURL=SecloreProtect.node.js.map
|