@sparkrewards/sra-client 0.0.3 → 0.0.5

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/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
189
+ Copyright 2018-2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,31 +1,106 @@
1
- ## @sparkrewards/app-api-sdk
1
+ ## @sparkrewards/sra-client
2
2
 
3
3
  TypeScript / JavaScript client SDK for the Spark Rewards App API, generated from the Smithy service model.
4
4
 
5
5
  ### Installation
6
6
 
7
7
  ```bash
8
- npm install @sparkrewards/app-api-sdk
8
+ npm install @sparkrewards/sra-client
9
9
  # or
10
- yarn add @sparkrewards/app-api-sdk
10
+ yarn add @sparkrewards/sra-client
11
11
  ```
12
12
 
13
- ### Basic usage
13
+ ### Authentication
14
14
 
15
- ```ts
16
- import { AppAPIClient, PlanCommand } from "@sparkrewards/app-api-sdk";
15
+ The App API uses **Cognito User Pools** authentication. You must configure the client with the `aws.auth#cognitoUserPools` auth scheme.
16
+
17
+ > **Important:** The generated client does not automatically provide auth scheme implementations. You must configure `httpAuthSchemes` when creating the client.
18
+
19
+ #### Basic Usage with AWS Amplify
20
+
21
+ ```typescript
22
+ import { AppAPIClient } from '@sparkrewards/sra-client';
23
+ import { fetchAuthSession } from 'aws-amplify/auth';
24
+ import {
25
+ HttpAuthScheme,
26
+ Identity,
27
+ IdentityProvider,
28
+ IdentityProviderConfig
29
+ } from "@smithy/types";
30
+
31
+ interface CognitoIdentity extends Identity {
32
+ token: string;
33
+ }
34
+
35
+ function createCognitoAuthScheme(token?: string): HttpAuthScheme {
36
+ return {
37
+ schemeId: "aws.auth#cognitoUserPools",
38
+ identityProvider: (config: IdentityProviderConfig): IdentityProvider<CognitoIdentity> => {
39
+ return async (): Promise<CognitoIdentity> => {
40
+ return { token: token || '' } as CognitoIdentity;
41
+ };
42
+ },
43
+ signer: {
44
+ sign: async (httpRequest: any, identity: any) => {
45
+ const cognitoIdentity = identity as CognitoIdentity;
46
+ httpRequest.headers["Authorization"] = `Bearer ${cognitoIdentity.token}`;
47
+ return httpRequest;
48
+ },
49
+ },
50
+ };
51
+ }
52
+
53
+ async function getClient(): Promise<AppAPIClient> {
54
+ const session = await fetchAuthSession();
55
+ const idToken = session.tokens?.idToken?.toString();
56
+
57
+ const client = new AppAPIClient({
58
+ endpoint: 'https://beta-api.sparkrewards.co/sra',
59
+ httpAuthSchemes: [createCognitoAuthScheme(idToken)],
60
+ });
61
+
62
+ return client;
63
+ }
64
+
65
+ // Usage
66
+ const client = await getClient();
67
+ const result = await client.send(new GetUserCommand({}));
68
+ ```
69
+
70
+ #### Using with Public Endpoints
71
+
72
+ For public endpoints (those with `@auth([])` in the model), you don't need authentication:
73
+
74
+ ```typescript
75
+ import { AppAPIClient, NearbyShopsPublicCommand } from '@sparkrewards/sra-client';
17
76
 
18
77
  const client = new AppAPIClient({
19
- region: "us-east-1",
20
- // endpoint, credentials, etc as needed
78
+ endpoint: 'https://beta-api.sparkrewards.co/sra',
79
+ httpAuthSchemes: [], // Empty array for public-only usage
21
80
  });
22
81
 
23
- async function getPlan(orgId: string) {
24
- const result = await client.send(new PlanCommand({ org_id: orgId }));
25
- console.log(result);
26
- }
82
+ const shops = await client.send(new NearbyShopsPublicCommand({
83
+ lat: 40.7128,
84
+ lon: -74.0060,
85
+ }));
27
86
  ```
