@fepro/workhub-app-sdk 0.1.1 → 0.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/AGENTS.md +122 -5
- package/CHANGELOG.md +52 -0
- package/README.md +92 -3
- package/dist/index.d.ts +196 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +280 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/src/index.ts +406 -17
package/dist/index.js
CHANGED
|
@@ -16,18 +16,36 @@
|
|
|
16
16
|
* await workhub.storage.set('lastView', { page: 7 });
|
|
17
17
|
* await workhub.notifications.toast('Saved');
|
|
18
18
|
* workhub.events.on('theme:change', applyTheme);
|
|
19
|
+
* workhub.events.on('app:customer.created', (e) => refresh());
|
|
20
|
+
* const { tokens } = await workhub.theme.current();
|
|
21
|
+
* const locale = await workhub.locale.current();
|
|
19
22
|
*
|
|
20
23
|
* Capability scopes (declared in workhub.json `scopes`) are enforced by
|
|
21
24
|
* the host bridge, not here — the SDK fires the request, the host either
|
|
22
25
|
* returns a result or rejects with `ERR_SCOPE_DENIED`.
|
|
23
26
|
*/
|
|
24
27
|
const RPC_TIMEOUT_MS = 10_000;
|
|
28
|
+
/** Typed error rethrown from RPC failures and backend.fetch() error envelopes.
|
|
29
|
+
* `code` matches the backend SDK's `AppError.code`, so apps can branch on
|
|
30
|
+
* string codes rather than http status. */
|
|
31
|
+
export class WorkhubError extends Error {
|
|
32
|
+
code;
|
|
33
|
+
status;
|
|
34
|
+
requestId;
|
|
35
|
+
details;
|
|
36
|
+
constructor(code, message, extras) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.name = 'WorkhubError';
|
|
39
|
+
this.code = code;
|
|
40
|
+
this.status = extras?.status;
|
|
41
|
+
this.requestId = extras?.requestId;
|
|
42
|
+
this.details = extras?.details;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
25
45
|
class HostChannel {
|
|
26
46
|
nextId = 1;
|
|
27
47
|
pending = new Map();
|
|
28
|
-
// Listeners: each event name maps to a Set of callbacks.
|
|
29
48
|
listeners = new Map();
|
|
30
|
-
// Lazy-init flag — we only attach the message listener on first use.
|
|
31
49
|
wired = false;
|
|
32
50
|
wire() {
|
|
33
51
|
if (this.wired)
|
|
@@ -48,12 +66,28 @@ class HostChannel {
|
|
|
48
66
|
if (!pending)
|
|
49
67
|
return;
|
|
50
68
|
this.pending.delete(data.id);
|
|
51
|
-
if (data.ok)
|
|
69
|
+
if (data.ok) {
|
|
52
70
|
pending.resolve(data.result);
|
|
53
|
-
|
|
54
|
-
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
pending.reject(new WorkhubError(data.error?.code ?? 'rpc_failed', data.error?.message ?? 'rpc failed'));
|
|
74
|
+
}
|
|
55
75
|
}
|
|
56
76
|
else if (data.__workhub === 'rpc-event') {
|
|
77
|
+
// Auto-navigate on host-driven route changes (deep-link, refresh
|
|
78
|
+
// restore, browser back/forward). Apps route via the URL hash, so
|
|
79
|
+
// setting location.hash drives their router with no app code change.
|
|
80
|
+
// Guarded to the differing case so it can't loop with the route
|
|
81
|
+
// reporter below.
|
|
82
|
+
if (data.name === 'route:change') {
|
|
83
|
+
const p = data.payload?.path;
|
|
84
|
+
if (typeof p === 'string') {
|
|
85
|
+
const target = p === '' ? '/' : (p.startsWith('/') ? p : `/${p}`);
|
|
86
|
+
if (window.location.hash.replace(/^#/, '') !== target) {
|
|
87
|
+
window.location.hash = target;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
57
91
|
const set = this.listeners.get(data.name);
|
|
58
92
|
if (!set)
|
|
59
93
|
return;
|
|
@@ -61,15 +95,28 @@ class HostChannel {
|
|
|
61
95
|
try {
|
|
62
96
|
cb(data.payload);
|
|
63
97
|
}
|
|
64
|
-
catch { /* swallow listener errors */ }
|
|
98
|
+
catch { /* swallow listener errors so one bad subscriber can't break the others */ }
|
|
65
99
|
}
|
|
66
100
|
}
|
|
67
101
|
});
|
|
102
|
+
// Mirror the app's route OUT to the host so it can reflect it in the browser
|
|
103
|
+
// URL — making full-page ("popped-out") apps deep-linkable and refresh-safe.
|
|
104
|
+
// Apps route via the URL hash; we report location.hash on every change + once
|
|
105
|
+
// now. The host decides whether to act on it (the full-page surface updates
|
|
106
|
+
// the address bar; the embedded portal view ignores it).
|
|
107
|
+
const reportRoute = () => {
|
|
108
|
+
if (window.parent === window)
|
|
109
|
+
return;
|
|
110
|
+
const path = window.location.hash.replace(/^#/, '') || '/';
|
|
111
|
+
window.parent.postMessage({ __workhub: 'route-report', path }, '*');
|
|
112
|
+
};
|
|
113
|
+
window.addEventListener('hashchange', reportRoute);
|
|
114
|
+
reportRoute();
|
|
68
115
|
}
|
|
69
116
|
call(verb, payload) {
|
|
70
117
|
this.wire();
|
|
71
118
|
if (typeof window === 'undefined' || window.parent === window) {
|
|
72
|
-
return Promise.reject(new
|
|
119
|
+
return Promise.reject(new WorkhubError('not_embedded', 'workhub SDK only works inside the portal iframe'));
|
|
73
120
|
}
|
|
74
121
|
const id = String(this.nextId++);
|
|
75
122
|
const msg = { __workhub: 'rpc-request', id, verb, payload };
|
|
@@ -77,7 +124,7 @@ class HostChannel {
|
|
|
77
124
|
return new Promise((resolve, reject) => {
|
|
78
125
|
const timeout = setTimeout(() => {
|
|
79
126
|
this.pending.delete(id);
|
|
80
|
-
reject(
|
|
127
|
+
reject(new WorkhubError('timeout', `rpc_timeout: ${verb}`));
|
|
81
128
|
}, RPC_TIMEOUT_MS);
|
|
82
129
|
this.pending.set(id, {
|
|
83
130
|
resolve: (v) => { clearTimeout(timeout); resolve(v); },
|
|
@@ -93,16 +140,153 @@ class HostChannel {
|
|
|
93
140
|
this.listeners.set(name, set);
|
|
94
141
|
}
|
|
95
142
|
set.add(cb);
|
|
96
|
-
|
|
143
|
+
// Tell the host bridge this iframe wants to receive `name`. The host
|
|
144
|
+
// tracks subscriptions per-iframe so it only forwards events the app
|
|
145
|
+
// is actually listening for, and so it knows which apps need server
|
|
146
|
+
// pushes for `app:*` events (the tenant-event bridge).
|
|
147
|
+
void this.call('events.subscribe', { name }).catch(() => undefined);
|
|
148
|
+
const setRef = set;
|
|
149
|
+
return () => {
|
|
150
|
+
setRef.delete(cb);
|
|
151
|
+
if (setRef.size === 0) {
|
|
152
|
+
this.listeners.delete(name);
|
|
153
|
+
void this.call('events.unsubscribe', { name }).catch(() => undefined);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
97
156
|
}
|
|
98
157
|
}
|
|
99
158
|
const channel = new HostChannel();
|
|
159
|
+
/** Tag set on the backend's error JSON payloads — the frontend looks for
|
|
160
|
+
* this so it can rethrow as `WorkhubError` instead of treating a 4xx body
|
|
161
|
+
* as a successful response. Must match `ERROR_ENVELOPE_TAG` in the
|
|
162
|
+
* backend SDK. */
|
|
163
|
+
const ERROR_ENVELOPE_TAG = '__workhub_error';
|
|
164
|
+
function isBackendErrorEnvelope(value) {
|
|
165
|
+
return (typeof value === 'object'
|
|
166
|
+
&& value !== null
|
|
167
|
+
&& value[ERROR_ENVELOPE_TAG] === true);
|
|
168
|
+
}
|
|
100
169
|
// ─── Surface ────────────────────────────────────────────────────────────────
|
|
170
|
+
// Per-session identity cache. Identity is immutable for the lifetime of an
|
|
171
|
+
// iframe (the bundle token is minted once at boot; user / tenant / installation
|
|
172
|
+
// cannot change without a reload), so the first successful response is the
|
|
173
|
+
// only one we'll ever need. Resolves BMS ERP request #31 — the second
|
|
174
|
+
// identity.current() call within a session was racing the host RPC bridge
|
|
175
|
+
// and surfacing `rpc_timeout: identity.current` even when the first call had
|
|
176
|
+
// just succeeded.
|
|
177
|
+
let identityCache = null;
|
|
178
|
+
let identityPending = null;
|
|
101
179
|
export const workhub = {
|
|
102
180
|
/** Identity — read-only user / tenant / installation context. */
|
|
103
181
|
identity: {
|
|
104
182
|
current() {
|
|
105
|
-
|
|
183
|
+
// Fast path — cached value from an earlier successful resolution.
|
|
184
|
+
if (identityCache)
|
|
185
|
+
return Promise.resolve(identityCache);
|
|
186
|
+
// In-flight de-duplication — concurrent callers during cold start
|
|
187
|
+
// share a single RPC instead of issuing one each. Without this,
|
|
188
|
+
// `Promise.all([identity.current(), identity.current()])` would
|
|
189
|
+
// re-race the host bridge.
|
|
190
|
+
if (identityPending)
|
|
191
|
+
return identityPending;
|
|
192
|
+
identityPending = channel.call('identity.current', {})
|
|
193
|
+
.then((value) => {
|
|
194
|
+
identityCache = value;
|
|
195
|
+
identityPending = null;
|
|
196
|
+
return value;
|
|
197
|
+
})
|
|
198
|
+
.catch((err) => {
|
|
199
|
+
// On failure clear the pending lock so a retry actually retries
|
|
200
|
+
// (callers usually catch + retry on UI events).
|
|
201
|
+
identityPending = null;
|
|
202
|
+
throw err;
|
|
203
|
+
});
|
|
204
|
+
return identityPending;
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
/** Session. `logout()` ends the WorkHub session by navigating the HOST (top)
|
|
208
|
+
* window to the platform sign-out — the only exit for full-page / app-only
|
|
209
|
+
* users who have no portal chrome. Fire-and-forget: the page unloads, so
|
|
210
|
+
* there's no result to await. */
|
|
211
|
+
auth: {
|
|
212
|
+
logout() {
|
|
213
|
+
void channel.call('auth.logout', {}).catch(() => { });
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
/** Locale propagation — read the portal's active locale so the app can
|
|
217
|
+
* match it. Apps SHOULD also subscribe to `locale:change` to update
|
|
218
|
+
* live when the user switches languages. */
|
|
219
|
+
locale: {
|
|
220
|
+
current() {
|
|
221
|
+
return channel.call('locale.current', {});
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
/** Organization units (sub-tenants / companies). `units()` lists what the
|
|
225
|
+
* user may access plus the active one; pair with `events.on('org-unit:switch')`
|
|
226
|
+
* to keep an in-app company switcher in sync with the portal. The active
|
|
227
|
+
* unit is also a signed claim on the backend (`ctx.org`), so authorization
|
|
228
|
+
* rides the identity token — the frontend value is for display + switching.
|
|
229
|
+
* Resolves BMS ERP request #22 (frontend half). */
|
|
230
|
+
org: {
|
|
231
|
+
/** List accessible units + the active one. */
|
|
232
|
+
units() {
|
|
233
|
+
return channel.call('org.units', {});
|
|
234
|
+
},
|
|
235
|
+
/** Ask the portal to switch the active unit. The portal validates access,
|
|
236
|
+
* re-issues the identity token, and emits `org-unit:switch`. */
|
|
237
|
+
switch(unitId) {
|
|
238
|
+
return channel.call('org.switch', { unitId });
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
/** Theme tokens — the portal pushes light/dark mode + the active tenant's
|
|
242
|
+
* brand palette so embedded apps repaint without each maintaining their
|
|
243
|
+
* own theme store. Combine with `events.on('theme:change')` for live
|
|
244
|
+
* updates when the user toggles dark mode. */
|
|
245
|
+
theme: {
|
|
246
|
+
current() {
|
|
247
|
+
return channel.call('theme.current', {});
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
/** Object / file storage (bytes) — distinct from `storage` (small JSON KV).
|
|
251
|
+
* Backed by the workspace's platform-provisioned bucket; the host bridge
|
|
252
|
+
* mints presigned URLs so the browser uploads/downloads directly without
|
|
253
|
+
* routing bytes through the portal. Persist the returned `key` (e.g. on a
|
|
254
|
+
* row) and resolve it back to a URL with `getUrl(key)` when rendering.
|
|
255
|
+
* Resolves BMS ERP request #25 (frontend half). */
|
|
256
|
+
files: {
|
|
257
|
+
/** Get a presigned PUT URL + the stable key to persist. Upload the file
|
|
258
|
+
* yourself with a plain `fetch(url, { method: 'PUT', body: file })`. */
|
|
259
|
+
presignUpload(opts) {
|
|
260
|
+
return channel.call('files.presignUpload', opts);
|
|
261
|
+
},
|
|
262
|
+
/** Convenience: presign + PUT in one call. Returns the stable key. */
|
|
263
|
+
async upload(file, opts) {
|
|
264
|
+
const filename = opts?.filename ?? file.name ?? 'upload.bin';
|
|
265
|
+
const contentType = file.type || 'application/octet-stream';
|
|
266
|
+
const presign = await workhub.files.presignUpload({
|
|
267
|
+
filename,
|
|
268
|
+
contentType,
|
|
269
|
+
...(opts?.keyHint ? { keyHint: opts.keyHint } : {}),
|
|
270
|
+
});
|
|
271
|
+
const put = await fetch(presign.url, {
|
|
272
|
+
method: 'PUT',
|
|
273
|
+
headers: { 'content-type': contentType, ...(presign.headers ?? {}) },
|
|
274
|
+
body: file,
|
|
275
|
+
});
|
|
276
|
+
if (!put.ok) {
|
|
277
|
+
throw new WorkhubError('upload_failed', `upload PUT failed: ${put.status} ${put.statusText}`, { status: put.status });
|
|
278
|
+
}
|
|
279
|
+
return { key: presign.key };
|
|
280
|
+
},
|
|
281
|
+
/** Presigned, time-limited GET URL for a stored key. */
|
|
282
|
+
getUrl(key, opts) {
|
|
283
|
+
return channel.call('files.getUrl', { key, expiresInSeconds: opts?.expiresInSeconds });
|
|
284
|
+
},
|
|
285
|
+
delete(key) {
|
|
286
|
+
return channel.call('files.delete', { key });
|
|
287
|
+
},
|
|
288
|
+
list(prefix) {
|
|
289
|
+
return channel.call('files.list', { prefix });
|
|
106
290
|
},
|
|
107
291
|
},
|
|
108
292
|
/** KV storage scoped to (tenant, installation). Survives reloads but
|
|
@@ -128,8 +312,17 @@ export const workhub = {
|
|
|
128
312
|
return channel.call('notifications.toast', { message, variant: opts?.variant ?? 'info' });
|
|
129
313
|
},
|
|
130
314
|
},
|
|
131
|
-
/** Pub/sub
|
|
132
|
-
*
|
|
315
|
+
/** Pub/sub.
|
|
316
|
+
*
|
|
317
|
+
* Host events (`theme:change`, `route:change`, `tenant:switch`,
|
|
318
|
+
* `locale:change`) come from the portal directly.
|
|
319
|
+
*
|
|
320
|
+
* App events (`app:<kind>`) are emitted by the workspace backend via
|
|
321
|
+
* `ctx.events.emit('customer.created', ...)`; the platform's tenant-event
|
|
322
|
+
* bridge forwards them to subscribed iframes. Replaces the polling shim
|
|
323
|
+
* documented in BMS ERP request #1.
|
|
324
|
+
*
|
|
325
|
+
* Returns an unsubscribe function. */
|
|
133
326
|
events: {
|
|
134
327
|
on: channel.on.bind(channel),
|
|
135
328
|
},
|
|
@@ -141,7 +334,82 @@ export const workhub = {
|
|
|
141
334
|
return channel.call('api.call', { verb, body });
|
|
142
335
|
},
|
|
143
336
|
},
|
|
337
|
+
/** Calls the developer's own workspace backend, proxied through the
|
|
338
|
+
* WorkHub runtime so requests carry a verifiable identity token (the
|
|
339
|
+
* backend SDK verifies it against /.well-known/jwks.json).
|
|
340
|
+
*
|
|
341
|
+
* Only available to apps installed under a developer workspace — for
|
|
342
|
+
* standalone-iframe apps this method throws because the runtime has
|
|
343
|
+
* no backend deployment to forward to. */
|
|
344
|
+
backend: {
|
|
345
|
+
/** Issue a request against the workspace backend.
|
|
346
|
+
*
|
|
347
|
+
* `path` is the route path declared in the backend's defineWorkspace
|
|
348
|
+
* routes table (e.g. `/leads` or `/leads/123/notes`). Leading slash
|
|
349
|
+
* required. The host SDK builds the full URL `/v1/apps/runtime/<installationId>/api<path>`
|
|
350
|
+
* and uses same-origin credentialed fetch — no extra auth wiring. */
|
|
351
|
+
async fetch(path, init) {
|
|
352
|
+
if (!path.startsWith('/')) {
|
|
353
|
+
throw new WorkhubError('bad_request', `workhub.backend.fetch: path must start with "/" — got "${path}"`);
|
|
354
|
+
}
|
|
355
|
+
const identity = await channel.call('identity.current', {});
|
|
356
|
+
const installationId = identity.installation?.id;
|
|
357
|
+
if (!installationId) {
|
|
358
|
+
throw new WorkhubError('not_installed', 'workhub.backend.fetch: no installation id on identity — is this app installed under a workspace?');
|
|
359
|
+
}
|
|
360
|
+
const url = `/v1/apps/runtime/${encodeURIComponent(installationId)}/api${path}`;
|
|
361
|
+
return fetch(url, {
|
|
362
|
+
...init,
|
|
363
|
+
credentials: 'include',
|
|
364
|
+
});
|
|
365
|
+
},
|
|
366
|
+
/** Convenience wrapper — JSON in, JSON out, with automatic error
|
|
367
|
+
* envelope detection. A 2xx response is parsed and returned. A 4xx/5xx
|
|
368
|
+
* carrying a `__workhub_error: true` payload is rethrown as
|
|
369
|
+
* `WorkhubError` so apps can `try/catch` by code instead of inspecting
|
|
370
|
+
* the response object. Pass `idempotencyKey` to deduplicate retries on
|
|
371
|
+
* idempotent backend routes. */
|
|
372
|
+
async call(path, opts = {}) {
|
|
373
|
+
const init = {
|
|
374
|
+
method: opts.method ?? (opts.body !== undefined ? 'POST' : 'GET'),
|
|
375
|
+
headers: {
|
|
376
|
+
accept: 'application/json',
|
|
377
|
+
...(opts.body !== undefined ? { 'content-type': 'application/json' } : {}),
|
|
378
|
+
...(opts.idempotencyKey ? { 'idempotency-key': opts.idempotencyKey } : {}),
|
|
379
|
+
...(opts.headers ?? {}),
|
|
380
|
+
},
|
|
381
|
+
...(opts.body !== undefined ? { body: JSON.stringify(opts.body) } : {}),
|
|
382
|
+
};
|
|
383
|
+
const res = await workhub.backend.fetch(path, init);
|
|
384
|
+
const text = await res.text();
|
|
385
|
+
const parsed = text.length > 0 ? safeParseJson(text) : null;
|
|
386
|
+
if (!res.ok) {
|
|
387
|
+
if (isBackendErrorEnvelope(parsed)) {
|
|
388
|
+
throw new WorkhubError(parsed.code, parsed.message, {
|
|
389
|
+
status: res.status,
|
|
390
|
+
requestId: parsed.requestId,
|
|
391
|
+
...(parsed.details ? { details: parsed.details } : {}),
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
const requestId = res.headers.get('x-request-id');
|
|
395
|
+
throw new WorkhubError('http_error', `backend ${res.status} ${res.statusText}`, {
|
|
396
|
+
status: res.status,
|
|
397
|
+
...(requestId ? { requestId } : {}),
|
|
398
|
+
details: { body: typeof parsed === 'string' ? parsed : parsed ?? undefined },
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
return parsed;
|
|
402
|
+
},
|
|
403
|
+
},
|
|
144
404
|
};
|
|
405
|
+
function safeParseJson(text) {
|
|
406
|
+
try {
|
|
407
|
+
return JSON.parse(text);
|
|
408
|
+
}
|
|
409
|
+
catch {
|
|
410
|
+
return text;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
145
413
|
// Default export for ergonomic single-import usage.
|
|
146
414
|
export default workhub;
|
|
147
415
|
//# sourceMappingURL=index.js.map
|
package/dist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,EAAE,EAAE,IAAI,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAE,MAAyC,IAAI,SAAS,EAAE;iBACjH,CACF,CAAC;YACJ,CAAC;YACD,OAAO,MAAW,CAAC;QACrB,CAAC;KACF;CACO,CAAC;AAEX,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,CAAC;QAAC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;AACzD,CAAC;AAED,oDAAoD;AACpD,eAAe,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fepro/workhub-app-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Client SDK for apps embedded in WorkHub. Use it inside an iframe app to call back into the host (identity, storage, notifications, events, API proxy).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"dist",
|
|
19
19
|
"src",
|
|
20
20
|
"README.md",
|
|
21
|
-
"AGENTS.md"
|
|
21
|
+
"AGENTS.md",
|
|
22
|
+
"CHANGELOG.md"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
25
|
"build": "tsc -p tsconfig.json",
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
"tenant",
|
|
33
34
|
"saas"
|
|
34
35
|
],
|
|
35
|
-
"homepage": "https://
|
|
36
|
+
"homepage": "https://workhubplatform.io/sdk",
|
|
36
37
|
"repository": {
|
|
37
38
|
"type": "git",
|
|
38
39
|
"url": "git+https://github.com/futureedgetechnologies/workhub.git",
|