@compassdigital/sdk.typescript 4.598.0 → 4.600.0
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/lib/index.d.ts +318 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +385 -0
- package/lib/index.js.map +1 -1
- package/lib/interface/loyalty.d.ts +853 -0
- package/lib/interface/loyalty.d.ts.map +1 -0
- package/lib/interface/loyalty.js +5 -0
- package/lib/interface/loyalty.js.map +1 -0
- package/manifest.json +7 -0
- package/package.json +1 -1
- package/src/index.ts +945 -0
- package/src/interface/loyalty.ts +1198 -0
- package/test/client.test.ts +23 -0
package/test/client.test.ts
CHANGED
|
@@ -84,6 +84,29 @@ describe('ServiceClient', () => {
|
|
|
84
84
|
});
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
+
test('loyalty client methods use path-style names', async () => {
|
|
88
|
+
const intercept = jest.fn(interceptor(200, { data: [] }));
|
|
89
|
+
const api = new ServiceClient({ stage: 'dev', intercept });
|
|
90
|
+
|
|
91
|
+
await api.get_loyalty_rewards({
|
|
92
|
+
query: {
|
|
93
|
+
realm: 'boost',
|
|
94
|
+
status: 'active',
|
|
95
|
+
},
|
|
96
|
+
} as any);
|
|
97
|
+
|
|
98
|
+
const req = intercept.mock.calls[0][0];
|
|
99
|
+
expect(req).toEqual({
|
|
100
|
+
route: '/loyalty/rewards',
|
|
101
|
+
service: 'loyalty',
|
|
102
|
+
url: 'https://dev.api.compassdigital.org/loyalty/rewards?realm=boost&status=active',
|
|
103
|
+
method: 'GET',
|
|
104
|
+
headers: {
|
|
105
|
+
'user-agent': 'CDL/ServiceClient',
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
87
110
|
test('user specified headers take priority', async () => {
|
|
88
111
|
const intercept = jest.fn(interceptor(200));
|
|
89
112
|
const api = new ServiceClient({
|