notes-to-strapi-export-article-ai 3.0.167 → 3.0.170
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.
|
@@ -8,23 +8,25 @@ on:
|
|
|
8
8
|
jobs:
|
|
9
9
|
publish:
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
id-token: write # Required for npm provenance
|
|
11
14
|
steps:
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
token: ${{ secrets.GIT_TOKEN }}
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
17
19
|
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
- name: Use Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: '20'
|
|
24
|
+
registry-url: 'https://registry.npmjs.org'
|
|
23
25
|
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
+
- name: Install Dependencies
|
|
27
|
+
run: npm ci
|
|
26
28
|
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
- name: Publish to npm with provenance
|
|
30
|
+
run: npm publish --provenance --access public
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "notes-to-strapi-export-article-ai",
|
|
3
3
|
"name": "Strapi Exporter AI",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.170",
|
|
5
5
|
"minAppVersion": "1.7.0",
|
|
6
6
|
"description": "Effortlessly export your notes to Strapi CMS with AI-powered handling and SEO optimization.",
|
|
7
7
|
"author": "Cinquin Andy",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "notes-to-strapi-export-article-ai",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.170",
|
|
4
4
|
"description": "Effortlessly export your Obsidian notes to Strapi CMS with AI-powered image handling and SEO optimization. Replace all the images in your notes by uploaded images in Strapi, and add SEO metadata to uploaded images.",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,22 +10,25 @@
|
|
|
10
10
|
},
|
|
11
11
|
"keywords": [],
|
|
12
12
|
"author": "Cinquin Andy",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/CinquinAndy/notes-to-strapi-export-article-ai"
|
|
16
|
+
},
|
|
13
17
|
"devDependencies": {
|
|
14
18
|
"@types/node": "22.19.7",
|
|
15
19
|
"@typescript-eslint/eslint-plugin": "8.53.0",
|
|
16
20
|
"@typescript-eslint/parser": "8.53.0",
|
|
17
21
|
"builtin-modules": "4.0.0",
|
|
18
|
-
"esbuild": "0.
|
|
22
|
+
"esbuild": "0.27.2",
|
|
19
23
|
"obsidian": "latest",
|
|
20
24
|
"prettier": "3.8.0",
|
|
21
25
|
"tslib": "2.8.1",
|
|
22
26
|
"typescript": "5.9.3"
|
|
23
27
|
},
|
|
24
28
|
"dependencies": {
|
|
25
|
-
"@ai-sdk/openai": "
|
|
26
|
-
"ai": "
|
|
29
|
+
"@ai-sdk/openai": "^3.0.12",
|
|
30
|
+
"ai": "^6.0.39",
|
|
27
31
|
"js-yaml": "4.1.1",
|
|
28
|
-
"openai": "4.104.0",
|
|
29
32
|
"process": "0.11.10"
|
|
30
33
|
}
|
|
31
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createOpenAI } from '@ai-sdk/openai'
|
|
2
|
-
import {
|
|
2
|
+
import { generateText, Output } from 'ai'
|
|
3
3
|
|
|
4
4
|
export class ConfigurationGenerator {
|
|
5
5
|
private model
|
|
@@ -9,7 +9,7 @@ export class ConfigurationGenerator {
|
|
|
9
9
|
apiKey: options.openaiApiKey,
|
|
10
10
|
})
|
|
11
11
|
|
|
12
|
-
this.model = openai('gpt-
|
|
12
|
+
this.model = openai.chat('gpt-4o-mini')
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
async generateConfiguration(params: {
|
|
@@ -23,14 +23,14 @@ export class ConfigurationGenerator {
|
|
|
23
23
|
const descriptions = JSON.parse(params.schemaDescription)
|
|
24
24
|
|
|
25
25
|
// Generate field configurations
|
|
26
|
-
const {
|
|
26
|
+
const { output } = await generateText({
|
|
27
27
|
model: this.model,
|
|
28
|
-
output:
|
|
28
|
+
output: Output.json(),
|
|
29
29
|
prompt: this.buildPrompt(schema.data, descriptions.data, params.language),
|
|
30
30
|
})
|
|
31
31
|
|
|
32
32
|
// Transform to final configuration
|
|
33
|
-
return this.transformToConfiguration(
|
|
33
|
+
return this.transformToConfiguration(output)
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
private buildPrompt(
|
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { generateObject } from 'ai'
|
|
1
|
+
import { generateText, Output } from 'ai'
|
|
3
2
|
import { createOpenAI } from '@ai-sdk/openai'
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
5
|
+
* Interface for field analysis result
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
imageFields:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fieldName: z.string(),
|
|
27
|
-
contentType: z.string(),
|
|
28
|
-
format: z.string().optional(),
|
|
29
|
-
})
|
|
30
|
-
),
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
type FieldAnalysis = z.infer<typeof fieldAnalysisSchema>
|
|
7
|
+
interface FieldAnalysis {
|
|
8
|
+
imageFields: Array<{
|
|
9
|
+
fieldName: string
|
|
10
|
+
fieldType: 'single-image' | 'gallery' | 'other'
|
|
11
|
+
required: boolean
|
|
12
|
+
description: string
|
|
13
|
+
}>
|
|
14
|
+
metadataFields: Array<{
|
|
15
|
+
fieldName: string
|
|
16
|
+
valueType: string
|
|
17
|
+
description: string
|
|
18
|
+
}>
|
|
19
|
+
contentFields: Array<{
|
|
20
|
+
fieldName: string
|
|
21
|
+
contentType: string
|
|
22
|
+
format?: string
|
|
23
|
+
}>
|
|
24
|
+
}
|
|
34
25
|
|
|
35
26
|
export interface FieldAnalyzerOptions {
|
|
36
27
|
openaiApiKey: string
|
|
@@ -43,9 +34,7 @@ export class StructuredFieldAnalyzer {
|
|
|
43
34
|
const openai = createOpenAI({
|
|
44
35
|
apiKey: options.openaiApiKey,
|
|
45
36
|
})
|
|
46
|
-
this.model = openai('gpt-5-mini'
|
|
47
|
-
structuredOutputs: true,
|
|
48
|
-
})
|
|
37
|
+
this.model = openai.chat('gpt-5-mini')
|
|
49
38
|
}
|
|
50
39
|
|
|
51
40
|
/**
|
|
@@ -53,16 +42,13 @@ export class StructuredFieldAnalyzer {
|
|
|
53
42
|
*/
|
|
54
43
|
async analyzeSchema(schema: string): Promise<FieldAnalysis> {
|
|
55
44
|
try {
|
|
56
|
-
const {
|
|
45
|
+
const { output } = await generateText({
|
|
57
46
|
model: this.model,
|
|
58
|
-
|
|
59
|
-
schemaName: 'SchemaAnalysis',
|
|
60
|
-
schemaDescription:
|
|
61
|
-
'Analysis of content schema fields to identify types and purposes',
|
|
47
|
+
output: Output.json(),
|
|
62
48
|
prompt: this.buildAnalysisPrompt(schema),
|
|
63
49
|
})
|
|
64
50
|
|
|
65
|
-
return
|
|
51
|
+
return output as unknown as FieldAnalysis
|
|
66
52
|
} catch (error) {
|
|
67
53
|
throw new Error(`Schema analysis failed: ${error.message}`)
|
|
68
54
|
}
|
|
@@ -74,7 +60,12 @@ export class StructuredFieldAnalyzer {
|
|
|
74
60
|
- Metadata fields (SEO, tags, dates, etc.)
|
|
75
61
|
- Content fields (text, rich text, markdown)
|
|
76
62
|
|
|
77
|
-
|
|
63
|
+
Return a JSON object with this exact structure:
|
|
64
|
+
{
|
|
65
|
+
"imageFields": [{ "fieldName": string, "fieldType": "single-image" | "gallery" | "other", "required": boolean, "description": string }],
|
|
66
|
+
"metadataFields": [{ "fieldName": string, "valueType": string, "description": string }],
|
|
67
|
+
"contentFields": [{ "fieldName": string, "contentType": string, "format": string (optional) }]
|
|
68
|
+
}
|
|
78
69
|
|
|
79
70
|
Schema to analyze:
|
|
80
71
|
${schema}
|
|
@@ -18,7 +18,7 @@ export class StrapiExportService {
|
|
|
18
18
|
const openai = createOpenAI({
|
|
19
19
|
apiKey: this.settings.openaiApiKey,
|
|
20
20
|
})
|
|
21
|
-
this.model = openai('gpt-
|
|
21
|
+
this.model = openai.chat('gpt-4o-mini')
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
private async sendToStrapi(data: any, route: RouteConfig): Promise<void> {
|