@iblai/data-layer 1.23.0 → 1.24.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.ts CHANGED
@@ -45,10 +45,14 @@ interface ApiToken {
45
45
  /** Present when the endpoint embeds per-field write flags in the payload. */
46
46
  field_permissions?: ApiTokenFieldPermissions;
47
47
  }
48
+ /**
49
+ * Page envelope returned when `page_size` is sent. The backend reports page
50
+ * NUMBERS (`next_page`/`previous_page`), not DRF `next`/`previous` URLs.
51
+ */
48
52
  interface PaginatedApiTokenList {
49
53
  count: number;
50
- next?: string | null;
51
- previous?: string | null;
54
+ next_page?: number | null;
55
+ previous_page?: number | null;
52
56
  results: ApiToken[];
53
57
  }
54
58
  /** POST/PATCH body. `expires_in` is a duration; `expires` is read-only. */
@@ -76,7 +80,7 @@ type ApiTokenFieldPermissions = Record<string, {
76
80
 
77
81
  /**
78
82
  * Normalizes a `getApiKeys` result: the endpoint returns a bare array unless
79
- * `pageSize` is sent, in which case it returns a DRF page envelope.
83
+ * `pageSize` is sent, in which case it returns a `{count, next_page, previous_page, results}` envelope.
80
84
  */
81
85
  declare function unwrapApiTokenList(response?: ApiToken[] | PaginatedApiTokenList): {
82
86
  tokens: ApiToken[];
package/dist/index.esm.js CHANGED
@@ -39780,7 +39780,7 @@ const buildEndpointFromDmServiceLegacy = (serviceFn, options) => buildEndpointFr
39780
39780
  const API_TOKENS_PATH = '/api/core/platform/api-tokens/';
39781
39781
  /**
39782
39782
  * Normalizes a `getApiKeys` result: the endpoint returns a bare array unless
39783
- * `pageSize` is sent, in which case it returns a DRF page envelope.
39783
+ * `pageSize` is sent, in which case it returns a `{count, next_page, previous_page, results}` envelope.
39784
39784
  */
39785
39785
  function unwrapApiTokenList(response) {
39786
39786
  var _a, _b;
@@ -39830,7 +39830,10 @@ const apiKeysApiSlice = createApi({
39830
39830
  if (args.pageSize !== undefined)
39831
39831
  queryParams.set('page_size', String(args.pageSize));
39832
39832
  return requestApiToken(`${API_TOKENS_PATH}?${queryParams.toString()}`, { method: 'GET' }, 'Failed to fetch API keys');
39833
- }),
39833
+ },
39834
+ // An out-of-range page is a 404 "Invalid page." — fail fast so the
39835
+ // caller can step back instead of waiting out the retry backoff.
39836
+ { expectedErrorStatuses: [404] }),
39834
39837
  providesTags: ['apiKeys'],
39835
39838
  }),
39836
39839
  /** Detail read — the only GET that returns the token's policies and groups. */