@spoketech/hub-client 0.1.19 → 0.1.21
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/README.md +24 -1
- package/dist/index.d.ts +811 -268
- package/dist/index.js +54 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,12 +165,35 @@ if (voucherError !== null) {
|
|
|
165
165
|
throw voucherError;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
const [addedPoints, addPointsError] = await client.points.add({
|
|
169
|
+
organizationId: "org_123",
|
|
170
|
+
waitMs: 10_000,
|
|
171
|
+
payload: {
|
|
172
|
+
externalSystemMemberId: "42",
|
|
173
|
+
amount: 25,
|
|
174
|
+
account: 7,
|
|
175
|
+
metadata: {
|
|
176
|
+
reason: "Birthday bonus",
|
|
177
|
+
eventType: "BirthdayPrizePoints",
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
if (addPointsError !== null) {
|
|
183
|
+
throw addPointsError;
|
|
184
|
+
}
|
|
185
|
+
|
|
168
186
|
const [points, pointsError] = await client.points.redeem({
|
|
169
187
|
organizationId: "org_123",
|
|
170
188
|
waitMs: 10_000,
|
|
171
189
|
payload: {
|
|
172
|
-
|
|
190
|
+
externalSystemMemberId: "42",
|
|
173
191
|
amount: 10,
|
|
192
|
+
account: 7,
|
|
193
|
+
metadata: {
|
|
194
|
+
deviceId: 12,
|
|
195
|
+
deviceTypeId: 3,
|
|
196
|
+
},
|
|
174
197
|
},
|
|
175
198
|
});
|
|
176
199
|
|