@localazy/strapi-plugin 1.4.0 → 1.7.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 +30 -0
- package/dist/_chunks/{FetchIdentity-BpFOT163.js → FetchIdentity-D89DgpbN.js} +24 -32
- package/dist/_chunks/{FetchIdentity-Cor4ooZv.mjs → FetchIdentity-DkHj24S5.mjs} +36 -44
- package/dist/_chunks/{LanguagesSelector-CC1ecWnc.js → LanguagesSelector-638KGQYw.js} +3 -2
- package/dist/_chunks/{LanguagesSelector-BbrMKwQY.mjs → LanguagesSelector-CR_7I2R1.mjs} +4 -3
- package/dist/_chunks/{LocalazyApp-D0JGRQeF.js → LocalazyApp-Benn8pkA.js} +75 -39
- package/dist/_chunks/{LocalazyApp-DpFR8p10.mjs → LocalazyApp-DM3zg5E4.mjs} +70 -34
- package/dist/_chunks/{LocalazyContentTransferSetup-Dael1Q4w.mjs → LocalazyContentTransferSetup-BA_rtSBM.mjs} +58 -22
- package/dist/_chunks/{LocalazyContentTransferSetup-Cr7D-BUi.js → LocalazyContentTransferSetup-CWchyGdD.js} +62 -26
- package/dist/_chunks/{LocalazyGlobalSettings-D3nG4zl7.js → LocalazyGlobalSettings-88jqQbD4.js} +56 -25
- package/dist/_chunks/{LocalazyGlobalSettings-DzBI5M-K.mjs → LocalazyGlobalSettings-BWF0s9tM.mjs} +56 -25
- package/dist/_chunks/{LocalazyPanel-W6j8N1WC.mjs → LocalazyPanel-4HRa1jNl.mjs} +12 -6
- package/dist/_chunks/{LocalazyPanel-KQPLxTDz.js → LocalazyPanel-D0w9JSIS.js} +14 -8
- package/dist/_chunks/{LocalazyStatusColumn-B7Q_U2Lu.js → LocalazyStatusColumn-BR3f8rKp.js} +10 -4
- package/dist/_chunks/{LocalazyStatusColumn-CrhsCjgp.mjs → LocalazyStatusColumn-D4-rZZUK.mjs} +10 -4
- package/dist/_chunks/{RequireLocalazyAuth-D3GeZPDh.js → RequireLocalazyAuth-C442750b.js} +30 -3
- package/dist/_chunks/{RequireLocalazyAuth-BwoGRfJq.mjs → RequireLocalazyAuth-DbNjEOq-.mjs} +32 -5
- package/dist/_chunks/{entry-exclusion-service-D7gaRHPE.mjs → entry-exclusion-service-Bd3mUDde.mjs} +1 -1
- package/dist/_chunks/{entry-exclusion-service-Bwruvyce.js → entry-exclusion-service-CAIcybXX.js} +1 -1
- package/dist/_chunks/{has-model-changed-Dp2Vkwjw.mjs → has-model-changed-BNs3d9q5.mjs} +4 -3
- package/dist/_chunks/{has-model-changed-5IV9WI_-.js → has-model-changed-BrDeyHFt.js} +4 -3
- package/dist/_chunks/{i18n-o24yXf-j.mjs → i18n-76ox2llT.mjs} +4 -1
- package/dist/_chunks/{i18n-C_5tJvr0.js → i18n-C5ucROBh.js} +4 -1
- package/dist/_chunks/{index-C9hN3KbD.mjs → index-C9Px4v-A.mjs} +34 -12
- package/dist/_chunks/{index-jAg6jjCu.js → index-DwFm1TyM.js} +33 -11
- package/dist/_chunks/{index-BjL9XpRh.mjs → index-shryj0jT.mjs} +16 -16
- package/dist/_chunks/{strapi-api-base-IG3Pe5Sg.js → strapi-api-base-BWZYbxxj.js} +1 -1
- package/dist/_chunks/{strapi-api-base-CAzGcwF6.mjs → strapi-api-base-lPo7wq6I.mjs} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/LocalazyStatusColumn.d.ts +1 -1
- package/dist/admin/src/constants/permissions.d.ts +29 -0
- package/dist/admin/src/modules/@common/components/LanguagesSelector.d.ts +1 -0
- package/dist/admin/src/modules/@common/models/supported-content-type-fields.d.ts +1 -1
- package/dist/admin/src/modules/login/locale/en.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/Tree.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/TreeItem.d.ts +1 -0
- package/dist/admin/src/modules/plugin-settings/components/WebhookSetup.d.ts +4 -1
- package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/services/plugin-settings-service.d.ts +4 -0
- package/dist/server/index.js +422 -213
- package/dist/server/index.mjs +422 -213
- package/dist/server/src/bootstrap.d.ts +1 -1
- package/dist/server/src/constants/permissions.d.ts +38 -0
- package/dist/server/src/controllers/index.d.ts +1 -0
- package/dist/server/src/controllers/plugin-settings-controller.d.ts +1 -0
- package/dist/server/src/core/index.d.ts +3 -1
- package/dist/server/src/index.d.ts +57 -8
- package/dist/server/src/routes/activity-logs-routes.d.ts +20 -3
- package/dist/server/src/routes/debug-bundle-routes.d.ts +6 -1
- package/dist/server/src/routes/entry-exclusion-routes.d.ts +20 -3
- package/dist/server/src/routes/index.d.ts +52 -6
- package/dist/server/src/routes/localazy-auth-routes.d.ts +6 -1
- package/dist/server/src/routes/localazy-project-routes.d.ts +20 -3
- package/dist/server/src/routes/localazy-transfer-routes.d.ts +6 -1
- package/dist/server/src/routes/localazy-user-routes.d.ts +20 -3
- package/dist/server/src/routes/plugin-settings-routes.d.ts +20 -3
- package/dist/server/src/routes/strapi-routes.d.ts +20 -3
- package/dist/server/src/services/index.d.ts +3 -1
- package/dist/server/src/services/localazy-transfer-download-service.d.ts +2 -1
- package/dist/server/src/services/plugin-settings-service.d.ts +4 -0
- package/dist/server/src/utils/blocks-to-translatable.d.ts +34 -0
- package/dist/server/src/utils/model-utils.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UIDs as Strapi sees them after `pluginName` is prepended by the action provider.
|
|
3
|
+
* Use these to reference permissions from route policies, admin menu/settings links
|
|
4
|
+
* and `useRBAC` calls. Renaming any UID is a breaking change for existing role grants
|
|
5
|
+
* — bumping a minor version is not enough.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PERMISSION_UIDS: {
|
|
8
|
+
readonly READ: `plugin::${string}.read`;
|
|
9
|
+
readonly TRANSFER: `plugin::${string}.transfer`;
|
|
10
|
+
readonly SETTINGS_READ: `plugin::${string}.settings.read`;
|
|
11
|
+
readonly SETTINGS_UPDATE: `plugin::${string}.settings.update`;
|
|
12
|
+
};
|
|
13
|
+
export type PermissionUid = (typeof PERMISSION_UIDS)[keyof typeof PERMISSION_UIDS];
|
|
14
|
+
type ActionRecord = {
|
|
15
|
+
section: 'plugins';
|
|
16
|
+
subCategory: string;
|
|
17
|
+
pluginName: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
uid: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Actions registered with `strapi.service('admin::permission').actionProvider.registerMany`
|
|
23
|
+
* during bootstrap. `pluginName` is prepended as `plugin::<pluginName>.` so the resulting
|
|
24
|
+
* UIDs become the ones in `PERMISSION_UIDS` above.
|
|
25
|
+
*
|
|
26
|
+
* All four actions live under `section: 'plugins'` so they appear together in the
|
|
27
|
+
* role editor's Plugins tab under "Localazy", grouped by `subCategory`. A previous
|
|
28
|
+
* split (settings-section for the two settings.* actions) caused them to land in a
|
|
29
|
+
* different tab — admins inspecting Plugins → Localazy only saw Read + Transfer and
|
|
30
|
+
* thought the other two were missing.
|
|
31
|
+
*
|
|
32
|
+
* Strapi's @strapi/admin yup validator (a) rejects `category` on `plugins`-section
|
|
33
|
+
* entries — `category` is only valid in `settings` section — and (b) allows
|
|
34
|
+
* `subCategory` on both `plugins` and `settings`. So we use `subCategory` alone for
|
|
35
|
+
* grouping here.
|
|
36
|
+
*/
|
|
37
|
+
export declare const LOCALAZY_RBAC_ACTIONS: ActionRecord[];
|
|
38
|
+
export {};
|
|
@@ -35,6 +35,7 @@ declare const _default: {
|
|
|
35
35
|
updateContentTransferSetup(ctx: any): Promise<void>;
|
|
36
36
|
getPluginSettings(ctx: any): Promise<void>;
|
|
37
37
|
updatePluginSettings(ctx: any): Promise<void>;
|
|
38
|
+
updatePluginSettingsUiPrefs(ctx: any): Promise<void>;
|
|
38
39
|
getSyncCursor(ctx: any): Promise<void>;
|
|
39
40
|
};
|
|
40
41
|
LocalazyTransferController: ({ strapi }: {
|
|
@@ -6,6 +6,7 @@ declare const PluginSettingsController: ({ strapi: _strapi }: {
|
|
|
6
6
|
updateContentTransferSetup(ctx: any): Promise<void>;
|
|
7
7
|
getPluginSettings(ctx: any): Promise<void>;
|
|
8
8
|
updatePluginSettings(ctx: any): Promise<void>;
|
|
9
|
+
updatePluginSettingsUiPrefs(ctx: any): Promise<void>;
|
|
9
10
|
getSyncCursor(ctx: any): Promise<void>;
|
|
10
11
|
};
|
|
11
12
|
export default PluginSettingsController;
|
|
@@ -18,9 +18,10 @@ export declare const getLocalazyTransferUploadService: () => {
|
|
|
18
18
|
}): Promise<void>;
|
|
19
19
|
};
|
|
20
20
|
export declare const getLocalazyTransferDownloadService: () => {
|
|
21
|
-
download({ notificationService, fullSync, }: {
|
|
21
|
+
download({ notificationService, fullSync, requestedUiLanguages, }: {
|
|
22
22
|
notificationService: import("../services/helpers/job-notification-service").default;
|
|
23
23
|
fullSync?: boolean;
|
|
24
|
+
requestedUiLanguages?: string[];
|
|
24
25
|
}): Promise<void>;
|
|
25
26
|
};
|
|
26
27
|
export declare const getPluginSettingsService: () => {
|
|
@@ -31,6 +32,7 @@ export declare const getPluginSettingsService: () => {
|
|
|
31
32
|
}>;
|
|
32
33
|
getPluginSettings(): Promise<import("../db/model/plugin-settings").PluginSettings>;
|
|
33
34
|
updatePluginSettings(settings: any): Promise<any>;
|
|
35
|
+
updatePluginSettingsUiPrefs(prefs: Partial<Pick<import("../db/model/plugin-settings").PluginSettings, "defaultRoute" | "activityLogsSort">>): Promise<import("../db/model/plugin-settings").PluginSettings>;
|
|
34
36
|
getSyncCursor(): Promise<import("../db/model/sync-cursor").SyncCursor>;
|
|
35
37
|
updateSyncCursor(cursor: import("../db/model/sync-cursor").SyncCursor): Promise<import("../db/model/sync-cursor").SyncCursor>;
|
|
36
38
|
};
|
|
@@ -4,7 +4,7 @@ declare const _default: {
|
|
|
4
4
|
}) => void;
|
|
5
5
|
bootstrap: ({ strapi }: {
|
|
6
6
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
7
|
-
}) => void
|
|
7
|
+
}) => Promise<void>;
|
|
8
8
|
destroy: ({ strapi: _strapi }: {
|
|
9
9
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
10
10
|
}) => void;
|
|
@@ -62,6 +62,7 @@ declare const _default: {
|
|
|
62
62
|
updateContentTransferSetup(ctx: any): Promise<void>;
|
|
63
63
|
getPluginSettings(ctx: any): Promise<void>;
|
|
64
64
|
updatePluginSettings(ctx: any): Promise<void>;
|
|
65
|
+
updatePluginSettingsUiPrefs(ctx: any): Promise<void>;
|
|
65
66
|
getSyncCursor(ctx: any): Promise<void>;
|
|
66
67
|
};
|
|
67
68
|
LocalazyTransferController: ({ strapi }: {
|
|
@@ -93,25 +94,71 @@ declare const _default: {
|
|
|
93
94
|
};
|
|
94
95
|
routes: {
|
|
95
96
|
'content-api': {
|
|
96
|
-
routes: {
|
|
97
|
+
routes: ({
|
|
97
98
|
method: string;
|
|
98
99
|
path: string;
|
|
99
100
|
handler: string;
|
|
100
101
|
config: {
|
|
101
|
-
policies:
|
|
102
|
+
policies: {
|
|
103
|
+
name: string;
|
|
104
|
+
config: {
|
|
105
|
+
actions: `plugin::${string}.read`[];
|
|
106
|
+
};
|
|
107
|
+
}[];
|
|
102
108
|
};
|
|
103
|
-
}
|
|
109
|
+
} | {
|
|
110
|
+
method: string;
|
|
111
|
+
path: string;
|
|
112
|
+
handler: string;
|
|
113
|
+
config: {
|
|
114
|
+
policies: {
|
|
115
|
+
name: string;
|
|
116
|
+
config: {
|
|
117
|
+
actions: `plugin::${string}.settings.update`[];
|
|
118
|
+
};
|
|
119
|
+
}[];
|
|
120
|
+
};
|
|
121
|
+
})[];
|
|
104
122
|
};
|
|
105
123
|
admin: {
|
|
106
124
|
type: string;
|
|
107
|
-
routes: {
|
|
125
|
+
routes: ({
|
|
108
126
|
method: string;
|
|
109
127
|
path: string;
|
|
110
128
|
handler: string;
|
|
111
129
|
config: {
|
|
112
|
-
policies:
|
|
130
|
+
policies: {
|
|
131
|
+
name: string;
|
|
132
|
+
config: {
|
|
133
|
+
actions: `plugin::${string}.read`[];
|
|
134
|
+
};
|
|
135
|
+
}[];
|
|
113
136
|
};
|
|
114
|
-
}
|
|
137
|
+
} | {
|
|
138
|
+
method: string;
|
|
139
|
+
path: string;
|
|
140
|
+
handler: string;
|
|
141
|
+
config: {
|
|
142
|
+
policies: {
|
|
143
|
+
name: string;
|
|
144
|
+
config: {
|
|
145
|
+
actions: `plugin::${string}.settings.update`[];
|
|
146
|
+
};
|
|
147
|
+
}[];
|
|
148
|
+
};
|
|
149
|
+
} | {
|
|
150
|
+
method: string;
|
|
151
|
+
path: string;
|
|
152
|
+
handler: string;
|
|
153
|
+
config: {
|
|
154
|
+
policies: {
|
|
155
|
+
name: string;
|
|
156
|
+
config: {
|
|
157
|
+
actions: `plugin::${string}.transfer`[];
|
|
158
|
+
};
|
|
159
|
+
}[];
|
|
160
|
+
};
|
|
161
|
+
})[];
|
|
115
162
|
};
|
|
116
163
|
LocalazyPublicTransferRoutes: {
|
|
117
164
|
routes: {
|
|
@@ -163,6 +210,7 @@ declare const _default: {
|
|
|
163
210
|
}>;
|
|
164
211
|
getPluginSettings(): Promise<import("./db/model/plugin-settings").PluginSettings>;
|
|
165
212
|
updatePluginSettings(settings: any): Promise<any>;
|
|
213
|
+
updatePluginSettingsUiPrefs(prefs: Partial<Pick<import("./db/model/plugin-settings").PluginSettings, "defaultRoute" | "activityLogsSort">>): Promise<import("./db/model/plugin-settings").PluginSettings>;
|
|
166
214
|
getSyncCursor(): Promise<import("./db/model/sync-cursor").SyncCursor>;
|
|
167
215
|
updateSyncCursor(cursor: import("./db/model/sync-cursor").SyncCursor): Promise<import("./db/model/sync-cursor").SyncCursor>;
|
|
168
216
|
};
|
|
@@ -176,9 +224,10 @@ declare const _default: {
|
|
|
176
224
|
LocalazyTransferDownloadService: ({ strapi }: {
|
|
177
225
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
178
226
|
}) => {
|
|
179
|
-
download({ notificationService, fullSync, }: {
|
|
227
|
+
download({ notificationService, fullSync, requestedUiLanguages, }: {
|
|
180
228
|
notificationService: import("./services/helpers/job-notification-service").default;
|
|
181
229
|
fullSync?: boolean;
|
|
230
|
+
requestedUiLanguages?: string[];
|
|
182
231
|
}): Promise<void>;
|
|
183
232
|
};
|
|
184
233
|
StrapiI18nService: ({ strapi }: {
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
declare const ActivityLogsRoutes: {
|
|
1
|
+
declare const ActivityLogsRoutes: ({
|
|
2
2
|
method: string;
|
|
3
3
|
path: string;
|
|
4
4
|
handler: string;
|
|
5
5
|
config: {
|
|
6
|
-
policies:
|
|
6
|
+
policies: {
|
|
7
|
+
name: string;
|
|
8
|
+
config: {
|
|
9
|
+
actions: `plugin::${string}.read`[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
7
12
|
};
|
|
8
|
-
}
|
|
13
|
+
} | {
|
|
14
|
+
method: string;
|
|
15
|
+
path: string;
|
|
16
|
+
handler: string;
|
|
17
|
+
config: {
|
|
18
|
+
policies: {
|
|
19
|
+
name: string;
|
|
20
|
+
config: {
|
|
21
|
+
actions: `plugin::${string}.transfer`[];
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
9
26
|
export default ActivityLogsRoutes;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
declare const EntryExclusionRoutes: {
|
|
1
|
+
declare const EntryExclusionRoutes: ({
|
|
2
2
|
method: string;
|
|
3
3
|
path: string;
|
|
4
4
|
handler: string;
|
|
5
5
|
config: {
|
|
6
|
-
policies:
|
|
6
|
+
policies: {
|
|
7
|
+
name: string;
|
|
8
|
+
config: {
|
|
9
|
+
actions: `plugin::${string}.read`[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
7
12
|
};
|
|
8
|
-
}
|
|
13
|
+
} | {
|
|
14
|
+
method: string;
|
|
15
|
+
path: string;
|
|
16
|
+
handler: string;
|
|
17
|
+
config: {
|
|
18
|
+
policies: {
|
|
19
|
+
name: string;
|
|
20
|
+
config: {
|
|
21
|
+
actions: `plugin::${string}.transfer`[];
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
9
26
|
export default EntryExclusionRoutes;
|
|
@@ -1,24 +1,70 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
'content-api': {
|
|
3
|
-
routes: {
|
|
3
|
+
routes: ({
|
|
4
4
|
method: string;
|
|
5
5
|
path: string;
|
|
6
6
|
handler: string;
|
|
7
7
|
config: {
|
|
8
|
-
policies:
|
|
8
|
+
policies: {
|
|
9
|
+
name: string;
|
|
10
|
+
config: {
|
|
11
|
+
actions: `plugin::${string}.read`[];
|
|
12
|
+
};
|
|
13
|
+
}[];
|
|
9
14
|
};
|
|
10
|
-
}
|
|
15
|
+
} | {
|
|
16
|
+
method: string;
|
|
17
|
+
path: string;
|
|
18
|
+
handler: string;
|
|
19
|
+
config: {
|
|
20
|
+
policies: {
|
|
21
|
+
name: string;
|
|
22
|
+
config: {
|
|
23
|
+
actions: `plugin::${string}.settings.update`[];
|
|
24
|
+
};
|
|
25
|
+
}[];
|
|
26
|
+
};
|
|
27
|
+
})[];
|
|
11
28
|
};
|
|
12
29
|
admin: {
|
|
13
30
|
type: string;
|
|
14
|
-
routes: {
|
|
31
|
+
routes: ({
|
|
15
32
|
method: string;
|
|
16
33
|
path: string;
|
|
17
34
|
handler: string;
|
|
18
35
|
config: {
|
|
19
|
-
policies:
|
|
36
|
+
policies: {
|
|
37
|
+
name: string;
|
|
38
|
+
config: {
|
|
39
|
+
actions: `plugin::${string}.read`[];
|
|
40
|
+
};
|
|
41
|
+
}[];
|
|
20
42
|
};
|
|
21
|
-
}
|
|
43
|
+
} | {
|
|
44
|
+
method: string;
|
|
45
|
+
path: string;
|
|
46
|
+
handler: string;
|
|
47
|
+
config: {
|
|
48
|
+
policies: {
|
|
49
|
+
name: string;
|
|
50
|
+
config: {
|
|
51
|
+
actions: `plugin::${string}.settings.update`[];
|
|
52
|
+
};
|
|
53
|
+
}[];
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
method: string;
|
|
57
|
+
path: string;
|
|
58
|
+
handler: string;
|
|
59
|
+
config: {
|
|
60
|
+
policies: {
|
|
61
|
+
name: string;
|
|
62
|
+
config: {
|
|
63
|
+
actions: `plugin::${string}.transfer`[];
|
|
64
|
+
};
|
|
65
|
+
}[];
|
|
66
|
+
};
|
|
67
|
+
})[];
|
|
22
68
|
};
|
|
23
69
|
LocalazyPublicTransferRoutes: {
|
|
24
70
|
routes: {
|
|
@@ -3,7 +3,12 @@ declare const LocalazyAuthRoutes: {
|
|
|
3
3
|
path: string;
|
|
4
4
|
handler: string;
|
|
5
5
|
config: {
|
|
6
|
-
policies:
|
|
6
|
+
policies: {
|
|
7
|
+
name: string;
|
|
8
|
+
config: {
|
|
9
|
+
actions: `plugin::${string}.settings.update`[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
7
12
|
};
|
|
8
13
|
}[];
|
|
9
14
|
export default LocalazyAuthRoutes;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
declare const LocalazyProjectRoutes: {
|
|
1
|
+
declare const LocalazyProjectRoutes: ({
|
|
2
2
|
method: string;
|
|
3
3
|
path: string;
|
|
4
4
|
handler: string;
|
|
5
5
|
config: {
|
|
6
|
-
policies:
|
|
6
|
+
policies: {
|
|
7
|
+
name: string;
|
|
8
|
+
config: {
|
|
9
|
+
actions: `plugin::${string}.read`[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
7
12
|
};
|
|
8
|
-
}
|
|
13
|
+
} | {
|
|
14
|
+
method: string;
|
|
15
|
+
path: string;
|
|
16
|
+
handler: string;
|
|
17
|
+
config: {
|
|
18
|
+
policies: {
|
|
19
|
+
name: string;
|
|
20
|
+
config: {
|
|
21
|
+
actions: `plugin::${string}.settings.update`[];
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
9
26
|
export default LocalazyProjectRoutes;
|
|
@@ -3,7 +3,12 @@ declare const LocalazyTransferRoutes: {
|
|
|
3
3
|
path: string;
|
|
4
4
|
handler: string;
|
|
5
5
|
config: {
|
|
6
|
-
policies:
|
|
6
|
+
policies: {
|
|
7
|
+
name: string;
|
|
8
|
+
config: {
|
|
9
|
+
actions: `plugin::${string}.transfer`[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
7
12
|
};
|
|
8
13
|
}[];
|
|
9
14
|
export default LocalazyTransferRoutes;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
declare const LocalazyUserRoutes: {
|
|
1
|
+
declare const LocalazyUserRoutes: ({
|
|
2
2
|
method: string;
|
|
3
3
|
path: string;
|
|
4
4
|
handler: string;
|
|
5
5
|
config: {
|
|
6
|
-
policies:
|
|
6
|
+
policies: {
|
|
7
|
+
name: string;
|
|
8
|
+
config: {
|
|
9
|
+
actions: `plugin::${string}.read`[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
7
12
|
};
|
|
8
|
-
}
|
|
13
|
+
} | {
|
|
14
|
+
method: string;
|
|
15
|
+
path: string;
|
|
16
|
+
handler: string;
|
|
17
|
+
config: {
|
|
18
|
+
policies: {
|
|
19
|
+
name: string;
|
|
20
|
+
config: {
|
|
21
|
+
actions: `plugin::${string}.settings.update`[];
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
9
26
|
export default LocalazyUserRoutes;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
declare const PluginSettingsRoutes: {
|
|
1
|
+
declare const PluginSettingsRoutes: ({
|
|
2
2
|
method: string;
|
|
3
3
|
path: string;
|
|
4
4
|
handler: string;
|
|
5
5
|
config: {
|
|
6
|
-
policies:
|
|
6
|
+
policies: {
|
|
7
|
+
name: string;
|
|
8
|
+
config: {
|
|
9
|
+
actions: `plugin::${string}.read`[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
7
12
|
};
|
|
8
|
-
}
|
|
13
|
+
} | {
|
|
14
|
+
method: string;
|
|
15
|
+
path: string;
|
|
16
|
+
handler: string;
|
|
17
|
+
config: {
|
|
18
|
+
policies: {
|
|
19
|
+
name: string;
|
|
20
|
+
config: {
|
|
21
|
+
actions: `plugin::${string}.settings.update`[];
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
9
26
|
export default PluginSettingsRoutes;
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
declare const StrapiRoutes: {
|
|
1
|
+
declare const StrapiRoutes: ({
|
|
2
2
|
method: string;
|
|
3
3
|
path: string;
|
|
4
4
|
handler: string;
|
|
5
5
|
config: {
|
|
6
|
-
policies:
|
|
6
|
+
policies: {
|
|
7
|
+
name: string;
|
|
8
|
+
config: {
|
|
9
|
+
actions: `plugin::${string}.read`[];
|
|
10
|
+
};
|
|
11
|
+
}[];
|
|
7
12
|
};
|
|
8
|
-
}
|
|
13
|
+
} | {
|
|
14
|
+
method: string;
|
|
15
|
+
path: string;
|
|
16
|
+
handler: string;
|
|
17
|
+
config: {
|
|
18
|
+
policies: {
|
|
19
|
+
name: string;
|
|
20
|
+
config: {
|
|
21
|
+
actions: `plugin::${string}.settings.update`[];
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
9
26
|
export default StrapiRoutes;
|
|
@@ -35,6 +35,7 @@ declare const _default: {
|
|
|
35
35
|
}>;
|
|
36
36
|
getPluginSettings(): Promise<import("../db/model/plugin-settings").PluginSettings>;
|
|
37
37
|
updatePluginSettings(settings: any): Promise<any>;
|
|
38
|
+
updatePluginSettingsUiPrefs(prefs: Partial<Pick<import("../db/model/plugin-settings").PluginSettings, "defaultRoute" | "activityLogsSort">>): Promise<import("../db/model/plugin-settings").PluginSettings>;
|
|
38
39
|
getSyncCursor(): Promise<import("../db/model/sync-cursor").SyncCursor>;
|
|
39
40
|
updateSyncCursor(cursor: import("../db/model/sync-cursor").SyncCursor): Promise<import("../db/model/sync-cursor").SyncCursor>;
|
|
40
41
|
};
|
|
@@ -48,9 +49,10 @@ declare const _default: {
|
|
|
48
49
|
LocalazyTransferDownloadService: ({ strapi }: {
|
|
49
50
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
50
51
|
}) => {
|
|
51
|
-
download({ notificationService, fullSync, }: {
|
|
52
|
+
download({ notificationService, fullSync, requestedUiLanguages, }: {
|
|
52
53
|
notificationService: import("./helpers/job-notification-service").default;
|
|
53
54
|
fullSync?: boolean;
|
|
55
|
+
requestedUiLanguages?: string[];
|
|
54
56
|
}): Promise<void>;
|
|
55
57
|
};
|
|
56
58
|
StrapiI18nService: ({ strapi }: {
|
|
@@ -3,9 +3,10 @@ import { JobNotificationServiceType } from './helpers/job-notification-service';
|
|
|
3
3
|
declare const LocalazyTransferDownloadService: ({ strapi }: {
|
|
4
4
|
strapi: Core.Strapi;
|
|
5
5
|
}) => {
|
|
6
|
-
download({ notificationService, fullSync, }: {
|
|
6
|
+
download({ notificationService, fullSync, requestedUiLanguages, }: {
|
|
7
7
|
notificationService: JobNotificationServiceType;
|
|
8
8
|
fullSync?: boolean;
|
|
9
|
+
requestedUiLanguages?: string[];
|
|
9
10
|
}): Promise<void>;
|
|
10
11
|
};
|
|
11
12
|
export type LocalazyTransferDownloadServiceReturnType = ReturnType<typeof LocalazyTransferDownloadService>;
|
|
@@ -2,6 +2,9 @@ import { Core } from '@strapi/strapi';
|
|
|
2
2
|
import { PluginSettings } from '../db/model/plugin-settings';
|
|
3
3
|
import { SyncCursor } from '../db/model/sync-cursor';
|
|
4
4
|
import { ContentTransferSetup } from '../models/plugin/content-transfer-setup';
|
|
5
|
+
declare const UI_PREF_FIELDS: readonly ["defaultRoute", "activityLogsSort"];
|
|
6
|
+
type UiPrefField = (typeof UI_PREF_FIELDS)[number];
|
|
7
|
+
export type PluginSettingsUiPrefs = Partial<Pick<PluginSettings, UiPrefField>>;
|
|
5
8
|
declare const PluginSettingsService: ({ strapi }: {
|
|
6
9
|
strapi: Core.Strapi;
|
|
7
10
|
}) => {
|
|
@@ -12,6 +15,7 @@ declare const PluginSettingsService: ({ strapi }: {
|
|
|
12
15
|
}>;
|
|
13
16
|
getPluginSettings(): Promise<PluginSettings>;
|
|
14
17
|
updatePluginSettings(settings: any): Promise<any>;
|
|
18
|
+
updatePluginSettingsUiPrefs(prefs: PluginSettingsUiPrefs): Promise<PluginSettings>;
|
|
15
19
|
getSyncCursor(): Promise<SyncCursor>;
|
|
16
20
|
updateSyncCursor(cursor: SyncCursor): Promise<SyncCursor>;
|
|
17
21
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const BLOCKS_ATTRIBUTE_TYPE = "blocks";
|
|
2
|
+
type GetModel = (uid: string) => {
|
|
3
|
+
attributes?: Record<string, any>;
|
|
4
|
+
} | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Upload side. A Blocks value is a rich-text AST: text lives in `text` leaves, everything else
|
|
7
|
+
* (block types, headings, lists, links, marks, images, quotes, code blocks) is structure. We
|
|
8
|
+
* project each blocks field down to a skeleton that keeps only the translatable text leaves in
|
|
9
|
+
* their original positions, so the transfer pipeline emits ONE segment per text node with the
|
|
10
|
+
* formatting carried as structure — never as literal markup inside the string. The dropped
|
|
11
|
+
* structure is restored from the source AST on download (see `overlayBlocksTranslation`). Blocks
|
|
12
|
+
* nested inside components / dynamic zones are reached by walking the schema. The source entry is
|
|
13
|
+
* not mutated.
|
|
14
|
+
*/
|
|
15
|
+
export declare const projectBlocksFields: (entry: any, model: any, getModel: GetModel) => any;
|
|
16
|
+
/**
|
|
17
|
+
* Reduce a blocks AST to a text-only skeleton: every node keeps only its `text` leaf and/or its
|
|
18
|
+
* (recursively projected) `children`. Structural nodes without text (e.g. images, dividers) become
|
|
19
|
+
* empty and contribute no segment. Positions are preserved so download can overlay by path.
|
|
20
|
+
*/
|
|
21
|
+
export declare const projectBlocksValue: (nodes: any) => any;
|
|
22
|
+
/**
|
|
23
|
+
* Download side. Rebuild a full blocks AST for the target locale by cloning the source-locale AST
|
|
24
|
+
* and overlaying the translated text onto each text leaf at the matching position. All structure
|
|
25
|
+
* and formatting come from the source, so the result is always a document Strapi accepts, a
|
|
26
|
+
* translation identical to the source round-trips byte-identically, and text nodes left
|
|
27
|
+
* untranslated fall back to the source text. `translated` is the per-node text skeleton
|
|
28
|
+
* reconstructed from the downloaded keys (an array, or an object keyed by numeric position).
|
|
29
|
+
*
|
|
30
|
+
* Returns `undefined` when there is no source AST to overlay onto (nothing safe to write), so the
|
|
31
|
+
* caller can skip the field instead of corrupting it.
|
|
32
|
+
*/
|
|
33
|
+
export declare const overlayBlocksTranslation: (sourceAst: any, translated: any) => any[] | undefined;
|
|
34
|
+
export {};
|
|
@@ -3,5 +3,6 @@ declare const isComponent: (attributeObj: any) => boolean;
|
|
|
3
3
|
declare const isDynamicZone: (attributeObj: any) => boolean;
|
|
4
4
|
declare const isRepeatable: (attributeObj: any) => boolean;
|
|
5
5
|
declare const isRelation: (attributeObj: any) => boolean;
|
|
6
|
+
declare const isBlocks: (attributeObj: any) => boolean;
|
|
6
7
|
declare const findModel: (models: any, uid: any) => any;
|
|
7
|
-
export { getAttribute, isComponent, isDynamicZone, isRepeatable, isRelation, findModel };
|
|
8
|
+
export { getAttribute, isComponent, isDynamicZone, isRepeatable, isRelation, isBlocks, findModel };
|