yt-transcript-strapi-plugin 0.0.1
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/README.md +4 -0
- package/dist/_chunks/App-BZXINnvY.mjs +23 -0
- package/dist/_chunks/App-BZXINnvY.mjs.map +1 -0
- package/dist/_chunks/App-Dk5vxL_c.js +23 -0
- package/dist/_chunks/App-Dk5vxL_c.js.map +1 -0
- package/dist/_chunks/en-B4KWt_jN.js +5 -0
- package/dist/_chunks/en-B4KWt_jN.js.map +1 -0
- package/dist/_chunks/en-Byx4XI2L.mjs +5 -0
- package/dist/_chunks/en-Byx4XI2L.mjs.map +1 -0
- package/dist/_chunks/index-CenWR5nf.js +74 -0
- package/dist/_chunks/index-CenWR5nf.js.map +1 -0
- package/dist/_chunks/index-xAToV0M5.mjs +75 -0
- package/dist/_chunks/index-xAToV0M5.mjs.map +1 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/index.mjs +5 -0
- package/dist/admin/index.mjs.map +1 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/index.d.ts +11 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/HomePage.d.ts +2 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/server/index.js +499 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/index.mjs +478 -0
- package/dist/server/index.mjs.map +1 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +5 -0
- package/dist/server/src/content-types/index.d.ts +45 -0
- package/dist/server/src/content-types/transcript/index.d.ts +43 -0
- package/dist/server/src/controllers/controller.d.ts +13 -0
- package/dist/server/src/controllers/index.d.ts +14 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +112 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin.d.ts +9 -0
- package/dist/server/src/routes/content-api.d.ts +9 -0
- package/dist/server/src/routes/index.d.ts +25 -0
- package/dist/server/src/services/index.d.ts +14 -0
- package/dist/server/src/services/service.d.ts +14 -0
- package/dist/server/src/utils/extract-youtube-id.d.ts +1 -0
- package/dist/server/src/utils/fetch-transcript.d.ts +15 -0
- package/dist/server/src/utils/openai.d.ts +9 -0
- package/package.json +81 -0
- package/strapi-server.js +3 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
schema: {
|
|
3
|
+
kind: string;
|
|
4
|
+
collectionName: string;
|
|
5
|
+
info: {
|
|
6
|
+
singularName: string;
|
|
7
|
+
pluralName: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
options: {
|
|
11
|
+
draftAndPublish: boolean;
|
|
12
|
+
};
|
|
13
|
+
pluginOptions: {
|
|
14
|
+
"content-manager": {
|
|
15
|
+
visible: boolean;
|
|
16
|
+
};
|
|
17
|
+
"content-type-builder": {
|
|
18
|
+
visible: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
attributes: {
|
|
22
|
+
title: {
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
videoId: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
thumbnailUrl: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
fullTranscript: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
transcriptWithTimeCodes: {
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
readableTranscript: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Core } from '@strapi/strapi';
|
|
2
|
+
declare const controller: ({ strapi }: {
|
|
3
|
+
strapi: Core.Strapi;
|
|
4
|
+
}) => {
|
|
5
|
+
getTranscript(ctx: any): Promise<{
|
|
6
|
+
error: string;
|
|
7
|
+
data: any;
|
|
8
|
+
} | {
|
|
9
|
+
data: any;
|
|
10
|
+
error?: undefined;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
export default controller;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
controller: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
|
+
}) => {
|
|
5
|
+
getTranscript(ctx: any): Promise<{
|
|
6
|
+
error: string;
|
|
7
|
+
data: any;
|
|
8
|
+
} | {
|
|
9
|
+
data: any;
|
|
10
|
+
error?: undefined;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
register: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
|
+
}) => void;
|
|
5
|
+
bootstrap: ({ strapi }: {
|
|
6
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
7
|
+
}) => void;
|
|
8
|
+
destroy: ({ strapi }: {
|
|
9
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
10
|
+
}) => void;
|
|
11
|
+
config: {
|
|
12
|
+
default: {};
|
|
13
|
+
validator(): void;
|
|
14
|
+
};
|
|
15
|
+
controllers: {
|
|
16
|
+
controller: ({ strapi }: {
|
|
17
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
18
|
+
}) => {
|
|
19
|
+
getTranscript(ctx: any): Promise<{
|
|
20
|
+
error: string;
|
|
21
|
+
data: any;
|
|
22
|
+
} | {
|
|
23
|
+
data: any;
|
|
24
|
+
error?: undefined;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
routes: {
|
|
29
|
+
"content-api": {
|
|
30
|
+
type: string;
|
|
31
|
+
routes: {
|
|
32
|
+
method: string;
|
|
33
|
+
path: string;
|
|
34
|
+
handler: string;
|
|
35
|
+
config: {
|
|
36
|
+
policies: any[];
|
|
37
|
+
};
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
40
|
+
admin: {
|
|
41
|
+
type: string;
|
|
42
|
+
routes: {
|
|
43
|
+
method: string;
|
|
44
|
+
path: string;
|
|
45
|
+
handler: string;
|
|
46
|
+
config: {
|
|
47
|
+
policies: any[];
|
|
48
|
+
};
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
services: {
|
|
53
|
+
service: ({ strapi }: {
|
|
54
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
55
|
+
}) => {
|
|
56
|
+
getTranscript(identifier: string): Promise<import("./utils/fetch-transcript").TranscriptData | {
|
|
57
|
+
error: string;
|
|
58
|
+
data: any;
|
|
59
|
+
}>;
|
|
60
|
+
saveTranscript(payload: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
61
|
+
findTranscript(videoId: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
62
|
+
generateHumanReadableTranscript(transcript: any): Promise<string>;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
contentTypes: {
|
|
66
|
+
transcript: {
|
|
67
|
+
schema: {
|
|
68
|
+
kind: string;
|
|
69
|
+
collectionName: string;
|
|
70
|
+
info: {
|
|
71
|
+
singularName: string;
|
|
72
|
+
pluralName: string;
|
|
73
|
+
displayName: string;
|
|
74
|
+
};
|
|
75
|
+
options: {
|
|
76
|
+
draftAndPublish: boolean;
|
|
77
|
+
};
|
|
78
|
+
pluginOptions: {
|
|
79
|
+
"content-manager": {
|
|
80
|
+
visible: boolean;
|
|
81
|
+
};
|
|
82
|
+
"content-type-builder": {
|
|
83
|
+
visible: boolean;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
attributes: {
|
|
87
|
+
title: {
|
|
88
|
+
type: string;
|
|
89
|
+
};
|
|
90
|
+
videoId: {
|
|
91
|
+
type: string;
|
|
92
|
+
};
|
|
93
|
+
thumbnailUrl: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
fullTranscript: {
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
transcriptWithTimeCodes: {
|
|
100
|
+
type: string;
|
|
101
|
+
};
|
|
102
|
+
readableTranscript: {
|
|
103
|
+
type: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
policies: {};
|
|
110
|
+
middlewares: {};
|
|
111
|
+
};
|
|
112
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"content-api": {
|
|
3
|
+
type: string;
|
|
4
|
+
routes: {
|
|
5
|
+
method: string;
|
|
6
|
+
path: string;
|
|
7
|
+
handler: string;
|
|
8
|
+
config: {
|
|
9
|
+
policies: any[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
admin: {
|
|
14
|
+
type: string;
|
|
15
|
+
routes: {
|
|
16
|
+
method: string;
|
|
17
|
+
path: string;
|
|
18
|
+
handler: string;
|
|
19
|
+
config: {
|
|
20
|
+
policies: any[];
|
|
21
|
+
};
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
service: ({ strapi }: {
|
|
3
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
4
|
+
}) => {
|
|
5
|
+
getTranscript(identifier: string): Promise<import("../utils/fetch-transcript").TranscriptData | {
|
|
6
|
+
error: string;
|
|
7
|
+
data: any;
|
|
8
|
+
}>;
|
|
9
|
+
saveTranscript(payload: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
10
|
+
findTranscript(videoId: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
11
|
+
generateHumanReadableTranscript(transcript: any): Promise<string>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Core } from '@strapi/strapi';
|
|
2
|
+
export declare function generateModifiedTranscript(rawTranscript: string): Promise<string>;
|
|
3
|
+
declare const service: ({ strapi }: {
|
|
4
|
+
strapi: Core.Strapi;
|
|
5
|
+
}) => {
|
|
6
|
+
getTranscript(identifier: string): Promise<import("../utils/fetch-transcript").TranscriptData | {
|
|
7
|
+
error: string;
|
|
8
|
+
data: any;
|
|
9
|
+
}>;
|
|
10
|
+
saveTranscript(payload: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
11
|
+
findTranscript(videoId: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
12
|
+
generateHumanReadableTranscript(transcript: any): Promise<string>;
|
|
13
|
+
};
|
|
14
|
+
export default service;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function extractYouTubeID(urlOrID: string): string | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TranscriptSegment {
|
|
2
|
+
text: string;
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
duration: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TranscriptData {
|
|
8
|
+
title: string;
|
|
9
|
+
videoId: string;
|
|
10
|
+
thumbnailUrl: string;
|
|
11
|
+
fullTranscript: string;
|
|
12
|
+
transcriptWithTimeCodes: TranscriptSegment[];
|
|
13
|
+
}
|
|
14
|
+
declare const fetchTranscript: (identifier: string) => Promise<TranscriptData>;
|
|
15
|
+
export default fetchTranscript;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChatOpenAI } from "@langchain/openai";
|
|
2
|
+
interface InitializeModelProps {
|
|
3
|
+
openAIApiKey: string;
|
|
4
|
+
model: string;
|
|
5
|
+
temp: number;
|
|
6
|
+
maxTokens?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function initializeModel({ openAIApiKey, model, temp, }: InitializeModelProps): Promise<ChatOpenAI<import("@langchain/openai").ChatOpenAICallOptions>>;
|
|
9
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.0.1",
|
|
3
|
+
"keywords": ["yt-transcript", "youtube", "transcript", "strapi", "plugin"],
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/PaulBratslavsky/yt-transcript-strapi-plugin"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
"./strapi-admin": {
|
|
12
|
+
"types": "./dist/admin/src/index.d.ts",
|
|
13
|
+
"source": "./admin/src/index.ts",
|
|
14
|
+
"import": "./dist/admin/index.mjs",
|
|
15
|
+
"require": "./dist/admin/index.js",
|
|
16
|
+
"default": "./dist/admin/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./strapi-server": {
|
|
19
|
+
"types": "./dist/server/src/index.d.ts",
|
|
20
|
+
"source": "./server/src/index.ts",
|
|
21
|
+
"import": "./dist/server/index.mjs",
|
|
22
|
+
"require": "./dist/server/index.js",
|
|
23
|
+
"default": "./dist/server/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"./strapi-server.js"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "strapi-plugin build",
|
|
32
|
+
"watch": "strapi-plugin watch",
|
|
33
|
+
"watch:link": "strapi-plugin watch:link",
|
|
34
|
+
"verify": "strapi-plugin verify",
|
|
35
|
+
"test:ts:front": "run -T tsc -p admin/tsconfig.json",
|
|
36
|
+
"test:ts:back": "run -T tsc -p server/tsconfig.json"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@langchain/core": "^0.3.18",
|
|
40
|
+
"@langchain/openai": "^0.3.13",
|
|
41
|
+
"@strapi/design-system": "^2.0.0-rc.12",
|
|
42
|
+
"@strapi/icons": "^2.0.0-rc.12",
|
|
43
|
+
"langchain": "^0.3.5",
|
|
44
|
+
"react-intl": "^6.8.7",
|
|
45
|
+
"youtubei.js": "^11.0.1"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@strapi/sdk-plugin": "^5.2.7",
|
|
49
|
+
"@strapi/strapi": "^5.0.0-rc.30",
|
|
50
|
+
"@strapi/typescript-utils": "^5.0.0-rc.30",
|
|
51
|
+
"@types/react": "^18.3.12",
|
|
52
|
+
"@types/react-dom": "^18.3.1",
|
|
53
|
+
"prettier": "^3.3.3",
|
|
54
|
+
"react": "^18.3.1",
|
|
55
|
+
"react-dom": "^18.3.1",
|
|
56
|
+
"react-router-dom": "^6.28.0",
|
|
57
|
+
"styled-components": "^6.1.13",
|
|
58
|
+
"typescript": "^5.6.3"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@strapi/sdk-plugin": "^5.2.7",
|
|
62
|
+
"@strapi/strapi": "^5.0.0-rc.30",
|
|
63
|
+
"react": "^18.3.1",
|
|
64
|
+
"react-dom": "^18.3.1",
|
|
65
|
+
"react-router-dom": "^6.28.0",
|
|
66
|
+
"styled-components": "^6.1.13"
|
|
67
|
+
},
|
|
68
|
+
"strapi": {
|
|
69
|
+
"kind": "plugin",
|
|
70
|
+
"name": "yt-transcript",
|
|
71
|
+
"displayName": "YT Transcript",
|
|
72
|
+
"description": "Get YT Video Transcript"
|
|
73
|
+
},
|
|
74
|
+
"name": "yt-transcript-strapi-plugin",
|
|
75
|
+
"description": "Get YT Video Transcript",
|
|
76
|
+
"license": "MIT",
|
|
77
|
+
"author": "Paul Brats <codingafterthirty@gmail.com>",
|
|
78
|
+
"publishConfig": {
|
|
79
|
+
"access": "public"
|
|
80
|
+
}
|
|
81
|
+
}
|
package/strapi-server.js
ADDED