@iblai/data-layer 1.23.0 → 1.25.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[];
@@ -122254,8 +122258,9 @@ declare const CUSTOM_DOMAIN_QUERY_KEYS: {
122254
122258
  /**
122255
122259
  * A deployed app. `site_url` is the address to show the user and is final as
122256
122260
  * soon as the deploy is accepted — never build a host from `name`.
122257
- * `shared_domain` is that same host on its own when the platform assigned it
122258
- * automatically, and empty when the app is served at a custom domain.
122261
+ * `shared_domain` is that same host on its own when it is the subdomain chosen
122262
+ * under the platform's shared domain, and empty when the app is served at a
122263
+ * custom domain.
122259
122264
  */
122260
122265
  interface HostingProject {
122261
122266
  id: number;
@@ -122319,10 +122324,16 @@ interface CreateHostingProjectDomainArgs {
122319
122324
  username: string;
122320
122325
  project: number;
122321
122326
  /**
122322
- * Omit to have the platform assign a subdomain of its shared zone. That path
122323
- * answers 503 on an instance where no shared zone is configured.
122327
+ * Exactly one of `domain` and `subdomain`. `domain` is a domain the
122328
+ * organization owns; `subdomain` is one label under the platform's shared
122329
+ * domain, chosen like a username (`^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`).
122330
+ * The backend refuses a body with neither (400, a `subdomain` field error —
122331
+ * it never invents an address), answers 409 when the subdomain is taken, 200
122332
+ * when the app already has it, and 503 when no shared domain is on offer for
122333
+ * this organization.
122324
122334
  */
122325
122335
  domain?: string;
122336
+ subdomain?: string;
122326
122337
  }
122327
122338
  interface DeleteHostingProjectDomainArgs {
122328
122339
  org: string;
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. */
@@ -46636,15 +46639,18 @@ const hostingApiSlice = createApi({
46636
46639
  { type: HOSTING_QUERY_KEYS.HOSTING_PROJECT_DOMAINS, id: args.project },
46637
46640
  ],
46638
46641
  }),
46639
- // Attach a domain the organization owns, or — with `domain` omitted — have
46640
- // the platform assign a subdomain of its shared zone.
46642
+ // Attach a domain the organization owns, or serve the app at a chosen
46643
+ // subdomain of the platform's shared domain. Only a key that is set is
46644
+ // sent: a present-but-empty value would be a request for "".
46641
46645
  createHostingProjectDomain: builder.mutation({
46642
46646
  query: (args) => ({
46643
46647
  url: HOSTING_ENDPOINTS.CREATE_HOSTING_PROJECT_DOMAIN.path(args.org, args.username),
46644
46648
  method: 'POST',
46645
- body: args.domain
46646
- ? { project: args.project, domain: args.domain }
46647
- : { project: args.project },
46649
+ body: {
46650
+ project: args.project,
46651
+ ...(args.domain ? { domain: args.domain } : {}),
46652
+ ...(args.subdomain ? { subdomain: args.subdomain } : {}),
46653
+ },
46648
46654
  service: HOSTING_ENDPOINTS.CREATE_HOSTING_PROJECT_DOMAIN.service,
46649
46655
  }),
46650
46656
  invalidatesTags: (result, error, args) => [