need4deed-sdk 0.0.14 → 0.0.16

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.
@@ -2,5 +2,6 @@ export declare enum Endpoint {
2
2
  OPPORTUNITY = "/opportunity",
3
3
  EVENT = "/event",
4
4
  TESTIMONIAL = "/testimonial",
5
- VOLUNTEER = "/volunteer"
5
+ VOLUNTEER = "/volunteer",
6
+ OPTION = "/option"
6
7
  }
@@ -7,4 +7,5 @@ var Endpoint;
7
7
  Endpoint["EVENT"] = "/event";
8
8
  Endpoint["TESTIMONIAL"] = "/testimonial";
9
9
  Endpoint["VOLUNTEER"] = "/volunteer";
10
+ Endpoint["OPTION"] = "/option";
10
11
  })(Endpoint || (exports.Endpoint = Endpoint = {}));
@@ -4,6 +4,7 @@ export * from "./language";
4
4
  export * from "./location";
5
5
  export * from "./new_api";
6
6
  export * from "./opportunity";
7
+ export * from "./option";
7
8
  export * from "./testimonial";
8
9
  export * from "./time";
9
10
  export * from "./volunteer";
@@ -20,6 +20,7 @@ __exportStar(require("./language"), exports);
20
20
  __exportStar(require("./location"), exports);
21
21
  __exportStar(require("./new_api"), exports);
22
22
  __exportStar(require("./opportunity"), exports);
23
+ __exportStar(require("./option"), exports);
23
24
  __exportStar(require("./testimonial"), exports);
24
25
  __exportStar(require("./time"), exports);
25
26
  __exportStar(require("./volunteer"), exports);
@@ -1,5 +1,7 @@
1
- import { LangProficiency } from "../core";
1
+ import { LangProficiency, LangPurpose } from "../core";
2
2
  export interface ApiLanguage {
3
+ id: number;
3
4
  title: string;
4
- proficiency: LangProficiency;
5
+ proficiency?: LangProficiency;
6
+ purpose?: LangPurpose;
5
7
  }
@@ -1,11 +1,11 @@
1
1
  export interface Address {
2
- id: string;
2
+ id: number;
3
3
  street: string;
4
4
  city: string;
5
5
  postcode: Postcode;
6
6
  }
