washday-sdk 1.6.15 → 1.6.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.
@@ -0,0 +1,58 @@
1
+ name: Bump Version on PR
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, reopened]
6
+ branches:
7
+ - main
8
+
9
+ permissions:
10
+ contents: write
11
+
12
+ jobs:
13
+ bump-version:
14
+ runs-on: ubuntu-latest
15
+ if: github.event.pull_request.base.ref == 'main'
16
+ steps:
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
19
+ with:
20
+ ref: ${{ github.head_ref }}
21
+ token: ${{ secrets.GITHUB_TOKEN }}
22
+
23
+ - name: Use Node.js 22
24
+ uses: actions/setup-node@v4
25
+ with:
26
+ node-version: 22
27
+
28
+ - name: Configure git identity
29
+ run: |
30
+ git config --global user.name "washday-bot"
31
+ git config --global user.email "ci@washday.dev"
32
+
33
+ - name: Fetch main branch
34
+ run: git fetch origin main:main
35
+
36
+ - name: Check if version already bumped
37
+ id: check_version
38
+ run: |
39
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
40
+ git show main:package.json > /tmp/main-package.json
41
+ MAIN_VERSION=$(node -p "require('/tmp/main-package.json').version")
42
+ echo "Current PR version: $CURRENT_VERSION"
43
+ echo "Main branch version: $MAIN_VERSION"
44
+ if [ "$CURRENT_VERSION" != "$MAIN_VERSION" ]; then
45
+ echo "already_bumped=true" >> $GITHUB_OUTPUT
46
+ echo "✅ Version already bumped in this PR"
47
+ else
48
+ echo "already_bumped=false" >> $GITHUB_OUTPUT
49
+ echo "⚠️ Version needs bumping"
50
+ fi
51
+
52
+ - name: Bump version patch
53
+ if: steps.check_version.outputs.already_bumped == 'false'
54
+ run: |
55
+ npm version patch --no-git-tag-version
56
+ git add package.json package-lock.json
57
+ git commit -m "chore: bump version [skip ci]"
58
+ git push origin ${{ github.head_ref }}
@@ -0,0 +1,38 @@
1
+ name: Publish SDK on Merge
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ permissions:
9
+ contents: read
10
+ id-token: write # Required for OIDC
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-latest
15
+ environment: publish
16
+ steps:
17
+ - name: Checkout
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Use Node.js 22
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ node-version: 22
24
+
25
+ - name: Update npm to latest
26
+ run: npm install -g npm@latest
27
+
28
+ - name: Install dependencies
29
+ run: npm ci
30
+
31
+ - name: Clear NODE_AUTH_TOKEN for OIDC
32
+ run: |
33
+ unset NODE_AUTH_TOKEN || true
34
+
35
+ - name: Build and publish
36
+ run: npm run build && npm publish --access public --no-provenance --verbose
37
+ env:
38
+ NODE_AUTH_TOKEN: ""
package/dist/api/index.js CHANGED
@@ -138,6 +138,7 @@ const WashdayClient = function WashdayClient(apiToken, env = 'PROD', clientId, c
138
138
  getRedeemPointsPreview: ordersEndpoints.postModule.getRedeemPointsPreview,
139
139
  setOrderUncollected: ordersEndpoints.postModule.setOrderUncollected,
140
140
  payAndCollect: ordersEndpoints.postModule.payAndCollect,
141
+ sendOrderUncollectedCustomerNotification: ordersEndpoints.postModule.sendOrderUncollectedCustomerNotification,
141
142
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
142
143
  getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
143
144
  getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
@@ -11,6 +11,7 @@ const GET_SET_ORDER_PAYMENTLINES = (orderId) => `/api/v2/order/${orderId}/paymen
11
11
  const GET_SET_ORDER = 'api/v2/order';
12
12
  const GET_SET_ORDER_CUSTOMERS_APP = 'api/v2/washdayapp/orders';
13
13
  const PAY_AND_COLLECT = (sequence, storeId) => `/api/v2/order/${sequence}/${storeId}/pay-and-collect`;
14
+ const SEND_UNCOLLECTED_CUSTOMER_NOTIFICATION = (orderId) => `/api/v2/order/${orderId}/send-uncollected-customer-notification`;
14
15
  export const createPaymentLine = function (id, data) {
15
16
  return __awaiter(this, void 0, void 0, function* () {
16
17
  try {
@@ -150,3 +151,17 @@ export const payAndCollect = function (params) {
150
151
  }
151
152
  });
152
153
  };
154
+ export const sendOrderUncollectedCustomerNotification = function (orderId) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ try {
157
+ const config = {
158
+ headers: { Authorization: `Bearer ${this.apiToken}` }
159
+ };
160
+ return yield this.axiosInstance.post(SEND_UNCOLLECTED_CUSTOMER_NOTIFICATION(orderId), {}, config);
161
+ }
162
+ catch (error) {
163
+ console.error('Error fetching sendOrderUncollectedCustomerNotification:', error);
164
+ throw error;
165
+ }
166
+ });
167
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.6.15",
3
+ "version": "1.6.16",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
package/src/api/index.ts CHANGED
@@ -145,6 +145,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
145
145
  getRedeemPointsPreview: ordersEndpoints.postModule.getRedeemPointsPreview,
146
146
  setOrderUncollected: ordersEndpoints.postModule.setOrderUncollected,
147
147
  payAndCollect: ordersEndpoints.postModule.payAndCollect,
148
+ sendOrderUncollectedCustomerNotification: ordersEndpoints.postModule.sendOrderUncollectedCustomerNotification,
148
149
  deletePaymentLineById: ordersEndpoints.deleteModule.deletePaymentLineById,
149
150
  getListCustomersApp: ordersEndpoints.getModule.getListCustomersApp,
150
151
  getByIdCustomersApp: ordersEndpoints.getModule.getByIdCustomersApp,
@@ -90,6 +90,11 @@ export const createMPAttempt = async function (this: WashdayClientInstance, data
90
90
  storeId: string;
91
91
  terminalId: string;
92
92
  cashierBoxId: string;
93
+ pinUserId?: string;
94
+ // DO WE NEED THIS NEXT 3?
95
+ print_on_terminal?: 'no_ticket' | 'seller_ticket';
96
+ clientRequestId?: string;
97
+ description?: string;
93
98
  }): Promise<any> {
94
99
  try {
95
100
  const config = {
@@ -7,6 +7,7 @@ const GET_SET_ORDER_PAYMENTLINES = (orderId: string) => `/api/v2/order/${orderId
7
7
  const GET_SET_ORDER = 'api/v2/order';
8
8
  const GET_SET_ORDER_CUSTOMERS_APP = 'api/v2/washdayapp/orders';
9
9
  const PAY_AND_COLLECT = (sequence: string, storeId: string) => `/api/v2/order/${sequence}/${storeId}/pay-and-collect`;
10
+ const SEND_UNCOLLECTED_CUSTOMER_NOTIFICATION = (orderId: string) => `/api/v2/order/${orderId}/send-uncollected-customer-notification`;
10
11
 
11
12
  export const createPaymentLine = async function (this: WashdayClientInstance, id: string, data: {
12
13
  amountPaid: number,
@@ -169,4 +170,20 @@ export const payAndCollect = async function (this: WashdayClientInstance, params
169
170
  console.error('Error fetching payAndCollect:', error);
170
171
  throw error;
171
172
  }
173
+ };
174
+
175
+ export const sendOrderUncollectedCustomerNotification = async function (this: WashdayClientInstance, orderId: string): Promise<AxiosResponse<any, any>> {
176
+ try {
177
+ const config = {
178
+ headers: { Authorization: `Bearer ${this.apiToken}` }
179
+ };
180
+ return await this.axiosInstance.post(
181
+ SEND_UNCOLLECTED_CUSTOMER_NOTIFICATION(orderId),
182
+ {},
183
+ config
184
+ );
185
+ } catch (error) {
186
+ console.error('Error fetching sendOrderUncollectedCustomerNotification:', error);
187
+ throw error;
188
+ }
172
189
  };
@@ -130,6 +130,7 @@ export interface WashdayClientInstance {
130
130
  getRedeemPointsPreview: typeof ordersEndpoints.postModule.getRedeemPointsPreview,
131
131
  setOrderUncollected: typeof ordersEndpoints.postModule.setOrderUncollected,
132
132
  payAndCollect: typeof ordersEndpoints.postModule.payAndCollect,
133
+ sendOrderUncollectedCustomerNotification: typeof ordersEndpoints.postModule.sendOrderUncollectedCustomerNotification,
133
134
  deletePaymentLineById: typeof ordersEndpoints.deleteModule.deletePaymentLineById;
134
135
  getListCustomersApp: typeof ordersEndpoints.getModule.getListCustomersApp;
135
136
  getByIdCustomersApp: typeof ordersEndpoints.getModule.getByIdCustomersApp;