@adventurelabs/scout-core 1.3.2 → 1.3.3

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.
Files changed (2) hide show
  1. package/dist/store/api.js +11 -0
  2. package/package.json +1 -1
package/dist/store/api.js CHANGED
@@ -1,5 +1,10 @@
1
1
  import { createApi, fakeBaseQuery } from "@reduxjs/toolkit/query/react";
2
2
  import { generateSignedUrlsBatch } from "../helpers/storage";
3
+ // Custom serialize function to exclude supabase client
4
+ const serializeQueryArgs = ({ queryArgs, endpointDefinition, endpointName, }) => {
5
+ const { supabase, ...serializableArgs } = queryArgs;
6
+ return JSON.stringify({ endpointName, args: serializableArgs });
7
+ };
3
8
  // Create the API slice
4
9
  export const scoutApi = createApi({
5
10
  reducerPath: "scoutApi",
@@ -10,6 +15,7 @@ export const scoutApi = createApi({
10
15
  // SESSIONS INFINITE QUERIES
11
16
  // =====================================================
12
17
  getSessionsInfiniteByHerd: builder.query({
18
+ serializeQueryArgs,
13
19
  async queryFn({ herdId, limit = 20, cursor, supabase }) {
14
20
  try {
15
21
  if (!herdId) {
@@ -61,6 +67,7 @@ export const scoutApi = createApi({
61
67
  : [{ type: "Session", id: "LIST" }],
62
68
  }),
63
69
  getSessionsInfiniteByDevice: builder.query({
70
+ serializeQueryArgs,
64
71
  async queryFn({ deviceId, limit = 20, cursor, supabase }) {
65
72
  try {
66
73
  if (!deviceId) {
@@ -115,6 +122,7 @@ export const scoutApi = createApi({
115
122
  // EVENTS INFINITE QUERIES
116
123
  // =====================================================
117
124
  getEventsInfiniteByHerd: builder.query({
125
+ serializeQueryArgs,
118
126
  async queryFn({ herdId, limit = 20, cursor, supabase }) {
119
127
  try {
120
128
  if (!herdId) {
@@ -166,6 +174,7 @@ export const scoutApi = createApi({
166
174
  : [{ type: "Event", id: "LIST" }],
167
175
  }),
168
176
  getEventsInfiniteByDevice: builder.query({
177
+ serializeQueryArgs,
169
178
  async queryFn({ deviceId, limit = 20, cursor, supabase }) {
170
179
  try {
171
180
  if (!deviceId) {
@@ -220,6 +229,7 @@ export const scoutApi = createApi({
220
229
  // ARTIFACTS INFINITE QUERIES
221
230
  // =====================================================
222
231
  getArtifactsInfiniteByHerd: builder.query({
232
+ serializeQueryArgs,
223
233
  async queryFn({ herdId, limit = 20, cursor, supabase }) {
224
234
  try {
225
235
  if (!herdId) {
@@ -296,6 +306,7 @@ export const scoutApi = createApi({
296
306
  : [{ type: "Artifact", id: "LIST" }],
297
307
  }),
298
308
  getArtifactsInfiniteByDevice: builder.query({
309
+ serializeQueryArgs,
299
310
  async queryFn({ deviceId, limit = 20, cursor, supabase }) {
300
311
  try {
301
312
  if (!deviceId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adventurelabs/scout-core",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Core utilities and helpers for Adventure Labs Scout applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",