need4deed-sdk 0.0.191 → 0.0.193
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
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
# sdk
|
|
2
2
|
|
|
3
3
|
Shared types for need4deed.org
|
|
4
|
+
|
|
5
|
+
## Translation field names
|
|
6
|
+
|
|
7
|
+
`TranslationFieldsByEntity` exports the registered translation fields for each entity. Backend registry validation can use this map to keep accepted fields aligned with the SDK.
|
|
8
|
+
|
|
9
|
+
Opportunity translation endpoints use `info` for the field exposed as `description` by `ApiOpportunityGet` and `ApiOpportunityPatch`. Translation requests must use `info`; ordinary opportunity requests use `description`.
|
|
@@ -215,7 +215,9 @@ export type ApiOpportunityPatch = VoidableProps<{
|
|
|
215
215
|
name?: string;
|
|
216
216
|
};
|
|
217
217
|
accompanyingDetails: ApiOpportunityAccompanyingDetails;
|
|
218
|
-
}
|
|
218
|
+
}> & {
|
|
219
|
+
originalLanguage?: Lang;
|
|
220
|
+
};
|
|
219
221
|
export interface OpportunityVolunteer {
|
|
220
222
|
id: number;
|
|
221
223
|
status: OpportunityVolunteerStatusType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Lang } from "..";
|
|
1
|
+
import { EntityTableName, Lang } from "..";
|
|
2
2
|
export declare enum TranslationOrigin {
|
|
3
3
|
REFERENCE = "reference",
|
|
4
4
|
MACHINE = "machine",
|
|
@@ -17,12 +17,37 @@ export interface ApiFieldTranslation {
|
|
|
17
17
|
status: TranslationStatus;
|
|
18
18
|
lastErrorCode?: TranslationErrorCode;
|
|
19
19
|
}
|
|
20
|
-
export interface
|
|
21
|
-
|
|
20
|
+
export interface ApiOriginalLanguagePut {
|
|
21
|
+
language: Lang;
|
|
22
|
+
}
|
|
23
|
+
export type TranslationFieldsByEntity = {
|
|
24
|
+
[EntityTableName.OPPORTUNITY]: "title" | "info";
|
|
25
|
+
[EntityTableName.LANGUAGE]: "title";
|
|
26
|
+
[EntityTableName.CATEGORY]: "title" | "description";
|
|
27
|
+
[EntityTableName.ACTIVITY]: "title";
|
|
28
|
+
[EntityTableName.SKILL]: "title";
|
|
29
|
+
[EntityTableName.AGENT_TYPE]: "title";
|
|
30
|
+
[EntityTableName.SERVICE]: "title";
|
|
31
|
+
[EntityTableName.LEAD]: "title";
|
|
32
|
+
};
|
|
33
|
+
export type TranslatedEntityType = keyof TranslationFieldsByEntity;
|
|
34
|
+
export interface ApiFieldTranslationGet<Entity extends TranslatedEntityType = TranslatedEntityType> {
|
|
35
|
+
fieldName: TranslationFieldsByEntity[Entity];
|
|
22
36
|
original: string;
|
|
23
37
|
originalLanguage?: Lang;
|
|
24
38
|
translations: Partial<Record<Lang, ApiFieldTranslation>>;
|
|
25
39
|
}
|
|
26
|
-
export
|
|
27
|
-
|
|
40
|
+
export type ApiFieldTranslationPost = {
|
|
41
|
+
[Entity in TranslatedEntityType]: {
|
|
42
|
+
entityType: Entity;
|
|
43
|
+
entityId: number;
|
|
44
|
+
fieldName: TranslationFieldsByEntity[Entity];
|
|
45
|
+
language: Lang;
|
|
46
|
+
text: string;
|
|
47
|
+
original: string;
|
|
48
|
+
};
|
|
49
|
+
}[TranslatedEntityType];
|
|
50
|
+
export interface ApiFieldTranslationPatch {
|
|
51
|
+
text: string;
|
|
52
|
+
original: string;
|
|
28
53
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TranslationStatus = exports.TranslationOrigin = void 0;
|
|
4
|
+
const __1 = require("..");
|
|
4
5
|
var TranslationOrigin;
|
|
5
6
|
(function (TranslationOrigin) {
|
|
6
7
|
TranslationOrigin["REFERENCE"] = "reference";
|
package/dist/types/core.d.ts
CHANGED
|
@@ -69,7 +69,9 @@ export declare enum EntityTableName {
|
|
|
69
69
|
export declare enum QueryParamsKeys {
|
|
70
70
|
ACCOMPANYING = "accompanying",
|
|
71
71
|
AVAILABILITY = "availability",
|
|
72
|
+
COMMUTE_OPPORTUNITY_ID = "commute-opportunity-id",
|
|
72
73
|
COMMUTE_POSTCODE = "commute-postcode",
|
|
74
|
+
COMMUTE_VOLUNTEER_ID = "commute-volunteer-id",
|
|
73
75
|
DISTRICT = "district",
|
|
74
76
|
ENGAGEMENT = "engagement",
|
|
75
77
|
GERMAN = "german",
|
package/dist/types/core.js
CHANGED
|
@@ -80,7 +80,9 @@ var QueryParamsKeys;
|
|
|
80
80
|
(function (QueryParamsKeys) {
|
|
81
81
|
QueryParamsKeys["ACCOMPANYING"] = "accompanying";
|
|
82
82
|
QueryParamsKeys["AVAILABILITY"] = "availability";
|
|
83
|
+
QueryParamsKeys["COMMUTE_OPPORTUNITY_ID"] = "commute-opportunity-id";
|
|
83
84
|
QueryParamsKeys["COMMUTE_POSTCODE"] = "commute-postcode";
|
|
85
|
+
QueryParamsKeys["COMMUTE_VOLUNTEER_ID"] = "commute-volunteer-id";
|
|
84
86
|
QueryParamsKeys["DISTRICT"] = "district";
|
|
85
87
|
QueryParamsKeys["ENGAGEMENT"] = "engagement";
|
|
86
88
|
QueryParamsKeys["GERMAN"] = "german";
|