@cadenya/cadenya 0.130.0 → 0.132.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/client.d.mts +9 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +9 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/index.d.mts +1 -0
  12. package/resources/index.d.mts.map +1 -1
  13. package/resources/index.d.ts +1 -0
  14. package/resources/index.d.ts.map +1 -1
  15. package/resources/index.js +3 -1
  16. package/resources/index.js.map +1 -1
  17. package/resources/index.mjs +1 -0
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/objectives/objectives.d.mts +18 -0
  20. package/resources/objectives/objectives.d.mts.map +1 -1
  21. package/resources/objectives/objectives.d.ts +18 -0
  22. package/resources/objectives/objectives.d.ts.map +1 -1
  23. package/resources/objectives/objectives.js.map +1 -1
  24. package/resources/objectives/objectives.mjs.map +1 -1
  25. package/resources/tenants/index.d.mts +3 -0
  26. package/resources/tenants/index.d.mts.map +1 -0
  27. package/resources/tenants/index.d.ts +3 -0
  28. package/resources/tenants/index.d.ts.map +1 -0
  29. package/resources/tenants/index.js +9 -0
  30. package/resources/tenants/index.js.map +1 -0
  31. package/resources/tenants/index.mjs +4 -0
  32. package/resources/tenants/index.mjs.map +1 -0
  33. package/resources/tenants/subjects.d.mts +43 -0
  34. package/resources/tenants/subjects.d.mts.map +1 -0
  35. package/resources/tenants/subjects.d.ts +43 -0
  36. package/resources/tenants/subjects.d.ts.map +1 -0
  37. package/resources/tenants/subjects.js +27 -0
  38. package/resources/tenants/subjects.js.map +1 -0
  39. package/resources/tenants/subjects.mjs +23 -0
  40. package/resources/tenants/subjects.mjs.map +1 -0
  41. package/resources/tenants/tenants.d.mts +158 -0
  42. package/resources/tenants/tenants.d.mts.map +1 -0
  43. package/resources/tenants/tenants.d.ts +158 -0
  44. package/resources/tenants/tenants.d.ts.map +1 -0
  45. package/resources/tenants/tenants.js +58 -0
  46. package/resources/tenants/tenants.js.map +1 -0
  47. package/resources/tenants/tenants.mjs +53 -0
  48. package/resources/tenants/tenants.mjs.map +1 -0
  49. package/resources/tenants.d.mts +2 -0
  50. package/resources/tenants.d.mts.map +1 -0
  51. package/resources/tenants.d.ts +2 -0
  52. package/resources/tenants.d.ts.map +1 -0
  53. package/resources/tenants.js +6 -0
  54. package/resources/tenants.js.map +1 -0
  55. package/resources/tenants.mjs +3 -0
  56. package/resources/tenants.mjs.map +1 -0
  57. package/src/client.ts +31 -0
  58. package/src/resources/index.ts +12 -0
  59. package/src/resources/objectives/objectives.ts +21 -0
  60. package/src/resources/tenants/index.ts +15 -0
  61. package/src/resources/tenants/subjects.ts +63 -0
  62. package/src/resources/tenants/tenants.ts +220 -0
  63. package/src/resources/tenants.ts +3 -0
  64. package/src/version.ts +1 -1
  65. package/version.d.mts +1 -1
  66. package/version.d.ts +1 -1
  67. package/version.js +1 -1
  68. package/version.mjs +1 -1