7
7
  export interface Postcode {
8
- id: string;
8
+ id: number;
9
9
  code: string;
10
10
  latitude: number;
11
11
  longitude: number;
@@ -1,4 +1,5 @@
1
1
  import { OptionId } from "./common";
2
+ import { ApiLanguage } from "./language";
2
3
  export declare enum OpportunityType {
3
4
  GENERAL = "volunteering",
4
5
  ACCOMPANYING = "accompanying"
@@ -34,3 +35,13 @@ export interface Opportunity {
34
35
  category_id: OptionId;
35
36
  last_edited_time_notion?: string;
36
37
  }
38
+ export interface ApiOpportunityGetList {
39
+ title: string;
40
+ type: OpportunityType;
41
+ languages: ApiLanguage[];
42
+ activities: string[];
43
+ skills: string[];
44
+ location: string[];
45
+ }
46
+ export interface AliOpportunityGet extends ApiOpportunityGetList {
47
+ }
@@ -0,0 +1,6 @@
1
+ import { EntityTableName } from "../core";
2
+ export interface OptionItem {
3
+ title: string;
4
+ id: number;
5
+ }
6
+ export type ApiOptionLists = Partial<Record<EntityTableName, OptionItem[]>>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ ;
@@ -0,0 +1,11 @@
1
+ import { Address } from "./location";
2
+ export interface ApiPersonGet {
3
+ id: number;
4
+ avatarUrl: string;
5
+ firstName: string;
6
+ lastName: string;
7
+ middleName: string;
8
+ phone: string;
9
+ email: string;
10
+ address: Address;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,8 +14,13 @@ export declare enum ByDay {
14
14
  SA = "Saturday",
15
15
  SU = "Sunday"
16
16
  }
17
- export type Occasionally = "occasionally";
18
- export type OccasionalDays = "weekends" | "weekdays";
17
+ export declare enum Occasionally {
18
+ OCCASIONALLY = "occasionally"
19
+ }
20
+ export declare enum OccasionalType {
21
+ WEEKENDS = "weekends",
22
+ WEEKDAYS = "weekdays"
23
+ }
19
24
  export declare enum Hour {
20
25
  H00 = "0:00",
21
26
  H01 = "1:00",
@@ -43,18 +48,14 @@ export declare enum Hour {
43
48
  H23 = "23:00",
44
49
  H24 = "24:00"
45
50
  }
46
- export type Daytime = [Hour, Hour] | OccasionalDays;
47
- export interface Availability {
51
+ export type Daytime = [Hour, Hour] | [OccasionalType];
52
+ export interface Availability extends Time {
53
+ timeslotId: number;
48
54
  day: ByDay | Occasionally;
49
55
  daytime: Daytime;
50
56
  }
51
- export declare enum OccasionalType {
52
- UNDEFINED = "undefined",
53
- WEEKENDS = "weekends",
54
- WEEKDAYS = "weekdays",
55
- OCCASIONALLY = "occasionally"
56
- }
57
57
  export interface TimedText {
58
- date: Date;
59
- text: string;
58
+ id: number;
59
+ timestamp: Date;
60
+ content: string;
60
61
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OccasionalType = exports.Hour = exports.ByDay = void 0;
3
+ exports.Hour = exports.OccasionalType = exports.Occasionally = exports.ByDay = void 0;
4
4
  var ByDay;
5
5
  (function (ByDay) {
6
6
  ByDay["MO"] = "Monday";
@@ -11,6 +11,15 @@ var ByDay;
11
11
  ByDay["SA"] = "Saturday";
12
12
  ByDay["SU"] = "Sunday";
13
13
  })(ByDay || (exports.ByDay = ByDay = {}));
14
+ var Occasionally;
15
+ (function (Occasionally) {
16
+ Occasionally["OCCASIONALLY"] = "occasionally";
17
+ })(Occasionally || (exports.Occasionally = Occasionally = {}));
18
+ var OccasionalType;
19
+ (function (OccasionalType) {
20
+ OccasionalType["WEEKENDS"] = "weekends";
21
+ OccasionalType["WEEKDAYS"] = "weekdays";
22
+ })(OccasionalType || (exports.OccasionalType = OccasionalType = {}));
14
23
  var Hour;
15
24
  (function (Hour) {
16
25
  Hour["H00"] = "0:00";
@@ -39,10 +48,3 @@ var Hour;
39
48
  Hour["H23"] = "23:00";
40
49
  Hour["H24"] = "24:00";
41
50
  })(Hour || (exports.Hour = Hour = {}));
42
- var OccasionalType;
43
- (function (OccasionalType) {
44
- OccasionalType["UNDEFINED"] = "undefined";
45
- OccasionalType["WEEKENDS"] = "weekends";
46
- OccasionalType["WEEKDAYS"] = "weekdays";
47
- OccasionalType["OCCASIONALLY"] = "occasionally";
48
- })(OccasionalType || (exports.OccasionalType = OccasionalType = {}));
@@ -1,7 +1,8 @@
1
- import { DocumentStatusType, Id } from "../core";
2
- import { Option, OptionId } from "./common";
1
+ import { DocumentStatusType, Id, VolunteerStateAppreciationType, VolunteerStateCGCType, VolunteerStateCommunicationType, VolunteerStateEngagementType, VolunteerStateMatchType, VolunteerStateType, VolunteerStateTypeType } from "../core";
2
+ import { OptionId } from "./common";
3
3
  import { ApiLanguage } from "./language";
4
- import { Address } from "./location";
4
+ import { OptionItem } from "./option";
5
+ import { ApiPersonGet } from "./person";
5
6
  import { Availability, TimedText } from "./time";
6
7
  export interface Volunteer {
7
8
  origin_opportunity: number | undefined;
@@ -22,7 +23,7 @@ export interface Volunteer {
22
23
  comments: string;
23
24
  }
24
25
  export interface VolunteerFormData {
25
- opportunityId?: Id | undefined;
26
+ opportunityId?: Id;
26
27
  fullName: string;
27
28
  phone: string;
28
29
  email: string;
@@ -38,25 +39,42 @@ export interface VolunteerFormData {
38
39
  comments: string;
39
40
  }
40
41
  export interface ApiVolunteerGetList {
42
+ id: number;
43
+ stateEngagement: VolunteerStateEngagementType;
44
+ stateType: VolunteerStateTypeType;
41
45
  name: string;
46
+ avatarUrl: string;
42
47
  languages: ApiLanguage[];
43
48
  availability: Availability[];
44
- activities: string[];
45
- skills: string[];
46
- locations: string[];
49
+ activities: OptionItem[];
50
+ skills: OptionItem[];
51
+ locations: OptionItem[];
47
52
  }
48
- export interface ApiVolunteerGet extends ApiVolunteerGetList {
49
- firstName: string;
50
- lastName: string;
51
- phone: string;
52
- email: string;
53
- address: Address;
53
+ export interface ApiVolunteerGet {
54
+ id: number;
55
+ person: ApiPersonGet;
56
+ status: VolunteerStateType;
57
+ statusEngagement: VolunteerStateEngagementType;
58
+ statusCommunication: VolunteerStateCommunicationType;
59
+ statusAppreciation: VolunteerStateAppreciationType;
60
+ statusType: VolunteerStateTypeType;
61
+ statusMatch: VolunteerStateMatchType;
62
+ statusCgcProcess: VolunteerStateCGCType;
63
+ createdAt: Date;
64
+ updatedAt: Date;
54
65
  goodConductCertificate: DocumentStatusType;
55
66
  measlesVaccination: DocumentStatusType;
56
67
  infoAbout: string;
57
68
  infoExperience: string;
58
69
  timelineLogs: TimedText[];
59
70
  comments: TimedText[];
60
- opportunitiesApplied: Option[];
61
- opportunitiesMatched: Option[];
71
+ opportunitiesApplied: OptionItem[];
72
+ opportunitiesMatched: OptionItem[];
73
+ languages: ApiLanguage[];
74
+ availability: Availability[];
75
+ activities: OptionItem[];
76
+ skills: OptionItem[];
77
+ locations: OptionItem[];
78
+ }
79
+ export interface VolunteerPatchBodyData extends Partial<ApiVolunteerGet> {
62
80
  }
@@ -9,6 +9,11 @@ export declare enum LangProficiency {
9
9
  FLUENT = "fluent",
10
10
  NATIVE = "native"
11
11
  }
12
+ export declare enum LangPurpose {
13
+ GENERAL = "general",
14
+ TRANSLATION = "translation",
15
+ RECIPIENT = "recipient"
16
+ }
12
17
  export declare enum HttpMethod {
13
18
  GET = "GET",
14
19
  HEAD = "HEAD",
@@ -28,5 +33,92 @@ export declare enum DocumentStatusType {
28
33
  APPLIED_SELF = "applied_self",
29
34
  APPLIED_N4D = "applied_n4d"
30
35
  }
36
+ export declare enum TimedTextType {
37
+ CREATE = "create",
38
+ UPDATE = "update",
39
+ REMOVE = "remove",
40
+ COMMENT = "comment",
41
+ STATUS = "status",
42
+ MATCHING = "matching"
43
+ }
31
44
  export type Id = string | number;
45
+ export declare enum VolunteerStateType {
46
+ NEW = "New",
47
+ OPPORTUNITY_SENT = "Opportunity sent",
48
+ MATCHED = "Matched",
49
+ ACTIVE_REGULAR = "Active regular",
50
+ ACTIVE_ACCOMPANY = "Active accompany",
51
+ ACTIVE_FEST = "Active fest",
52
+ TO_REMATCH = "To rematch",
53
+ TEMP_INACTIVE = "Temp inactive",
54
+ INACTIVE = "Inactive"
55
+ }
56
+ export declare enum VolunteerStateEngagementType {
57
+ NEW = "new",
58
+ ACTIVE = "active",
59
+ AVAILABLE = "available",
60
+ TEMP_UNAVAILABLE = "temp-unavailable",
61
+ INACTIVE = "inactive",
62
+ UNRESPONSIVE = "unresponsive"
63
+ }
64
+ export declare enum VolunteerStateCommunicationType {
65
+ CALLED = "called",
66
+ EMAIL_SENT = "email-sent",
67
+ BRIEFED = "briefed",
68
+ TRIED_CALL = "tried-call",
69
+ NOT_RESPONDING = "not-responding"
70
+ }
71
+ export declare enum VolunteerStateAppreciationType {
72
+ T_SHIRT = "t-shirt",
73
+ BENEFIT_CARD = "benefit-card",
74
+ TOTE_BAG = "tote-bag"
75
+ }
76
+ export declare enum VolunteerStateTypeType {
77
+ ACCOMPANYING = "accompanying",
78
+ REGULAR = "regular",
79
+ EVENT = "event",
80
+ FESTIVAL = "festival",
81
+ WEEKEND_ONLY = "weekend-only"
82
+ }
83
+ export declare enum VolunteerStateMatchType {
84
+ NO_MATCHES = "no-matches",
85
+ PENDING_MATCH = "pending_match",
86
+ MATCHED = "matched",
87
+ NEEDS_REMATCH = "needs-rematch"
88
+ }
89
+ export declare enum VolunteerStateCGCType {
90
+ UPLOADED = "uploaded",
91
+ MISSING = "missing"
92
+ }
93
+ export declare enum SortOrder {
94
+ NewToOld = "new-old",
95
+ OldToNew = "old-new"
96
+ }
32
97
  export type SomeType = "some" | "type";
98
+ export declare enum QueryParams {
99
+ Language = "language",
100
+ Search = "search"
101
+ }
102
+ export declare enum EntityTableName {
103
+ NONE = "none",
104
+ ACTIVITY = "activity",
105
+ SKILL = "skill",
106
+ CATEGORY = "category",
107
+ LANGUAGE = "language",
108
+ LEAD = "lead_from",
109
+ DISTRICT = "district",
110
+ VOLUNTEER = "volunteer"
111
+ }
112
+ export declare enum QueryParamsKeys {
113
+ ACCOMPANYING = "accompanying",
114
+ AVAILABILITY = "availability",
115
+ DISTRICT = "district",
116
+ ENGAGEMENT = "engagement",
117
+ GERMAN = "german",
118
+ LANGUAGE = "language",
119
+ LANGUAGES = "languages",
120
+ LIMIT = "limit",
121
+ ORDER = "order",
122
+ PAGE = "page",
123
+ SEARCH = "search"
124
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentStatusType = exports.HttpMethod = exports.LangProficiency = exports.Lang = void 0;
3
+ exports.QueryParamsKeys = exports.EntityTableName = exports.QueryParams = exports.SortOrder = exports.VolunteerStateCGCType = exports.VolunteerStateMatchType = exports.VolunteerStateTypeType = exports.VolunteerStateAppreciationType = exports.VolunteerStateCommunicationType = exports.VolunteerStateEngagementType = exports.VolunteerStateType = exports.TimedTextType = exports.DocumentStatusType = exports.HttpMethod = exports.LangPurpose = exports.LangProficiency = exports.Lang = void 0;
4
4
  var Lang;
5
5
  (function (Lang) {
6
6
  Lang["EN"] = "en";
@@ -14,6 +14,12 @@ var LangProficiency;
14
14
  LangProficiency["FLUENT"] = "fluent";
15
15
  LangProficiency["NATIVE"] = "native";
16
16
  })(LangProficiency || (exports.LangProficiency = LangProficiency = {}));
17
+ var LangPurpose;
18
+ (function (LangPurpose) {
19
+ LangPurpose["GENERAL"] = "general";
20
+ LangPurpose["TRANSLATION"] = "translation";
21
+ LangPurpose["RECIPIENT"] = "recipient";
22
+ })(LangPurpose || (exports.LangPurpose = LangPurpose = {}));
17
23
  var HttpMethod;
18
24
  (function (HttpMethod) {
19
25
  HttpMethod["GET"] = "GET";
@@ -35,3 +41,102 @@ var DocumentStatusType;
35
41
  DocumentStatusType["APPLIED_SELF"] = "applied_self";
36
42
  DocumentStatusType["APPLIED_N4D"] = "applied_n4d";
37
43
  })(DocumentStatusType || (exports.DocumentStatusType = DocumentStatusType = {}));
44
+ var TimedTextType;
45
+ (function (TimedTextType) {
46
+ TimedTextType["CREATE"] = "create";
47
+ TimedTextType["UPDATE"] = "update";
48
+ TimedTextType["REMOVE"] = "remove";
49
+ TimedTextType["COMMENT"] = "comment";
50
+ TimedTextType["STATUS"] = "status";
51
+ TimedTextType["MATCHING"] = "matching";
52
+ })(TimedTextType || (exports.TimedTextType = TimedTextType = {}));
53
+ var VolunteerStateType;
54
+ (function (VolunteerStateType) {
55
+ VolunteerStateType["NEW"] = "New";
56
+ VolunteerStateType["OPPORTUNITY_SENT"] = "Opportunity sent";
57
+ VolunteerStateType["MATCHED"] = "Matched";
58
+ VolunteerStateType["ACTIVE_REGULAR"] = "Active regular";
59
+ VolunteerStateType["ACTIVE_ACCOMPANY"] = "Active accompany";
60
+ VolunteerStateType["ACTIVE_FEST"] = "Active fest";
61
+ VolunteerStateType["TO_REMATCH"] = "To rematch";
62
+ VolunteerStateType["TEMP_INACTIVE"] = "Temp inactive";
63
+ VolunteerStateType["INACTIVE"] = "Inactive";
64
+ })(VolunteerStateType || (exports.VolunteerStateType = VolunteerStateType = {}));
65
+ var VolunteerStateEngagementType;
66
+ (function (VolunteerStateEngagementType) {
67
+ VolunteerStateEngagementType["NEW"] = "new";
68
+ VolunteerStateEngagementType["ACTIVE"] = "active";
69
+ VolunteerStateEngagementType["AVAILABLE"] = "available";
70
+ VolunteerStateEngagementType["TEMP_UNAVAILABLE"] = "temp-unavailable";
71
+ VolunteerStateEngagementType["INACTIVE"] = "inactive";
72
+ VolunteerStateEngagementType["UNRESPONSIVE"] = "unresponsive";
73
+ })(VolunteerStateEngagementType || (exports.VolunteerStateEngagementType = VolunteerStateEngagementType = {}));
74
+ var VolunteerStateCommunicationType;
75
+ (function (VolunteerStateCommunicationType) {
76
+ VolunteerStateCommunicationType["CALLED"] = "called";
77
+ VolunteerStateCommunicationType["EMAIL_SENT"] = "email-sent";
78
+ VolunteerStateCommunicationType["BRIEFED"] = "briefed";
79
+ VolunteerStateCommunicationType["TRIED_CALL"] = "tried-call";
80
+ VolunteerStateCommunicationType["NOT_RESPONDING"] = "not-responding";
81
+ })(VolunteerStateCommunicationType || (exports.VolunteerStateCommunicationType = VolunteerStateCommunicationType = {}));
82
+ var VolunteerStateAppreciationType;
83
+ (function (VolunteerStateAppreciationType) {
84
+ VolunteerStateAppreciationType["T_SHIRT"] = "t-shirt";
85
+ VolunteerStateAppreciationType["BENEFIT_CARD"] = "benefit-card";
86
+ VolunteerStateAppreciationType["TOTE_BAG"] = "tote-bag";
87
+ })(VolunteerStateAppreciationType || (exports.VolunteerStateAppreciationType = VolunteerStateAppreciationType = {}));
88
+ var VolunteerStateTypeType;
89
+ (function (VolunteerStateTypeType) {
90
+ VolunteerStateTypeType["ACCOMPANYING"] = "accompanying";
91
+ VolunteerStateTypeType["REGULAR"] = "regular";
92
+ VolunteerStateTypeType["EVENT"] = "event";
93
+ VolunteerStateTypeType["FESTIVAL"] = "festival";
94
+ VolunteerStateTypeType["WEEKEND_ONLY"] = "weekend-only";
95
+ })(VolunteerStateTypeType || (exports.VolunteerStateTypeType = VolunteerStateTypeType = {}));
96
+ var VolunteerStateMatchType;
97
+ (function (VolunteerStateMatchType) {
98
+ VolunteerStateMatchType["NO_MATCHES"] = "no-matches";
99
+ VolunteerStateMatchType["PENDING_MATCH"] = "pending_match";
100
+ VolunteerStateMatchType["MATCHED"] = "matched";
101
+ VolunteerStateMatchType["NEEDS_REMATCH"] = "needs-rematch";
102
+ })(VolunteerStateMatchType || (exports.VolunteerStateMatchType = VolunteerStateMatchType = {}));
103
+ var VolunteerStateCGCType;
104
+ (function (VolunteerStateCGCType) {
105
+ VolunteerStateCGCType["UPLOADED"] = "uploaded";
106
+ VolunteerStateCGCType["MISSING"] = "missing";
107
+ })(VolunteerStateCGCType || (exports.VolunteerStateCGCType = VolunteerStateCGCType = {}));
108
+ var SortOrder;
109
+ (function (SortOrder) {
110
+ SortOrder["NewToOld"] = "new-old";
111
+ SortOrder["OldToNew"] = "old-new";
112
+ })(SortOrder || (exports.SortOrder = SortOrder = {}));
113
+ var QueryParams;
114
+ (function (QueryParams) {
115
+ QueryParams["Language"] = "language";
116
+ QueryParams["Search"] = "search";
117
+ })(QueryParams || (exports.QueryParams = QueryParams = {}));
118
+ var EntityTableName;
119
+ (function (EntityTableName) {
120
+ EntityTableName["NONE"] = "none";
121
+ EntityTableName["ACTIVITY"] = "activity";
122
+ EntityTableName["SKILL"] = "skill";
123
+ EntityTableName["CATEGORY"] = "category";
124
+ EntityTableName["LANGUAGE"] = "language";
125
+ EntityTableName["LEAD"] = "lead_from";
126
+ EntityTableName["DISTRICT"] = "district";
127
+ EntityTableName["VOLUNTEER"] = "volunteer";
128
+ })(EntityTableName || (exports.EntityTableName = EntityTableName = {}));
129
+ var QueryParamsKeys;
130
+ (function (QueryParamsKeys) {
131
+ QueryParamsKeys["ACCOMPANYING"] = "accompanying";
132
+ QueryParamsKeys["AVAILABILITY"] = "availability";
133
+ QueryParamsKeys["DISTRICT"] = "district";
134
+ QueryParamsKeys["ENGAGEMENT"] = "engagement";
135
+ QueryParamsKeys["GERMAN"] = "german";
136
+ QueryParamsKeys["LANGUAGE"] = "language";
137
+ QueryParamsKeys["LANGUAGES"] = "languages";
138
+ QueryParamsKeys["LIMIT"] = "limit";
139
+ QueryParamsKeys["ORDER"] = "order";
140
+ QueryParamsKeys["PAGE"] = "page";
141
+ QueryParamsKeys["SEARCH"] = "search";
142
+ })(QueryParamsKeys || (exports.QueryParamsKeys = QueryParamsKeys = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "need4deed-sdk",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Need4Deed.org SDK",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",