@collective-intelligence/extensions-sdk 0.3.1 → 0.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.
- package/README.md +38 -34
- package/dist/access/dataset-policy.d.ts +38 -0
- package/dist/access/index.d.ts +3 -1
- package/dist/access/manifest.d.ts +31 -1
- package/dist/access/readers.d.ts +19 -1
- package/dist/components/base.d.ts +1 -1
- package/dist/components/connector-instances.d.ts +14 -1
- package/dist/components/document-collections.d.ts +9 -1
- package/dist/components/metadata-authoring.d.ts +11 -3
- package/dist/documents.js +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -3
- package/dist/package/primitive-readers.d.ts +18 -0
- package/dist/release/stored-manifest.d.ts +16 -4
- package/docs/guide/ai/index.md +36 -17
- package/docs/guide/ai/studio.md +245 -0
- package/docs/guide/data/connectors.md +81 -18
- package/docs/guide/data/datasets.md +6 -17
- package/docs/guide/data/documents.md +235 -0
- package/docs/guide/data/index.md +62 -0
- package/docs/guide/data/knowledge.md +21 -18
- package/docs/guide/develop/extensions.md +15 -14
- package/docs/guide/develop/external-apps.md +48 -14
- package/docs/guide/develop/infrastructure.md +135 -0
- package/docs/guide/develop/sdks.md +2 -2
- package/docs/guide/index.md +11 -7
- package/docs/guide/platform/access.md +82 -17
- package/docs/guide/platform/architecture.md +27 -18
- package/docs/guide/platform/entrypoints.md +125 -48
- package/docs/guide/scenarios/index.md +69 -46
- package/docs/guide/template/index.md +22 -9
- package/docs/guide/template/state-machines.md +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1409,6 +1409,7 @@ holds a declared condition; hosts use it on the inlined `where`.
|
|
|
1409
1409
|
| `declareAccessProfileGrant` | A static grant: one recipient, one profile, one Knowledge Entity Identifier per axis |
|
|
1410
1410
|
| `declareAccessKnowledgeDataPolicy` | A rule on one schema and one operation: capability, axis bindings, `where`, field lists |
|
|
1411
1411
|
| `declareAccessKnowledgeDataCondition` | A reusable, tested row predicate for a policy `where` |
|
|
1412
|
+
| `declareAccessDatasetDataPolicy` | A `read` rule on one Dataset of the package: capability, axis fields, a `where` with a Dataset filter form, readable fields and limits |
|
|
1412
1413
|
| `declareAccessDocumentDataPolicy` | A rule on one document collection or folder and one operation; no axes. `read` opens the current Version, `history` the older Versions, `write` creates, updates and deletes |
|
|
1413
1414
|
| `declareAccessMaxPrivileges` | The capabilities that an app's user tokens or an API key template may use at most |
|
|
1414
1415
|
| `declareCoreAccessPolicy` | A core tenant, admin or default policy of the core built-in package; returns a plain value |
|
|
@@ -2738,9 +2739,9 @@ release dependencies at installation. Every bundle requires
|
|
|
2738
2739
|
`lifecycle: { deployMode: "init_only" | "upsert", readonly: boolean }`.
|
|
2739
2740
|
`init_only` creates absent configuration and preserves existing content; `upsert`
|
|
2740
2741
|
reconciles owned content through baseline/live merge. `readonly` governs manual
|
|
2741
|
-
configuration edits across the bundle. Child bindings, pipelines
|
|
2742
|
-
|
|
2743
|
-
|
|
2742
|
+
configuration edits across the bundle. Child bindings, pipelines and schedules
|
|
2743
|
+
share that lifecycle; runtime data, cursors and authorized execution are
|
|
2744
|
+
separate.
|
|
2744
2745
|
|
|
2745
2746
|
An entity binding of a Knowledge gateway connector may declare
|
|
2746
2747
|
`pushEntityMatch: "unique_fields"`. A pushed record then joins the live entity
|
|
@@ -2825,17 +2826,7 @@ const orders = declareDatasetConnectorInstance({
|
|
|
2825
2826
|
cronExpression: "0 * * * *",
|
|
2826
2827
|
timezone: "UTC"
|
|
2827
2828
|
}
|
|
2828
|
-
]
|
|
2829
|
-
dataPolicy: {
|
|
2830
|
-
principals: [
|
|
2831
|
-
{ kind: "user", id: "7f824c46-54f3-41aa-b0b5-3951fabf952a" }
|
|
2832
|
-
],
|
|
2833
|
-
allowedOperations: ["describe", "records"],
|
|
2834
|
-
allowedFields: ["id", "total"],
|
|
2835
|
-
maxRows: 1000,
|
|
2836
|
-
maxBytes: 1048576,
|
|
2837
|
-
maxTimeoutMs: 30000
|
|
2838
|
-
}
|
|
2829
|
+
]
|
|
2839
2830
|
}
|
|
2840
2831
|
})
|
|
2841
2832
|
export default declarePackage({
|
|
@@ -2855,14 +2846,39 @@ export default declarePackage({
|
|
|
2855
2846
|
})
|
|
2856
2847
|
```
|
|
2857
2848
|
|
|
2858
|
-
Use your actual exact dependency release, executable/schema FQNs
|
|
2859
|
-
location
|
|
2849
|
+
Use your actual exact dependency release, executable/schema FQNs and source
|
|
2850
|
+
location. A Knowledge connector instance declares no
|
|
2860
2851
|
policy: the package's Knowledge Data Policies decide who reads and writes the
|
|
2861
2852
|
records it imports (see "Knowledge Data Policies and Conditions").
|
|
2862
2853
|
|
|
2863
|
-
Dataset
|
|
2864
|
-
|
|
2865
|
-
|
|
2854
|
+
A Dataset connector instance declares no policy either: a
|
|
2855
|
+
`declareAccessDatasetDataPolicy` on the Dataset decides who reads which rows and
|
|
2856
|
+
fields of it. Its `where` must lower to a Dataset filter, so `overlaps`,
|
|
2857
|
+
`includesMe`, `via` and declared conditions fail the build, and activation
|
|
2858
|
+
refuses a rule on a `json` field or a field the Dataset does not define.
|
|
2859
|
+
|
|
2860
|
+
```ts
|
|
2861
|
+
import { declareAccessDatasetDataPolicy } from "@collective-intelligence/extensions-sdk"
|
|
2862
|
+
|
|
2863
|
+
const ordersRead = declareAccessDatasetDataPolicy({
|
|
2864
|
+
manifest: { fqn: "com.acme.sales.policies.orders-read", version: "1.0.0" },
|
|
2865
|
+
definition: {
|
|
2866
|
+
dataset: orders,
|
|
2867
|
+
capability: { mode: "read", requires: "com.acme.sales.access.orders" },
|
|
2868
|
+
axes: [
|
|
2869
|
+
{ axis: "com.acme.sales.axes.region", field: "region", match: "id" }
|
|
2870
|
+
],
|
|
2871
|
+
readableFields: ["id", "total"],
|
|
2872
|
+
limits: { maxRows: 1000 }
|
|
2873
|
+
}
|
|
2874
|
+
})
|
|
2875
|
+
```
|
|
2876
|
+
|
|
2877
|
+
The host writes one row per declaration for the installation and removes it
|
|
2878
|
+
when a release no longer declares it. Readers also need the Dataset Audience:
|
|
2879
|
+
`declareDatasetConnectorInstance` takes an `audience` with the Document
|
|
2880
|
+
Collection shape, written by the bundle lifecycle. Without one, a Dataset the
|
|
2881
|
+
deploy creates starts with the whole Organization, and admin edits stay.
|
|
2866
2882
|
|
|
2867
2883
|
Knowledge settings retain `{ type: "inline" | "linked", value }` entries;
|
|
2868
2884
|
`remoteFilters` retain native `mode` and `selected_ids`. Binding `parentKey`,
|
|
@@ -2963,16 +2979,6 @@ const fabricOrders = declareDatasetConnectorInstance({
|
|
|
2963
2979
|
{ kind: "dataset", opaqueId: "semantic_model:item-id", label: "Orders" }
|
|
2964
2980
|
]
|
|
2965
2981
|
},
|
|
2966
|
-
dataPolicy: {
|
|
2967
|
-
principals: [
|
|
2968
|
-
{ kind: "user", id: "7f824c46-54f3-41aa-b0b5-3951fabf952a" }
|
|
2969
|
-
],
|
|
2970
|
-
allowedOperations: ["describe", "records"],
|
|
2971
|
-
allowedFields: ["admitted-order-id-field"],
|
|
2972
|
-
maxRows: 100,
|
|
2973
|
-
maxBytes: 1048576,
|
|
2974
|
-
maxTimeoutMs: 30000
|
|
2975
|
-
},
|
|
2976
2982
|
schedules: [
|
|
2977
2983
|
{
|
|
2978
2984
|
key: "health",
|
|
@@ -3001,11 +3007,9 @@ export default declarePackage({
|
|
|
3001
3007
|
})
|
|
3002
3008
|
```
|
|
3003
3009
|
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
budget bounds. Omission is not an instruction to erase protected adopted/manual
|
|
3008
|
-
grants; existing resources follow the selected lifecycle and preservation rules.
|
|
3010
|
+
A package-created Dataset with no Dataset Data Policy is read by admins only.
|
|
3011
|
+
A package update never changes the policies an admin wrote for an adopted or
|
|
3012
|
+
manual Dataset.
|
|
3009
3013
|
|
|
3010
3014
|
Installation configures empty Managed backing or admits a live External binding;
|
|
3011
3015
|
it does not ingest business rows or trigger projection backfill. Managed file or
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DeclarationReference, DeclaredComponent } from "../components/authoring-core.js";
|
|
2
|
+
import type { LifecycleOptions } from "../components/lifecycle.js";
|
|
3
|
+
import type { AccessCondition, AccessGrantAxisReference } from "./conditions.js";
|
|
4
|
+
import type { AccessDeclarationInput } from "./declarations.js";
|
|
5
|
+
import type { AccessDatasetDataPolicyDeclaration, AccessDatasetLimits, AccessDatasetPolicyAxis, AccessFieldSelection } from "./manifest.js";
|
|
6
|
+
import type { AccessCapabilityRequirement } from "./requirement.js";
|
|
7
|
+
/** The authored definition of a Dataset Data Policy. */
|
|
8
|
+
export type AccessDatasetDataPolicyDefinition = Readonly<{
|
|
9
|
+
/** One rule per Grant Axis: the Dataset field that holds its value. */
|
|
10
|
+
axes?: readonly (Omit<AccessDatasetPolicyAxis, "axis"> & Readonly<{
|
|
11
|
+
axis: AccessGrantAxisReference;
|
|
12
|
+
}>)[];
|
|
13
|
+
capability: AccessCapabilityRequirement;
|
|
14
|
+
dataset: DeclarationReference<"datasetConnectorInstance">;
|
|
15
|
+
lifecycle?: LifecycleOptions;
|
|
16
|
+
limits?: AccessDatasetLimits;
|
|
17
|
+
/** Ignores every axis that `axes` does not bind. */
|
|
18
|
+
otherAxes?: "unscoped";
|
|
19
|
+
/** Every field that is not sensitive without it. */
|
|
20
|
+
readableFields?: AccessFieldSelection;
|
|
21
|
+
where?: AccessCondition;
|
|
22
|
+
}>;
|
|
23
|
+
/** A declared Dataset Data Policy. */
|
|
24
|
+
export type AccessDatasetDataPolicyHandle = DeclaredComponent<AccessDatasetDataPolicyDeclaration>;
|
|
25
|
+
/**
|
|
26
|
+
* Shared authoring and serialized admission invariant of a Dataset Data
|
|
27
|
+
* Policy: one rule per axis, a `where` that lowers to a Dataset filter,
|
|
28
|
+
* non-empty field keys and positive whole limits. The host refuses what
|
|
29
|
+
* needs the Dataset's fields (a `json` field, an unknown field) on
|
|
30
|
+
* activation.
|
|
31
|
+
*/
|
|
32
|
+
export declare const datasetDataPolicyViolation: (policy: Pick<AccessDatasetDataPolicyDeclaration, "axes" | "limits" | "readableFields" | "where">) => string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Declares a Dataset Data Policy on one Dataset of the package: who reads
|
|
35
|
+
* which rows and fields of it. The host writes it on activation and removes
|
|
36
|
+
* it when the release no longer declares it.
|
|
37
|
+
*/
|
|
38
|
+
export declare const declareAccessDatasetDataPolicy: (input: AccessDeclarationInput<AccessDatasetDataPolicyDefinition>) => AccessDatasetDataPolicyHandle;
|
package/dist/access/index.d.ts
CHANGED
|
@@ -53,10 +53,12 @@ export { builtinGroups, coreCapabilities, coreSectionRequirements } from "./core
|
|
|
53
53
|
export type { AccessSectionRequirement } from "./core-catalog.js";
|
|
54
54
|
export { accessGrantAxisSlug, declareAccessCapabilities, declareAccessGrantAxis, declareAccessMaxPrivileges, declareAccessProfile, declareAccessProfileGrant, knowledgeEntity } from "./declarations.js";
|
|
55
55
|
export type { AccessCapabilitiesHandle, AccessComponentManifest, AccessDeclarationInput, AccessGranteeInput, AccessGrantAxisHandle, AccessGrantAxisSlug, AccessKnowledgeSchemaReference, AccessMaxPrivilegesHandle, AccessProfileAxisSlugs, AccessProfileDefinition, AccessProfileGrantDefinition, AccessProfileGrantHandle, AccessProfileHandle, AccessProfileReference } from "./declarations.js";
|
|
56
|
+
export { declareAccessDatasetDataPolicy } from "./dataset-policy.js";
|
|
57
|
+
export type { AccessDatasetDataPolicyDefinition, AccessDatasetDataPolicyHandle } from "./dataset-policy.js";
|
|
56
58
|
export { declareAccessDocumentDataPolicy } from "./document-policy.js";
|
|
57
59
|
export type { AccessDocumentDataPolicyDefinition, AccessDocumentDataPolicyHandle, AccessDocumentFolderInput } from "./document-policy.js";
|
|
58
60
|
export { declareAccessKnowledgeDataCondition, declareAccessKnowledgeDataPolicy, declareCoreAccessPolicy, unreadConditionAxes } from "./knowledge-policy.js";
|
|
59
61
|
export type { AccessCorePolicy, AccessKnowledgeDataPolicyDefinition, AccessKnowledgeDataPolicyHandle } from "./knowledge-policy.js";
|
|
60
|
-
export type { AccessCanGrant, AccessCapabilitiesDeclaration, AccessConditionTest, AccessDataOperation, AccessDocumentDataOperation, AccessDocumentDataPolicyDeclaration, AccessDocumentFolder, AccessFieldSelection, AccessGrantableBy, AccessGrantAxisDeclaration, AccessGrantee, AccessKnowledgeDataConditionDeclaration, AccessKnowledgeDataPolicyDeclaration, AccessKnowledgeEntityIdentifier, AccessMaxPrivilegesDeclaration, AccessMaxPrivilegesTarget, AccessPolicyAxis, AccessPolicyPurpose, AccessPrimitiveDeclaration, AccessProfileAppliesTo, AccessProfileDeclaration, AccessProfileGrantDeclaration, AxisBinding } from "./manifest.js";
|
|
62
|
+
export type { AccessCanGrant, AccessCapabilitiesDeclaration, AccessConditionTest, AccessDataOperation, AccessDatasetDataPolicyDeclaration, AccessDatasetLimits, AccessDatasetPolicyAxis, AccessDocumentDataOperation, AccessDocumentDataPolicyDeclaration, AccessDocumentFolder, AccessFieldSelection, AccessGrantableBy, AccessGrantAxisDeclaration, AccessGrantee, AccessKnowledgeDataConditionDeclaration, AccessKnowledgeDataPolicyDeclaration, AccessKnowledgeEntityIdentifier, AccessMaxPrivilegesDeclaration, AccessMaxPrivilegesTarget, AccessPolicyAxis, AccessPolicyPurpose, AccessPrimitiveDeclaration, AccessProfileAppliesTo, AccessProfileDeclaration, AccessProfileGrantDeclaration, AxisBinding } from "./manifest.js";
|
|
61
63
|
export { accessCapabilityMode, evaluateAccessRequirement } from "./requirement.js";
|
|
62
64
|
export type { AccessCapabilityRequirement, AccessEntryRequirement, AccessHeldCapability, AccessRequirement, AccessRequirementLeaf, AccessRequirementResult } from "./requirement.js";
|
|
@@ -147,6 +147,36 @@ export type AccessDocumentDataPolicyDeclaration = PackagePrimitiveBase<"accessDo
|
|
|
147
147
|
collection?: never;
|
|
148
148
|
folder: AccessDocumentFolder;
|
|
149
149
|
}>);
|
|
150
|
+
/** A Dataset field that holds the value of one Grant Axis, as the axis record `id` or `externalId`. */
|
|
151
|
+
export type AccessDatasetPolicyAxis = Readonly<{
|
|
152
|
+
/** FQN of the Grant Axis. */
|
|
153
|
+
axis: string;
|
|
154
|
+
field: string;
|
|
155
|
+
match: "externalId" | "id";
|
|
156
|
+
}>;
|
|
157
|
+
/** The budget of one read; the Dataset defaults fill an absent bound. */
|
|
158
|
+
export type AccessDatasetLimits = Readonly<{
|
|
159
|
+
maxBytes?: number;
|
|
160
|
+
maxRows?: number;
|
|
161
|
+
maxTimeoutMs?: number;
|
|
162
|
+
}>;
|
|
163
|
+
/**
|
|
164
|
+
* A Dataset Data Policy: one Dataset, `read` only. Its `where` lowers to a
|
|
165
|
+
* Dataset filter, so `overlaps`, `includesMe`, `via` and declared
|
|
166
|
+
* conditions are refused (Q26).
|
|
167
|
+
*/
|
|
168
|
+
export type AccessDatasetDataPolicyDeclaration = PackagePrimitiveBase<"accessDatasetDataPolicy"> & Readonly<{
|
|
169
|
+
axes?: readonly AccessDatasetPolicyAxis[];
|
|
170
|
+
capability: AccessCapabilityRequirement;
|
|
171
|
+
/** FQN of the Dataset connector instance. */
|
|
172
|
+
dataset: string;
|
|
173
|
+
lifecycle?: LifecycleOptions;
|
|
174
|
+
limits?: AccessDatasetLimits;
|
|
175
|
+
otherAxes?: "unscoped";
|
|
176
|
+
/** Every field that is not sensitive without it. */
|
|
177
|
+
readableFields?: AccessFieldSelection;
|
|
178
|
+
where?: AccessCondition;
|
|
179
|
+
}>;
|
|
150
180
|
/** What Max Privileges cap: the user tokens of an app, or the keys of an API key template. */
|
|
151
181
|
export type AccessMaxPrivilegesTarget = Readonly<{
|
|
152
182
|
apiKeyTemplate: string;
|
|
@@ -159,4 +189,4 @@ export type AccessMaxPrivilegesDeclaration = PackagePrimitiveBase<"accessMaxPriv
|
|
|
159
189
|
capabilities: readonly AccessCapabilityGrant[];
|
|
160
190
|
lifecycle?: LifecycleOptions;
|
|
161
191
|
}>;
|
|
162
|
-
export type AccessPrimitiveDeclaration = AccessCapabilitiesDeclaration | AccessDocumentDataPolicyDeclaration | AccessGrantAxisDeclaration | AccessKnowledgeDataConditionDeclaration | AccessKnowledgeDataPolicyDeclaration | AccessMaxPrivilegesDeclaration | AccessProfileDeclaration | AccessProfileGrantDeclaration;
|
|
192
|
+
export type AccessPrimitiveDeclaration = AccessCapabilitiesDeclaration | AccessDatasetDataPolicyDeclaration | AccessDocumentDataPolicyDeclaration | AccessGrantAxisDeclaration | AccessKnowledgeDataConditionDeclaration | AccessKnowledgeDataPolicyDeclaration | AccessMaxPrivilegesDeclaration | AccessProfileDeclaration | AccessProfileGrantDeclaration;
|
package/dist/access/readers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReadValue } from "../package/readers.js";
|
|
2
2
|
import type { AccessCapabilityGrant, AccessCapabilityNodeDeclaration } from "./capabilities.js";
|
|
3
3
|
import type { AccessCondition } from "./conditions.js";
|
|
4
|
-
import type { AccessConditionTest, AccessDocumentDataPolicyDeclaration, AccessFieldSelection, AccessGrantee, AccessKnowledgeEntityIdentifier, AccessMaxPrivilegesTarget, AccessPolicyAxis } from "./manifest.js";
|
|
4
|
+
import type { AccessConditionTest, AccessDatasetLimits, AccessDatasetPolicyAxis, AccessDocumentDataPolicyDeclaration, AccessFieldSelection, AccessGrantee, AccessKnowledgeEntityIdentifier, AccessMaxPrivilegesTarget, AccessPolicyAxis } from "./manifest.js";
|
|
5
5
|
import type { AccessCapabilityRequirement } from "./requirement.js";
|
|
6
6
|
/** The serialized capability nodes below an app gate, a Switch. */
|
|
7
7
|
export declare const applicationCapabilityNodes: ReadValue<Readonly<Record<string, AccessCapabilityNodeDeclaration>>>;
|
|
@@ -20,6 +20,24 @@ export declare const accessPrimitives: {
|
|
|
20
20
|
lifecycle?: import("../index.js").LifecycleOptions;
|
|
21
21
|
nodes: Readonly<Record<string, AccessCapabilityNodeDeclaration>>;
|
|
22
22
|
}> & import("../index.js").JsonObject>;
|
|
23
|
+
accessDatasetDataPolicy: ReadValue<Readonly<{
|
|
24
|
+
description?: string;
|
|
25
|
+
displayName: string;
|
|
26
|
+
fqn: string;
|
|
27
|
+
icon?: string;
|
|
28
|
+
kind: "accessDatasetDataPolicy";
|
|
29
|
+
tags?: readonly string[];
|
|
30
|
+
version: string;
|
|
31
|
+
}> & Readonly<{
|
|
32
|
+
axes?: readonly AccessDatasetPolicyAxis[];
|
|
33
|
+
capability: AccessCapabilityRequirement;
|
|
34
|
+
dataset: string;
|
|
35
|
+
lifecycle?: import("../index.js").LifecycleOptions;
|
|
36
|
+
limits?: AccessDatasetLimits;
|
|
37
|
+
otherAxes?: "unscoped";
|
|
38
|
+
readableFields?: AccessFieldSelection;
|
|
39
|
+
where?: AccessCondition;
|
|
40
|
+
}> & import("../index.js").JsonObject>;
|
|
23
41
|
accessDocumentDataPolicy: ReadValue<AccessDocumentDataPolicyDeclaration>;
|
|
24
42
|
accessGrantAxis: ReadValue<Readonly<{
|
|
25
43
|
description?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VisibilityCondition } from "../schema/forms.js";
|
|
2
2
|
export type BindingScope = "organization" | "tenant";
|
|
3
|
-
export type PackagePrimitiveKind = "accessCapabilities" | "accessDocumentDataPolicy" | "accessGrantAxis" | "accessKnowledgeDataCondition" | "accessKnowledgeDataPolicy" | "accessMaxPrivileges" | "accessProfile" | "accessProfileGrant" | "agent" | "automationLimits" | "knowledgeEntityAdapter" | "connection" | "connectionInstance" | "externalDatasetProvider" | "managedDatasetProvider" | "datasetParser" | "datasetBlueprint" | "datasetTableTemplate" | "documentCollection" | "documentsConnector" | "knowledgeConnectorInstance" | "datasetConnectorInstance" | "knowledgeConnector" | "knowledgeConnectorOauth" | "domain" | "domainTemplate" | "emailProvider" | "eventListener" | "externalApplication" | "externalAppGateway" | "fieldTransformer" | "knowledgeEntitySchema" | "notificationChannel" | "organizationGroup" | "organizationInstructions" | "organizationSettings" | "organizationSso" | "outboundMessagingProvider" | "packageSource" | "placementRule" | "remoteToolCollection" | "repositoryLink" | "reviewPolicy" | "servicePrincipal" | "skill" | "skillTemplate" | "studioApp" | "studioAppTemplate" | "studioComponent" | "tool" | "toolCollection" | "toolSettingsOptions" | "workflow" | "workflowField" | "workflowFieldCollection" | "workflowNode" | "workflowNodeCollection" | "workflowTemplate";
|
|
3
|
+
export type PackagePrimitiveKind = "accessCapabilities" | "accessDatasetDataPolicy" | "accessDocumentDataPolicy" | "accessGrantAxis" | "accessKnowledgeDataCondition" | "accessKnowledgeDataPolicy" | "accessMaxPrivileges" | "accessProfile" | "accessProfileGrant" | "agent" | "automationLimits" | "knowledgeEntityAdapter" | "connection" | "connectionInstance" | "externalDatasetProvider" | "managedDatasetProvider" | "datasetParser" | "datasetBlueprint" | "datasetTableTemplate" | "documentCollection" | "documentsConnector" | "knowledgeConnectorInstance" | "datasetConnectorInstance" | "knowledgeConnector" | "knowledgeConnectorOauth" | "domain" | "domainTemplate" | "emailProvider" | "eventListener" | "externalApplication" | "externalAppGateway" | "fieldTransformer" | "knowledgeEntitySchema" | "notificationChannel" | "organizationGroup" | "organizationInstructions" | "organizationSettings" | "organizationSso" | "outboundMessagingProvider" | "packageSource" | "placementRule" | "remoteToolCollection" | "repositoryLink" | "reviewPolicy" | "servicePrincipal" | "skill" | "skillTemplate" | "studioApp" | "studioAppTemplate" | "studioComponent" | "tool" | "toolCollection" | "toolSettingsOptions" | "workflow" | "workflowField" | "workflowFieldCollection" | "workflowNode" | "workflowNodeCollection" | "workflowTemplate";
|
|
4
4
|
export type PackagePrimitiveBase<Kind extends PackagePrimitiveKind> = Readonly<{
|
|
5
5
|
description?: string;
|
|
6
6
|
displayName: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AccessAudienceDeclaration } from "../access/audience.js";
|
|
1
2
|
import type { JsonObject, JsonValue } from "../foundation/json.js";
|
|
2
3
|
import type { PackagePrimitiveBase } from "./base.js";
|
|
3
4
|
import type { KnowledgeConnectorBindingExtraConfig, KnowledgeConnectorFieldMapRule } from "./connectors.js";
|
|
@@ -101,6 +102,11 @@ export type KnowledgeConnectorInstanceDeclaration = PackagePrimitiveBase<"knowle
|
|
|
101
102
|
entityBindings?: readonly KnowledgeConnectorInstanceEntityBinding[];
|
|
102
103
|
pipelines?: readonly KnowledgeConnectorInstancePipeline[];
|
|
103
104
|
}>;
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated The legacy admin-written Dataset policy that release N
|
|
107
|
+
* converts into Dataset Data Policies. No declaration carries it: a package
|
|
108
|
+
* declares `declareAccessDatasetDataPolicy` instead.
|
|
109
|
+
*/
|
|
104
110
|
export type DatasetConnectorInstanceDataPolicy = Readonly<{
|
|
105
111
|
principals: readonly Readonly<{
|
|
106
112
|
kind: "user" | "service";
|
|
@@ -124,9 +130,16 @@ export type DatasetConnectorInstanceSchedule = Readonly<{
|
|
|
124
130
|
type DatasetConnectorInstanceBase = PackagePrimitiveBase<"datasetConnectorInstance"> & Readonly<{
|
|
125
131
|
lifecycle: LifecycleOptions;
|
|
126
132
|
providerFqn: string;
|
|
133
|
+
/**
|
|
134
|
+
* Who the Dataset is offered to (its Dataset Audience), written by the
|
|
135
|
+
* bundle lifecycle: `upsert` on every deploy, `init_only` when the
|
|
136
|
+
* deploy creates the Dataset. Without it, a Dataset the deploy creates
|
|
137
|
+
* starts with the whole Organization; Dataset Data Policies still
|
|
138
|
+
* decide its rows.
|
|
139
|
+
*/
|
|
140
|
+
audience?: AccessAudienceDeclaration;
|
|
127
141
|
connection?: ConnectorInstanceConnection;
|
|
128
142
|
settings?: JsonObject;
|
|
129
|
-
dataPolicy?: DatasetConnectorInstanceDataPolicy;
|
|
130
143
|
schedules?: readonly DatasetConnectorInstanceSchedule[];
|
|
131
144
|
}>;
|
|
132
145
|
/** These configure actual native Datasets with the existing executable providers. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AccessAudienceDeclaration } from "../access/audience.js";
|
|
1
2
|
import type { PackagePrimitiveBase } from "./base.js";
|
|
2
3
|
import type { ConnectorInstanceConnection } from "./connector-instances.js";
|
|
3
4
|
/**
|
|
@@ -18,9 +19,16 @@ export type DocumentFolderTarget = Readonly<{
|
|
|
18
19
|
/**
|
|
19
20
|
* One Declared Connected collection and its Documents connector instance.
|
|
20
21
|
* The declaration `description` is the collection description. No option
|
|
21
|
-
* creates a Local collection. Document Data Policies decide who reads it
|
|
22
|
+
* creates a Local collection. Document Data Policies decide who reads it,
|
|
23
|
+
* inside its Collection Audience.
|
|
22
24
|
*/
|
|
23
25
|
export type DocumentCollectionDeclaration = PackagePrimitiveBase<"documentCollection"> & Readonly<{
|
|
26
|
+
/**
|
|
27
|
+
* Who the collection is offered to, written when the deploy creates
|
|
28
|
+
* it; admin edits stay after. Without it, the collection starts with
|
|
29
|
+
* the whole Organization.
|
|
30
|
+
*/
|
|
31
|
+
audience?: AccessAudienceDeclaration;
|
|
24
32
|
/** An existing Connection by setup input, or a declared Connection. */
|
|
25
33
|
connection: ConnectorInstanceConnection;
|
|
26
34
|
/**
|
|
@@ -150,9 +150,17 @@ type StudioComponentDefinitionInput<Schema> = Omit<MetadataDefinition<StudioComp
|
|
|
150
150
|
}>;
|
|
151
151
|
export declare const declareStudioComponent: <Schema>(input: MetadataClassDeclaration<StudioComponentDeclaration, StudioComponentDefinitionInput<Schema>>) => DeclaredComponent<StudioComponentDeclaration>;
|
|
152
152
|
export declare const declareKnowledgeConnectorInstance: (input: MetadataClassDeclaration<KnowledgeConnectorInstanceDeclaration, VaryingMetadataDefinition<KnowledgeConnectorInstanceDeclaration>>) => DeclaredComponent<KnowledgeConnectorInstanceDeclaration>;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
/** Each binding mode of the definition, with an authored audience. */
|
|
154
|
+
type DatasetConnectorInstanceDefinitionInput = VaryingMetadataDefinition<DatasetConnectorInstanceDeclaration> extends infer Definition ? Definition extends unknown ? Omit<Definition, "audience"> & Readonly<{
|
|
155
|
+
audience?: AccessAudience;
|
|
156
|
+
}> : never : never;
|
|
157
|
+
/** Declares a Dataset connector instance with its Dataset Audience. */
|
|
158
|
+
export declare const declareDatasetConnectorInstance: (input: MetadataClassDeclaration<DatasetConnectorInstanceDeclaration, DatasetConnectorInstanceDefinitionInput>) => DeclaredComponent<DatasetConnectorInstanceDeclaration>;
|
|
159
|
+
type DocumentCollectionDefinitionInput = Omit<VaryingMetadataDefinition<DocumentCollectionDeclaration>, "audience"> & Readonly<{
|
|
160
|
+
audience?: AccessAudience;
|
|
161
|
+
}>;
|
|
162
|
+
/** Declares a Declared Connected collection with its Declared rules and its audience. */
|
|
163
|
+
export declare const declareDocumentCollection: (input: MetadataClassDeclaration<DocumentCollectionDeclaration, DocumentCollectionDefinitionInput>) => DeclaredComponent<DocumentCollectionDeclaration>;
|
|
156
164
|
type RepositoryLinkDefinitionInput = Omit<MetadataDefinition<RepositoryLinkDeclaration>, "connection"> & Readonly<{
|
|
157
165
|
connection: DeclarationReference<"connectionInstance">;
|
|
158
166
|
}>;
|