@smplkit/sdk 3.0.70 → 3.0.72

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.cjs CHANGED
@@ -16918,7 +16918,7 @@ var AuditEventBuffer = class {
16918
16918
  var JSONAPI_CONTENT_TYPE = "application/vnd.api+json";
16919
16919
  function _eventBodyFromInput(input) {
16920
16920
  const attrs = {
16921
- action: input.action,
16921
+ event_type: input.eventType,
16922
16922
  resource_type: input.resourceType,
16923
16923
  resource_id: input.resourceId,
16924
16924
  do_not_forward: input.doNotForward ?? false
@@ -16938,7 +16938,7 @@ function _eventFromResource(resource) {
16938
16938
  const attrs = resource.attributes;
16939
16939
  return {
16940
16940
  id: resource.id,
16941
- action: String(attrs.action ?? ""),
16941
+ eventType: String(attrs.event_type ?? ""),
16942
16942
  resourceType: String(attrs.resource_type ?? ""),
16943
16943
  resourceId: String(attrs.resource_id ?? ""),
16944
16944
  occurredAt: String(attrs.occurred_at ?? ""),
@@ -17017,7 +17017,7 @@ var EventsClient = class {
17017
17017
  }
17018
17018
  async list(params = {}) {
17019
17019
  const query = {};
17020
- if (params.action !== void 0) query["filter[action]"] = params.action;
17020
+ if (params.eventType !== void 0) query["filter[event_type]"] = params.eventType;
17021
17021
  if (params.resourceType !== void 0) query["filter[resource_type]"] = params.resourceType;
17022
17022
  if (params.resourceId !== void 0) query["filter[resource_id]"] = params.resourceId;
17023
17023
  if (params.actorType !== void 0) query["filter[actor_type]"] = params.actorType;
@@ -17088,15 +17088,15 @@ var ResourceTypesClient = class {
17088
17088
  return { resourceTypes, pagination: _paginationFromBody(body) };
17089
17089
  }
17090
17090
  };
17091
- var ActionsClient = class {
17091
+ var EventTypesClient = class {
17092
17092
  constructor(_http) {
17093
17093
  this._http = _http;
17094
17094
  }
17095
17095
  /**
17096
- * List the distinct `action` slugs recorded for this account.
17096
+ * List the distinct `event_type` slugs recorded for this account.
17097
17097
  *
17098
- * Without `filterResourceType`, returns one row per distinct action.
17099
- * With `filterResourceType`, returns only the actions recorded with
17098
+ * Without `filterResourceType`, returns one row per distinct event type.
17099
+ * With `filterResourceType`, returns only the event types recorded with
17100
17100
  * that resource_type, powering cascading-filter UIs (ADR-047 §2.5).
17101
17101
  * Sorted alphabetically; offset pagination via `pageNumber` / `pageSize`.
17102
17102
  */
@@ -17107,29 +17107,29 @@ var ActionsClient = class {
17107
17107
  if (params.pageNumber !== void 0) query["page[number]"] = params.pageNumber;
17108
17108
  if (params.pageSize !== void 0) query["page[size]"] = params.pageSize;
17109
17109
  if (params.metaTotal !== void 0) query["meta[total]"] = params.metaTotal;
17110
- const result = await this._http.GET("/api/v1/actions", {
17110
+ const result = await this._http.GET("/api/v1/event_types", {
17111
17111
  params: { query }
17112
17112
  });
17113
17113
  if (!result.response.ok) await _throwForResponse(result.response);
17114
17114
  if (result.data === void 0) throw new SmplError("Unexpected empty response from audit");
17115
17115
  const body = result.data;
17116
- const actions = (body.data ?? []).map(
17116
+ const eventTypes = (body.data ?? []).map(
17117
17117
  (r) => ({
17118
17118
  id: r.id,
17119
17119
  createdAt: String(r.attributes.created_at ?? "")
17120
17120
  })
17121
17121
  );
17122
- return { actions, pagination: _paginationFromBody(body) };
17122
+ return { eventTypes, pagination: _paginationFromBody(body) };
17123
17123
  }
17124
17124
  };
17125
17125
  var AuditClient = class {
17126
17126
  events;
17127
17127
  resourceTypes;
17128
- actions;
17128
+ eventTypes;
17129
17129
  constructor(opts) {
17130
17130
  this.events = new EventsClient(opts);
17131
17131
  this.resourceTypes = new ResourceTypesClient(this.events._http);
17132
- this.actions = new ActionsClient(this.events._http);
17132
+ this.eventTypes = new EventTypesClient(this.events._http);
17133
17133
  }
17134
17134
  /** @internal */
17135
17135
  async _close() {