@memberjunction/actions-content-autotag 2.5.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/generic/content-autotag-and-vectorize.action.d.ts +14 -0
- package/dist/generic/content-autotag-and-vectorize.action.d.ts.map +1 -0
- package/dist/generic/content-autotag-and-vectorize.action.js +64 -0
- package/dist/generic/content-autotag-and-vectorize.action.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions";
|
|
2
|
+
import { VectorizeEntityAction } from "@memberjunction/core-actions";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* Params:
|
|
6
|
+
* * Autotag: Bit, if set to true, will autotag the content.
|
|
7
|
+
* * Vectorize: Bit, if set to true, will vectorize the content.
|
|
8
|
+
* * EntityNames: Comma separated list of entity names to vectorize.
|
|
9
|
+
*/
|
|
10
|
+
export declare class AutotagAndVectorizeContentAction extends VectorizeEntityAction {
|
|
11
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
12
|
+
}
|
|
13
|
+
export declare function LoadAutotagAndVectorizeContentAction(): void;
|
|
14
|
+
//# sourceMappingURL=content-autotag-and-vectorize.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-autotag-and-vectorize.action.d.ts","sourceRoot":"","sources":["../../src/generic/content-autotag-and-vectorize.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,kBAAkB,EAAc,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEvG,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAMrE;;;;;;EAME;AACF,qBACa,gCAAiC,SAAQ,qBAAqB;cACvD,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAwC1F;AAED,wBAAgB,oCAAoC,SAEnD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
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.LoadAutotagAndVectorizeContentAction = exports.AutotagAndVectorizeContentAction = void 0;
|
|
10
|
+
const actions_1 = require("@memberjunction/actions");
|
|
11
|
+
const global_1 = require("@memberjunction/global");
|
|
12
|
+
const core_actions_1 = require("@memberjunction/core-actions");
|
|
13
|
+
const content_autotagging_1 = require("@memberjunction/content-autotagging");
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* Params:
|
|
17
|
+
* * Autotag: Bit, if set to true, will autotag the content.
|
|
18
|
+
* * Vectorize: Bit, if set to true, will vectorize the content.
|
|
19
|
+
* * EntityNames: Comma separated list of entity names to vectorize.
|
|
20
|
+
*/
|
|
21
|
+
let AutotagAndVectorizeContentAction = class AutotagAndVectorizeContentAction extends core_actions_1.VectorizeEntityAction {
|
|
22
|
+
async InternalRunAction(params) {
|
|
23
|
+
const autotagParam = params.Params.find(p => p.Name === 'Autotag');
|
|
24
|
+
const vectorizeParam = params.Params.find(p => p.Name === 'Vectorize');
|
|
25
|
+
if (!autotagParam || !vectorizeParam) {
|
|
26
|
+
throw new Error('Autotag and Vectorize params are required.');
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
if (autotagParam.Value === 1) {
|
|
30
|
+
const FileAutotag = new content_autotagging_1.AutotagLocalFileSystem();
|
|
31
|
+
await FileAutotag.Autotag(params.ContextUser);
|
|
32
|
+
const RSSAutotag = new content_autotagging_1.AutotagRSSFeed();
|
|
33
|
+
await RSSAutotag.Autotag(params.ContextUser);
|
|
34
|
+
const WebsiteAutotag = new content_autotagging_1.AutotagWebsite();
|
|
35
|
+
await WebsiteAutotag.Autotag(params.ContextUser);
|
|
36
|
+
console.log('Autotagging complete.');
|
|
37
|
+
}
|
|
38
|
+
if (vectorizeParam.Value === 1) {
|
|
39
|
+
const vectorize = await super.InternalRunAction(params);
|
|
40
|
+
console.log('Vectorization complete.');
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
Success: true,
|
|
44
|
+
ResultCode: "SUCCESS"
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
return {
|
|
49
|
+
Success: false,
|
|
50
|
+
Message: error,
|
|
51
|
+
ResultCode: "FAILED"
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.AutotagAndVectorizeContentAction = AutotagAndVectorizeContentAction;
|
|
57
|
+
exports.AutotagAndVectorizeContentAction = AutotagAndVectorizeContentAction = __decorate([
|
|
58
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "Autotag And Vectorize Content")
|
|
59
|
+
], AutotagAndVectorizeContentAction);
|
|
60
|
+
function LoadAutotagAndVectorizeContentAction() {
|
|
61
|
+
// this function is a stub that is used to force the bundler to include the above class in the final bundle and not tree shake them out
|
|
62
|
+
}
|
|
63
|
+
exports.LoadAutotagAndVectorizeContentAction = LoadAutotagAndVectorizeContentAction;
|
|
64
|
+
//# sourceMappingURL=content-autotag-and-vectorize.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-autotag-and-vectorize.action.js","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AAC,CAAC;gBAExD,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;YAC1C,CAAC;YAED,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,SAAS;aACxB,CAAC;QACN,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACX,OAAO;gBACH,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,KAAY;gBACrB,UAAU,EAAE,QAAQ;aACvB,CAAC;QACN,CAAC;IACL,CAAC;CACJ,CAAA;AAzCY,4EAAgC;2CAAhC,gCAAgC;IAD5C,IAAA,sBAAa,EAAC,oBAAU,EAAE,+BAA+B,CAAC;GAC9C,gCAAgC,CAyC5C;AAED,SAAgB,oCAAoC;IAChD,uIAAuI;AAC3I,CAAC;AAFD,oFAEC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gDAAgD,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./generic/content-autotag-and-vectorize.action"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iFAA+D"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@memberjunction/actions-content-autotag",
|
|
3
|
+
"version": "2.5.0",
|
|
4
|
+
"description": "Action classes that execute the content autotagging and vectorization actions.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"/dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "ts-node-dev src/index.ts",
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
14
|
+
},
|
|
15
|
+
"author": "MemberJunction.com",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"ts-node-dev": "^2.0.0",
|
|
19
|
+
"typescript": "^5.4.5"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@memberjunction/global": "2.5.0",
|
|
23
|
+
"@memberjunction/core": "2.5.0",
|
|
24
|
+
"@memberjunction/core-entities": "2.5.0",
|
|
25
|
+
"@memberjunction/actions": "2.5.0",
|
|
26
|
+
"@memberjunction/core-actions": "2.5.0",
|
|
27
|
+
"@memberjunction/content-autotagging": "2.5.0",
|
|
28
|
+
"axios": "^1.7.2"
|
|
29
|
+
}
|
|
30
|
+
}
|