@@ -0,0 +1,158 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as Shared from "../shared.mjs";
3
+ import * as WidgetSessionsAPI from "../widget-sessions.mjs";
4
+ import * as SubjectsAPI from "./subjects.mjs";
5
+ import { SubjectListParams, Subjects } from "./subjects.mjs";
6
+ import { APIPromise } from "../../core/api-promise.mjs";
7
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.mjs";
8
+ import { RequestOptions } from "../../internal/request-options.mjs";
9
+ /**
10
+ * Read and erase tenants and the subjects under them. Tenants and subjects are
11
+ * created by assertion — on objective creation or widget session mint — never
12
+ * directly, so this service has no create or update: it exists to enumerate what
13
+ * assertions have produced, and to destroy it on request.
14
+ */
15
+ export declare class Tenants extends APIResource {
16
+ subjects: SubjectsAPI.Subjects;
17
+ /**
18
+ * Retrieves a tenant by its canonical id or by the `external_id:<value>` form the
19
+ * customer asserted it under.
20
+ */
21
+ retrieve(id: string, params?: TenantRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<Tenant>;
22
+ /**
23
+ * Lists the tenants asserted in a workspace, newest first. `query` matches against
24
+ * a tenant's name and its external_id, for type-ahead filters.
25
+ */
26
+ list(params?: TenantListParams | null | undefined, options?: RequestOptions): PagePromise<TenantsCursorPagination, Tenant>;
27
+ /**
28
+ * Destroys the tenant, its subjects, every objective associated with it and
29
+ * everything reachable from those objectives, and its widget sessions. This is the
30
+ * full erasure hammer, wider than `DELETE /widget_sessions`, which removes only
31
+ * what widget sessions created. The work runs in the background: this returns the
32
+ * tenant in STATE_ERASING rather than a count of what was removed, since a large
33
+ * tenant's history cannot be destroyed inside a request. Poll the tenant to follow
34
+ * it — STATE_ERASING while it runs, NotFound once it finishes. Erasure is
35
+ * terminal; a tenant cannot be recovered once it starts.
36
+ */
37
+ delete(id: string, params?: TenantDeleteParams | null | undefined, options?: RequestOptions): APIPromise<Tenant>;
38
+ }
39
+ export type TenantsCursorPagination = CursorPagination<Tenant>;
40
+ export type SubjectsCursorPagination = CursorPagination<Subject>;
41
+ /**
42
+ * Subject is a person within a tenant as a readable record. Like Tenant it carries
43
+ * no spec — `metadata.external_id` is the customer's key for them, unique within
44
+ * the tenant rather than the workspace.
45
+ */
46
+ export interface Subject {
47
+ /**
48
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
49
+ */
50
+ metadata: Shared.ResourceMetadata;
51
+ /**
52
+ * SubjectInfo provides read-only server-derived data about a subject.
53
+ */
54
+ info?: SubjectInfo;
55
+ }
56
+ /**
57
+ * SubjectInfo provides read-only server-derived data about a subject.
58
+ */
59
+ export interface SubjectInfo {
60
+ /**
61
+ * Number of objectives associated with this subject.
62
+ */
63
+ objectiveCount?: number;
64
+ /**
65
+ * TenantReference is the read-only echo of a resource's tenant association,
66
+ * carrying both Cadenya's canonical id and the customer's own key.
67
+ */
68
+ tenant?: WidgetSessionsAPI.TenantReference;
69
+ }
70
+ /**
71
+ * Tenant is the customer's organization as a readable record rather than an echo.
72
+ * It carries no spec: a tenant is never configured, only asserted, so everything
73
+ * about it lives in the metadata envelope — `external_id` is the key the customer
74
+ * asserted it under, `name` is the most recent name they asserted, and
75
+ * `updated_at` is therefore when the tenant was last asserted.
76
+ */
77
+ export interface Tenant {
78
+ /**
79
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
80
+ */
81
+ metadata: Shared.ResourceMetadata;
82
+ /**
83
+ * The current lifecycle state of the tenant. Output only.
84
+ */
85
+ state: 'STATE_UNSPECIFIED' | 'STATE_ACTIVE' | 'STATE_ERASING';
86
+ /**
87
+ * TenantInfo provides read-only server-derived data about a tenant.
88
+ */
89
+ info?: TenantInfo;
90
+ }
91
+ /**
92
+ * TenantInfo provides read-only server-derived data about a tenant.
93
+ */
94
+ export interface TenantInfo {
95
+ /**
96
+ * Number of objectives associated with this tenant, across every surface — widget
97
+ * conversations and objectives created directly against the API alike. This is the
98
+ * footprint a delete would destroy, which is why it is worth the count query that
99
+ * populating `info` costs.
100
+ */
101
+ objectiveCount?: number;
102
+ /**
103
+ * Number of subjects asserted under this tenant.
104
+ */
105
+ subjectCount?: number;
106
+ /**
107
+ * Number of widget sessions minted for this tenant that still exist.
108
+ */
109
+ widgetSessionCount?: number;
110
+ }
111
+ export interface TenantRetrieveParams {
112
+ /**
113
+ * Path param: Workspace ID.
114
+ */
115
+ workspaceId?: string;
116
+ /**
117
+ * Query param: When true, the `info` field is populated.
118
+ */
119
+ includeInfo?: boolean;
120
+ }
121
+ export interface TenantListParams extends CursorPaginationParams {
122
+ /**
123
+ * Path param: Workspace ID.
124
+ */
125
+ workspaceId?: string;
126
+ /**
127
+ * Query param: When true, the `info` field on each returned tenant is populated.
128
+ * This costs several count queries per tenant, so it is off by default.
129
+ */
130
+ includeInfo?: boolean;
131
+ /**
132
+ * Query param: Filters by metadata labels. Comma-separated key=value pairs, e.g.
133
+ * "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
134
+ * semantics).
135
+ */
136
+ labels?: string;
137
+ /**
138
+ * Query param: Substring match against the tenant's name and external_id. Built
139
+ * for type-ahead filter pickers, where the operator knows the customer's own
140
+ * identifier rather than Cadenya's.
141
+ */
142
+ query?: string;
143
+ /**
144
+ * Query param: Sort order for results (asc or desc by creation time).
145
+ */
146
+ sortOrder?: string;
147
+ }
148
+ export interface TenantDeleteParams {
149
+ /**
150
+ * Workspace ID.
151
+ */
152
+ workspaceId?: string;
153
+ }
154
+ export declare namespace Tenants {
155
+ export { type Subject as Subject, type SubjectInfo as SubjectInfo, type Tenant as Tenant, type TenantInfo as TenantInfo, type TenantsCursorPagination as TenantsCursorPagination, type TenantRetrieveParams as TenantRetrieveParams, type TenantListParams as TenantListParams, type TenantDeleteParams as TenantDeleteParams, };
156
+ export { Subjects as Subjects, type SubjectListParams as SubjectListParams };
157
+ }
158
+ //# sourceMappingURL=tenants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.d.mts","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,MAAM,sBAAkB;AACpC,OAAO,KAAK,iBAAiB,+BAA2B;AACxD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,uBAAmB;AACzD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,kCAA8B;AACnG,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IAExE;;;OAGG;IACH,QAAQ,CACN,EAAE,EAAE,MAAM,EACV,MAAM,GAAE,oBAAoB,GAA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AAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;IAEF,OAAO,EAAE,QAAQ,IAAI,QAAQ,EAAE,KAAK,iBAAiB,IAAI,iBAAiB,EAAE,CAAC;CAC9E"}
@@ -0,0 +1,158 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as Shared from "../shared.js";
3
+ import * as WidgetSessionsAPI from "../widget-sessions.js";
4
+ import * as SubjectsAPI from "./subjects.js";
5
+ import { SubjectListParams, Subjects } from "./subjects.js";
6
+ import { APIPromise } from "../../core/api-promise.js";
7
+ import { CursorPagination, type CursorPaginationParams, PagePromise } from "../../core/pagination.js";
8
+ import { RequestOptions } from "../../internal/request-options.js";
9
+ /**
10
+ * Read and erase tenants and the subjects under them. Tenants and subjects are
11
+ * created by assertion — on objective creation or widget session mint — never
12
+ * directly, so this service has no create or update: it exists to enumerate what
13
+ * assertions have produced, and to destroy it on request.
14
+ */
15
+ export declare class Tenants extends APIResource {
16
+ subjects: SubjectsAPI.Subjects;
17
+ /**
18
+ * Retrieves a tenant by its canonical id or by the `external_id:<value>` form the
19
+ * customer asserted it under.
20
+ */
21
+ retrieve(id: string, params?: TenantRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<Tenant>;
22
+ /**
23
+ * Lists the tenants asserted in a workspace, newest first. `query` matches against
24
+ * a tenant's name and its external_id, for type-ahead filters.
25
+ */
26
+ list(params?: TenantListParams | null | undefined, options?: RequestOptions): PagePromise<TenantsCursorPagination, Tenant>;
27
+ /**
28
+ * Destroys the tenant, its subjects, every objective associated with it and
29
+ * everything reachable from those objectives, and its widget sessions. This is the
30
+ * full erasure hammer, wider than `DELETE /widget_sessions`, which removes only
31
+ * what widget sessions created. The work runs in the background: this returns the
32
+ * tenant in STATE_ERASING rather than a count of what was removed, since a large
33
+ * tenant's history cannot be destroyed inside a request. Poll the tenant to follow
34
+ * it — STATE_ERASING while it runs, NotFound once it finishes. Erasure is
35
+ * terminal; a tenant cannot be recovered once it starts.
36
+ */
37
+ delete(id: string, params?: TenantDeleteParams | null | undefined, options?: RequestOptions): APIPromise<Tenant>;
38
+ }
39
+ export type TenantsCursorPagination = CursorPagination<Tenant>;
40
+ export type SubjectsCursorPagination = CursorPagination<Subject>;
41
+ /**
42
+ * Subject is a person within a tenant as a readable record. Like Tenant it carries
43
+ * no spec — `metadata.external_id` is the customer's key for them, unique within
44
+ * the tenant rather than the workspace.
45
+ */
46
+ export interface Subject {
47
+ /**
48
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
49
+ */
50
+ metadata: Shared.ResourceMetadata;
51
+ /**
52
+ * SubjectInfo provides read-only server-derived data about a subject.
53
+ */
54
+ info?: SubjectInfo;
55
+ }
56
+ /**
57
+ * SubjectInfo provides read-only server-derived data about a subject.
58
+ */
59
+ export interface SubjectInfo {
60
+ /**
61
+ * Number of objectives associated with this subject.
62
+ */
63
+ objectiveCount?: number;
64
+ /**
65
+ * TenantReference is the read-only echo of a resource's tenant association,
66
+ * carrying both Cadenya's canonical id and the customer's own key.
67
+ */
68
+ tenant?: WidgetSessionsAPI.TenantReference;
69
+ }
70
+ /**
71
+ * Tenant is the customer's organization as a readable record rather than an echo.
72
+ * It carries no spec: a tenant is never configured, only asserted, so everything
73
+ * about it lives in the metadata envelope — `external_id` is the key the customer
74
+ * asserted it under, `name` is the most recent name they asserted, and
75
+ * `updated_at` is therefore when the tenant was last asserted.
76
+ */
77
+ export interface Tenant {
78
+ /**
79
+ * Standard metadata for persistent, named resources (e.g., agents, tools, prompts)
80
+ */
81
+ metadata: Shared.ResourceMetadata;
82
+ /**
83
+ * The current lifecycle state of the tenant. Output only.
84
+ */
85
+ state: 'STATE_UNSPECIFIED' | 'STATE_ACTIVE' | 'STATE_ERASING';
86
+ /**
87
+ * TenantInfo provides read-only server-derived data about a tenant.
88
+ */
89
+ info?: TenantInfo;
90
+ }
91
+ /**
92
+ * TenantInfo provides read-only server-derived data about a tenant.
93
+ */
94
+ export interface TenantInfo {
95
+ /**
96
+ * Number of objectives associated with this tenant, across every surface — widget
97
+ * conversations and objectives created directly against the API alike. This is the
98
+ * footprint a delete would destroy, which is why it is worth the count query that
99
+ * populating `info` costs.
100
+ */
101
+ objectiveCount?: number;
102
+ /**
103
+ * Number of subjects asserted under this tenant.
104
+ */
105
+ subjectCount?: number;
106
+ /**
107
+ * Number of widget sessions minted for this tenant that still exist.
108
+ */
109
+ widgetSessionCount?: number;
110
+ }
111
+ export interface TenantRetrieveParams {
112
+ /**
113
+ * Path param: Workspace ID.
114
+ */
115
+ workspaceId?: string;
116
+ /**
117
+ * Query param: When true, the `info` field is populated.
118
+ */
119
+ includeInfo?: boolean;
120
+ }
121
+ export interface TenantListParams extends CursorPaginationParams {
122
+ /**
123
+ * Path param: Workspace ID.
124
+ */
125
+ workspaceId?: string;
126
+ /**
127
+ * Query param: When true, the `info` field on each returned tenant is populated.
128
+ * This costs several count queries per tenant, so it is off by default.
129
+ */
130
+ includeInfo?: boolean;
131
+ /**
132
+ * Query param: Filters by metadata labels. Comma-separated key=value pairs, e.g.
133
+ * "env=prod,team=ai". A resource matches only if every pair matches exactly (AND
134
+ * semantics).
135
+ */
136
+ labels?: string;
137
+ /**
138
+ * Query param: Substring match against the tenant's name and external_id. Built
139
+ * for type-ahead filter pickers, where the operator knows the customer's own
140
+ * identifier rather than Cadenya's.
141
+ */
142
+ query?: string;
143
+ /**
144
+ * Query param: Sort order for results (asc or desc by creation time).
145
+ */
146
+ sortOrder?: string;
147
+ }
148
+ export interface TenantDeleteParams {
149
+ /**
150
+ * Workspace ID.
151
+ */
152
+ workspaceId?: string;
153
+ }
154
+ export declare namespace Tenants {
155
+ export { type Subject as Subject, type SubjectInfo as SubjectInfo, type Tenant as Tenant, type TenantInfo as TenantInfo, type TenantsCursorPagination as TenantsCursorPagination, type TenantRetrieveParams as TenantRetrieveParams, type TenantListParams as TenantListParams, type TenantDeleteParams as TenantDeleteParams, };
156
+ export { Subjects as Subjects, type SubjectListParams as SubjectListParams };
157
+ }
158
+ //# sourceMappingURL=tenants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,MAAM,qBAAkB;AACpC,OAAO,KAAK,iBAAiB,8BAA2B;AACxD,OAAO,KAAK,WAAW,sBAAmB;AAC1C,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,sBAAmB;AACzD,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE,iCAA8B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IBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Tenants = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const SubjectsAPI = tslib_1.__importStar(require("./subjects.js"));
8
+ const subjects_1 = require("./subjects.js");
9
+ const pagination_1 = require("../../core/pagination.js");
10
+ const path_1 = require("../../internal/utils/path.js");
11
+ /**
12
+ * Read and erase tenants and the subjects under them. Tenants and subjects are
13
+ * created by assertion — on objective creation or widget session mint — never
14
+ * directly, so this service has no create or update: it exists to enumerate what
15
+ * assertions have produced, and to destroy it on request.
16
+ */
17
+ class Tenants extends resource_1.APIResource {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.subjects = new SubjectsAPI.Subjects(this._client);
21
+ }
22
+ /**
23
+ * Retrieves a tenant by its canonical id or by the `external_id:<value>` form the
24
+ * customer asserted it under.
25
+ */
26
+ retrieve(id, params = {}, options) {
27
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
28
+ return this._client.get((0, path_1.path) `/v1/workspaces/${workspaceId}/tenants/${id}`, { query, ...options });
29
+ }
30
+ /**
31
+ * Lists the tenants asserted in a workspace, newest first. `query` matches against
32
+ * a tenant's name and its external_id, for type-ahead filters.
33
+ */
34
+ list(params = {}, options) {
35
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
36
+ return this._client.getAPIList((0, path_1.path) `/v1/workspaces/${workspaceId}/tenants`, (pagination_1.CursorPagination), {
37
+ query,
38
+ ...options,
39
+ });
40
+ }
41
+ /**
42
+ * Destroys the tenant, its subjects, every objective associated with it and
43
+ * everything reachable from those objectives, and its widget sessions. This is the
44
+ * full erasure hammer, wider than `DELETE /widget_sessions`, which removes only
45
+ * what widget sessions created. The work runs in the background: this returns the
46
+ * tenant in STATE_ERASING rather than a count of what was removed, since a large
47
+ * tenant's history cannot be destroyed inside a request. Poll the tenant to follow
48
+ * it — STATE_ERASING while it runs, NotFound once it finishes. Erasure is
49
+ * terminal; a tenant cannot be recovered once it starts.
50
+ */
51
+ delete(id, params = {}, options) {
52
+ const { workspaceId = this._client.workspaceID } = params ?? {};
53
+ return this._client.delete((0, path_1.path) `/v1/workspaces/${workspaceId}/tenants/${id}`, options);
54
+ }
55
+ }
56
+ exports.Tenants = Tenants;
57
+ Tenants.Subjects = subjects_1.Subjects;
58
+ //# sourceMappingURL=tenants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,mEAA0C;AAC1C,4CAAyD;AAEzD,yDAAmG;AAEnG,uDAAiD;AAEjD;;;;;GAKG;AACH,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAgD1E,CAAC;IA9CC;;;OAGG;IACH,QAAQ,CACN,EAAU,EACV,SAAkD,EAAE,EACpD,OAAwB;QAExB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,kBAAkB,WAAW,YAAY,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;OAGG;IACH,IAAI,CACF,SAA8C,EAAE,EAChD,OAAwB;QAExB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAA,WAAI,EAAA,kBAAkB,WAAW,UAAU,EAAE,CAAA,6BAAwB,CAAA,EAAE;YACpG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,EAAU,EACV,SAAgD,EAAE,EAClD,OAAwB;QAExB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,kBAAkB,WAAW,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACF;AAjDD,0BAiDC;AAyID,OAAO,CAAC,QAAQ,GAAG,mBAAQ,CAAC"}
@@ -0,0 +1,53 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as SubjectsAPI from "./subjects.mjs";
4
+ import { Subjects } from "./subjects.mjs";
5
+ import { CursorPagination } from "../../core/pagination.mjs";
6
+ import { path } from "../../internal/utils/path.mjs";
7
+ /**
8
+ * Read and erase tenants and the subjects under them. Tenants and subjects are
9
+ * created by assertion — on objective creation or widget session mint — never
10
+ * directly, so this service has no create or update: it exists to enumerate what
11
+ * assertions have produced, and to destroy it on request.
12
+ */
13
+ export class Tenants extends APIResource {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.subjects = new SubjectsAPI.Subjects(this._client);
17
+ }
18
+ /**
19
+ * Retrieves a tenant by its canonical id or by the `external_id:<value>` form the
20
+ * customer asserted it under.
21
+ */
22
+ retrieve(id, params = {}, options) {
23
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
24
+ return this._client.get(path `/v1/workspaces/${workspaceId}/tenants/${id}`, { query, ...options });
25
+ }
26
+ /**
27
+ * Lists the tenants asserted in a workspace, newest first. `query` matches against
28
+ * a tenant's name and its external_id, for type-ahead filters.
29
+ */
30
+ list(params = {}, options) {
31
+ const { workspaceId = this._client.workspaceID, ...query } = params ?? {};
32
+ return this._client.getAPIList(path `/v1/workspaces/${workspaceId}/tenants`, (CursorPagination), {
33
+ query,
34
+ ...options,
35
+ });
36
+ }
37
+ /**
38
+ * Destroys the tenant, its subjects, every objective associated with it and
39
+ * everything reachable from those objectives, and its widget sessions. This is the
40
+ * full erasure hammer, wider than `DELETE /widget_sessions`, which removes only
41
+ * what widget sessions created. The work runs in the background: this returns the
42
+ * tenant in STATE_ERASING rather than a count of what was removed, since a large
43
+ * tenant's history cannot be destroyed inside a request. Poll the tenant to follow
44
+ * it — STATE_ERASING while it runs, NotFound once it finishes. Erasure is
45
+ * terminal; a tenant cannot be recovered once it starts.
46
+ */
47
+ delete(id, params = {}, options) {
48
+ const { workspaceId = this._client.workspaceID } = params ?? {};
49
+ return this._client.delete(path `/v1/workspaces/${workspaceId}/tenants/${id}`, options);
50
+ }
51
+ }
52
+ Tenants.Subjects = Subjects;
53
+ //# sourceMappingURL=tenants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../../src/resources/tenants/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,KAAK,WAAW,uBAAmB;AAC1C,OAAO,EAAqB,QAAQ,EAAE,uBAAmB;AAEzD,OAAO,EAAE,gBAAgB,EAA4C,kCAA8B;AAEnG,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAgD1E,CAAC;IA9CC;;;OAGG;IACH,QAAQ,CACN,EAAU,EACV,SAAkD,EAAE,EACpD,OAAwB;QAExB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,kBAAkB,WAAW,YAAY,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;OAGG;IACH,IAAI,CACF,SAA8C,EAAE,EAChD,OAAwB;QAExB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAA,kBAAkB,WAAW,UAAU,EAAE,CAAA,gBAAwB,CAAA,EAAE;YACpG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CACJ,EAAU,EACV,SAAgD,EAAE,EAClD,OAAwB;QAExB,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,kBAAkB,WAAW,YAAY,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;CACF;AAyID,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./tenants/index.mjs";
2
+ //# sourceMappingURL=tenants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.d.mts","sourceRoot":"","sources":["../src/resources/tenants.ts"],"names":[],"mappings":"AAEA,oCAAgC"}
@@ -0,0 +1,2 @@
1
+ export * from "./tenants/index.js";
2
+ //# sourceMappingURL=tenants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../src/resources/tenants.ts"],"names":[],"mappings":"AAEA,mCAAgC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./tenants/index.js"), exports);
6
+ //# sourceMappingURL=tenants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.js","sourceRoot":"","sources":["../src/resources/tenants.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./tenants/index.mjs";
3
+ //# sourceMappingURL=tenants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.mjs","sourceRoot":"","sources":["../src/resources/tenants.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,oCAAgC"}
package/src/client.ts CHANGED
@@ -234,6 +234,17 @@ import {
234
234
  ToolResult,
235
235
  UserMessage,
236
236
  } from './resources/objectives/objectives';
