need4deed-sdk 0.0.196 → 0.0.198

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.
@@ -0,0 +1,12 @@
1
+ import { Id } from "..";
2
+ export interface ApiCommuteRange {
3
+ min: number;
4
+ max: number;
5
+ }
6
+ export interface ApiVolunteerCommuteQuery {
7
+ opportunity: Id | Id[];
8
+ }
9
+ export interface ApiVolunteerCommute {
10
+ opportunityId: Id;
11
+ commute: ApiCommuteRange | null;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,6 +5,7 @@ export * from "./appreciation";
5
5
  export * from "./comment";
6
6
  export * from "./common";
7
7
  export * from "./communication";
8
+ export * from "./commute";
8
9
  export * from "./district-aggregate";
9
10
  export * from "./district-geometry";
10
11
  export * from "./district-marker";
@@ -21,6 +21,7 @@ __exportStar(require("./appreciation"), exports);
21
21
  __exportStar(require("./comment"), exports);
22
22
  __exportStar(require("./common"), exports);
23
23
  __exportStar(require("./communication"), exports);
24
+ __exportStar(require("./commute"), exports);
24
25
  __exportStar(require("./district-aggregate"), exports);
25
26
  __exportStar(require("./district-geometry"), exports);
26
27
  __exportStar(require("./district-marker"), exports);
@@ -2,6 +2,7 @@ import { Id, Lang, VoidableProps, VoidableUndefined } from "..";
2
2
  import { ApiOpportunityAccompanyingDetails } from "./accompanying";
3
3
  import { AgentType } from "./agent";
4
4
  import { ApiComment } from "./comment";
5
+ import { ApiCommuteRange } from "./commute";
5
6
  import { OptionById, OptionId } from "./common";
6
7
  import { ApiLanguage } from "./language";
7
8
  import { OptionItem } from "./option";
@@ -125,6 +126,7 @@ export interface OpportunityCreateFormDataProps {
125
126
  accomp_information?: string;
126
127
  accomp_translation?: `${TranslatedIntoType}`;
127
128
  districtIds?: number[];
129
+ address?: ApiOpportunityAddress;
128
130
  languageIds: number[];
129
131
  activityIds: number[];
130
132
  skillIds: number[];
@@ -138,6 +140,11 @@ export interface OpportunityCreateFormDataProps {
138
140
  language: `${Lang}`;
139
141
  }
140
142
  export type OpportunityFormDataWithAgentSubmitter = VoidableUndefined<OpportunityCreateFormDataProps>;
143
+ export interface ApiOpportunityAddress {
144
+ street: string;
145
+ postcode: string;
146
+ city: string;
147
+ }
141
148
  export interface ApiOpportunityAgent {
142
149
  id: number;
143
150
  type: AgentType;
@@ -189,6 +196,7 @@ export interface ApiOpportunityGet extends ApiOpportunityGetList {
189
196
  time: string;
190
197
  };
191
198
  myMatchStatus?: OpportunityVolunteerStatusType | null;
199
+ address?: ApiOpportunityAddress | null;
192
200
  }
193
201
  export type ApiOpportunityLean = Omit<ApiOpportunityGet, "comments">;
194
202
  export type ApiOpportunityPatch = VoidableProps<{
@@ -215,6 +223,7 @@ export type ApiOpportunityPatch = VoidableProps<{
215
223
  name?: string;
216
224
  };
217
225
  accompanyingDetails: ApiOpportunityAccompanyingDetails;
226
+ address: ApiOpportunityAddress;
218
227
  }> & {
219
228
  originalLanguage?: Lang;
220
229
  };
@@ -227,6 +236,7 @@ export interface OpportunityVolunteer {
227
236
  }
228
237
  export interface ApiOpportunityVolunteerGet extends OpportunityVolunteer {
229
238
  title: string;
239
+ commute?: ApiCommuteRange | null;
230
240
  }
231
241
  export declare const EMAIL_NOTE_MAX_LENGTH = 1000;
232
242
  export interface ApiOpportunityVolunteerPost {
@@ -1,5 +1,14 @@
1
+ import { ApiCommuteRange } from "./commute";
2
+ import { ApiOpportunityGetList } from "./opportunity";
3
+ import { ApiVolunteerGetList } from "./volunteer";
1
4
  export declare const RECOMMENDED_MATCHES_DEFAULT_LIMIT = 3;
2
5
  export declare const RECOMMENDED_MATCHES_MAX_LIMIT = 10;
3
6
  export interface ApiRecommendedMatchesQuery {
4
7
  limit?: number;
5
8
  }
9
+ export type ApiRecommendedVolunteer = ApiVolunteerGetList & {
10
+ commute: ApiCommuteRange | null;
11
+ };
12
+ export type ApiRecommendedOpportunity = ApiOpportunityGetList & {
13
+ commute: ApiCommuteRange | null;
14
+ };
@@ -1,6 +1,7 @@
1
1
  import { DocumentStatusType, Id } from "../core";
2
2
  import { VoidableProps } from "../utils";
3
3
  import { OptionById, OptionId } from "./common";
4
+ import { ApiCommuteRange } from "./commute";
4
5
  import { ApiLanguage } from "./language";
5
6
  import { ApiOpportunityGetList, OpportunityType, OpportunityVolunteer } from "./opportunity";
6
7
  import { OptionItem } from "./option";
@@ -180,6 +181,7 @@ export interface ApiVolunteerOpportunityGet extends OpportunityVolunteer {
180
181
  activities: OptionItem[];
181
182
  skills: OptionItem[];
182
183
  locations: OptionItem[];
184
+ commute?: ApiCommuteRange | null;
183
185
  }
184
186
  export interface ApiVolunteerOpportunityGetList extends ApiOpportunityGetList {
185
187
  languages: ApiLanguage[];
@@ -0,0 +1,3 @@
1
+ import type { ApiCommuteRange } from "../types/api/commute";
2
+ export declare const COMMUTE_RANGE_STEP_MINUTES = 5;
3
+ export declare function toCommuteRange(minutes: number | null | undefined): ApiCommuteRange | null;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.COMMUTE_RANGE_STEP_MINUTES = void 0;
4
+ exports.toCommuteRange = toCommuteRange;
5
+ exports.COMMUTE_RANGE_STEP_MINUTES = 5;
6
+ function toCommuteRange(minutes) {
7
+ if (minutes === null || minutes === undefined || !Number.isFinite(minutes) || minutes < 0)
8
+ return null;
9
+ const min = exports.COMMUTE_RANGE_STEP_MINUTES * Math.floor(minutes / exports.COMMUTE_RANGE_STEP_MINUTES);
10
+ return { min, max: min + exports.COMMUTE_RANGE_STEP_MINUTES };
11
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./working-days";
2
2
  export * from "./communication";
3
3
  export * from "./volunteer-types";
4
+ export * from "./commute";
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./working-days"), exports);
18
18
  __exportStar(require("./communication"), exports);
19
19
  __exportStar(require("./volunteer-types"), exports);
20
+ __exportStar(require("./commute"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "need4deed-sdk",
3
- "version": "0.0.196",
3
+ "version": "0.0.198",
4
4
  "description": "Need4Deed.org SDK",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",