@aletheia-dev/api-client 0.1.0 → 0.2.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/CHANGELOG.md +13 -0
- package/dist/index.cjs +166 -136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -3
- package/dist/index.d.ts +33 -3
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @aletheia-dev/api-client
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#10](https://github.com/akhiljames/aletheia/pull/10) [`2d95c87`](https://github.com/akhiljames/aletheia/commit/2d95c8708f7119e066d9cfdf91dbb753e15923f1) Thanks [@akhiljames](https://github.com/akhiljames)! - New `policyPacks` domain: `import(pack, { publish? })` posts a `PolicyPack` to
|
|
8
|
+
`POST /definitions/import` and `export(keys, { name?, version?, description? })` reads one back
|
|
9
|
+
from `GET /definitions/export`. `PolicyPack` and the import result schema are re-exported.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`1b1c13f`](https://github.com/akhiljames/aletheia/commit/1b1c13f230b10d8d4704196b510edc164d14e7e9)]:
|
|
14
|
+
- @aletheia-dev/core@0.2.0
|
|
15
|
+
|
|
3
16
|
## 0.1.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -20,117 +20,121 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
-
ActorType: () =>
|
|
24
|
-
AddListEntriesInput: () =>
|
|
25
|
-
AggregationPolicy: () =>
|
|
23
|
+
ActorType: () => import_core10.ActorType,
|
|
24
|
+
AddListEntriesInput: () => import_core15.AddListEntriesInput,
|
|
25
|
+
AggregationPolicy: () => import_core15.AggregationPolicy,
|
|
26
26
|
ApiError: () => ApiError,
|
|
27
|
-
ApprovalCommentInput: () =>
|
|
28
|
-
ApprovalDecision: () =>
|
|
27
|
+
ApprovalCommentInput: () => import_core10.ApprovalCommentInput,
|
|
28
|
+
ApprovalDecision: () => import_core10.ApprovalDecision,
|
|
29
29
|
ApprovalOutcome: () => ApprovalOutcome,
|
|
30
|
-
AssignCaseInput: () =>
|
|
31
|
-
AuditEvent: () =>
|
|
32
|
-
AuditExportFormat: () =>
|
|
33
|
-
AuditFilter: () =>
|
|
34
|
-
Backtest: () =>
|
|
35
|
-
BacktestProgress: () =>
|
|
36
|
-
BacktestSample: () =>
|
|
37
|
-
BacktestSampleFailure: () =>
|
|
38
|
-
BacktestStatus: () =>
|
|
39
|
-
BacktestSummary: () =>
|
|
40
|
-
Case: () =>
|
|
30
|
+
AssignCaseInput: () => import_core13.AssignCaseInput,
|
|
31
|
+
AuditEvent: () => import_core10.AuditEvent,
|
|
32
|
+
AuditExportFormat: () => import_core10.AuditExportFormat,
|
|
33
|
+
AuditFilter: () => import_core10.AuditFilter,
|
|
34
|
+
Backtest: () => import_core15.Backtest,
|
|
35
|
+
BacktestProgress: () => import_core15.BacktestProgress,
|
|
36
|
+
BacktestSample: () => import_core15.BacktestSample,
|
|
37
|
+
BacktestSampleFailure: () => import_core15.BacktestSampleFailure,
|
|
38
|
+
BacktestStatus: () => import_core15.BacktestStatus,
|
|
39
|
+
BacktestSummary: () => import_core15.BacktestSummary,
|
|
40
|
+
Case: () => import_core13.Case,
|
|
41
41
|
CaseDetail: () => CaseDetail,
|
|
42
|
-
CaseFilter: () =>
|
|
43
|
-
CaseNote: () =>
|
|
44
|
-
CaseNoteInput: () =>
|
|
45
|
-
CasePriority: () =>
|
|
46
|
-
CaseQueue: () =>
|
|
42
|
+
CaseFilter: () => import_core13.CaseFilter,
|
|
43
|
+
CaseNote: () => import_core13.CaseNote,
|
|
44
|
+
CaseNoteInput: () => import_core13.CaseNoteInput,
|
|
45
|
+
CasePriority: () => import_core13.CasePriority,
|
|
46
|
+
CaseQueue: () => import_core13.CaseQueue,
|
|
47
47
|
CaseQueueCount: () => CaseQueueCount,
|
|
48
|
-
CaseSlaState: () =>
|
|
49
|
-
CaseSort: () =>
|
|
50
|
-
CaseStatus: () =>
|
|
51
|
-
CaseView: () =>
|
|
52
|
-
CloseCaseInput: () =>
|
|
53
|
-
Condition: () =>
|
|
54
|
-
ConditionOp: () =>
|
|
55
|
-
CreateDocumentInput: () =>
|
|
48
|
+
CaseSlaState: () => import_core13.CaseSlaState,
|
|
49
|
+
CaseSort: () => import_core13.CaseSort,
|
|
50
|
+
CaseStatus: () => import_core13.CaseStatus,
|
|
51
|
+
CaseView: () => import_core13.CaseView,
|
|
52
|
+
CloseCaseInput: () => import_core13.CloseCaseInput,
|
|
53
|
+
Condition: () => import_core12.Condition,
|
|
54
|
+
ConditionOp: () => import_core12.ConditionOp,
|
|
55
|
+
CreateDocumentInput: () => import_core14.CreateDocumentInput,
|
|
56
56
|
CreatedSubmission: () => CreatedSubmission,
|
|
57
|
-
DEFINITION_PATHS: () =>
|
|
58
|
-
DOCUMENT_CONTENT_TYPES: () =>
|
|
59
|
-
DOCUMENT_MAX_BYTES: () =>
|
|
60
|
-
DOCUMENT_OPEN_STATUSES: () =>
|
|
57
|
+
DEFINITION_PATHS: () => import_core10.DEFINITION_PATHS,
|
|
58
|
+
DOCUMENT_CONTENT_TYPES: () => import_core14.DOCUMENT_CONTENT_TYPES,
|
|
59
|
+
DOCUMENT_MAX_BYTES: () => import_core14.DOCUMENT_MAX_BYTES,
|
|
60
|
+
DOCUMENT_OPEN_STATUSES: () => import_core14.DOCUMENT_OPEN_STATUSES,
|
|
61
61
|
DecideCaseResult: () => DecideCaseResult,
|
|
62
|
-
DefinitionApproval: () =>
|
|
63
|
-
DefinitionDiff: () =>
|
|
64
|
-
DefinitionIssue: () =>
|
|
65
|
-
DefinitionKind: () =>
|
|
66
|
-
DefinitionVersionSummary: () =>
|
|
67
|
-
DiffChange: () =>
|
|
68
|
-
DiffOp: () =>
|
|
69
|
-
DirectoryUser: () =>
|
|
70
|
-
Document: () =>
|
|
71
|
-
DocumentContentType: () =>
|
|
72
|
-
DocumentDownload: () =>
|
|
62
|
+
DefinitionApproval: () => import_core10.DefinitionApproval,
|
|
63
|
+
DefinitionDiff: () => import_core10.DefinitionDiff,
|
|
64
|
+
DefinitionIssue: () => import_core12.DefinitionIssue,
|
|
65
|
+
DefinitionKind: () => import_core10.DefinitionKind,
|
|
66
|
+
DefinitionVersionSummary: () => import_core10.DefinitionVersionSummary,
|
|
67
|
+
DiffChange: () => import_core10.DiffChange,
|
|
68
|
+
DiffOp: () => import_core10.DiffOp,
|
|
69
|
+
DirectoryUser: () => import_core13.DirectoryUser,
|
|
70
|
+
Document: () => import_core14.Document,
|
|
71
|
+
DocumentContentType: () => import_core14.DocumentContentType,
|
|
72
|
+
DocumentDownload: () => import_core14.DocumentDownload,
|
|
73
73
|
DocumentPollTimeoutError: () => DocumentPollTimeoutError,
|
|
74
|
-
DocumentScan: () =>
|
|
75
|
-
DocumentStatus: () =>
|
|
76
|
-
DocumentUploadTicket: () =>
|
|
74
|
+
DocumentScan: () => import_core14.DocumentScan,
|
|
75
|
+
DocumentStatus: () => import_core14.DocumentStatus,
|
|
76
|
+
DocumentUploadTicket: () => import_core14.DocumentUploadTicket,
|
|
77
77
|
DryRunResult: () => DryRunResult,
|
|
78
|
-
Event: () =>
|
|
79
|
-
EventKey: () =>
|
|
78
|
+
Event: () => import_core15.Event,
|
|
79
|
+
EventKey: () => import_core15.EventKey,
|
|
80
80
|
FORBIDDEN_CODES: () => FORBIDDEN_CODES,
|
|
81
|
-
FieldTypeDescription: () =>
|
|
82
|
-
FileFieldValue: () =>
|
|
83
|
-
FormUiHints: () =>
|
|
81
|
+
FieldTypeDescription: () => import_core12.FieldTypeDescription,
|
|
82
|
+
FileFieldValue: () => import_core14.FileFieldValue,
|
|
83
|
+
FormUiHints: () => import_core12.FormUiHints,
|
|
84
84
|
HealthStatus: () => HealthStatus,
|
|
85
|
-
IngestEventsInput: () =>
|
|
86
|
-
IngestEventsResult: () =>
|
|
87
|
-
IssueSeverity: () =>
|
|
88
|
-
List: () =>
|
|
89
|
-
ListEntry: () =>
|
|
90
|
-
ListImportResult: () =>
|
|
91
|
-
ListKind: () =>
|
|
85
|
+
IngestEventsInput: () => import_core15.IngestEventsInput,
|
|
86
|
+
IngestEventsResult: () => import_core15.IngestEventsResult,
|
|
87
|
+
IssueSeverity: () => import_core12.IssueSeverity,
|
|
88
|
+
List: () => import_core15.List,
|
|
89
|
+
ListEntry: () => import_core15.ListEntry,
|
|
90
|
+
ListImportResult: () => import_core15.ListImportResult,
|
|
91
|
+
ListKind: () => import_core15.ListKind,
|
|
92
92
|
Me: () => Me,
|
|
93
93
|
MePrincipal: () => MePrincipal,
|
|
94
|
-
NewEvent: () =>
|
|
95
|
-
NewListEntry: () =>
|
|
94
|
+
NewEvent: () => import_core15.NewEvent,
|
|
95
|
+
NewListEntry: () => import_core15.NewListEntry,
|
|
96
|
+
POLICY_PACK_MAX_LIST_ROWS: () => import_core11.POLICY_PACK_MAX_LIST_ROWS,
|
|
96
97
|
PluginSummary: () => PluginSummary,
|
|
98
|
+
PolicyPack: () => import_core11.PolicyPack,
|
|
99
|
+
PolicyPackImportResult: () => import_core11.PolicyPackImportResult,
|
|
100
|
+
PolicyPackKeyRef: () => import_core11.PolicyPackKeyRef,
|
|
97
101
|
RUNTIME_CONFIG_PATH: () => RUNTIME_CONFIG_PATH,
|
|
98
102
|
ReadyStatus: () => ReadyStatus,
|
|
99
|
-
RemoveListEntriesInput: () =>
|
|
103
|
+
RemoveListEntriesInput: () => import_core15.RemoveListEntriesInput,
|
|
100
104
|
RemovedCount: () => RemovedCount,
|
|
101
|
-
RuleSetBody: () =>
|
|
102
|
-
RuleSetDefinition: () =>
|
|
103
|
-
RuleSetRule: () =>
|
|
104
|
-
RuleSetUseCase: () =>
|
|
105
|
+
RuleSetBody: () => import_core15.RuleSetBody,
|
|
106
|
+
RuleSetDefinition: () => import_core15.RuleSetDefinition,
|
|
107
|
+
RuleSetRule: () => import_core15.RuleSetRule,
|
|
108
|
+
RuleSetUseCase: () => import_core15.RuleSetUseCase,
|
|
105
109
|
RuleTypeDescription: () => RuleTypeDescription,
|
|
106
110
|
RuleUiHints: () => RuleUiHints,
|
|
107
111
|
RuntimeConfig: () => RuntimeConfig,
|
|
108
|
-
ScoreBand: () =>
|
|
109
|
-
ScoreClamp: () =>
|
|
110
|
-
SortOrder: () =>
|
|
111
|
-
StartBacktestInput: () =>
|
|
112
|
-
StepTypeDescription: () =>
|
|
113
|
-
Subject: () =>
|
|
114
|
-
SubjectKind: () =>
|
|
115
|
-
SubjectListQuery: () =>
|
|
116
|
-
SubjectStatus: () =>
|
|
112
|
+
ScoreBand: () => import_core15.ScoreBand,
|
|
113
|
+
ScoreClamp: () => import_core15.ScoreClamp,
|
|
114
|
+
SortOrder: () => import_core13.SortOrder,
|
|
115
|
+
StartBacktestInput: () => import_core15.StartBacktestInput,
|
|
116
|
+
StepTypeDescription: () => import_core12.StepTypeDescription,
|
|
117
|
+
Subject: () => import_core17.Subject,
|
|
118
|
+
SubjectKind: () => import_core17.SubjectKind,
|
|
119
|
+
SubjectListQuery: () => import_core17.SubjectListQuery,
|
|
120
|
+
SubjectStatus: () => import_core17.SubjectStatus,
|
|
117
121
|
SubmissionDetail: () => SubmissionDetail,
|
|
118
122
|
SubmissionEmbed: () => SubmissionEmbed,
|
|
119
123
|
SubmissionStatus: () => SubmissionStatus,
|
|
120
|
-
TenantSettings: () =>
|
|
121
|
-
TimelineEntry: () =>
|
|
122
|
-
TimelineKind: () =>
|
|
123
|
-
TimelineQuery: () =>
|
|
124
|
+
TenantSettings: () => import_core16.TenantSettings,
|
|
125
|
+
TimelineEntry: () => import_core17.TimelineEntry,
|
|
126
|
+
TimelineKind: () => import_core17.TimelineKind,
|
|
127
|
+
TimelineQuery: () => import_core17.TimelineQuery,
|
|
124
128
|
UploadError: () => UploadError,
|
|
125
|
-
UpsertCaseQueueInput: () =>
|
|
126
|
-
UpsertListInput: () =>
|
|
127
|
-
UpsertRuleSetInput: () =>
|
|
128
|
-
ValidationReport: () =>
|
|
129
|
-
WebOrigin: () =>
|
|
129
|
+
UpsertCaseQueueInput: () => import_core13.UpsertCaseQueueInput,
|
|
130
|
+
UpsertListInput: () => import_core15.UpsertListInput,
|
|
131
|
+
UpsertRuleSetInput: () => import_core15.UpsertRuleSetInput,
|
|
132
|
+
ValidationReport: () => import_core12.ValidationReport,
|
|
133
|
+
WebOrigin: () => import_core16.WebOrigin,
|
|
130
134
|
auditFilterParams: () => auditFilterParams,
|
|
131
|
-
bandFor: () =>
|
|
135
|
+
bandFor: () => import_core15.bandFor,
|
|
132
136
|
caseListParams: () => caseListParams,
|
|
133
|
-
caseSlaState: () =>
|
|
137
|
+
caseSlaState: () => import_core13.caseSlaState,
|
|
134
138
|
checkFileBeforeUpload: () => checkFileBeforeUpload,
|
|
135
139
|
createApiClient: () => createApiClient,
|
|
136
140
|
isApiError: () => isApiError,
|
|
@@ -140,7 +144,9 @@ __export(src_exports, {
|
|
|
140
144
|
isTerminalDocumentStatus: () => isTerminalDocumentStatus,
|
|
141
145
|
isUnauthenticated: () => isUnauthenticated,
|
|
142
146
|
loadRuntimeConfig: () => loadRuntimeConfig,
|
|
143
|
-
normalizeListValue: () =>
|
|
147
|
+
normalizeListValue: () => import_core15.normalizeListValue,
|
|
148
|
+
parsePolicyPackKeyRef: () => import_core11.parsePolicyPackKeyRef,
|
|
149
|
+
policyPackKeyRefs: () => import_core11.policyPackKeyRefs,
|
|
144
150
|
pollDocument: () => pollDocument,
|
|
145
151
|
resolveConfig: () => resolveConfig,
|
|
146
152
|
uploadToStorage: () => uploadToStorage,
|
|
@@ -380,8 +386,9 @@ function governanceDomain(http) {
|
|
|
380
386
|
}
|
|
381
387
|
|
|
382
388
|
// src/index.ts
|
|
383
|
-
var import_core9 = require("@aletheia-dev/core");
|
|
384
389
|
var import_core10 = require("@aletheia-dev/core");
|
|
390
|
+
var import_core11 = require("@aletheia-dev/core");
|
|
391
|
+
var import_core12 = require("@aletheia-dev/core");
|
|
385
392
|
|
|
386
393
|
// src/cases.ts
|
|
387
394
|
var import_core3 = require("@aletheia-dev/core");
|
|
@@ -469,7 +476,7 @@ function usersDomain(http) {
|
|
|
469
476
|
}
|
|
470
477
|
|
|
471
478
|
// src/index.ts
|
|
472
|
-
var
|
|
479
|
+
var import_core13 = require("@aletheia-dev/core");
|
|
473
480
|
|
|
474
481
|
// src/documents.ts
|
|
475
482
|
var import_core4 = require("@aletheia-dev/core");
|
|
@@ -603,14 +610,14 @@ async function pollDocument(client, id, opts = {}) {
|
|
|
603
610
|
}
|
|
604
611
|
|
|
605
612
|
// src/index.ts
|
|
606
|
-
var import_core12 = require("@aletheia-dev/core");
|
|
607
|
-
var import_core13 = require("@aletheia-dev/core");
|
|
608
613
|
var import_core14 = require("@aletheia-dev/core");
|
|
609
614
|
var import_core15 = require("@aletheia-dev/core");
|
|
615
|
+
var import_core16 = require("@aletheia-dev/core");
|
|
616
|
+
var import_core17 = require("@aletheia-dev/core");
|
|
610
617
|
|
|
611
618
|
// src/client.ts
|
|
612
619
|
var import_zod7 = require("zod");
|
|
613
|
-
var
|
|
620
|
+
var import_core9 = require("@aletheia-dev/core");
|
|
614
621
|
|
|
615
622
|
// src/builder.ts
|
|
616
623
|
var import_core5 = require("@aletheia-dev/core");
|
|
@@ -626,23 +633,44 @@ function validateCall(http, path) {
|
|
|
626
633
|
return (body) => http.parsed(import_core5.ValidationReport, `${path}/validate`, { method: "POST", body });
|
|
627
634
|
}
|
|
628
635
|
|
|
629
|
-
// src/
|
|
636
|
+
// src/definitions-packs.ts
|
|
630
637
|
var import_core6 = require("@aletheia-dev/core");
|
|
638
|
+
var keyRef = (key) => typeof key === "string" ? key : `${key.kind}:${key.key}`;
|
|
639
|
+
function policyPacksDomain(http) {
|
|
640
|
+
return {
|
|
641
|
+
import: (pack, options = {}) => http.parsed(import_core6.PolicyPackImportResult, "/definitions/import", {
|
|
642
|
+
method: "POST",
|
|
643
|
+
body: pack,
|
|
644
|
+
query: { publish: options.publish ? "true" : void 0 }
|
|
645
|
+
}),
|
|
646
|
+
export: (keys, options = {}) => http.parsed(import_core6.PolicyPack, "/definitions/export", {
|
|
647
|
+
query: {
|
|
648
|
+
keys: keys.map(keyRef),
|
|
649
|
+
name: options.name,
|
|
650
|
+
version: options.version,
|
|
651
|
+
description: options.description
|
|
652
|
+
}
|
|
653
|
+
})
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// src/tenants.ts
|
|
658
|
+
var import_core7 = require("@aletheia-dev/core");
|
|
631
659
|
function tenantsDomain(http) {
|
|
632
660
|
return {
|
|
633
|
-
getSettings: () => http.parsed(
|
|
634
|
-
updateSettings: (body) => http.parsed(
|
|
661
|
+
getSettings: () => http.parsed(import_core7.TenantSettings, "/tenants/me/settings"),
|
|
662
|
+
updateSettings: (body) => http.parsed(import_core7.TenantSettings, "/tenants/me/settings", { method: "PUT", body })
|
|
635
663
|
};
|
|
636
664
|
}
|
|
637
665
|
|
|
638
666
|
// src/workflow-runs.ts
|
|
639
|
-
var
|
|
667
|
+
var import_core8 = require("@aletheia-dev/core");
|
|
640
668
|
var import_zod6 = require("zod");
|
|
641
|
-
var RunList = import_zod6.z.object({ items: import_zod6.z.array(
|
|
669
|
+
var RunList = import_zod6.z.object({ items: import_zod6.z.array(import_core8.WorkflowRun) });
|
|
642
670
|
function workflowRunsDomain(http) {
|
|
643
671
|
return {
|
|
644
|
-
start: (body) => http.parsed(
|
|
645
|
-
get: (id) => http.parsed(
|
|
672
|
+
start: (body) => http.parsed(import_core8.WorkflowRun, "/workflow-runs", { method: "POST", body }),
|
|
673
|
+
get: (id) => http.parsed(import_core8.WorkflowRun, `/workflow-runs/${encodeSegment(id)}`),
|
|
646
674
|
listBySubject: async (subjectId) => (await http.parsed(RunList, "/workflow-runs", { query: { subjectId } })).items,
|
|
647
675
|
history: (id) => http.request(`/workflow-runs/${encodeSegment(id)}/history`)
|
|
648
676
|
};
|
|
@@ -685,7 +713,7 @@ var RuleUiHints = import_zod7.z.object({
|
|
|
685
713
|
listPicker: import_zod7.z.array(import_zod7.z.string()).optional()
|
|
686
714
|
});
|
|
687
715
|
var RuleTypeDescription = import_zod7.z.object({
|
|
688
|
-
type:
|
|
716
|
+
type: import_core9.RuleType,
|
|
689
717
|
description: import_zod7.z.string(),
|
|
690
718
|
/** JSON Schema of the rule config, produced by `z.toJSONSchema` on the API. */
|
|
691
719
|
configSchema: import_zod7.z.unknown(),
|
|
@@ -694,36 +722,36 @@ var RuleTypeDescription = import_zod7.z.object({
|
|
|
694
722
|
uiHints: RuleUiHints.optional()
|
|
695
723
|
});
|
|
696
724
|
var DryRunResult = import_zod7.z.object({
|
|
697
|
-
result:
|
|
725
|
+
result: import_core9.RuleEvaluationResult,
|
|
698
726
|
rule: import_zod7.z.object({
|
|
699
727
|
key: import_zod7.z.string(),
|
|
700
728
|
version: import_zod7.z.number().int(),
|
|
701
|
-
status:
|
|
702
|
-
type:
|
|
729
|
+
status: import_core9.DefinitionStatus,
|
|
730
|
+
type: import_core9.RuleType
|
|
703
731
|
}),
|
|
704
732
|
/** Data namespaces the rule may reference, a hint for composing inline test data. */
|
|
705
733
|
dataPaths: import_zod7.z.array(import_zod7.z.string()).default([])
|
|
706
734
|
});
|
|
707
735
|
var RemovedCount = import_zod7.z.object({ removed: import_zod7.z.number().int().nonnegative() });
|
|
708
736
|
var SubmissionDetail = import_zod7.z.object({
|
|
709
|
-
submission:
|
|
710
|
-
flow:
|
|
737
|
+
submission: import_core9.CollectionSubmission,
|
|
738
|
+
flow: import_core9.CollectionFlowDefinition
|
|
711
739
|
});
|
|
712
740
|
var SubmissionStatus = import_zod7.z.object({
|
|
713
741
|
submission: import_zod7.z.object({
|
|
714
|
-
id:
|
|
715
|
-
status:
|
|
742
|
+
id: import_core9.Id,
|
|
743
|
+
status: import_core9.SubmissionStatus,
|
|
716
744
|
submittedAt: import_zod7.z.coerce.date().nullable()
|
|
717
745
|
}),
|
|
718
746
|
run: import_zod7.z.object({
|
|
719
|
-
id:
|
|
720
|
-
status:
|
|
747
|
+
id: import_core9.Id,
|
|
748
|
+
status: import_core9.WorkflowRunStatus,
|
|
721
749
|
currentStepId: import_zod7.z.string().nullable(),
|
|
722
|
-
decision: import_zod7.z.object({ outcome:
|
|
750
|
+
decision: import_zod7.z.object({ outcome: import_core9.DecisionOutcome }).nullable()
|
|
723
751
|
}).nullable()
|
|
724
752
|
});
|
|
725
753
|
var CreatedSubmission = import_zod7.z.object({
|
|
726
|
-
submission:
|
|
754
|
+
submission: import_core9.CollectionSubmission,
|
|
727
755
|
link: import_zod7.z.string().nullable()
|
|
728
756
|
});
|
|
729
757
|
var SubmissionEmbed = import_zod7.z.object({
|
|
@@ -767,18 +795,18 @@ function createApiClient(options) {
|
|
|
767
795
|
/** The caller's principal, tenant and permissions as the API sees the bearer token. */
|
|
768
796
|
me: () => http.parsed(Me, "/me"),
|
|
769
797
|
subjects: {
|
|
770
|
-
create: (body) => http.parsed(
|
|
798
|
+
create: (body) => http.parsed(import_core9.Subject, "/subjects", { method: "POST", body }),
|
|
771
799
|
/**
|
|
772
800
|
* Subjects matching `query`: `search` matches the external id and `data.name` /
|
|
773
801
|
* `data.legalName`; `riskScoreMin`/`riskScoreMax` bound the risk score (`subjects:read`).
|
|
774
802
|
*/
|
|
775
|
-
list: (query = {}) => list(
|
|
776
|
-
get: (id) => http.parsed(
|
|
803
|
+
list: (query = {}) => list(import_core9.Subject, "/subjects", query),
|
|
804
|
+
get: (id) => http.parsed(import_core9.Subject, `/subjects/${encodeSegment(id)}`),
|
|
777
805
|
/**
|
|
778
806
|
* The subject's history, newest first (`subjects:read`). Entries of kinds the caller may
|
|
779
807
|
* not read are omitted by the API; page with `offset`.
|
|
780
808
|
*/
|
|
781
|
-
timeline: (id, query = {}) => list(
|
|
809
|
+
timeline: (id, query = {}) => list(import_core9.TimelineEntry, `/subjects/${encodeSegment(id)}/timeline`, timelineParams(query))
|
|
782
810
|
},
|
|
783
811
|
workflowRuns: workflowRunsDomain(http),
|
|
784
812
|
/** Review cases: filtered lists, detail, decide, assign/claim/close and notes. See `cases.ts`. */
|
|
@@ -789,7 +817,7 @@ function createApiClient(options) {
|
|
|
789
817
|
users: usersDomain(http),
|
|
790
818
|
workflowDefinitions: {
|
|
791
819
|
...definitions(
|
|
792
|
-
|
|
820
|
+
import_core9.WorkflowDefinition,
|
|
793
821
|
"/workflow-definitions"
|
|
794
822
|
),
|
|
795
823
|
/** Validates a draft body without saving; issues carry step ids. */
|
|
@@ -799,7 +827,7 @@ function createApiClient(options) {
|
|
|
799
827
|
builder: builderDomain(http),
|
|
800
828
|
ruleDefinitions: {
|
|
801
829
|
...definitions(
|
|
802
|
-
|
|
830
|
+
import_core9.RuleDefinition,
|
|
803
831
|
"/rule-definitions"
|
|
804
832
|
),
|
|
805
833
|
/** Evaluates one rule version against a subject or inline data; nothing is recorded. */
|
|
@@ -811,14 +839,16 @@ function createApiClient(options) {
|
|
|
811
839
|
ruleTypes: {
|
|
812
840
|
list: () => list(RuleTypeDescription, "/rule-types")
|
|
813
841
|
},
|
|
842
|
+
/** Import and export sets of definitions as policy packs. See `definitions-packs.ts`. */
|
|
843
|
+
policyPacks: policyPacksDomain(http),
|
|
814
844
|
/** Versioned, ordered groups of rules with an aggregation policy (`/rule-sets`). */
|
|
815
845
|
ruleSets: definitions(
|
|
816
|
-
|
|
846
|
+
import_core9.RuleSetDefinition,
|
|
817
847
|
"/rule-sets"
|
|
818
848
|
),
|
|
819
849
|
collectionFlows: {
|
|
820
850
|
...definitions(
|
|
821
|
-
|
|
851
|
+
import_core9.CollectionFlowDefinition,
|
|
822
852
|
"/collection-flows"
|
|
823
853
|
),
|
|
824
854
|
/** Validates a draft flow body without saving; issues carry step / field keys. */
|
|
@@ -828,11 +858,11 @@ function createApiClient(options) {
|
|
|
828
858
|
/** Creates the submission and returns the applicant link alongside it. */
|
|
829
859
|
create: (body) => http.parsed(CreatedSubmission, "/collection-submissions", { method: "POST", body }),
|
|
830
860
|
get: (id) => http.parsed(SubmissionDetail, `/collection-submissions/${encodeSegment(id)}`),
|
|
831
|
-
save: (id, body) => http.parsed(
|
|
861
|
+
save: (id, body) => http.parsed(import_core9.CollectionSubmission, `/collection-submissions/${encodeSegment(id)}`, {
|
|
832
862
|
method: "PATCH",
|
|
833
863
|
body
|
|
834
864
|
}),
|
|
835
|
-
submit: (id) => http.parsed(
|
|
865
|
+
submit: (id) => http.parsed(import_core9.CollectionSubmission, `/collection-submissions/${encodeSegment(id)}/submit`, {
|
|
836
866
|
method: "POST"
|
|
837
867
|
}),
|
|
838
868
|
/** Where the submission's workflow run is; readable with the applicant's token. */
|
|
@@ -843,22 +873,22 @@ function createApiClient(options) {
|
|
|
843
873
|
/** Subject events: the facts velocity rules aggregate over. */
|
|
844
874
|
events: {
|
|
845
875
|
/** Inserts events; re-sent idempotency keys are counted as `duplicates`, not errors. */
|
|
846
|
-
ingest: (body) => http.parsed(
|
|
876
|
+
ingest: (body) => http.parsed(import_core9.IngestEventsResult, "/events", { method: "POST", body }),
|
|
847
877
|
/** Newest first. */
|
|
848
|
-
list: (query = {}) => list(
|
|
878
|
+
list: (query = {}) => list(import_core9.Event, "/events", { ...query, from: isoOf3(query.from), to: isoOf3(query.to) })
|
|
849
879
|
},
|
|
850
880
|
/**
|
|
851
881
|
* Replays recorded evaluations against a rule version (`backtests:run`). `start` returns the
|
|
852
882
|
* queued job; poll `get` until its status is `completed` (with `summary`) or `failed`.
|
|
853
883
|
*/
|
|
854
884
|
backtests: {
|
|
855
|
-
start: (body) => http.parsed(
|
|
885
|
+
start: (body) => http.parsed(import_core9.Backtest, "/backtests", { method: "POST", body }),
|
|
856
886
|
/** Newest first. */
|
|
857
|
-
list: (query = {}) => list(
|
|
858
|
-
get: (id) => http.parsed(
|
|
887
|
+
list: (query = {}) => list(import_core9.Backtest, "/backtests", query),
|
|
888
|
+
get: (id) => http.parsed(import_core9.Backtest, `/backtests/${encodeSegment(id)}`)
|
|
859
889
|
},
|
|
860
890
|
decisions: {
|
|
861
|
-
listBySubject: (subjectId) => list(
|
|
891
|
+
listBySubject: (subjectId) => list(import_core9.Decision, "/decisions", { subjectId })
|
|
862
892
|
},
|
|
863
893
|
/** Filtered audit trail, exports and manifest verification (`audit:read`). See `audit.ts`. */
|
|
864
894
|
audit,
|
|
@@ -869,12 +899,12 @@ function createApiClient(options) {
|
|
|
869
899
|
/** Version history, diffs and the approval workflow of definitions. See `governance.ts`. */
|
|
870
900
|
governance: governanceDomain(http),
|
|
871
901
|
plugins: {
|
|
872
|
-
list: () => list(
|
|
902
|
+
list: () => list(import_core9.PluginDefinition, "/plugins"),
|
|
873
903
|
available: () => list(PluginSummary, "/plugins/available"),
|
|
874
|
-
configure: (name, body) => http.parsed(
|
|
904
|
+
configure: (name, body) => http.parsed(import_core9.PluginDefinition, `/plugins/${encodeSegment(name)}`, { method: "PUT", body })
|
|
875
905
|
},
|
|
876
906
|
pluginInvocations: {
|
|
877
|
-
list: (query = {}) => list(
|
|
907
|
+
list: (query = {}) => list(import_core9.PluginInvocation, "/plugin-invocations", query)
|
|
878
908
|
},
|
|
879
909
|
/**
|
|
880
910
|
* Uploaded files: `create` -> `uploadToStorage` (helper) -> `finalize` -> `pollDocument`
|
|
@@ -885,15 +915,15 @@ function createApiClient(options) {
|
|
|
885
915
|
tenants: tenantsDomain(http),
|
|
886
916
|
/** Tenant lists (blocklists / allowlists) and their entries. Lists are keyed, not versioned. */
|
|
887
917
|
lists: {
|
|
888
|
-
list: () => list(
|
|
889
|
-
get: (key) => http.parsed(
|
|
918
|
+
list: () => list(import_core9.List, "/lists"),
|
|
919
|
+
get: (key) => http.parsed(import_core9.List, `/lists/${encodeSegment(key)}`),
|
|
890
920
|
/** Creates the list or updates its metadata; entries are untouched. */
|
|
891
|
-
upsert: (key, body) => http.parsed(
|
|
921
|
+
upsert: (key, body) => http.parsed(import_core9.List, `/lists/${encodeSegment(key)}`, { method: "PUT", body }),
|
|
892
922
|
remove: async (key) => {
|
|
893
923
|
await http.request(`/lists/${encodeSegment(key)}`, { method: "DELETE" });
|
|
894
924
|
},
|
|
895
|
-
entries: (key, query = {}) => list(
|
|
896
|
-
addEntries: (key, body) => http.parsed(
|
|
925
|
+
entries: (key, query = {}) => list(import_core9.ListEntry, `/lists/${encodeSegment(key)}/entries`, query),
|
|
926
|
+
addEntries: (key, body) => http.parsed(import_core9.ListImportResult, `/lists/${encodeSegment(key)}/entries`, {
|
|
897
927
|
method: "POST",
|
|
898
928
|
body
|
|
899
929
|
}),
|
|
@@ -902,7 +932,7 @@ function createApiClient(options) {
|
|
|
902
932
|
body
|
|
903
933
|
}),
|
|
904
934
|
/** Uploads a CSV (one value per line, optional `value,reason,expires_at` header). */
|
|
905
|
-
importCsv: (key, csv) => http.parsed(
|
|
935
|
+
importCsv: (key, csv) => http.parsed(import_core9.ListImportResult, `/lists/${encodeSegment(key)}/import`, {
|
|
906
936
|
method: "POST",
|
|
907
937
|
raw: { content: csv, contentType: "text/csv" }
|
|
908
938
|
})
|