onboardconnect-agent 1.3.0 → 1.4.1
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/binary.d.ts +30 -0
- package/dist/binary.d.ts.map +1 -0
- package/dist/binary.js +139 -0
- package/dist/binary.js.map +1 -0
- package/dist/binary.test.d.ts +2 -0
- package/dist/binary.test.d.ts.map +1 -0
- package/dist/binary.test.js +163 -0
- package/dist/binary.test.js.map +1 -0
- package/dist/relay.d.ts +2 -0
- package/dist/relay.d.ts.map +1 -1
- package/dist/relay.js +88 -4
- package/dist/relay.js.map +1 -1
- package/dist/sis/ethos.test.d.ts +2 -0
- package/dist/sis/ethos.test.d.ts.map +1 -0
- package/dist/sis/ethos.test.js +266 -0
- package/dist/sis/ethos.test.js.map +1 -0
- package/dist/sis/peoplesoft.test.d.ts +2 -0
- package/dist/sis/peoplesoft.test.d.ts.map +1 -0
- package/dist/sis/peoplesoft.test.js +266 -0
- package/dist/sis/peoplesoft.test.js.map +1 -0
- package/dist/sis/workday.test.d.ts +2 -0
- package/dist/sis/workday.test.d.ts.map +1 -0
- package/dist/sis/workday.test.js +369 -0
- package/dist/sis/workday.test.js.map +1 -0
- package/dist/sis.d.ts.map +1 -1
- package/dist/sis.js +22 -0
- package/dist/sis.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +4 -1
- package/dist/store.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ethos.test.d.ts","sourceRoot":"","sources":["../../src/sis/ethos.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { describe, it, expect, beforeAll, afterEach, afterAll } from "vitest";
|
|
2
|
+
import { createServer } from "http";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
import { tmpdir } from "os";
|
|
5
|
+
// Redirect the agent logger to a writable temp dir BEFORE importing ethos.js
|
|
6
|
+
// (which transitively constructs the winston file logger). Without this the file
|
|
7
|
+
// transport tries to open C:\ProgramData\OnboardConnect\logs and throws EPERM in
|
|
8
|
+
// an unelevated test runner. Mirrors binary.test.ts.
|
|
9
|
+
process.env["OC_LOG_DIR"] = join(tmpdir(), "oc-agent-test-logs");
|
|
10
|
+
let ocEthosCall;
|
|
11
|
+
beforeAll(async () => {
|
|
12
|
+
({ ocEthosCall } = await import("./ethos.js"));
|
|
13
|
+
});
|
|
14
|
+
let openServers = [];
|
|
15
|
+
// Spin up a throwaway local HTTP server. Every request is buffered and recorded
|
|
16
|
+
// into `recorded` before the handler runs, so tests can assert on method/path/
|
|
17
|
+
// headers/body after the call resolves.
|
|
18
|
+
function ocStartServer(handler) {
|
|
19
|
+
const recorded = [];
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
const server = createServer((req, res) => {
|
|
22
|
+
const chunks = [];
|
|
23
|
+
req.on("data", (c) => chunks.push(c));
|
|
24
|
+
req.on("end", () => {
|
|
25
|
+
const rec = {
|
|
26
|
+
method: req.method ?? "",
|
|
27
|
+
url: req.url ?? "",
|
|
28
|
+
headers: req.headers,
|
|
29
|
+
body: Buffer.concat(chunks).toString("utf8"),
|
|
30
|
+
};
|
|
31
|
+
recorded.push(rec);
|
|
32
|
+
handler(req, res, rec);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
openServers.push(server);
|
|
36
|
+
server.listen(0, "127.0.0.1", () => {
|
|
37
|
+
const { port } = server.address();
|
|
38
|
+
resolve({ url: `http://127.0.0.1:${port}`, recorded });
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// Await each server's close so no listener handle leaks past the test file — a
|
|
43
|
+
// dangling handle makes the Vitest worker report a teardown error (see the note
|
|
44
|
+
// in binary.test.ts).
|
|
45
|
+
async function ocCloseServers() {
|
|
46
|
+
await Promise.all(openServers.map((s) => new Promise((resolve) => s.close(() => resolve()))));
|
|
47
|
+
openServers = [];
|
|
48
|
+
}
|
|
49
|
+
afterEach(ocCloseServers);
|
|
50
|
+
afterAll(ocCloseServers);
|
|
51
|
+
const OC_ETHOS_MEDIA_TYPE = "application/vnd.hedtech.integration.v12+json";
|
|
52
|
+
let profileSeq = 0;
|
|
53
|
+
function ocEthosProfile(baseUrl, over = {}) {
|
|
54
|
+
// Unique id per profile so the process-lifetime token cache never bleeds
|
|
55
|
+
// between tests (caching is only asserted where we deliberately reuse one id).
|
|
56
|
+
return {
|
|
57
|
+
id: `ethos-${++profileSeq}`,
|
|
58
|
+
vendor: "ethos",
|
|
59
|
+
baseUrl,
|
|
60
|
+
authType: "api_key",
|
|
61
|
+
apiKey: "secret-api-key",
|
|
62
|
+
...over,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function payload(over = {}) {
|
|
66
|
+
return {
|
|
67
|
+
profileId: "ethos-x",
|
|
68
|
+
vendor: "ethos",
|
|
69
|
+
operation: "test",
|
|
70
|
+
resource: "persons",
|
|
71
|
+
...over,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
describe("ocEthosCall — test operation", () => {
|
|
75
|
+
it("exchanges the API key for a JWT at /auth then resolves", async () => {
|
|
76
|
+
const { url, recorded } = await ocStartServer((_req, res, rec) => {
|
|
77
|
+
if (rec.url === "/auth" && rec.method === "POST") {
|
|
78
|
+
res.writeHead(200, { "Content-Type": "text/plain" });
|
|
79
|
+
res.end("jwt-token-abc");
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
res.writeHead(404);
|
|
83
|
+
res.end();
|
|
84
|
+
});
|
|
85
|
+
const profile = ocEthosProfile(url);
|
|
86
|
+
const result = await ocEthosCall({ payload: payload({ profileId: profile.id }), profile });
|
|
87
|
+
expect(result.raw).toEqual({ ok: true, vendor: "ethos", resource: "persons" });
|
|
88
|
+
// Auth hit /auth with the API key as a Bearer header.
|
|
89
|
+
const auth = recorded.find((r) => r.url === "/auth");
|
|
90
|
+
expect(auth).toBeDefined();
|
|
91
|
+
expect(auth.method).toBe("POST");
|
|
92
|
+
expect(auth.headers["authorization"]).toBe("Bearer secret-api-key");
|
|
93
|
+
});
|
|
94
|
+
it("caches the JWT — a second call with the same profile reuses it (one /auth hit)", async () => {
|
|
95
|
+
const { url, recorded } = await ocStartServer((_req, res, rec) => {
|
|
96
|
+
if (rec.url === "/auth") {
|
|
97
|
+
res.writeHead(200, { "Content-Type": "text/plain" });
|
|
98
|
+
res.end("jwt-cached");
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
102
|
+
res.end("[]");
|
|
103
|
+
});
|
|
104
|
+
// Same profile object/id reused across both calls.
|
|
105
|
+
const profile = ocEthosProfile(url);
|
|
106
|
+
await ocEthosCall({ payload: payload({ profileId: profile.id }), profile });
|
|
107
|
+
await ocEthosCall({ payload: payload({ profileId: profile.id, operation: "read" }), profile });
|
|
108
|
+
const authHits = recorded.filter((r) => r.url === "/auth");
|
|
109
|
+
expect(authHits).toHaveLength(1);
|
|
110
|
+
});
|
|
111
|
+
it("throws including the status when the token exchange fails", async () => {
|
|
112
|
+
const { url } = await ocStartServer((_req, res) => {
|
|
113
|
+
res.writeHead(401);
|
|
114
|
+
res.end("unauthorized");
|
|
115
|
+
});
|
|
116
|
+
const profile = ocEthosProfile(url);
|
|
117
|
+
await expect(ocEthosCall({ payload: payload({ profileId: profile.id }), profile })).rejects.toThrow(/Ethos auth failed \(401\)/);
|
|
118
|
+
});
|
|
119
|
+
it("throws when the profile has no API key", async () => {
|
|
120
|
+
const profile = ocEthosProfile("http://127.0.0.1:1", { apiKey: "" });
|
|
121
|
+
await expect(ocEthosCall({ payload: payload({ profileId: profile.id }), profile })).rejects.toThrow(/no API key/i);
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
describe("ocEthosCall — upsert", () => {
|
|
125
|
+
it("POSTs to create when no match key resolves a GUID and surfaces the returned id", async () => {
|
|
126
|
+
const { url, recorded } = await ocStartServer((_req, res, rec) => {
|
|
127
|
+
if (rec.url === "/auth") {
|
|
128
|
+
res.writeHead(200);
|
|
129
|
+
res.end("jwt-create");
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (rec.method === "POST" && rec.url === "/api/persons") {
|
|
133
|
+
res.writeHead(201, { "Content-Type": "application/json" });
|
|
134
|
+
res.end(JSON.stringify({ id: "new-guid-1" }));
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
res.writeHead(404);
|
|
138
|
+
res.end();
|
|
139
|
+
});
|
|
140
|
+
const profile = ocEthosProfile(url);
|
|
141
|
+
const result = await ocEthosCall({
|
|
142
|
+
payload: payload({
|
|
143
|
+
profileId: profile.id,
|
|
144
|
+
operation: "upsert",
|
|
145
|
+
resource: "persons",
|
|
146
|
+
record: { lastName: "Doe" },
|
|
147
|
+
}),
|
|
148
|
+
profile,
|
|
149
|
+
});
|
|
150
|
+
expect(result.sisId).toBe("new-guid-1");
|
|
151
|
+
const post = recorded.find((r) => r.method === "POST" && r.url === "/api/persons");
|
|
152
|
+
expect(post).toBeDefined();
|
|
153
|
+
expect(post.headers["accept"]).toBe(OC_ETHOS_MEDIA_TYPE);
|
|
154
|
+
expect(post.headers["content-type"]).toBe(OC_ETHOS_MEDIA_TYPE);
|
|
155
|
+
expect(JSON.parse(post.body)).toEqual({ lastName: "Doe" });
|
|
156
|
+
});
|
|
157
|
+
it("resolves an existing GUID via criteria then PUTs to the keyed URL", async () => {
|
|
158
|
+
const { url, recorded } = await ocStartServer((_req, res, rec) => {
|
|
159
|
+
if (rec.url === "/auth") {
|
|
160
|
+
res.writeHead(200);
|
|
161
|
+
res.end("jwt-update");
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
// Criteria resolve GET returns a matching GUID.
|
|
165
|
+
if (rec.method === "GET" && rec.url.startsWith("/api/persons?criteria=")) {
|
|
166
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
167
|
+
res.end(JSON.stringify([{ id: "existing-guid-9" }]));
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (rec.method === "PUT" && rec.url === "/api/persons/existing-guid-9") {
|
|
171
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
172
|
+
res.end(JSON.stringify({ id: "existing-guid-9" }));
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
res.writeHead(404);
|
|
176
|
+
res.end();
|
|
177
|
+
});
|
|
178
|
+
const profile = ocEthosProfile(url);
|
|
179
|
+
const result = await ocEthosCall({
|
|
180
|
+
payload: payload({
|
|
181
|
+
profileId: profile.id,
|
|
182
|
+
operation: "upsert",
|
|
183
|
+
resource: "persons",
|
|
184
|
+
record: { lastName: "Smith" },
|
|
185
|
+
match: { bannerId: "B123" },
|
|
186
|
+
}),
|
|
187
|
+
profile,
|
|
188
|
+
});
|
|
189
|
+
expect(result.sisId).toBe("existing-guid-9");
|
|
190
|
+
const put = recorded.find((r) => r.method === "PUT");
|
|
191
|
+
expect(put).toBeDefined();
|
|
192
|
+
expect(put.url).toBe("/api/persons/existing-guid-9");
|
|
193
|
+
// On update the id is injected into the body to match the URL GUID.
|
|
194
|
+
expect(JSON.parse(put.body)).toEqual({ lastName: "Smith", id: "existing-guid-9" });
|
|
195
|
+
});
|
|
196
|
+
it("throws including the status when the write returns non-2xx", async () => {
|
|
197
|
+
const { url } = await ocStartServer((_req, res, rec) => {
|
|
198
|
+
if (rec.url === "/auth") {
|
|
199
|
+
res.writeHead(200);
|
|
200
|
+
res.end("jwt-err");
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
res.writeHead(500);
|
|
204
|
+
res.end("boom");
|
|
205
|
+
});
|
|
206
|
+
const profile = ocEthosProfile(url);
|
|
207
|
+
await expect(ocEthosCall({
|
|
208
|
+
payload: payload({
|
|
209
|
+
profileId: profile.id,
|
|
210
|
+
operation: "upsert",
|
|
211
|
+
resource: "persons",
|
|
212
|
+
record: { lastName: "X" },
|
|
213
|
+
}),
|
|
214
|
+
profile,
|
|
215
|
+
})).rejects.toThrow(/Ethos POST persons failed \(500\)/);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
describe("ocEthosCall — read", () => {
|
|
219
|
+
it("returns flattened rows and sends the versioned Accept header", async () => {
|
|
220
|
+
const { url, recorded } = await ocStartServer((_req, res, rec) => {
|
|
221
|
+
if (rec.url === "/auth") {
|
|
222
|
+
res.writeHead(200);
|
|
223
|
+
res.end("jwt-read");
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (rec.method === "GET" && rec.url.startsWith("/api/persons")) {
|
|
227
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
228
|
+
res.end(JSON.stringify([
|
|
229
|
+
{ id: "g1", names: { first: "Ann" }, age: 21 },
|
|
230
|
+
{ id: "g2", age: null },
|
|
231
|
+
]));
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
res.writeHead(404);
|
|
235
|
+
res.end();
|
|
236
|
+
});
|
|
237
|
+
const profile = ocEthosProfile(url);
|
|
238
|
+
const result = await ocEthosCall({
|
|
239
|
+
payload: payload({ profileId: profile.id, operation: "read", resource: "persons" }),
|
|
240
|
+
profile,
|
|
241
|
+
});
|
|
242
|
+
expect(result.rows).toHaveLength(2);
|
|
243
|
+
// Objects are JSON-stringified, scalars stringified, nulls dropped.
|
|
244
|
+
expect(result.rows[0]).toEqual({ id: "g1", names: '{"first":"Ann"}', age: "21" });
|
|
245
|
+
expect(result.rows[1]).toEqual({ id: "g2" });
|
|
246
|
+
const get = recorded.find((r) => r.method === "GET");
|
|
247
|
+
expect(get.headers["accept"]).toBe(OC_ETHOS_MEDIA_TYPE);
|
|
248
|
+
});
|
|
249
|
+
it("throws including the status when read returns non-2xx", async () => {
|
|
250
|
+
const { url } = await ocStartServer((_req, res, rec) => {
|
|
251
|
+
if (rec.url === "/auth") {
|
|
252
|
+
res.writeHead(200);
|
|
253
|
+
res.end("jwt-read-err");
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
res.writeHead(403);
|
|
257
|
+
res.end("forbidden");
|
|
258
|
+
});
|
|
259
|
+
const profile = ocEthosProfile(url);
|
|
260
|
+
await expect(ocEthosCall({
|
|
261
|
+
payload: payload({ profileId: profile.id, operation: "read", resource: "persons" }),
|
|
262
|
+
profile,
|
|
263
|
+
})).rejects.toThrow(/Ethos read failed \(403\)/);
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
//# sourceMappingURL=ethos.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ethos.test.js","sourceRoot":"","sources":["../../src/sis/ethos.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9E,OAAO,EAAE,YAAY,EAA0D,MAAM,MAAM,CAAC;AAE5F,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAE5B,6EAA6E;AAC7E,iFAAiF;AACjF,iFAAiF;AACjF,qDAAqD;AACrD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,oBAAoB,CAAC,CAAC;AAEjE,IAAI,WAAoD,CAAC;AACzD,SAAS,CAAC,KAAK,IAAI,EAAE;IACnB,CAAC,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC,CAAC;AAeH,IAAI,WAAW,GAAa,EAAE,CAAC;AAE/B,gFAAgF;AAChF,+EAA+E;AAC/E,wCAAwC;AACxC,SAAS,aAAa,CAAC,OAAgB;IACrC,MAAM,QAAQ,GAAe,EAAE,CAAC;IAChC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,GAAG,EAAE,G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AC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;YACnF,OAAO;SACR,CAAC,CACH,CAAC,OAAO,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peoplesoft.test.d.ts","sourceRoot":"","sources":["../../src/sis/peoplesoft.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { describe, it, expect, beforeAll, afterEach, afterAll } from "vitest";
|
|
2
|
+
import { createServer } from "http";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
import { tmpdir } from "os";
|
|
5
|
+
// Redirect the agent logger to a writable temp dir BEFORE importing peoplesoft.js
|
|
6
|
+
// (transitively constructs the winston file logger). Mirrors binary.test.ts.
|
|
7
|
+
process.env["OC_LOG_DIR"] = join(tmpdir(), "oc-agent-test-logs");
|
|
8
|
+
let ocPeoplesoftCall;
|
|
9
|
+
beforeAll(async () => {
|
|
10
|
+
({ ocPeoplesoftCall } = await import("./peoplesoft.js"));
|
|
11
|
+
});
|
|
12
|
+
let openServers = [];
|
|
13
|
+
function ocStartServer(handler) {
|
|
14
|
+
const recorded = [];
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
const server = createServer((req, res) => {
|
|
17
|
+
const chunks = [];
|
|
18
|
+
req.on("data", (c) => chunks.push(c));
|
|
19
|
+
req.on("end", () => {
|
|
20
|
+
const rec = {
|
|
21
|
+
method: req.method ?? "",
|
|
22
|
+
url: req.url ?? "",
|
|
23
|
+
headers: req.headers,
|
|
24
|
+
body: Buffer.concat(chunks).toString("utf8"),
|
|
25
|
+
};
|
|
26
|
+
recorded.push(rec);
|
|
27
|
+
handler(req, res, rec);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
openServers.push(server);
|
|
31
|
+
server.listen(0, "127.0.0.1", () => {
|
|
32
|
+
const { port } = server.address();
|
|
33
|
+
resolve({ url: `http://127.0.0.1:${port}`, recorded });
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// Await closes so no listener handle leaks (binary.test.ts teardown note).
|
|
38
|
+
async function ocCloseServers() {
|
|
39
|
+
await Promise.all(openServers.map((s) => new Promise((resolve) => s.close(() => resolve()))));
|
|
40
|
+
openServers = [];
|
|
41
|
+
}
|
|
42
|
+
afterEach(ocCloseServers);
|
|
43
|
+
afterAll(ocCloseServers);
|
|
44
|
+
let profileSeq = 0;
|
|
45
|
+
function ocPsProfile(baseUrl, over = {}) {
|
|
46
|
+
return {
|
|
47
|
+
id: `ps-${++profileSeq}`,
|
|
48
|
+
vendor: "peoplesoft",
|
|
49
|
+
baseUrl,
|
|
50
|
+
authType: "basic",
|
|
51
|
+
username: "isuser",
|
|
52
|
+
password: "isupass",
|
|
53
|
+
...over,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function payload(over = {}) {
|
|
57
|
+
return {
|
|
58
|
+
profileId: "ps-x",
|
|
59
|
+
vendor: "peoplesoft",
|
|
60
|
+
operation: "test",
|
|
61
|
+
resource: "OC_PING",
|
|
62
|
+
...over,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Expected Basic header for the default credentials.
|
|
66
|
+
const BASIC = "Basic " + Buffer.from("isuser:isupass").toString("base64");
|
|
67
|
+
describe("ocPeoplesoftCall — test operation", () => {
|
|
68
|
+
it("probes the resource path with a Basic-auth header and resolves", async () => {
|
|
69
|
+
const { url, recorded } = await ocStartServer((_req, res) => {
|
|
70
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
71
|
+
res.end(JSON.stringify({ ok: true }));
|
|
72
|
+
});
|
|
73
|
+
const profile = ocPsProfile(url);
|
|
74
|
+
const result = await ocPeoplesoftCall({
|
|
75
|
+
payload: payload({ profileId: profile.id, resource: "OC_PING" }),
|
|
76
|
+
profile,
|
|
77
|
+
});
|
|
78
|
+
expect(result.raw).toEqual({ ok: true, vendor: "peoplesoft", resource: "OC_PING" });
|
|
79
|
+
const probe = recorded[0];
|
|
80
|
+
expect(probe.method).toBe("GET");
|
|
81
|
+
expect(probe.url).toBe("/OC_PING");
|
|
82
|
+
expect(probe.headers["authorization"]).toBe(BASIC);
|
|
83
|
+
});
|
|
84
|
+
it("sends a Bearer header when authType is bearer", async () => {
|
|
85
|
+
const { url, recorded } = await ocStartServer((_req, res) => {
|
|
86
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
87
|
+
res.end("{}");
|
|
88
|
+
});
|
|
89
|
+
const profile = ocPsProfile(url, { authType: "bearer", bearerToken: "tok-123" });
|
|
90
|
+
await ocPeoplesoftCall({
|
|
91
|
+
payload: payload({ profileId: profile.id, resource: "OC_PING" }),
|
|
92
|
+
profile,
|
|
93
|
+
});
|
|
94
|
+
expect(recorded[0].headers["authorization"]).toBe("Bearer tok-123");
|
|
95
|
+
});
|
|
96
|
+
it("throws including the status when the probe fails", async () => {
|
|
97
|
+
const { url } = await ocStartServer((_req, res) => {
|
|
98
|
+
res.writeHead(401);
|
|
99
|
+
res.end("denied");
|
|
100
|
+
});
|
|
101
|
+
const profile = ocPsProfile(url);
|
|
102
|
+
await expect(ocPeoplesoftCall({
|
|
103
|
+
payload: payload({ profileId: profile.id, resource: "OC_PING" }),
|
|
104
|
+
profile,
|
|
105
|
+
})).rejects.toThrow(/PeopleSoft test probe failed \(401\)/);
|
|
106
|
+
});
|
|
107
|
+
it("throws when basic auth profile is missing username/password", async () => {
|
|
108
|
+
const profile = ocPsProfile("http://127.0.0.1:1", { username: "" });
|
|
109
|
+
await expect(ocPeoplesoftCall({
|
|
110
|
+
payload: payload({ profileId: profile.id, resource: "OC_PING" }),
|
|
111
|
+
profile,
|
|
112
|
+
})).rejects.toThrow(/missing username\/password/i);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
describe("ocPeoplesoftCall — upsert", () => {
|
|
116
|
+
it("POSTs to the service-op path when no match key is present (create)", async () => {
|
|
117
|
+
const { url, recorded } = await ocStartServer((_req, res) => {
|
|
118
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
119
|
+
res.end(JSON.stringify({ EMPLID: "E999" }));
|
|
120
|
+
});
|
|
121
|
+
const profile = ocPsProfile(url);
|
|
122
|
+
const result = await ocPeoplesoftCall({
|
|
123
|
+
payload: payload({
|
|
124
|
+
profileId: profile.id,
|
|
125
|
+
operation: "upsert",
|
|
126
|
+
resource: "OC_CONSTITUENT",
|
|
127
|
+
record: { firstName: "Ann" },
|
|
128
|
+
}),
|
|
129
|
+
profile,
|
|
130
|
+
});
|
|
131
|
+
// Service op echoes EMPLID → that surfaces as sisId.
|
|
132
|
+
expect(result.sisId).toBe("E999");
|
|
133
|
+
const post = recorded[0];
|
|
134
|
+
expect(post.method).toBe("POST");
|
|
135
|
+
expect(post.url).toBe("/OC_CONSTITUENT");
|
|
136
|
+
expect(post.headers["content-type"]).toMatch(/application\/json/);
|
|
137
|
+
expect(JSON.parse(post.body)).toEqual({ firstName: "Ann" });
|
|
138
|
+
});
|
|
139
|
+
it("PUTs to the keyed instance path when a match key is present (update)", async () => {
|
|
140
|
+
const { url, recorded } = await ocStartServer((_req, res) => {
|
|
141
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
142
|
+
res.end("{}");
|
|
143
|
+
});
|
|
144
|
+
const profile = ocPsProfile(url);
|
|
145
|
+
const result = await ocPeoplesoftCall({
|
|
146
|
+
payload: payload({
|
|
147
|
+
profileId: profile.id,
|
|
148
|
+
operation: "upsert",
|
|
149
|
+
resource: "OC_CONSTITUENT",
|
|
150
|
+
record: { firstName: "Bo" },
|
|
151
|
+
match: { EMPLID: "E123" },
|
|
152
|
+
}),
|
|
153
|
+
profile,
|
|
154
|
+
});
|
|
155
|
+
const put = recorded[0];
|
|
156
|
+
expect(put.method).toBe("PUT");
|
|
157
|
+
expect(put.url).toBe("/OC_CONSTITUENT/E123");
|
|
158
|
+
// No echoed id → falls back to the supplied natural key.
|
|
159
|
+
expect(result.sisId).toBe("E123");
|
|
160
|
+
});
|
|
161
|
+
it("throws including the status when the write returns non-2xx", async () => {
|
|
162
|
+
const { url } = await ocStartServer((_req, res) => {
|
|
163
|
+
res.writeHead(500);
|
|
164
|
+
res.end("server error");
|
|
165
|
+
});
|
|
166
|
+
const profile = ocPsProfile(url);
|
|
167
|
+
await expect(ocPeoplesoftCall({
|
|
168
|
+
payload: payload({
|
|
169
|
+
profileId: profile.id,
|
|
170
|
+
operation: "upsert",
|
|
171
|
+
resource: "OC_CONSTITUENT",
|
|
172
|
+
record: { firstName: "X" },
|
|
173
|
+
}),
|
|
174
|
+
profile,
|
|
175
|
+
})).rejects.toThrow(/PeopleSoft POST OC_CONSTITUENT failed \(500\)/);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
describe("ocPeoplesoftCall — read", () => {
|
|
179
|
+
it("normalises a wrapped { data: [...] } collection into flattened rows", async () => {
|
|
180
|
+
const { url, recorded } = await ocStartServer((_req, res) => {
|
|
181
|
+
res.writeHead(200, { "Content-Type": "application/json" });
|
|
182
|
+
res.end(JSON.stringify({
|
|
183
|
+
data: [
|
|
184
|
+
{ EMPLID: "E1", name: { last: "A" } },
|
|
185
|
+
{ EMPLID: "E2", flag: null },
|
|
186
|
+
],
|
|
187
|
+
}));
|
|
188
|
+
});
|
|
189
|
+
const profile = ocPsProfile(url);
|
|
190
|
+
const result = await ocPeoplesoftCall({
|
|
191
|
+
payload: payload({
|
|
192
|
+
profileId: profile.id,
|
|
193
|
+
operation: "read",
|
|
194
|
+
resource: "OC_GET",
|
|
195
|
+
match: { EMPLID: "E1" },
|
|
196
|
+
}),
|
|
197
|
+
profile,
|
|
198
|
+
});
|
|
199
|
+
expect(result.rows).toHaveLength(2);
|
|
200
|
+
expect(result.rows[0]).toEqual({ EMPLID: "E1", name: '{"last":"A"}' });
|
|
201
|
+
expect(result.rows[1]).toEqual({ EMPLID: "E2" });
|
|
202
|
+
// Match keys ride both the path segment and the query string.
|
|
203
|
+
const get = recorded[0];
|
|
204
|
+
expect(get.url).toBe("/OC_GET/E1?EMPLID=E1");
|
|
205
|
+
});
|
|
206
|
+
it("throws including the status when read returns non-2xx", async () => {
|
|
207
|
+
const { url } = await ocStartServer((_req, res) => {
|
|
208
|
+
res.writeHead(404);
|
|
209
|
+
res.end("not found");
|
|
210
|
+
});
|
|
211
|
+
const profile = ocPsProfile(url);
|
|
212
|
+
await expect(ocPeoplesoftCall({
|
|
213
|
+
payload: payload({ profileId: profile.id, operation: "read", resource: "OC_GET" }),
|
|
214
|
+
profile,
|
|
215
|
+
})).rejects.toThrow(/PeopleSoft read failed \(404\)/);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
describe("ocPeoplesoftCall — SOAP variant", () => {
|
|
219
|
+
it("POSTs a WS-Security SOAP envelope to the listener and surfaces the match key", async () => {
|
|
220
|
+
const { url, recorded } = await ocStartServer((_req, res) => {
|
|
221
|
+
res.writeHead(200, { "Content-Type": "text/xml" });
|
|
222
|
+
res.end("<soapenv:Envelope><soapenv:Body><Result>ok</Result></soapenv:Body></soapenv:Envelope>");
|
|
223
|
+
});
|
|
224
|
+
const profile = ocPsProfile(url, { authType: "soap" });
|
|
225
|
+
const result = await ocPeoplesoftCall({
|
|
226
|
+
payload: payload({
|
|
227
|
+
profileId: profile.id,
|
|
228
|
+
operation: "upsert",
|
|
229
|
+
resource: "OC_PostConstituent",
|
|
230
|
+
record: { firstName: "Ann" },
|
|
231
|
+
match: { EMPLID: "E777" },
|
|
232
|
+
}),
|
|
233
|
+
profile,
|
|
234
|
+
});
|
|
235
|
+
const soap = recorded[0];
|
|
236
|
+
expect(soap.method).toBe("POST");
|
|
237
|
+
expect(soap.headers["content-type"]).toMatch(/text\/xml/);
|
|
238
|
+
expect(soap.headers["soapaction"]).toBe("OC_PostConstituent");
|
|
239
|
+
// Envelope carries the WS-Security UsernameToken and the data fields.
|
|
240
|
+
expect(soap.body).toContain("<soapenv:Envelope");
|
|
241
|
+
expect(soap.body).toContain("<wsse:Username>isuser</wsse:Username>");
|
|
242
|
+
expect(soap.body).toContain("<wsse:Password>isupass</wsse:Password>");
|
|
243
|
+
expect(soap.body).toContain("<OC_PostConstituent>");
|
|
244
|
+
expect(soap.body).toContain("<firstName>Ann</firstName>");
|
|
245
|
+
expect(soap.body).toContain("<EMPLID>E777</EMPLID>");
|
|
246
|
+
// First match value surfaces as the sisId.
|
|
247
|
+
expect(result.sisId).toBe("E777");
|
|
248
|
+
});
|
|
249
|
+
it("throws when the SOAP body contains a Fault", async () => {
|
|
250
|
+
const { url } = await ocStartServer((_req, res) => {
|
|
251
|
+
res.writeHead(200, { "Content-Type": "text/xml" });
|
|
252
|
+
res.end("<soapenv:Envelope><soapenv:Body><soapenv:Fault><faultstring>nope</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>");
|
|
253
|
+
});
|
|
254
|
+
const profile = ocPsProfile(url, { authType: "soap" });
|
|
255
|
+
await expect(ocPeoplesoftCall({
|
|
256
|
+
payload: payload({
|
|
257
|
+
profileId: profile.id,
|
|
258
|
+
operation: "upsert",
|
|
259
|
+
resource: "OC_PostConstituent",
|
|
260
|
+
record: { firstName: "X" },
|
|
261
|
+
}),
|
|
262
|
+
profile,
|
|
263
|
+
})).rejects.toThrow(/PeopleSoft SOAP OC_PostConstituent failed/);
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
//# sourceMappingURL=peoplesoft.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peoplesoft.test.js","sourceRoot":"","sources":["../../src/sis/peoplesoft.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAC9E,OAAO,EAAE,YAAY,EAA0D,MAAM,MAAM,CAAC;AAE5F,OAAO,EAAE,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