@orangecheck/me-client 0.25.3 → 0.26.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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -340,6 +340,11 @@ async function fire(options) {
|
|
|
340
340
|
if (!options.subtype) {
|
|
341
341
|
throw new Error("event.fire requires subtype");
|
|
342
342
|
}
|
|
343
|
+
if (options.userAddress && !options.signingSecret) {
|
|
344
|
+
throw new Error(
|
|
345
|
+
"event.fire: userAddress names who earns, so it requires signingSecret \u2014 the signature over the request body is what authorises that earner. Without the secret, pass bearerToken (or rely on the oc_session cookie) and the caller earns instead."
|
|
346
|
+
);
|
|
347
|
+
}
|
|
343
348
|
const requestBody = {
|
|
344
349
|
project_key: options.project_key,
|
|
345
350
|
subtype: options.subtype
|
|
@@ -349,6 +354,7 @@ async function fire(options) {
|
|
|
349
354
|
if (options.action_label !== void 0) requestBody.action_label = options.action_label;
|
|
350
355
|
if (options.metadata !== void 0) requestBody.metadata = options.metadata;
|
|
351
356
|
if (options.is_agent !== void 0) requestBody.is_agent = options.is_agent;
|
|
357
|
+
if (options.userAddress !== void 0) requestBody.user_address = options.userAddress;
|
|
352
358
|
const headers = {};
|
|
353
359
|
if (options.idempotencyKey) headers["idempotency-key"] = options.idempotencyKey;
|
|
354
360
|
if (options.signingSecret) {
|