28
87
 
88
+ ### API Operations
89
+
90
+ The client supports both authenticated and public operations:
91
+
92
+ **Authenticated operations** (require Cognito token):
93
+ - `GetUser`, `UpdateUser`, `DeleteUser`, `OnboardUser`
94
+ - `NearbyShops`, `FavoriteShops`, `GetShop`, `PinnedShop`, `PopularShops`
95
+ - `Plan`, `Plans`, `FavoritePlans`
96
+ - `RedeemFirstTimeReward`, `RedeemVisitReward`, `RedeemPointReward`
97
+ - `RecordVisit`, `LikeOrg`
98
+
99
+ **Public operations** (no authentication required):
100
+ - `NearbyShopsPublic`, `PopularShopsPublic`, `GetShopPublic`
101
+ - `PlanPublic`, `PinnedShopPublic`, `SearchShopsPublic`
102
+ - `RadiusShops`, `SearchSuggestion`
103
+
29
104
  ### Regenerating from the Smithy model
30
105
 
31
106
  This package is generated by the `typescript-client-codegen` Smithy plugin. To regenerate it:
@@ -38,4 +113,3 @@ The generated package lives under:
38
113
 
39
114
  - `smithy/build/smithyprojections/smithy/source/typescript-client-codegen`
40
115
 
