@sixtyninecommerce/client 0.25.0 → 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.
@@ -3,6 +3,22 @@ export interface EventAggregateRef {
3
3
  readonly type: string;
4
4
  readonly id: string | null;
5
5
  }
6
+ /**
7
+ * WHO caused the event.
8
+ *
9
+ * `type` is one of `user`, `customer`, `api_token`, `system`, `service`,
10
+ * `anonymous` — typed as a string because the vocabulary grows and your build
11
+ * must stay able to read an envelope whose actor kind it does not know yet.
12
+ *
13
+ * `label` is a non-personal display name, and is usually null: only an API token
14
+ * carries one (its name). A human actor is deliberately unlabelled — you are a
15
+ * third party, and an administrator's email address is not yours to receive.
16
+ */
17
+ export interface EventActorRef {
18
+ readonly type: string;
19
+ readonly id: string | null;
20
+ readonly label: string | null;
21
+ }
6
22
  /**
7
23
  * The exact JSON shape delivered to a webhook endpoint and served by the pull feed.
8
24
  *
@@ -37,6 +53,14 @@ export interface PlatformEventEnvelope<TData = Record<string, unknown>> {
37
53
  readonly aggregate: EventAggregateRef;
38
54
  /** W3C trace id tying this event to the action that caused it. */
39
55
  readonly trace_id: string | null;
56
+ /**
57
+ * Who caused it, when anything recorded an actor.
58
+ *
59
+ * OPTIONAL: it was added after the envelope shipped, and the services that
60
+ * send you events deploy independently of your build. Read it as
61
+ * `envelope.actor ?? null` rather than assuming the key is there.
62
+ */
63
+ readonly actor?: EventActorRef | null;
40
64
  readonly data: TData;
41
65
  }
42
66
  /** One page of the pull feed. */
@@ -1 +1 @@
1
- {"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../../src/events/envelope.ts"],"names":[],"mappings":"AAaA,8EAA8E;AAC9E,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,qBAA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,QAAQ,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
@@ -19,6 +19,6 @@ export { verifyEventDelivery } from '../revalidation/event-verify.js';
19
19
  export type { ChannelUrlRuleSet, UrlContext, UrlContextSource, } from '../revalidation/url-context.js';
20
20
  export { urlContextFromChannelSettings, urlContextFromClient, } from '../revalidation/url-context.js';
21
21
  export { verifyWebhookSignature } from '../revalidation/verify.js';
22
- export type { EventAggregateRef, PlatformEventEnvelope, PlatformEventPage, } from './envelope.js';
22
+ export type { EventActorRef, EventAggregateRef, PlatformEventEnvelope, PlatformEventPage, } from './envelope.js';
23
23
  export type * from './payloads.js';
24
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzF,YAAY,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACpF,YAAY,EACV,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,mBAAmB,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzF,YAAY,EACV,0BAA0B,EAC1B,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACpF,YAAY,EACV,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,6BAA6B,EAC7B,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,eAAe,CAAC;AACvB,mBAAmB,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixtyninecommerce/client",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "JavaScript/TypeScript client for sixtynine-commerce storefronts",
5
5
  "homepage": "https://github.com/SIXTYNINE-digital/sixtynine-commerce-engine/tree/main/packages/storefront-client#readme",
6
6
  "repository": {