washday-sdk 0.0.87 → 0.0.88

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/dist/api/index.js CHANGED
@@ -16,7 +16,7 @@ import { updateStoreStaffById } from "./staff/put";
16
16
  import { getStoreById, getStoreImages, getStoreReviewLink, getStores } from "./stores/get";
17
17
  import { copyStore, createStore, createStoreImage } from "./stores/post";
18
18
  import { deleteStoreById, updateStoreById } from "./stores/put";
19
- import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession } from "./stripe/post";
19
+ import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "./stripe/post";
20
20
  import { deleteSupplyById } from "./supplies/delete";
21
21
  import { getSupplies, getSupplyById, getSupplyHistory } from "./supplies/get";
22
22
  import { createSupply } from "./supplies/post";
@@ -145,6 +145,7 @@ const WashdayClient = function WashdayClient(apiToken) {
145
145
  this.stripe = bindMethods(this, {
146
146
  createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
147
147
  createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
148
+ createGetMoreCheckoutSession: createGetMoreCheckoutSession,
148
149
  createCustomerPortalSession: createCustomerPortalSession
149
150
  });
150
151
  this.staff = bindMethods(this, {
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import axiosInstance from "../axiosInstance";
11
11
  const GET_SET_STRIPE = 'api/stripe';
12
+ const GENERATE_CHECKOUT_SESSION = 'api/orders/create-checkout-session';
12
13
  export const createCreateSuscriptionCheckoutSession = function (data) {
13
14
  return __awaiter(this, void 0, void 0, function* () {
14
15
  try {
@@ -54,3 +55,17 @@ export const createCFDISuscrptionCheckoutSession = function (data) {
54
55
  }
55
56
  });
56
57
  };
58
+ export const createGetMoreCheckoutSession = function (data) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ try {
61
+ const config = {
62
+ headers: { Authorization: `Bearer ${this.apiToken}` }
63
+ };
64
+ return yield axiosInstance.post(`${GENERATE_CHECKOUT_SESSION}`, data, config);
65
+ }
66
+ catch (error) {
67
+ console.error('Error fetching createGetMoreCheckoutSession:', error);
68
+ throw error;
69
+ }
70
+ });
71
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.87",
3
+ "version": "0.0.88",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -17,7 +17,7 @@ import { updateStoreStaffById } from "./staff/put";
17
17
  import { getStoreById, getStoreImages, getStoreReviewLink, getStores } from "./stores/get";
18
18
  import { copyStore, createStore, createStoreImage } from "./stores/post";
19
19
  import { deleteStoreById, updateStoreById } from "./stores/put";
20
- import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession } from "./stripe/post";
20
+ import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "./stripe/post";
21
21
  import { deleteSupplyById } from "./supplies/delete";
22
22
  import { getSupplies, getSupplyById, getSupplyHistory } from "./supplies/get";
23
23
  import { createSupply } from "./supplies/post";
@@ -151,6 +151,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
151
151
  this.stripe = bindMethods(this, {
152
152
  createCreateSuscriptionCheckoutSession: createCreateSuscriptionCheckoutSession,
153
153
  createCFDISuscrptionCheckoutSession: createCFDISuscrptionCheckoutSession,
154
+ createGetMoreCheckoutSession: createGetMoreCheckoutSession,
154
155
  createCustomerPortalSession: createCustomerPortalSession
155
156
  });
156
157
  this.staff = bindMethods(this, {
@@ -1,6 +1,7 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import axiosInstance from "../axiosInstance";
3
3
  const GET_SET_STRIPE = 'api/stripe';
4
+ const GENERATE_CHECKOUT_SESSION = 'api/orders/create-checkout-session';
4
5
 
5
6
  export const createCreateSuscriptionCheckoutSession = async function (this: WashdayClientInstance, data: {
6
7
  priceId: string
@@ -42,3 +43,17 @@ export const createCFDISuscrptionCheckoutSession = async function (this: Washday
42
43
  throw error;
43
44
  }
44
45
  };
46
+
47
+ export const createGetMoreCheckoutSession = async function (this: WashdayClientInstance, data: {
48
+ priceId: string
49
+ }): Promise<any> {
50
+ try {
51
+ const config = {
52
+ headers: { Authorization: `Bearer ${this.apiToken}` }
53
+ };
54
+ return await axiosInstance.post(`${GENERATE_CHECKOUT_SESSION}`, data, config);
55
+ } catch (error) {
56
+ console.error('Error fetching createGetMoreCheckoutSession:', error);
57
+ throw error;
58
+ }
59
+ };
@@ -16,7 +16,7 @@ import { updateStoreStaffById } from "../api/staff/put";
16
16
  import { getStoreById, getStoreImages, getStoreReviewLink, getStores } from "../api/stores/get";
17
17
  import { copyStore, createStore, createStoreImage } from "../api/stores/post";
18
18
  import { deleteStoreById, updateStoreById } from "../api/stores/put";
19
- import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession } from "../api/stripe/post";
19
+ import { createCFDISuscrptionCheckoutSession, createCreateSuscriptionCheckoutSession, createCustomerPortalSession, createGetMoreCheckoutSession } from "../api/stripe/post";
20
20
  import { deleteSupplyById } from "../api/supplies/delete";
21
21
  import { getSupplies, getSupplyById, getSupplyHistory } from "../api/supplies/get";
22
22
  import { createSupply } from "../api/supplies/post";
@@ -136,6 +136,7 @@ export interface WashdayClientInstance {
136
136
  stripe: {
137
137
  createCreateSuscriptionCheckoutSession: typeof createCreateSuscriptionCheckoutSession;
138
138
  createCFDISuscrptionCheckoutSession: typeof createCFDISuscrptionCheckoutSession;
139
+ createGetMoreCheckoutSession: typeof createGetMoreCheckoutSession;
139
140
  createCustomerPortalSession: typeof createCustomerPortalSession;
140
141
  };
141
142
  staff: {