41
-
@@ -41,10 +41,11 @@ const se_FavoriteShopsCommand = async (input, context) => {
41
41
  const headers = {};
42
42
  b.bp("/shops/favorite");
43
43
  const query = (0, smithy_client_1.map)({
44
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
45
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
44
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
45
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
46
46
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
47
- [_f]: [, input[_f]],
47
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
48
+ [_c]: [, input[_c]],
48
49
  });
49
50
  let body;
50
51
  b.m("GET")
@@ -109,10 +110,11 @@ const se_NearbyShopsCommand = async (input, context) => {
109
110
  const headers = {};
110
111
  b.bp("/shops");
111
112
  const query = (0, smithy_client_1.map)({
112
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
113
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
113
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
114
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
114
115
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
115
- [_f]: [, input[_f]],
116
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
117
+ [_c]: [, input[_c]],
116
118
  });
117
119
  let body;
118
120
  b.m("GET")
@@ -127,10 +129,11 @@ const se_NearbyShopsPublicCommand = async (input, context) => {
127
129
  const headers = {};
128
130
  b.bp("/public/shops");
129
131
  const query = (0, smithy_client_1.map)({
130
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
131
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
132
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
133
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
132
134
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
133
- [_f]: [, input[_f]],
135
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
136
+ [_c]: [, input[_c]],
134
137
  });
135
138
  let body;
136
139
  b.m("GET")
@@ -255,10 +258,11 @@ const se_PopularShopsCommand = async (input, context) => {
255
258
  const headers = {};
256
259
  b.bp("/shops/popular");
257
260
  const query = (0, smithy_client_1.map)({
258
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
259
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
261
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
262
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
260
263
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
261
- [_f]: [, input[_f]],
264
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
265
+ [_c]: [, input[_c]],
262
266
  });
263
267
  let body;
264
268
  b.m("GET")
@@ -273,10 +277,11 @@ const se_PopularShopsPublicCommand = async (input, context) => {
273
277
  const headers = {};
274
278
  b.bp("/public/shops/popular");
275
279
  const query = (0, smithy_client_1.map)({
276
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
277
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
280
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
281
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
278
282
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
279
- [_f]: [, input[_f]],
283
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
284
+ [_c]: [, input[_c]],
280
285
  });
281
286
  let body;
282
287
  b.m("GET")
@@ -291,10 +296,11 @@ const se_RadiusShopsCommand = async (input, context) => {
291
296
  const headers = {};
292
297
  b.bp("/public/shops/radius");
293
298
  const query = (0, smithy_client_1.map)({
294
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
295
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
299
+ [_la]: [(0, smithy_client_1.expectNonNull)(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
300
+ [_lo]: [(0, smithy_client_1.expectNonNull)(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
296
301
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
297
- [_f]: [, input[_f]],
302
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
303
+ [_c]: [, input[_c]],
298
304
  });
299
305
  let body;
300
306
  b.m("GET")
@@ -378,7 +384,7 @@ const se_SearchShopsPublicCommand = async (input, context) => {
378
384
  [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
379
385
  [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
380
386
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
381
- [_f]: [, input[_f]],
387
+ [_f]: [, input[_ta]],
382
388
  });
383
389
  let body;
384
390
  b.m("GET")
@@ -1060,14 +1066,17 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1060
1066
  (!Object.getOwnPropertyNames(value).includes("length") ||
1061
1067
  value.length != 0) &&
1062
1068
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1069
+ const _c = "categories";
1063
1070
  const _f = "filters";
1064
1071
  const _l = "limit";
1065
1072
  const _la = "lat";
1066
1073
  const _lo = "lon";
1067
1074
  const _oi = "org_id";
1075
+ const _on = "open_now";
1068
1076
  const _p = "page";
1069
1077
  const _q = "q";
1070
1078
  const _ri = "reward_id";
1071
1079
  const _si = "shop_id";
1072
1080
  const _sn = "shop_name";
1073
1081
  const _t = "timestamp";
1082
+ const _ta = "tags";
@@ -35,10 +35,11 @@ export const se_FavoriteShopsCommand = async (input, context) => {
35
35
  const headers = {};
36
36
  b.bp("/shops/favorite");
37
37
  const query = map({
38
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
39
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
38
+ [_la]: [__expectNonNull(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
39
+ [_lo]: [__expectNonNull(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
40
40
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
41
- [_f]: [, input[_f]],
41
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
42
+ [_c]: [, input[_c]],
42
43
  });
43
44
  let body;
44
45
  b.m("GET")
@@ -98,10 +99,11 @@ export const se_NearbyShopsCommand = async (input, context) => {
98
99
  const headers = {};
99
100
  b.bp("/shops");
100
101
  const query = map({
101
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
102
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
102
+ [_la]: [__expectNonNull(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
103
+ [_lo]: [__expectNonNull(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
103
104
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
104
- [_f]: [, input[_f]],
105
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
106
+ [_c]: [, input[_c]],
105
107
  });
106
108
  let body;
107
109
  b.m("GET")
@@ -115,10 +117,11 @@ export const se_NearbyShopsPublicCommand = async (input, context) => {
115
117
  const headers = {};
116
118
  b.bp("/public/shops");
117
119
  const query = map({
118
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
119
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
120
+ [_la]: [__expectNonNull(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
121
+ [_lo]: [__expectNonNull(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
120
122
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
121
- [_f]: [, input[_f]],
123
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
124
+ [_c]: [, input[_c]],
122
125
  });
123
126
  let body;
124
127
  b.m("GET")
@@ -235,10 +238,11 @@ export const se_PopularShopsCommand = async (input, context) => {
235
238
  const headers = {};
236
239
  b.bp("/shops/popular");
237
240
  const query = map({
238
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
239
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
241
+ [_la]: [__expectNonNull(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
242
+ [_lo]: [__expectNonNull(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
240
243
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
241
- [_f]: [, input[_f]],
244
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
245
+ [_c]: [, input[_c]],
242
246
  });
243
247
  let body;
244
248
  b.m("GET")
@@ -252,10 +256,11 @@ export const se_PopularShopsPublicCommand = async (input, context) => {
252
256
  const headers = {};
253
257
  b.bp("/public/shops/popular");
254
258
  const query = map({
255
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
256
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
259
+ [_la]: [__expectNonNull(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
260
+ [_lo]: [__expectNonNull(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
257
261
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
258
- [_f]: [, input[_f]],
262
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
263
+ [_c]: [, input[_c]],
259
264
  });
260
265
  let body;
261
266
  b.m("GET")
@@ -269,10 +274,11 @@ export const se_RadiusShopsCommand = async (input, context) => {
269
274
  const headers = {};
270
275
  b.bp("/public/shops/radius");
271
276
  const query = map({
272
- [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
273
- [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
277
+ [_la]: [__expectNonNull(input.lat, `lat`) != null, () => ((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString())],
278
+ [_lo]: [__expectNonNull(input.lon, `lon`) != null, () => ((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString())],
274
279
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
275
- [_f]: [, input[_f]],
280
+ [_on]: [() => input.open_now !== void 0, () => (input[_on].toString())],
281
+ [_c]: [, input[_c]],
276
282
  });
277
283
  let body;
278
284
  b.m("GET")
@@ -351,7 +357,7 @@ export const se_SearchShopsPublicCommand = async (input, context) => {
351
357
  [_la]: [() => input.lat !== void 0, () => (((input[_la] % 1 == 0) ? input[_la] + ".0" : input[_la].toString()))],
352
358
  [_lo]: [() => input.lon !== void 0, () => (((input[_lo] % 1 == 0) ? input[_lo] + ".0" : input[_lo].toString()))],
353
359
  [_p]: [() => input.page !== void 0, () => (input[_p].toString())],
354
- [_f]: [, input[_f]],
360
+ [_f]: [, input[_ta]],
355
361
  });
356
362
  let body;
357
363
  b.m("GET")
@@ -1004,14 +1010,17 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1004
1010
  (!Object.getOwnPropertyNames(value).includes("length") ||
1005
1011
  value.length != 0) &&
1006
1012
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1013
+ const _c = "categories";
1007
1014
  const _f = "filters";
1008
1015
  const _l = "limit";
1009
1016
  const _la = "lat";
1010
1017
  const _lo = "lon";
1011
1018
  const _oi = "org_id";
1019
+ const _on = "open_now";
1012
1020
  const _p = "page";
1013
1021
  const _q = "q";
1014
1022
  const _ri = "reward_id";
1015
1023
  const _si = "shop_id";
1016
1024
  const _sn = "shop_name";
1017
1025
  const _t = "timestamp";
1026
+ const _ta = "tags";
@@ -43,7 +43,6 @@ export interface AppAPI {
43
43
  /**
44
44
  * @see {@link FavoriteShopsCommand}
45
45
  */
46
- favoriteShops(): Promise<FavoriteShopsCommandOutput>;
47
46
  favoriteShops(args: FavoriteShopsCommandInput, options?: __HttpHandlerOptions): Promise<FavoriteShopsCommandOutput>;
48
47
  favoriteShops(args: FavoriteShopsCommandInput, cb: (err: any, data?: FavoriteShopsCommandOutput) => void): void;
49
48
  favoriteShops(args: FavoriteShopsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: FavoriteShopsCommandOutput) => void): void;
@@ -75,14 +74,12 @@ export interface AppAPI {
75
74
  /**
76
75
  * @see {@link NearbyShopsCommand}
77
76
  */
78
- nearbyShops(): Promise<NearbyShopsCommandOutput>;
79
77
  nearbyShops(args: NearbyShopsCommandInput, options?: __HttpHandlerOptions): Promise<NearbyShopsCommandOutput>;
80
78
  nearbyShops(args: NearbyShopsCommandInput, cb: (err: any, data?: NearbyShopsCommandOutput) => void): void;
81
79
  nearbyShops(args: NearbyShopsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: NearbyShopsCommandOutput) => void): void;
82
80
  /**
83
81
  * @see {@link NearbyShopsPublicCommand}
84
82
  */
85
- nearbyShopsPublic(): Promise<NearbyShopsPublicCommandOutput>;
86
83
  nearbyShopsPublic(args: NearbyShopsPublicCommandInput, options?: __HttpHandlerOptions): Promise<NearbyShopsPublicCommandOutput>;
87
84
  nearbyShopsPublic(args: NearbyShopsPublicCommandInput, cb: (err: any, data?: NearbyShopsPublicCommandOutput) => void): void;
88
85
  nearbyShopsPublic(args: NearbyShopsPublicCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: NearbyShopsPublicCommandOutput) => void): void;
@@ -132,21 +129,18 @@ export interface AppAPI {
132
129
  /**
133
130
  * @see {@link PopularShopsCommand}
134
131
  */
135
- popularShops(): Promise<PopularShopsCommandOutput>;
136
132
  popularShops(args: PopularShopsCommandInput, options?: __HttpHandlerOptions): Promise<PopularShopsCommandOutput>;
137
133
  popularShops(args: PopularShopsCommandInput, cb: (err: any, data?: PopularShopsCommandOutput) => void): void;
138
134
  popularShops(args: PopularShopsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PopularShopsCommandOutput) => void): void;
139
135
  /**
140
136
  * @see {@link PopularShopsPublicCommand}
141
137
  */
142
- popularShopsPublic(): Promise<PopularShopsPublicCommandOutput>;
143
138
  popularShopsPublic(args: PopularShopsPublicCommandInput, options?: __HttpHandlerOptions): Promise<PopularShopsPublicCommandOutput>;
144
139
  popularShopsPublic(args: PopularShopsPublicCommandInput, cb: (err: any, data?: PopularShopsPublicCommandOutput) => void): void;
145
140
  popularShopsPublic(args: PopularShopsPublicCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: PopularShopsPublicCommandOutput) => void): void;
146
141
  /**
147
142
  * @see {@link RadiusShopsCommand}
148
143
  */
149
- radiusShops(): Promise<RadiusShopsCommandOutput>;
150
144
  radiusShops(args: RadiusShopsCommandInput, options?: __HttpHandlerOptions): Promise<RadiusShopsCommandOutput>;
151
145
  radiusShops(args: RadiusShopsCommandInput, cb: (err: any, data?: RadiusShopsCommandOutput) => void): void;
152
146
  radiusShops(args: RadiusShopsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: RadiusShopsCommandOutput) => void): void;
@@ -23,7 +23,7 @@ export interface FavoriteShopsCommandOutput extends ShopListWithPaginationOutput
23
23
  }
24
24
  declare const FavoriteShopsCommand_base: {
25
25
  new (input: FavoriteShopsCommandInput): import("@smithy/smithy-client").CommandImpl<FavoriteShopsCommandInput, FavoriteShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (...[input]: [] | [FavoriteShopsCommandInput]): import("@smithy/smithy-client").CommandImpl<FavoriteShopsCommandInput, FavoriteShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: FavoriteShopsCommandInput): import("@smithy/smithy-client").CommandImpl<FavoriteShopsCommandInput, FavoriteShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
@@ -35,10 +35,11 @@ declare const FavoriteShopsCommand_base: {
35
35
  * // const { AppAPIClient, FavoriteShopsCommand } = require("@sparkrewards/sra-client"); // CommonJS import
36
36
  * const client = new AppAPIClient(config);
37
37
  * const input = { // ShopListInput
38
- * lat: Number("double"),
39
- * lon: Number("double"),
38
+ * lat: Number("double"), // required
39
+ * lon: Number("double"), // required
40
40
  * page: Number("int"),
41
- * filters: "STRING_VALUE",
41
+ * open_now: true || false,
42
+ * categories: "STRING_VALUE",
42
43
  * };
43
44
  * const command = new FavoriteShopsCommand(input);
44
45
  * const response = await client.send(command);
@@ -23,7 +23,7 @@ export interface NearbyShopsCommandOutput extends ShopListWithPaginationOutput,
23
23
  }
24
24
  declare const NearbyShopsCommand_base: {
25
25
  new (input: NearbyShopsCommandInput): import("@smithy/smithy-client").CommandImpl<NearbyShopsCommandInput, NearbyShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (...[input]: [] | [NearbyShopsCommandInput]): import("@smithy/smithy-client").CommandImpl<NearbyShopsCommandInput, NearbyShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: NearbyShopsCommandInput): import("@smithy/smithy-client").CommandImpl<NearbyShopsCommandInput, NearbyShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
@@ -35,10 +35,11 @@ declare const NearbyShopsCommand_base: {
35
35
  * // const { AppAPIClient, NearbyShopsCommand } = require("@sparkrewards/sra-client"); // CommonJS import
36
36
  * const client = new AppAPIClient(config);
37
37
  * const input = { // ShopListInput
38
- * lat: Number("double"),
39
- * lon: Number("double"),
38
+ * lat: Number("double"), // required
39
+ * lon: Number("double"), // required
40
40
  * page: Number("int"),
41
- * filters: "STRING_VALUE",
41
+ * open_now: true || false,
42
+ * categories: "STRING_VALUE",
42
43
  * };
43
44
  * const command = new NearbyShopsCommand(input);
44
45
  * const response = await client.send(command);
@@ -23,7 +23,7 @@ export interface NearbyShopsPublicCommandOutput extends ShopListWithPaginationOu
23
23
  }
24
24
  declare const NearbyShopsPublicCommand_base: {
25
25
  new (input: NearbyShopsPublicCommandInput): import("@smithy/smithy-client").CommandImpl<NearbyShopsPublicCommandInput, NearbyShopsPublicCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (...[input]: [] | [NearbyShopsPublicCommandInput]): import("@smithy/smithy-client").CommandImpl<NearbyShopsPublicCommandInput, NearbyShopsPublicCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: NearbyShopsPublicCommandInput): import("@smithy/smithy-client").CommandImpl<NearbyShopsPublicCommandInput, NearbyShopsPublicCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
@@ -35,10 +35,11 @@ declare const NearbyShopsPublicCommand_base: {
35
35
  * // const { AppAPIClient, NearbyShopsPublicCommand } = require("@sparkrewards/sra-client"); // CommonJS import
36
36
  * const client = new AppAPIClient(config);
37
37
  * const input = { // ShopListInput
38
- * lat: Number("double"),
39
- * lon: Number("double"),
38
+ * lat: Number("double"), // required
39
+ * lon: Number("double"), // required
40
40
  * page: Number("int"),
41
- * filters: "STRING_VALUE",
41
+ * open_now: true || false,
42
+ * categories: "STRING_VALUE",
42
43
  * };
43
44
  * const command = new NearbyShopsPublicCommand(input);
44
45
  * const response = await client.send(command);
@@ -23,7 +23,7 @@ export interface PopularShopsCommandOutput extends ShopListWithPaginationOutput,
23
23
  }
24
24
  declare const PopularShopsCommand_base: {
25
25
  new (input: PopularShopsCommandInput): import("@smithy/smithy-client").CommandImpl<PopularShopsCommandInput, PopularShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (...[input]: [] | [PopularShopsCommandInput]): import("@smithy/smithy-client").CommandImpl<PopularShopsCommandInput, PopularShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: PopularShopsCommandInput): import("@smithy/smithy-client").CommandImpl<PopularShopsCommandInput, PopularShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
@@ -35,10 +35,11 @@ declare const PopularShopsCommand_base: {
35
35
  * // const { AppAPIClient, PopularShopsCommand } = require("@sparkrewards/sra-client"); // CommonJS import
36
36
  * const client = new AppAPIClient(config);
37
37
  * const input = { // ShopListInput
38
- * lat: Number("double"),
39
- * lon: Number("double"),
38
+ * lat: Number("double"), // required
39
+ * lon: Number("double"), // required
40
40
  * page: Number("int"),
41
- * filters: "STRING_VALUE",
41
+ * open_now: true || false,
42
+ * categories: "STRING_VALUE",
42
43
  * };
43
44
  * const command = new PopularShopsCommand(input);
44
45
  * const response = await client.send(command);
@@ -23,7 +23,7 @@ export interface PopularShopsPublicCommandOutput extends ShopListWithPaginationO
23
23
  }
24
24
  declare const PopularShopsPublicCommand_base: {
25
25
  new (input: PopularShopsPublicCommandInput): import("@smithy/smithy-client").CommandImpl<PopularShopsPublicCommandInput, PopularShopsPublicCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (...[input]: [] | [PopularShopsPublicCommandInput]): import("@smithy/smithy-client").CommandImpl<PopularShopsPublicCommandInput, PopularShopsPublicCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: PopularShopsPublicCommandInput): import("@smithy/smithy-client").CommandImpl<PopularShopsPublicCommandInput, PopularShopsPublicCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
@@ -35,10 +35,11 @@ declare const PopularShopsPublicCommand_base: {
35
35
  * // const { AppAPIClient, PopularShopsPublicCommand } = require("@sparkrewards/sra-client"); // CommonJS import
36
36
  * const client = new AppAPIClient(config);
37
37
  * const input = { // ShopListInput
38
- * lat: Number("double"),
39
- * lon: Number("double"),
38
+ * lat: Number("double"), // required
39
+ * lon: Number("double"), // required
40
40
  * page: Number("int"),
41
- * filters: "STRING_VALUE",
41
+ * open_now: true || false,
42
+ * categories: "STRING_VALUE",
42
43
  * };
43
44
  * const command = new PopularShopsPublicCommand(input);
44
45
  * const response = await client.send(command);
@@ -23,7 +23,7 @@ export interface RadiusShopsCommandOutput extends RadiusShopsOutput, __MetadataB
23
23
  }
24
24
  declare const RadiusShopsCommand_base: {
25
25
  new (input: RadiusShopsCommandInput): import("@smithy/smithy-client").CommandImpl<RadiusShopsCommandInput, RadiusShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
- new (...[input]: [] | [RadiusShopsCommandInput]): import("@smithy/smithy-client").CommandImpl<RadiusShopsCommandInput, RadiusShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: RadiusShopsCommandInput): import("@smithy/smithy-client").CommandImpl<RadiusShopsCommandInput, RadiusShopsCommandOutput, AppAPIClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
@@ -35,10 +35,11 @@ declare const RadiusShopsCommand_base: {
35
35
  * // const { AppAPIClient, RadiusShopsCommand } = require("@sparkrewards/sra-client"); // CommonJS import
36
36
  * const client = new AppAPIClient(config);
37
37
  * const input = { // ShopListInput
38
- * lat: Number("double"),
39
- * lon: Number("double"),
38
+ * lat: Number("double"), // required
39
+ * lon: Number("double"), // required
40
40
  * page: Number("int"),
41
- * filters: "STRING_VALUE",
41
+ * open_now: true || false,
42
+ * categories: "STRING_VALUE",
42
43
  * };
43
44
  * const command = new RadiusShopsCommand(input);
44
45
  * const response = await client.send(command);
@@ -40,7 +40,7 @@ declare const SearchShopsPublicCommand_base: {
40
40
  * lat: Number("double"),
41
41
  * lon: Number("double"),
42
42
  * page: Number("int"),
43
- * filters: "STRING_VALUE",
43
+ * tags: "STRING_VALUE",
44
44
  * };
45
45
  * const command = new SearchShopsPublicCommand(input);
46
46
  * const response = await client.send(command);
@@ -147,14 +147,14 @@ export interface PlansOutput {
147
147
  pagination: PaginationInfo | undefined;
148
148
  }
149
149
  /**
150
- * Input for shop list operations that require location and pagination
151
150
  * @public
152
151
  */
153
152
  export interface ShopListInput {
154
- lat?: number;
155
- lon?: number;
153
+ lat: number | undefined;
154
+ lon: number | undefined;
156
155
  page?: number;
157
- filters?: string;
156
+ open_now?: boolean;
157
+ categories?: string;
158
158
  }
159
159
  /**
160
160
  * Location details for a shop
@@ -485,10 +485,9 @@ export interface SearchShopsInput {
485
485
  lat?: number;
486
486
  lon?: number;
487
487
  page?: number;
488
- filters?: string;
488
+ tags?: string;
489
489
  }
490
490
  /**
491
- * Note: FilterShopsInput is the same as ShopListInput - reuse ShopListInput
492
491
  * Input for search suggestions
493
492
  * @public
494
493
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sparkrewards/sra-client",
3
3
  "description": "@sparkrewards/sra-client client",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",