Skip to main content

Class: TopicsClient

Defined in: src/management/topics.ts:38

Client for AIRS custom topic CRUD operations.

Constructors​

Constructor​

new TopicsClient(opts): TopicsClient;

Defined in: src/management/topics.ts:73

Parameters​

ParameterType
optsTopicsClientOptions

Returns​

TopicsClient

Methods​

listForToken()​

listForToken(opts?): Promise<objectOutputType<{
custom_topics: ZodDefault<ZodArray<ZodObject<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, "passthrough", ZodTypeAny, objectOutputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">, objectInputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>, "many">>;
next_offset: ZodOptional<ZodNumber>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:40

List topics using the OpenAPI route scoped by the token.

Parameters​

ParameterType
optsOmit<PaginationOptions, "latest">

Returns​

Promise<objectOutputType<{ custom_topics: ZodDefault<ZodArray<ZodObject<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, "passthrough", ZodTypeAny, objectOutputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">, objectInputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>, "many">>; next_offset: ZodOptional<ZodNumber>; }, ZodTypeAny, "passthrough">>

Example​

`const page = await mgmt.topics.listForToken({ limit: 20 });`

forceDeleteWithAudit()​

forceDeleteWithAudit(topicId, updatedBy): Promise<
| {
message: string;
}
| objectOutputType<{
message: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:54

Force-delete through the OpenAPI route, recording the acting user.

Parameters​

ParameterType
topicIdstring
updatedBystring

Returns​

Promise< | { message: string; } | objectOutputType<{ message: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>

Example​

`await mgmt.topics.forceDeleteWithAudit(topicUuid, 'admin@example.com');`

create()​

create(body): Promise<objectOutputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:100

Create a new custom topic.

Parameters​

ParameterTypeDescription
bodyobjectOutputTypeTopic definition with name, description, and examples.

Returns​

Promise<objectOutputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>

The created custom topic.

Example​

import { ManagementClient } from '@cdot65/prisma-airs-sdk';
const mgmt = new ManagementClient(); // reads PANW_MGMT_* env vars

const topic = await mgmt.topics.create({
topic_name: 'credit-card-numbers',
active: true,
description: 'Detects credit card numbers in prompts and responses',
examples: ['4111-1111-1111-1111', '5500 0000 0000 0004'],
});
// topic =>
// { topic_id: '550e8400-...', topic_name: 'credit-card-numbers',
// revision: 1, active: true, examples: ['4111-1111-1111-1111', ...] }

list()​

list(opts?): Promise<objectOutputType<{
custom_topics: ZodDefault<ZodArray<ZodObject<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, "passthrough", ZodTypeAny, objectOutputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">, objectInputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>, "many">>;
next_offset: ZodOptional<ZodNumber>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:128

List custom topics for the TSG.

Parameters​

ParameterTypeDescription
opts?TopicListOptionsPagination options.

Returns​

Promise<objectOutputType<{ custom_topics: ZodDefault<ZodArray<ZodObject<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, "passthrough", ZodTypeAny, objectOutputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">, objectInputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>, "many">>; next_offset: ZodOptional<ZodNumber>; }, ZodTypeAny, "passthrough">>

Paginated list of custom topics.

Example​

import { ManagementClient } from '@cdot65/prisma-airs-sdk';
const mgmt = new ManagementClient(); // reads PANW_MGMT_* env vars

const page = await mgmt.topics.list({ offset: 0, limit: 5 });
// page =>
// { custom_topics: [ { topic_id: '550e8400-...', topic_name: 'credit-cards',
// revision: 1, active: true } ], next_offset: 20 }

listAll()​

listAll(opts?): Promise<objectOutputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">[]>;

Defined in: src/management/topics.ts:168

List custom topics across every response page.

Parameters​

ParameterType
optsTopicListAllOptions

Returns​

Promise<objectOutputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">[]>

Example​

const topics = await mgmt.topics.listAll({ limit: 200 });

get()​

get(topicId): Promise<objectOutputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:186

Get an exact custom-topic revision by UUID.

Parameters​

ParameterType
topicIdstring

Returns​

Promise<objectOutputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>

Example​

const topic = await mgmt.topics.get('550e8400-e29b-41d4-a716-446655440000');

getByName()​

getByName(topicName): Promise<objectOutputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:203

Get the highest revision of a custom topic by name.

Parameters​

ParameterType
topicNamestring

Returns​

Promise<objectOutputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>

Example​

const topic = await mgmt.topics.getByName('credit-cards');

update()​

update(topicId, body): Promise<objectOutputType<{
topic_id: ZodOptional<ZodString>;
topic_name: ZodString;
revision: ZodNumber;
active: ZodOptional<ZodBoolean>;
description: ZodString;
examples: ZodDefault<ZodArray<ZodString, "many">>;
created_by: ZodOptional<ZodString>;
updated_by: ZodOptional<ZodString>;
last_modified_ts: ZodOptional<ZodString>;
created_ts: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:232

Update an existing custom topic.

Parameters​

ParameterTypeDescription
topicIdstringUUID of the topic to update.
bodyobjectOutputTypeUpdated topic definition.

Returns​

Promise<objectOutputType<{ topic_id: ZodOptional<ZodString>; topic_name: ZodString; revision: ZodNumber; active: ZodOptional<ZodBoolean>; description: ZodString; examples: ZodDefault<ZodArray<ZodString, "many">>; created_by: ZodOptional<ZodString>; updated_by: ZodOptional<ZodString>; last_modified_ts: ZodOptional<ZodString>; created_ts: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>

The updated custom topic.

Example​

import { ManagementClient } from '@cdot65/prisma-airs-sdk';
const mgmt = new ManagementClient(); // reads PANW_MGMT_* env vars

const updated = await mgmt.topics.update('550e8400-e29b-41d4-a716-446655440000', {
topic_name: 'credit-card-numbers',
description: 'Updated: detects credit card numbers and CVVs',
examples: ['4111-1111-1111-1111', 'CVV: 123'],
});
// updated =>
// { topic_id: '550e8400-...', topic_name: 'credit-card-numbers', revision: 2, active: true }

delete()​

delete(topicId): Promise<
| {
message: string;
}
| objectOutputType<{
message: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:259

Delete a custom topic. Fails if topic is referenced by a profile.

Parameters​

ParameterTypeDescription
topicIdstringUUID of the topic to delete.

Returns​

Promise< | { message: string; } | objectOutputType<{ message: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>

Deletion confirmation message.

Example​

import { ManagementClient } from '@cdot65/prisma-airs-sdk';
const mgmt = new ManagementClient(); // reads PANW_MGMT_* env vars

const result = await mgmt.topics.delete('550e8400-e29b-41d4-a716-446655440000');
// result => { message: 'deleted' }

forceDelete()​

forceDelete(topicId, updatedBy?): Promise<
| {
message: string;
}
| objectOutputType<{
message: ZodOptional<ZodString>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/management/topics.ts:290

Force-delete a custom topic, removing it from any referencing profiles.

Parameters​

ParameterTypeDescription
topicIdstringUUID of the topic to force-delete.
updatedBy?stringActing user, required by the API. The optional TypeScript parameter is retained for existing CLI wrappers; omitting it now fails locally. For a required parameter in new code, use TopicsClient.forceDeleteWithAudit.

Returns​

Promise< | { message: string; } | objectOutputType<{ message: ZodOptional<ZodString>; }, ZodTypeAny, "passthrough">>

Deletion confirmation message.

Example​

import { ManagementClient } from '@cdot65/prisma-airs-sdk';
const mgmt = new ManagementClient(); // reads PANW_MGMT_* env vars

const result = await mgmt.topics.forceDelete(
'550e8400-e29b-41d4-a716-446655440000',
'admin@example.com',
);
// result => { message: 'force deleted' }