@translationstudio/translationstudio-strapi-extension 1.1.1 → 2.0.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/README.md +1 -1
- package/dist/Types.d.ts +8 -9
- package/dist/_chunks/{App-rdXR_woe.js → App-C5dxwMbx.js} +145 -80
- package/dist/_chunks/{App-jiozoQyG.mjs → App-DxAbaDu8.mjs} +147 -82
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +542 -388
- package/dist/server/index.mjs +523 -387
- package/dist/server/src/controllers/controller.d.ts +2 -1
- package/dist/server/src/controllers/index.d.ts +2 -1
- package/dist/server/src/index.d.ts +10 -6
- package/dist/server/src/services/functions/exportData/getContentType.d.ts +30 -2
- package/dist/server/src/services/functions/exportData/getEntry.d.ts +3 -1
- package/dist/server/src/services/functions/exportData/processComponent.d.ts +2 -2
- package/dist/server/src/services/functions/exportData/processEntryFields.d.ts +7 -1
- package/dist/server/src/services/functions/exportData/transformResponse.d.ts +7 -1
- package/dist/server/src/services/functions/importData/prepareImportData.d.ts +3 -2
- package/dist/server/src/services/functions/importData/updateEntry.d.ts +3 -2
- package/dist/server/src/services/index.d.ts +8 -5
- package/dist/server/src/services/service.d.ts +8 -5
- package/package.json +18 -6
- package/dist/server/src/services/functions/importData/organizeFields.d.ts +0 -2
- package/dist/server/src/services/functions/importData/processDynamicZones.d.ts +0 -2
- package/dist/server/src/services/functions/importData/processRegularFields.d.ts +0 -2
|
@@ -10,10 +10,11 @@ declare const controller: ({ strapi }: {
|
|
|
10
10
|
getLanguageOptions(ctx: any): Promise<void>;
|
|
11
11
|
requestTranslation(ctx: any): Promise<void>;
|
|
12
12
|
exportData(ctx: any): Promise<void>;
|
|
13
|
+
setDevelopmentUrl(ctx: any): Promise<void>;
|
|
14
|
+
getDevelopmentUrl(ctx: any): Promise<void>;
|
|
13
15
|
importData(ctx: any): Promise<void>;
|
|
14
16
|
ping(ctx: any): Promise<void>;
|
|
15
17
|
getLanguages(ctx: any): Promise<void>;
|
|
16
18
|
getEmail(ctx: any): Promise<void>;
|
|
17
|
-
getEntryData(ctx: any): Promise<any>;
|
|
18
19
|
};
|
|
19
20
|
export default controller;
|
|
@@ -10,11 +10,12 @@ declare const _default: {
|
|
|
10
10
|
getLanguageOptions(ctx: any): Promise<void>;
|
|
11
11
|
requestTranslation(ctx: any): Promise<void>;
|
|
12
12
|
exportData(ctx: any): Promise<void>;
|
|
13
|
+
setDevelopmentUrl(ctx: any): Promise<void>;
|
|
14
|
+
getDevelopmentUrl(ctx: any): Promise<void>;
|
|
13
15
|
importData(ctx: any): Promise<void>;
|
|
14
16
|
ping(ctx: any): Promise<void>;
|
|
15
17
|
getLanguages(ctx: any): Promise<void>;
|
|
16
18
|
getEmail(ctx: any): Promise<void>;
|
|
17
|
-
getEntryData(ctx: any): Promise<any>;
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
21
|
export default _default;
|
|
@@ -24,11 +24,12 @@ declare const _default: {
|
|
|
24
24
|
getLanguageOptions(ctx: any): Promise<void>;
|
|
25
25
|
requestTranslation(ctx: any): Promise<void>;
|
|
26
26
|
exportData(ctx: any): Promise<void>;
|
|
27
|
+
setDevelopmentUrl(ctx: any): Promise<void>;
|
|
28
|
+
getDevelopmentUrl(ctx: any): Promise<void>;
|
|
27
29
|
importData(ctx: any): Promise<void>;
|
|
28
30
|
ping(ctx: any): Promise<void>;
|
|
29
31
|
getLanguages(ctx: any): Promise<void>;
|
|
30
32
|
getEmail(ctx: any): Promise<void>;
|
|
31
|
-
getEntryData(ctx: any): Promise<any>;
|
|
32
33
|
};
|
|
33
34
|
};
|
|
34
35
|
routes: ({
|
|
@@ -55,27 +56,30 @@ declare const _default: {
|
|
|
55
56
|
getLicense(): Promise<{
|
|
56
57
|
license: unknown;
|
|
57
58
|
}>;
|
|
59
|
+
getTranslationstudioUrl(): Promise<string>;
|
|
58
60
|
setLicense(license: string): Promise<{
|
|
59
61
|
success: boolean;
|
|
60
62
|
}>;
|
|
63
|
+
setDevelopmentUrl(url: string): Promise<boolean>;
|
|
64
|
+
getDevelopmentUrl(): Promise<string>;
|
|
61
65
|
getToken(): Promise<{
|
|
62
66
|
token: unknown;
|
|
63
67
|
}>;
|
|
64
68
|
generateToken(): Promise<{
|
|
65
|
-
token:
|
|
69
|
+
token: string;
|
|
66
70
|
}>;
|
|
67
71
|
getLanguageOptions(): Promise<unknown>;
|
|
68
|
-
exportData(payload: import("../../Types").ExportPayload): Promise<
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
exportData(payload: import("../../Types").ExportPayload): Promise<{
|
|
73
|
+
fields: any[];
|
|
74
|
+
keep: any;
|
|
71
75
|
}>;
|
|
76
|
+
importData(payload: import("../../Types").ImportPayload): Promise<boolean>;
|
|
72
77
|
requestTranslation(payload: import("../../Types").TranslationRequest): Promise<boolean>;
|
|
73
78
|
getEmail(ctx: any): Promise<{
|
|
74
79
|
email: any;
|
|
75
80
|
}>;
|
|
76
81
|
getLanguages(): Promise<import("../../Types").LocaleMap>;
|
|
77
82
|
ping(): Promise<void>;
|
|
78
|
-
getEntryData(contentTypeID: any, entryID: any, locale: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
79
83
|
};
|
|
80
84
|
};
|
|
81
85
|
contentTypes: {};
|
|
@@ -1,2 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface IStrapiSchemaField {
|
|
2
|
+
"type": string;
|
|
3
|
+
"components"?: string[];
|
|
4
|
+
"pluginOptions"?: {
|
|
5
|
+
"i18n"?: {
|
|
6
|
+
"localized": boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface IStrapiSchemaEntryAttributes {
|
|
11
|
+
[fieldName: string]: IStrapiSchemaField;
|
|
12
|
+
}
|
|
13
|
+
export interface IStrapiSchemaEntry {
|
|
14
|
+
"kind": string;
|
|
15
|
+
"collectionName": string;
|
|
16
|
+
"pluginOptions": {
|
|
17
|
+
"i18n"?: {
|
|
18
|
+
"localized": boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
"attributes": IStrapiSchemaEntryAttributes;
|
|
22
|
+
}
|
|
23
|
+
export interface IStrapiComponentSchemaMap {
|
|
24
|
+
[name: string]: IStrapiSchemaEntry;
|
|
25
|
+
}
|
|
26
|
+
export interface IStrapiSchema {
|
|
27
|
+
"entry": IStrapiSchemaEntry;
|
|
28
|
+
"components": IStrapiComponentSchemaMap;
|
|
29
|
+
}
|
|
30
|
+
export default function getContentType(contentTypeID: string): IStrapiSchema | null;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const requireTargetEntry: (contentTypeID: string, entryID: string | undefined, locale: string, logError?: boolean) => Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
2
|
+
declare const getEntry: (contentTypeID: string, entryID: string | undefined, locale: string, logError?: boolean) => Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
3
|
+
export { requireTargetEntry };
|
|
2
4
|
export default getEntry;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TranslationstudioTranslatable } from "../../../../../Types";
|
|
2
|
-
|
|
3
|
-
export default processComponent
|
|
2
|
+
import { IStrapiComponentSchemaMap, IStrapiSchemaEntry } from "./getContentType";
|
|
3
|
+
export default function processComponent(fieldName: string, value: any, componentSchema: IStrapiSchemaEntry, schemata: IStrapiComponentSchemaMap): Promise<TranslationstudioTranslatable[]>;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { IStrapiSchema, IStrapiSchemaEntry } from './getContentType';
|
|
2
|
+
export interface ExportedDocumentFields {
|
|
3
|
+
fields: any[];
|
|
4
|
+
keep: any;
|
|
5
|
+
}
|
|
6
|
+
export declare function IsLocalisableSchema(schema: IStrapiSchemaEntry): boolean;
|
|
7
|
+
declare const processEntryFields: (entry: any, schemaData: IStrapiSchema, _locale: string) => Promise<ExportedDocumentFields>;
|
|
2
8
|
export default processEntryFields;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { TranslationstudioTranslatable } from "../../../../../Types";
|
|
2
|
-
|
|
1
|
+
import { TranslatedDocumentReplaceFields, TranslationstudioTranslatable } from "../../../../../Types";
|
|
2
|
+
import { IStrapiSchema } from "../exportData/getContentType";
|
|
3
|
+
export declare function prepareImportData(translatables: TranslationstudioTranslatable[], keepData: TranslatedDocumentReplaceFields, existingEntry: any, targetSchema: IStrapiSchema): Record<string, any> | null;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
1
|
+
import { IStrapiSchema } from '../exportData/getContentType';
|
|
2
|
+
export declare function appendMissingFields(data: Record<string, any>, sourceEntry: any, targetSchema: IStrapiSchema, targetEntry: any): void;
|
|
3
|
+
export declare function updateEntry(contentTypeID: string, entryID: string, targetLocale: string, data: Record<string, any>): Promise<void>;
|
|
@@ -5,27 +5,30 @@ declare const _default: {
|
|
|
5
5
|
getLicense(): Promise<{
|
|
6
6
|
license: unknown;
|
|
7
7
|
}>;
|
|
8
|
+
getTranslationstudioUrl(): Promise<string>;
|
|
8
9
|
setLicense(license: string): Promise<{
|
|
9
10
|
success: boolean;
|
|
10
11
|
}>;
|
|
12
|
+
setDevelopmentUrl(url: string): Promise<boolean>;
|
|
13
|
+
getDevelopmentUrl(): Promise<string>;
|
|
11
14
|
getToken(): Promise<{
|
|
12
15
|
token: unknown;
|
|
13
16
|
}>;
|
|
14
17
|
generateToken(): Promise<{
|
|
15
|
-
token:
|
|
18
|
+
token: string;
|
|
16
19
|
}>;
|
|
17
20
|
getLanguageOptions(): Promise<unknown>;
|
|
18
|
-
exportData(payload: import("../../../Types").ExportPayload): Promise<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
exportData(payload: import("../../../Types").ExportPayload): Promise<{
|
|
22
|
+
fields: any[];
|
|
23
|
+
keep: any;
|
|
21
24
|
}>;
|
|
25
|
+
importData(payload: import("../../../Types").ImportPayload): Promise<boolean>;
|
|
22
26
|
requestTranslation(payload: import("../../../Types").TranslationRequest): Promise<boolean>;
|
|
23
27
|
getEmail(ctx: any): Promise<{
|
|
24
28
|
email: any;
|
|
25
29
|
}>;
|
|
26
30
|
getLanguages(): Promise<import("../../../Types").LocaleMap>;
|
|
27
31
|
ping(): Promise<void>;
|
|
28
|
-
getEntryData(contentTypeID: any, entryID: any, locale: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
29
32
|
};
|
|
30
33
|
};
|
|
31
34
|
export default _default;
|
|
@@ -6,26 +6,29 @@ declare const service: ({ strapi }: {
|
|
|
6
6
|
getLicense(): Promise<{
|
|
7
7
|
license: unknown;
|
|
8
8
|
}>;
|
|
9
|
+
getTranslationstudioUrl(): Promise<string>;
|
|
9
10
|
setLicense(license: string): Promise<{
|
|
10
11
|
success: boolean;
|
|
11
12
|
}>;
|
|
13
|
+
setDevelopmentUrl(url: string): Promise<boolean>;
|
|
14
|
+
getDevelopmentUrl(): Promise<string>;
|
|
12
15
|
getToken(): Promise<{
|
|
13
16
|
token: unknown;
|
|
14
17
|
}>;
|
|
15
18
|
generateToken(): Promise<{
|
|
16
|
-
token:
|
|
19
|
+
token: string;
|
|
17
20
|
}>;
|
|
18
21
|
getLanguageOptions(): Promise<unknown>;
|
|
19
|
-
exportData(payload: ExportPayload): Promise<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
exportData(payload: ExportPayload): Promise<{
|
|
23
|
+
fields: any[];
|
|
24
|
+
keep: any;
|
|
22
25
|
}>;
|
|
26
|
+
importData(payload: ImportPayload): Promise<boolean>;
|
|
23
27
|
requestTranslation(payload: TranslationRequest): Promise<boolean>;
|
|
24
28
|
getEmail(ctx: any): Promise<{
|
|
25
29
|
email: any;
|
|
26
30
|
}>;
|
|
27
31
|
getLanguages(): Promise<LocaleMap>;
|
|
28
32
|
ping(): Promise<void>;
|
|
29
|
-
getEntryData(contentTypeID: any, entryID: any, locale: any): Promise<import("@strapi/types/dist/modules/documents").AnyDocument>;
|
|
30
33
|
};
|
|
31
34
|
export default service;
|
package/package.json
CHANGED
|
@@ -3,8 +3,14 @@
|
|
|
3
3
|
"description": "translationstudio extension for strapi",
|
|
4
4
|
"license": "GPL-2.0-only",
|
|
5
5
|
"author": "Duncan Leininger <duncan.leininger@idmedia.com>",
|
|
6
|
+
"contributors": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Phillip Austerfield",
|
|
9
|
+
"email": "phillip.austerfield@idmedia.com"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
6
12
|
"homepage": "https://translationstudio.tech",
|
|
7
|
-
"version": "
|
|
13
|
+
"version": "2.0.0",
|
|
8
14
|
"keywords": [
|
|
9
15
|
"translationstudio",
|
|
10
16
|
"strapi",
|
|
@@ -46,20 +52,26 @@
|
|
|
46
52
|
"dependencies": {
|
|
47
53
|
"@strapi/design-system": "^2.0.0-rc.14",
|
|
48
54
|
"@strapi/icons": "^2.0.0-rc.14",
|
|
49
|
-
"react-intl": "^7.1.10"
|
|
55
|
+
"react-intl": "^7.1.10",
|
|
56
|
+
"translationstudio-strapi-extension": "file:.yalc/translationstudio-strapi-extension"
|
|
50
57
|
},
|
|
51
58
|
"devDependencies": {
|
|
52
|
-
"@
|
|
59
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
60
|
+
"@jest/globals": "^30.0.0-beta.3",
|
|
53
61
|
"@strapi/sdk-plugin": "^5.3.2",
|
|
54
|
-
"
|
|
62
|
+
"@strapi/strapi": "^5.12.4",
|
|
63
|
+
"@strapi/typescript-utils": "^5.5.0",
|
|
64
|
+
"@types/jest": "^29.5.14",
|
|
55
65
|
"@types/react": "^18.3.1",
|
|
56
66
|
"@types/react-dom": "^18.3.1",
|
|
57
|
-
"
|
|
67
|
+
"jest": "^29.7.0",
|
|
68
|
+
"prettier": "^3.4.2",
|
|
69
|
+
"ts-jest": "^29.3.4",
|
|
58
70
|
"typescript": "^5.7.2"
|
|
59
71
|
},
|
|
60
72
|
"peerDependencies": {
|
|
61
|
-
"@strapi/strapi": "^5.5.0",
|
|
62
73
|
"@strapi/sdk-plugin": "^5.2.7",
|
|
74
|
+
"@strapi/strapi": "^5.5.0",
|
|
63
75
|
"react": "^18.3.1",
|
|
64
76
|
"react-dom": "^18.3.1",
|
|
65
77
|
"react-router-dom": "^6.28.0",
|