Appearance
Interface: PolicyPacksClient
Policy packs (POST /definitions/import, GET /definitions/export): load a set of rules, rule sets, workflows, collection flows and lists into the tenant, or read the published versions back as one. See docs/integrate/policies.md.
Properties
export
ts
export: (keys, options?) => Promise<{
definitions: {
collectionFlows: object[];
lists: object[];
rules: object[];
ruleSets: object[];
workflows: object[];
};
description?: string;
installs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
name: string;
version: string;
}>;The published versions of keys as a pack (definitions:read; lists need lists:read). The pack declares every install its definitions call, under the name they call it, with the app that install runs; 409 unknown_install when the tenant has no install by a name they call.
Parameters
keys
readonly PolicyPackKeyLike[]
options?
Returns
Promise<{ definitions: { collectionFlows: object[]; lists: object[]; rules: object[]; ruleSets: object[]; workflows: object[]; }; description?: string; installs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>; name: string; version: string; }>
import
ts
import: (pack, options?) => Promise<{
approvalRequired: boolean;
definitions: object[];
installs: object[];
lists: object[];
name: string;
publish: boolean;
version: string;
}>;Validates every item first and creates one draft version per definition (definitions:write). The result's installs reports each install the pack declares: present (an install of the tenant by that name, or a former name it keeps, runs the app the pack expects; issues lists actions its version lacks or answers asynchronously for an app rule, which refuse the import only with publish) or missing, with appAvailable saying whether the catalogue can install the app. An install of that name running another app refuses the import (400).
Parameters
pack
definitions
{ collectionFlows?: object[]; lists?: object[]; rules?: object[]; ruleSets?: object[]; workflows?: object[]; }
definitions.collectionFlows?
object[]
definitions.lists?
object[]
definitions.rules?
object[]
definitions.ruleSets?
object[]
definitions.workflows?
object[]
description?
string
installs?
Record<string, string>
name
string
version
string
options?
Returns
Promise<{ approvalRequired: boolean; definitions: object[]; installs: object[]; lists: object[]; name: string; publish: boolean; version: string; }>
importStarter
ts
importStarter: (id, options?) => Promise<{
approvalRequired: boolean;
definitions: object[];
installs: object[];
lists: object[];
name: string;
publish: boolean;
version: string;
}>;Imports a starter pack by its id, like import with the pack as the body, installs included.
Parameters
id
string
options?
Returns
Promise<{ approvalRequired: boolean; definitions: object[]; installs: object[]; lists: object[]; name: string; publish: boolean; version: string; }>
starters
ts
starters: () => Promise<object[]>;The starter packs the deployment ships (definitions:read).
Returns
Promise<object[]>