237
+ import {
238
+ Subject,
239
+ SubjectInfo,
240
+ Tenant,
241
+ TenantDeleteParams,
242
+ TenantInfo,
243
+ TenantListParams,
244
+ TenantRetrieveParams,
245
+ Tenants,
246
+ TenantsCursorPagination,
247
+ } from './resources/tenants/tenants';
237
248
  import {
238
249
  ApprovalRequirementFilter,
239
250
  ApprovalRequirementFilterAlways,
@@ -1140,6 +1151,13 @@ export class Cadenya {
1140
1151
  * session tokens minted via WidgetSessionService.
1141
1152
  */
1142
1153
  widgets: API.Widgets = new API.Widgets(this);
1154
+ /**
1155
+ * Read and erase tenants and the subjects under them. Tenants and subjects are
1156
+ * created by assertion — on objective creation or widget session mint — never
1157
+ * directly, so this service has no create or update: it exists to enumerate what
1158
+ * assertions have produced, and to destroy it on request.
1159
+ */
1160
+ tenants: API.Tenants = new API.Tenants(this);
1143
1161
  /**
1144
1162
  * Mint and manage widget sessions. Session creation is server-to-server only:
1145
1163
  * the customer's backend authenticates its visitor, asserts tenant/subject
@@ -1166,6 +1184,7 @@ Cadenya.Workspaces = Workspaces;
1166
1184
  Cadenya.WorkspaceAdmin = WorkspaceAdmin;
1167
1185
  Cadenya.Webhooks = Webhooks;
1168
1186
  Cadenya.Widgets = Widgets;
1187
+ Cadenya.Tenants = Tenants;
1169
1188
  Cadenya.WidgetSessions = WidgetSessions;
1170
1189
 
1171
1190
  export declare namespace Cadenya {
@@ -1455,6 +1474,18 @@ export declare namespace Cadenya {
1455
1474
  type WidgetUnarchiveParams as WidgetUnarchiveParams,
1456
1475
  };
1457
1476
 
1477
+ export {
1478
+ Tenants as Tenants,
1479
+ type Subject as Subject,
1480
+ type SubjectInfo as SubjectInfo,
1481
+ type Tenant as Tenant,
1482
+ type TenantInfo as TenantInfo,
1483
+ type TenantsCursorPagination as TenantsCursorPagination,
1484
+ type TenantRetrieveParams as TenantRetrieveParams,
1485
+ type TenantListParams as TenantListParams,
1486
+ type TenantDeleteParams as TenantDeleteParams,
1487
+ };
1488
+
1458
1489
  export {
1459
1490
  WidgetSessions as WidgetSessions,
1460
1491
  type SubjectAssertion as SubjectAssertion,
@@ -157,6 +157,18 @@ export {
157
157
  type SearchSearchToolsOrToolSetsResponse,
158
158
  type SearchSearchToolsOrToolSetsParams,
159
159
  } from './search';
160
+ export {
161
+ Tenants,
162
+ type Subject,
163
+ type SubjectInfo,
164
+ type Tenant,
165
+ type TenantInfo,
166
+ type TenantRetrieveParams,
167
+ type TenantListParams,
168
+ type TenantDeleteParams,
169
+ type SubjectsCursorPagination,
170
+ type TenantsCursorPagination,
171
+ } from './tenants/tenants';
160
172
  export {
161
173
  ToolSets,
162
174
  type ApprovalRequirementFilter,
@@ -1150,6 +1150,16 @@ export interface ObjectiveInfo {
1150
1150
  * carrying both Cadenya's canonical id and the customer's own key.
1151
1151
  */
1152
1152
  tenant?: WidgetSessionsAPI.TenantReference;
1153
+
1154
+ /**
1155
+ * BareMetadata contains the minimal metadata for a resource: the ID and an
1156
+ * optional human-readable name. These are used for reference fields where the full
1157
+ * metadata (account scoping, timestamps, labels, external IDs) is not needed —
1158
+ * e.g., the tool references inside an agent variation spec or the tools assigned
1159
+ * to an objective. Both fields are server-populated; clients provide IDs through
1160
+ * sibling fields rather than by constructing a BareMetadata themselves.
1161
+ */
1162
+ widget?: Shared.BareMetadata;
1153
1163
  }
1154
1164
 
1155
1165
  export interface ObjectiveSecret {
@@ -1500,6 +1510,17 @@ export interface ObjectiveListParams extends CursorPaginationParams {
1500
1510
  * canonical `tenant_…` form or the `external_id:<value>` form.
1501
1511
  */
1502
1512
  tenantId?: string;
1513
+
1514
+ /**
1515
+ * Query param: Filter to objectives whose conversation ran through a widget.
1516
+ * Accepts the canonical `wgt_…` form or the `external_id:<value>` form.
1517
+ */
1518
+ widgetId?: string;
1519
+
1520
+ /**
1521
+ * Query param: Filter to objectives created by a specific widget session.
1522
+ */
1523
+ widgetSessionId?: string;
1503
1524
  }
1504
1525
 
1505
1526
  export interface ObjectiveCancelParams {
@@ -0,0 +1,15 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export { Subjects, type SubjectListParams } from './subjects';
4
+ export {
5
+ Tenants,
6
+ type Subject,
7
+ type SubjectInfo,
8
+ type Tenant,
9
+ type TenantInfo,
10
+ type TenantRetrieveParams,
11
+ type TenantListParams,
12
+ type TenantDeleteParams,
13
+ type SubjectsCursorPagination,
14
+ type TenantsCursorPagination,
15
+ } from './tenants';