@umbraco-ai/core 1.8.0 → 1.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-ai/core",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "type": "module",
5
5
  "types": "./types/umbraco-ai-public-types.d.ts",
6
6
  "files": [
@@ -8,8 +8,8 @@
8
8
  "README.md"
9
9
  ],
10
10
  "peerDependencies": {
11
+ "@umbraco-cms/backoffice": "^17.3.0",
11
12
  "chart.js": "^4.5.1",
12
- "diff": "^8.0.3",
13
- "@umbraco-cms/backoffice": "^17.1.0"
13
+ "diff": "^8.0.3"
14
14
  }
15
15
  }
@@ -14,6 +14,7 @@ import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
14
14
  import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
15
15
  import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
16
16
  import type { UmbDetailRepository } from '@umbraco-cms/backoffice/repository';
17
+ import type { UmbElement } from '@umbraco-cms/backoffice/element-api';
17
18
  import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action';
18
19
  import { UmbEntityActionEvent } from '@umbraco-cms/backoffice/entity-action';
19
20
  import { UmbEntityBulkActionBase } from '@umbraco-cms/backoffice/entity-bulk-action';
@@ -23,8 +24,41 @@ import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal';
23
24
  import { UmbModalToken } from '@umbraco-cms/backoffice/modal';
24
25
  import { UUIFormControlMixinElement } from '@umbraco-ui/uui-base';
25
26
 
27
+ declare interface AiHttpClient {
28
+ setConfig: (config: any) => unknown;
29
+ interceptors: {
30
+ response: {
31
+ use: (fn: (response: Response, request: Request, opts?: unknown) => Response | Promise<Response>) => unknown;
32
+ };
33
+ };
34
+ }
35
+
36
+ /**
37
+ * Configures a generated hey-api client with the backoffice auth callback
38
+ * and attaches a silent 401 recovery interceptor.
39
+ *
40
+ * The interceptor calls `authContext.makeRefreshTokenRequest()` on a 401
41
+ * and retries the request once. This is a workaround for CMS issue
42
+ * https://github.com/umbraco/Umbraco-CMS/issues/22647 — the default
43
+ * `UmbApiInterceptorController.bindDefaultInterceptors` is unusable from
44
+ * third-party entry-point hosts because its `UmbAuthSignalerContext`
45
+ * ends up scoped below `umb-app` and emissions never reach `UmbAuthContext`.
46
+ *
47
+ * @param host The entry point's `host` parameter (`UmbElement`).
48
+ * @param client The generated hey-api client to configure.
49
+ * @returns A Promise that resolves once auth is configured on the client.
50
+ * @public
51
+ */
52
+ export declare function configureAiClient(host: UmbElement, client: AiHttpClient): Promise<void>;
53
+
26
54
  export declare const coreClientReady: Promise<void>;
27
55
 
56
+ /**
57
+ * Helper to create context item from a serialized element (e.g., a block within a document).
58
+ * Uses "elementType" instead of "entityType" so the backend can distinguish element from entity context.
59
+ */
60
+ export declare function createElementContextItem(entity: UaiSerializedEntity): UaiRequestContextItem;
61
+
28
62
  /**
29
63
  * Helper to create context item from serialized entity.
30
64
  */