@open-tender/cloud 0.4.29 → 0.4.30

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.
@@ -58,8 +58,8 @@ declare class OpenTenderAPI {
58
58
  getRevenueCenters(revenue_center_type: RevenueCenterType, is_outpost: boolean, lat: number, lng: number, requestedAt: string): Promise<unknown>;
59
59
  getRevenueCenter(revenue_center_id: number, requestedAt: string): Promise<unknown>;
60
60
  getLocations(revenue_center_type: RevenueCenterType, is_outpost?: boolean, lat?: number, lng?: number, requestedAt?: string, cart_total?: string): Promise<unknown>;
61
- getLocation(revenue_center_id: number): Promise<unknown>;
62
- getLocationBySlug(slug: string): Promise<unknown>;
61
+ getLocation(revenue_center_id: number, cart_total?: string): Promise<unknown>;
62
+ getLocationBySlug(slug: string, cart_total?: string): Promise<unknown>;
63
63
  getValidTimes(revenueCenterType: RevenueCenterType): Promise<unknown>;
64
64
  getTags(): Promise<unknown>;
65
65
  getAllergens(): Promise<unknown>;
@@ -328,11 +328,17 @@ class OpenTenderAPI {
328
328
  params += `&cart_total=${cart_total}`;
329
329
  return this.request(`/locations?${params}`);
330
330
  }
331
- getLocation(revenue_center_id) {
332
- return this.request(`/locations/${revenue_center_id}`);
331
+ getLocation(revenue_center_id, cart_total) {
332
+ let params = '';
333
+ if (cart_total)
334
+ params += `?cart_total=${cart_total}`;
335
+ return this.request(`/locations/${revenue_center_id}${params}`);
333
336
  }
334
- getLocationBySlug(slug) {
335
- return this.request(`/locations/${slug}`);
337
+ getLocationBySlug(slug, cart_total) {
338
+ let params = '';
339
+ if (cart_total)
340
+ params += `?cart_total=${cart_total}`;
341
+ return this.request(`/locations/${slug}${params}`);
336
342
  }
337
343
  getValidTimes(revenueCenterType) {
338
344
  const params = `revenue_center_type=${revenueCenterType}`;
@@ -43,7 +43,10 @@ export declare const fetchRevenueCenter: import("@reduxjs/toolkit").AsyncThunk<v
43
43
  fulfilledMeta?: unknown;
44
44
  rejectedMeta?: unknown;
45
45
  }>;
46
- export declare const fetchLocation: import("@reduxjs/toolkit").AsyncThunk<void, number, {
46
+ export declare const fetchLocation: import("@reduxjs/toolkit").AsyncThunk<void, {
47
+ revenueCenterId: number;
48
+ cartTotal?: string | undefined;
49
+ }, {
47
50
  state: AppState;
48
51
  rejectValue: RequestError;
49
52
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -53,7 +56,10 @@ export declare const fetchLocation: import("@reduxjs/toolkit").AsyncThunk<void,
53
56
  fulfilledMeta?: unknown;
54
57
  rejectedMeta?: unknown;
55
58
  }>;
56
- export declare const fetchLocationBySlug: import("@reduxjs/toolkit").AsyncThunk<void, string, {
59
+ export declare const fetchLocationBySlug: import("@reduxjs/toolkit").AsyncThunk<void, {
60
+ slug: string;
61
+ cartTotal?: string | undefined;
62
+ }, {
57
63
  state: AppState;
58
64
  rejectValue: RequestError;
59
65
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -54,12 +54,12 @@ exports.fetchRevenueCenter = (0, toolkit_1.createAsyncThunk)(OrderActionType.Fet
54
54
  return rejectWithValue(err);
55
55
  }
56
56
  }));
57
- exports.fetchLocation = (0, toolkit_1.createAsyncThunk)(OrderActionType.FetchLocation, (revenueCenterId, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
57
+ exports.fetchLocation = (0, toolkit_1.createAsyncThunk)(OrderActionType.FetchLocation, ({ revenueCenterId, cartTotal }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
58
58
  const { api } = getState().config;
59
59
  if (!api)
60
60
  return;
61
61
  try {
62
- const revenueCenter = yield api.getLocation(revenueCenterId);
62
+ const revenueCenter = yield api.getLocation(revenueCenterId, cartTotal);
63
63
  dispatch((0, exports.setRevenueCenter)(revenueCenter));
64
64
  return revenueCenter;
65
65
  }
@@ -67,12 +67,12 @@ exports.fetchLocation = (0, toolkit_1.createAsyncThunk)(OrderActionType.FetchLoc
67
67
  return rejectWithValue(err);
68
68
  }
69
69
  }));
70
- exports.fetchLocationBySlug = (0, toolkit_1.createAsyncThunk)(OrderActionType.FetchLocation, (slug, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
70
+ exports.fetchLocationBySlug = (0, toolkit_1.createAsyncThunk)(OrderActionType.FetchLocation, ({ slug, cartTotal }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
71
71
  const { api } = getState().config;
72
72
  if (!api)
73
73
  return;
74
74
  try {
75
- const revenueCenter = yield api.getLocationBySlug(slug);
75
+ const revenueCenter = yield api.getLocationBySlug(slug, cartTotal);
76
76
  dispatch((0, exports.setRevenueCenter)(revenueCenter));
77
77
  return revenueCenter;
78
78
  }
@@ -58,8 +58,8 @@ declare class OpenTenderAPI {
58
58
  getRevenueCenters(revenue_center_type: RevenueCenterType, is_outpost: boolean, lat: number, lng: number, requestedAt: string): Promise<unknown>;
59
59
  getRevenueCenter(revenue_center_id: number, requestedAt: string): Promise<unknown>;
60
60
  getLocations(revenue_center_type: RevenueCenterType, is_outpost?: boolean, lat?: number, lng?: number, requestedAt?: string, cart_total?: string): Promise<unknown>;
61
- getLocation(revenue_center_id: number): Promise<unknown>;
62
- getLocationBySlug(slug: string): Promise<unknown>;
61
+ getLocation(revenue_center_id: number, cart_total?: string): Promise<unknown>;
62
+ getLocationBySlug(slug: string, cart_total?: string): Promise<unknown>;
63
63
  getValidTimes(revenueCenterType: RevenueCenterType): Promise<unknown>;
64
64
  getTags(): Promise<unknown>;
65
65
  getAllergens(): Promise<unknown>;
@@ -326,11 +326,17 @@ class OpenTenderAPI {
326
326
  params += `&cart_total=${cart_total}`;
327
327
  return this.request(`/locations?${params}`);
328
328
  }
329
- getLocation(revenue_center_id) {
330
- return this.request(`/locations/${revenue_center_id}`);
329
+ getLocation(revenue_center_id, cart_total) {
330
+ let params = '';
331
+ if (cart_total)
332
+ params += `?cart_total=${cart_total}`;
333
+ return this.request(`/locations/${revenue_center_id}${params}`);
331
334
  }
332
- getLocationBySlug(slug) {
333
- return this.request(`/locations/${slug}`);
335
+ getLocationBySlug(slug, cart_total) {
336
+ let params = '';
337
+ if (cart_total)
338
+ params += `?cart_total=${cart_total}`;
339
+ return this.request(`/locations/${slug}${params}`);
334
340
  }
335
341
  getValidTimes(revenueCenterType) {
336
342
  const params = `revenue_center_type=${revenueCenterType}`;
@@ -43,7 +43,10 @@ export declare const fetchRevenueCenter: import("@reduxjs/toolkit").AsyncThunk<v
43
43
  fulfilledMeta?: unknown;
44
44
  rejectedMeta?: unknown;
45
45
  }>;
46
- export declare const fetchLocation: import("@reduxjs/toolkit").AsyncThunk<void, number, {
46
+ export declare const fetchLocation: import("@reduxjs/toolkit").AsyncThunk<void, {
47
+ revenueCenterId: number;
48
+ cartTotal?: string | undefined;
49
+ }, {
47
50
  state: AppState;
48
51
  rejectValue: RequestError;
49
52
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -53,7 +56,10 @@ export declare const fetchLocation: import("@reduxjs/toolkit").AsyncThunk<void,
53
56
  fulfilledMeta?: unknown;
54
57
  rejectedMeta?: unknown;
55
58
  }>;
56
- export declare const fetchLocationBySlug: import("@reduxjs/toolkit").AsyncThunk<void, string, {
59
+ export declare const fetchLocationBySlug: import("@reduxjs/toolkit").AsyncThunk<void, {
60
+ slug: string;
61
+ cartTotal?: string | undefined;
62
+ }, {
57
63
  state: AppState;
58
64
  rejectValue: RequestError;
59
65
  dispatch?: import("redux").Dispatch<import("redux").AnyAction> | undefined;
@@ -49,12 +49,12 @@ export const fetchRevenueCenter = createAsyncThunk(OrderActionType.FetchRevenueC
49
49
  return rejectWithValue(err);
50
50
  }
51
51
  }));
52
- export const fetchLocation = createAsyncThunk(OrderActionType.FetchLocation, (revenueCenterId, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
52
+ export const fetchLocation = createAsyncThunk(OrderActionType.FetchLocation, ({ revenueCenterId, cartTotal }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
53
53
  const { api } = getState().config;
54
54
  if (!api)
55
55
  return;
56
56
  try {
57
- const revenueCenter = yield api.getLocation(revenueCenterId);
57
+ const revenueCenter = yield api.getLocation(revenueCenterId, cartTotal);
58
58
  dispatch(setRevenueCenter(revenueCenter));
59
59
  return revenueCenter;
60
60
  }
@@ -62,12 +62,12 @@ export const fetchLocation = createAsyncThunk(OrderActionType.FetchLocation, (re
62
62
  return rejectWithValue(err);
63
63
  }
64
64
  }));
65
- export const fetchLocationBySlug = createAsyncThunk(OrderActionType.FetchLocation, (slug, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
65
+ export const fetchLocationBySlug = createAsyncThunk(OrderActionType.FetchLocation, ({ slug, cartTotal }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
66
66
  const { api } = getState().config;
67
67
  if (!api)
68
68
  return;
69
69
  try {
70
- const revenueCenter = yield api.getLocationBySlug(slug);
70
+ const revenueCenter = yield api.getLocationBySlug(slug, cartTotal);
71
71
  dispatch(setRevenueCenter(revenueCenter));
72
72
  return revenueCenter;
73
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.4.29",
3
+ "version": "0.4.30",
4
4
  "description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",