@funnelsgrove/runtime 0.1.4 → 0.1.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.
@@ -8,6 +8,9 @@ export type AppUser = {
8
8
  attributes: FunnelUserAnswers;
9
9
  document: Record<string, unknown>;
10
10
  };
11
+ type AppUserInput = Omit<AppUser, 'document'> & {
12
+ document?: Record<string, unknown>;
13
+ };
11
14
  export type FunnelEvent = {
12
15
  userId: string;
13
16
  eventType: string;
@@ -76,7 +79,7 @@ declare class ApiService {
76
79
  attribution?: FunnelUserAttribution;
77
80
  }): Promise<AppUser>;
78
81
  syncUrlUserAttributes(input: {
79
- user: AppUser;
82
+ user: AppUserInput;
80
83
  attributes?: FunnelUserAnswers;
81
84
  urlAttributes?: UrlUserAttributes | null;
82
85
  attribution?: FunnelUserAttribution;
@@ -328,6 +328,7 @@ class ApiService {
328
328
  });
329
329
  }
330
330
  async syncUrlUserAttributes(input) {
331
+ var _a;
331
332
  if (!hasUrlUserAttributes(input.urlAttributes)) {
332
333
  return null;
333
334
  }
@@ -336,7 +337,7 @@ class ApiService {
336
337
  attributes: input.attributes,
337
338
  urlAttributes: input.urlAttributes,
338
339
  });
339
- const updatedUser = await this.updateUser(nextUser, {
340
+ const updatedUser = await this.updateUser(Object.assign(Object.assign({}, nextUser), { document: (_a = nextUser.document) !== null && _a !== void 0 ? _a : {} }), {
340
341
  attribution: input.attribution,
341
342
  });
342
343
  return applyUrlUserAttributesToUser({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnelsgrove/runtime",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",