need4deed-sdk 0.0.188 → 0.0.190

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.
@@ -1,3 +1,4 @@
1
+ import { VoidableProps } from "../utils";
1
2
  export declare enum ContactType {
2
3
  CALL = "called",
3
4
  TRIED_CALL = "tried-to-call",
@@ -30,10 +31,10 @@ export declare enum CommunicationType {
30
31
  export interface ApiCommunicationPost {
31
32
  contactType: ContactType;
32
33
  contactMethod: ContactMethodType;
33
- communicationType: CommunicationType;
34
+ communicationType?: CommunicationType;
34
35
  date: Date;
35
36
  }
36
- export type ApiCommunicationPatch = Partial<ApiCommunicationPost>;
37
+ export type ApiCommunicationPatch = Partial<VoidableProps<ApiCommunicationPost, "communicationType">>;
37
38
  export interface ApiCommunicationGet extends ApiCommunicationPost {
38
39
  id: number;
39
40
  volunteerId?: number;
@@ -2,7 +2,7 @@ import { DocumentStatusType, Id } from "../core";
2
2
  import { VoidableProps } from "../utils";
3
3
  import { OptionById, OptionId } from "./common";
4
4
  import { ApiLanguage } from "./language";
5
- import { ApiOpportunityGetList, OpportunityVolunteer } from "./opportunity";
5
+ import { ApiOpportunityGetList, OpportunityType, OpportunityVolunteer } from "./opportunity";
6
6
  import { OptionItem } from "./option";
7
7
  import { ApiPersonGet, PreferredCommunicationType } from "./person";
8
8
  import { ProfileVolunteeringType } from "./profile";
@@ -86,6 +86,7 @@ export declare enum VolunteerStateAppreciationType {
86
86
  }
87
87
  export declare const VolunteerStateTypeType: typeof ProfileVolunteeringType;
88
88
  export type VolunteerStateTypeType = ProfileVolunteeringType;
89
+ export type VolunteerType = OpportunityType;
89
90
  export declare enum VolunteerStateCGCType {
90
91
  UPLOADED = "uploaded",
91
92
  MISSING = "missing"
@@ -114,7 +115,9 @@ interface VolunteerGetListProps {
114
115
  id: number;
115
116
  ownerAgentId: number | null;
116
117
  statusEngagement: VolunteerStateEngagementType;
118
+ /** @deprecated use statusTypes */
117
119
  statusType: VolunteerStateTypeType;
120
+ statusTypes: VolunteerType[];
118
121
  statusMatch: VolunteerStateMatchType;
119
122
  statusCommunication: VolunteerStateCommunicationType;
120
123
  name: string;
@@ -136,7 +139,9 @@ export interface ApiVolunteerGet {
136
139
  statusEngagement: VolunteerStateEngagementType;
137
140
  statusCommunication: VolunteerStateCommunicationType;
138
141
  statusAppreciation: VolunteerStateAppreciationType;
142
+ /** @deprecated use statusTypes */
139
143
  statusType: VolunteerStateTypeType;
144
+ statusTypes: VolunteerType[];
140
145
  statusMatch: VolunteerStateMatchType;
141
146
  statusCgcProcess: VolunteerStateCGCType;
142
147
  dateReturn: Date | null;
@@ -165,7 +170,9 @@ export type VolunteerPatchBodyData = VoidableProps<ApiVolunteerGet>;
165
170
  export interface ApiVolunteerOpportunityGet extends OpportunityVolunteer {
166
171
  name: string;
167
172
  avatarUrl: string;
173
+ /** @deprecated use volunteeringTypes */
168
174
  volunteeringType: ProfileVolunteeringType;
175
+ volunteeringTypes: VolunteerType[];
169
176
  engagement: VolunteerStateEngagementType;
170
177
  communication: VolunteerStateCommunicationType;
171
178
  languages: ApiLanguage[];
@@ -1 +1,2 @@
1
1
  export * from "./working-days";
2
+ export * from "./volunteer-types";
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./working-days"), exports);
18
+ __exportStar(require("./volunteer-types"), exports);
@@ -0,0 +1,3 @@
1
+ import { ProfileVolunteeringType } from "../types/api/profile";
2
+ import type { VolunteerType } from "../types/api/volunteer";
3
+ export declare function volunteerTypesFromStatusType(statusType: ProfileVolunteeringType | null | undefined): VolunteerType[];
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.volunteerTypesFromStatusType = volunteerTypesFromStatusType;
4
+ const opportunity_1 = require("../types/api/opportunity");
5
+ const profile_1 = require("../types/api/profile");
6
+ function volunteerTypesFromStatusType(statusType) {
7
+ if (!statusType) {
8
+ return [];
9
+ }
10
+ if (statusType === profile_1.ProfileVolunteeringType.REGULAR_ACCOMPANYING) {
11
+ return [opportunity_1.OpportunityType.REGULAR, opportunity_1.OpportunityType.ACCOMPANYING];
12
+ }
13
+ return [statusType];
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "need4deed-sdk",
3
- "version": "0.0.188",
3
+ "version": "0.0.190",
4
4
  "description": "Need4Deed.org SDK",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",