@nyrra/prismantix-cli 0.0.3-next.17 → 0.0.3-next.2

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 (56) hide show
  1. package/README.md +20 -28
  2. package/bin/dev.js +1 -3
  3. package/bin/run.js +1 -3
  4. package/dist/api.d.ts +200 -173
  5. package/dist/api.d.ts.map +1 -1
  6. package/dist/api.js +236 -110
  7. package/dist/command-support.d.ts +13 -0
  8. package/dist/command-support.d.ts.map +1 -0
  9. package/dist/command-support.js +40 -0
  10. package/dist/commands/object/details.d.ts +13 -0
  11. package/dist/commands/object/details.d.ts.map +1 -0
  12. package/dist/commands/object/details.js +28 -0
  13. package/dist/commands/object/list.d.ts +13 -0
  14. package/dist/commands/object/list.d.ts.map +1 -0
  15. package/dist/commands/object/list.js +27 -0
  16. package/dist/commands/ontology/list.d.ts +10 -0
  17. package/dist/commands/ontology/list.d.ts.map +1 -0
  18. package/dist/commands/ontology/list.js +25 -0
  19. package/dist/commands/records/cancel.d.ts +13 -0
  20. package/dist/commands/records/cancel.d.ts.map +1 -0
  21. package/dist/commands/records/cancel.js +21 -0
  22. package/dist/commands/records/generate.d.ts +15 -0
  23. package/dist/commands/records/generate.d.ts.map +1 -0
  24. package/dist/commands/records/generate.js +56 -0
  25. package/dist/commands/{download.d.ts → records/pull.d.ts} +5 -11
  26. package/dist/commands/records/pull.d.ts.map +1 -0
  27. package/dist/commands/records/pull.js +59 -0
  28. package/dist/commands/records/status.d.ts +13 -0
  29. package/dist/commands/records/status.d.ts.map +1 -0
  30. package/dist/commands/records/status.js +22 -0
  31. package/dist/constants.d.ts +2 -1
  32. package/dist/constants.d.ts.map +1 -1
  33. package/dist/constants.js +2 -1
  34. package/dist/errors.d.ts.map +1 -1
  35. package/dist/errors.js +39 -0
  36. package/dist/generation.d.ts +13 -0
  37. package/dist/generation.d.ts.map +1 -0
  38. package/dist/generation.js +77 -0
  39. package/dist/io.d.ts.map +1 -1
  40. package/dist/io.js +1 -1
  41. package/dist/runtime.d.ts +3 -0
  42. package/dist/runtime.d.ts.map +1 -0
  43. package/dist/runtime.js +10 -0
  44. package/dist/workflow.d.ts +3 -14
  45. package/dist/workflow.d.ts.map +1 -1
  46. package/dist/workflow.js +85 -61
  47. package/oclif.manifest.json +266 -40
  48. package/package.json +22 -22
  49. package/dist/commands/download.d.ts.map +0 -1
  50. package/dist/commands/download.js +0 -136
  51. package/dist/commands/guided.d.ts +0 -7
  52. package/dist/commands/guided.d.ts.map +0 -1
  53. package/dist/commands/guided.js +0 -15
  54. package/dist/ui/guided-flow.d.ts +0 -20
  55. package/dist/ui/guided-flow.d.ts.map +0 -1
  56. package/dist/ui/guided-flow.js +0 -156
package/README.md CHANGED
@@ -1,42 +1,34 @@
1
1
  # @nyrra/prismantix-cli
2
2
 
3
- Public PrismantiX export API client.
4
-
5
- ## Usage
6
-
7
- Run the guided export flow:
3
+ The public PrismantiX ontology catalog and client-record CLI. The package installs one executable: `prismantix`.
8
4
 
9
5
  ```sh
10
- npx -y @nyrra/prismantix-cli
11
- ```
12
-
13
- The guided flow reads `PRISMANTIX_API_KEY` when it is set. If it is missing, the CLI prompts for the key with masked input. The default API base is `https://api.prismantix.com`.
6
+ npm install --global @nyrra/prismantix-cli
7
+ export PRISMANTIX_API_KEY="sk_..."
14
8
 
15
- ## Non-Interactive Download
9
+ prismantix ontology list
10
+ prismantix object list healthcare
11
+ prismantix object details deviations
12
+ prismantix records pull --client NVO
13
+ prismantix records generate --client NVO --ontology pharma
14
+ prismantix records status <operation-id>
15
+ prismantix records cancel <operation-id>
16
+ ```
16
17
 
17
- Queue a full client export, poll until completion, write the manifest and CSV files locally, and print machine-readable JSON to stdout:
18
+ Every command supports `--json`. JSON mode reserves stdout for one result; progress and diagnostics go to stderr. `--api-base` overrides `PRISMANTIX_API_BASE`, whose default is `https://api.prismantix.com`.
18
19
 
19
- ```sh
20
- export PRISMANTIX_API_KEY="sk_..."
21
- npx -y @nyrra/prismantix-cli download --client LLY --yes --json
22
- ```
20
+ `records generate` waits for completion by default with a 30-minute timeout. Use `--no-wait`, `--timeout`, and `--poll-interval` for operational control. A completed operation exits 0. A failed operation or an operation canceled while this command is waiting exits 1 with a typed error; an explicitly acknowledged `records cancel` request exits 0.
23
21
 
24
- Download an existing export without queueing a new one:
22
+ `records pull` creates and waits for a CSV-bundle export, then writes `manifest.json` and its files under `./prismantix-exports/<canonical-client-id>/<export-id>/`. Use `--output`, repeatable `--table`, `--timeout`, and `--poll-interval` when needed.
25
23
 
26
- ```sh
27
- export PRISMANTIX_API_KEY="sk_..."
28
- npx -y @nyrra/prismantix-cli download --export-id <export-id> --json
29
- ```
24
+ ## Restricted Foundry plugin
30
25
 
31
- Useful options:
26
+ Foundry import is intentionally not bundled with the anonymous public CLI. Authorized Shpitdev operators install the restricted plugin explicitly:
32
27
 
33
28
  ```sh
34
- npx -y @nyrra/prismantix-cli download \
35
- --api-base "https://api.prismantix.com" \
36
- --client LLY \
37
- --yes \
38
- --output ./prismantix-exports \
39
- --json
29
+ npm login --scope=@shpitdev --registry=https://registry.npmjs.org
30
+ prismantix plugins install @shpitdev/prismantix-ontology-interop
31
+ prismantix foundry import --help
40
32
  ```
41
33
 
42
- `--json` keeps stdout machine-readable. Progress and errors are written to stderr, and the API key is never printed.
34
+ CI must use an npm token scoped to read restricted `@shpitdev` packages. Never commit a populated user `.npmrc`.
package/bin/dev.js CHANGED
@@ -2,10 +2,8 @@
2
2
 
3
3
  import { execute } from "@oclif/core";
4
4
 
5
- const args = process.argv.slice(2);
6
-
7
5
  await execute({
8
- args: args.length === 0 ? ["guided"] : args,
6
+ args: process.argv.slice(2),
9
7
  development: true,
10
8
  dir: import.meta.url,
11
9
  });
package/bin/run.js CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  import { execute } from "@oclif/core";
4
4
 
5
- const args = process.argv.slice(2);
6
-
7
5
  await execute({
8
- args: args.length === 0 ? ["guided"] : args,
6
+ args: process.argv.slice(2),
9
7
  dir: import.meta.url,
10
8
  });
package/dist/api.d.ts CHANGED
@@ -1,179 +1,206 @@
1
- import { z } from "zod";
2
- declare const exportFileSchema: z.ZodObject<{
3
- downloadUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4
- fileName: z.ZodString;
5
- mimeType: z.ZodOptional<z.ZodString>;
6
- rowCount: z.ZodOptional<z.ZodNumber>;
7
- sha256: z.ZodOptional<z.ZodString>;
8
- sizeBytes: z.ZodOptional<z.ZodNumber>;
9
- tableName: z.ZodString;
10
- }, z.core.$strip>;
11
- declare const exportCreatedSchema: z.ZodObject<{
12
- clientId: z.ZodString;
13
- exportId: z.ZodString;
14
- manifestUrl: z.ZodOptional<z.ZodString>;
15
- status: z.ZodOptional<z.ZodLiteral<"queued">>;
16
- statusUrl: z.ZodOptional<z.ZodString>;
17
- }, z.core.$strip>;
18
- declare const exportStatusSchema: z.ZodObject<{
19
- clientId: z.ZodString;
20
- completedAt: z.ZodOptional<z.ZodNumber>;
21
- createdAt: z.ZodOptional<z.ZodNumber>;
22
- errorMessage: z.ZodOptional<z.ZodString>;
23
- exportId: z.ZodString;
24
- failedAt: z.ZodOptional<z.ZodNumber>;
25
- files: z.ZodDefault<z.ZodArray<z.ZodObject<{
26
- downloadUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
- fileName: z.ZodString;
28
- mimeType: z.ZodOptional<z.ZodString>;
29
- rowCount: z.ZodOptional<z.ZodNumber>;
30
- sha256: z.ZodOptional<z.ZodString>;
31
- sizeBytes: z.ZodOptional<z.ZodNumber>;
32
- tableName: z.ZodString;
33
- }, z.core.$strip>>>;
34
- manifestUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
- startedAt: z.ZodOptional<z.ZodNumber>;
36
- status: z.ZodEnum<{
37
- queued: "queued";
38
- running: "running";
39
- completed: "completed";
40
- failed: "failed";
1
+ import { ConfigProvider, Context, Effect, Layer, Schema } from "effect";
2
+ declare const ManifestFileSchema: Schema.Struct<{
3
+ readonly columns: Schema.optionalKey<Schema.$Array<Schema.String>>;
4
+ readonly fileName: Schema.String;
5
+ readonly mimeType: Schema.optionalKey<Schema.String>;
6
+ readonly rowCount: Schema.optionalKey<Schema.Number>;
7
+ readonly sha256: Schema.optionalKey<Schema.String>;
8
+ readonly sizeBytes: Schema.optionalKey<Schema.Number>;
9
+ readonly storageKey: Schema.optionalKey<Schema.String>;
10
+ readonly tableName: Schema.String;
11
+ }>;
12
+ export interface ExportManifestFile extends Schema.Schema.Type<typeof ManifestFileSchema> {
13
+ readonly downloadUrl?: string | null;
14
+ }
15
+ declare const ExportManifestSchema: Schema.Struct<{
16
+ readonly clientId: Schema.String;
17
+ readonly completedAt: Schema.optionalKey<Schema.Number>;
18
+ readonly createdAt: Schema.optionalKey<Schema.Number>;
19
+ readonly exportId: Schema.String;
20
+ readonly files: Schema.$Array<Schema.Struct<{
21
+ readonly columns: Schema.optionalKey<Schema.$Array<Schema.String>>;
22
+ readonly fileName: Schema.String;
23
+ readonly mimeType: Schema.optionalKey<Schema.String>;
24
+ readonly rowCount: Schema.optionalKey<Schema.Number>;
25
+ readonly sha256: Schema.optionalKey<Schema.String>;
26
+ readonly sizeBytes: Schema.optionalKey<Schema.Number>;
27
+ readonly storageKey: Schema.optionalKey<Schema.String>;
28
+ readonly tableName: Schema.String;
29
+ }>>;
30
+ readonly output: Schema.Union<readonly [Schema.Struct<{
31
+ readonly kind: Schema.Literal<"csv_bundle">;
32
+ }>, Schema.Struct<{
33
+ readonly kind: Schema.Literal<"sqlite_seed_script">;
34
+ }>]>;
35
+ readonly schemaVersion: Schema.optionalKey<Schema.String>;
36
+ readonly totalRows: Schema.Number;
37
+ }>;
38
+ export interface ExportManifest extends Schema.Schema.Type<typeof ExportManifestSchema> {
39
+ }
40
+ declare const ExportStatusSchema: Schema.Struct<{
41
+ readonly clientId: Schema.String;
42
+ readonly completedAt: Schema.optionalKey<Schema.Number>;
43
+ readonly createdAt: Schema.optionalKey<Schema.Number>;
44
+ readonly errorMessage: Schema.optionalKey<Schema.String>;
45
+ readonly exportId: Schema.String;
46
+ readonly failedAt: Schema.optionalKey<Schema.Number>;
47
+ readonly files: Schema.$Array<Schema.Struct<{
48
+ readonly downloadUrl: Schema.NullOr<Schema.String>;
49
+ readonly fileName: Schema.String;
50
+ readonly mimeType: Schema.optionalKey<Schema.String>;
51
+ readonly rowCount: Schema.optionalKey<Schema.Number>;
52
+ readonly sha256: Schema.optionalKey<Schema.String>;
53
+ readonly sizeBytes: Schema.optionalKey<Schema.Number>;
54
+ readonly tableName: Schema.String;
55
+ }>>;
56
+ readonly manifestUrl: Schema.optionalKey<Schema.NullOr<Schema.String>>;
57
+ readonly output: Schema.Union<readonly [Schema.Struct<{
58
+ readonly kind: Schema.Literal<"csv_bundle">;
59
+ }>, Schema.Struct<{
60
+ readonly kind: Schema.Literal<"sqlite_seed_script">;
61
+ }>]>;
62
+ readonly startedAt: Schema.optionalKey<Schema.Number>;
63
+ readonly status: Schema.Literals<readonly ["completed", "failed", "queued", "running"]>;
64
+ readonly totalFiles: Schema.optionalKey<Schema.Number>;
65
+ readonly totalRows: Schema.optionalKey<Schema.Number>;
66
+ }>;
67
+ export interface ExportStatus extends Schema.Schema.Type<typeof ExportStatusSchema> {
68
+ }
69
+ declare const ExportCreatedSchema: Schema.Struct<{
70
+ readonly clientId: Schema.String;
71
+ readonly exportId: Schema.String;
72
+ readonly status: Schema.Literal<"queued">;
73
+ }>;
74
+ interface ExportCreated extends Schema.Schema.Type<typeof ExportCreatedSchema> {
75
+ }
76
+ declare const OntologySummarySchema: Schema.Struct<{
77
+ readonly description: Schema.String;
78
+ readonly displayName: Schema.String;
79
+ readonly id: Schema.String;
80
+ readonly objectCount: Schema.Number;
81
+ }>;
82
+ interface OntologySummary extends Schema.Schema.Type<typeof OntologySummarySchema> {
83
+ }
84
+ declare const OntologyObjectSummarySchema: Schema.Struct<{
85
+ readonly defaultRecordCount: Schema.NullOr<Schema.Number>;
86
+ readonly description: Schema.String;
87
+ readonly displayName: Schema.String;
88
+ readonly generationEligible: Schema.Boolean;
89
+ readonly owningOntologyId: Schema.String;
90
+ readonly pluralDisplayName: Schema.String;
91
+ readonly slug: Schema.String;
92
+ }>;
93
+ interface OntologyObjectSummary extends Schema.Schema.Type<typeof OntologyObjectSummarySchema> {
94
+ }
95
+ declare const OntologyObjectDetailSchema: Schema.Struct<{
96
+ readonly fields: Schema.$Array<Schema.Struct<{
97
+ readonly array: Schema.Boolean;
98
+ readonly description: Schema.String;
99
+ readonly displayName: Schema.String;
100
+ readonly enumValues: Schema.optionalKey<Schema.$Array<Schema.String>>;
101
+ readonly name: Schema.String;
102
+ readonly nullable: Schema.Boolean;
103
+ readonly optional: Schema.Boolean;
104
+ readonly type: Schema.String;
105
+ }>>;
106
+ readonly generationDependencies: Schema.$Array<Schema.String>;
107
+ readonly guidance: Schema.$Array<Schema.String>;
108
+ readonly relationships: Schema.$Array<Schema.Struct<{
109
+ readonly field: Schema.String;
110
+ readonly many: Schema.Boolean;
111
+ readonly targetObjectSlug: Schema.String;
112
+ }>>;
113
+ readonly defaultRecordCount: Schema.NullOr<Schema.Number>;
114
+ readonly description: Schema.String;
115
+ readonly displayName: Schema.String;
116
+ readonly generationEligible: Schema.Boolean;
117
+ readonly owningOntologyId: Schema.String;
118
+ readonly pluralDisplayName: Schema.String;
119
+ readonly slug: Schema.String;
120
+ }>;
121
+ interface OntologyObjectDetail extends Schema.Schema.Type<typeof OntologyObjectDetailSchema> {
122
+ }
123
+ declare const RecordGenerationCreatedSchema: Schema.Struct<{
124
+ readonly clientId: Schema.String;
125
+ readonly createdAt: Schema.Number;
126
+ readonly ontologyId: Schema.String;
127
+ readonly operationId: Schema.String;
128
+ readonly status: Schema.Literal<"queued">;
129
+ readonly statusUrl: Schema.String;
130
+ }>;
131
+ export interface RecordGenerationCreated extends Schema.Schema.Type<typeof RecordGenerationCreatedSchema> {
132
+ }
133
+ declare const RecordGenerationStatusSchema: Schema.Struct<{
134
+ readonly canceledAt: Schema.optionalKey<Schema.Number>;
135
+ readonly clientId: Schema.String;
136
+ readonly completedAt: Schema.optionalKey<Schema.Number>;
137
+ readonly createdAt: Schema.Number;
138
+ readonly failure: Schema.optionalKey<Schema.Struct<{
139
+ readonly code: Schema.String;
140
+ readonly message: Schema.String;
141
+ }>>;
142
+ readonly ontologyId: Schema.String;
143
+ readonly operationId: Schema.String;
144
+ readonly startedAt: Schema.optionalKey<Schema.Number>;
145
+ readonly status: Schema.Literals<readonly ["queued", "running", "completed", "failed", "canceled"]>;
146
+ readonly steps: Schema.$Array<Schema.Struct<{
147
+ readonly issues: Schema.$Array<Schema.String>;
148
+ readonly objectSlug: Schema.String;
149
+ readonly persistedCount: Schema.Number;
150
+ readonly requestedCount: Schema.Number;
151
+ readonly state: Schema.Literals<readonly ["queued", "running", "completed", "failed", "canceled"]>;
152
+ }>>;
153
+ readonly totals: Schema.Struct<{
154
+ readonly objectCount: Schema.Number;
155
+ readonly persistedCount: Schema.Number;
156
+ readonly requestedCount: Schema.Number;
41
157
  }>;
42
- totalFiles: z.ZodOptional<z.ZodNumber>;
43
- totalRows: z.ZodOptional<z.ZodNumber>;
44
- }, z.core.$strip>;
45
- declare const exportManifestSchema: z.ZodPipe<z.ZodObject<{
46
- clientId: z.ZodString;
47
- completedAt: z.ZodOptional<z.ZodNumber>;
48
- createdAt: z.ZodOptional<z.ZodNumber>;
49
- exportId: z.ZodString;
50
- files: z.ZodArray<z.ZodObject<{
51
- downloadUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
- fileName: z.ZodString;
53
- mimeType: z.ZodOptional<z.ZodString>;
54
- rowCount: z.ZodOptional<z.ZodNumber>;
55
- sha256: z.ZodOptional<z.ZodString>;
56
- sizeBytes: z.ZodOptional<z.ZodNumber>;
57
- tableName: z.ZodString;
58
- columns: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
- storageKey: z.ZodOptional<z.ZodString>;
60
- }, z.core.$strip>>;
61
- format: z.ZodOptional<z.ZodLiteral<"csv">>;
62
- medium: z.ZodOptional<z.ZodLiteral<"csv_bundle">>;
63
- mode: z.ZodOptional<z.ZodLiteral<"current_client_snapshot">>;
64
- schemaVersion: z.ZodOptional<z.ZodString>;
65
- totalRows: z.ZodOptional<z.ZodNumber>;
66
- }, z.core.$strip>, z.ZodTransform<{
67
- totalRows: number;
68
- clientId: string;
69
- exportId: string;
70
- files: {
71
- fileName: string;
72
- tableName: string;
73
- downloadUrl?: string | null | undefined;
74
- mimeType?: string | undefined;
75
- rowCount?: number | undefined;
76
- sha256?: string | undefined;
77
- sizeBytes?: number | undefined;
78
- columns?: string[] | undefined;
79
- storageKey?: string | undefined;
80
- }[];
81
- completedAt?: number | undefined;
82
- createdAt?: number | undefined;
83
- format?: "csv" | undefined;
84
- medium?: "csv_bundle" | undefined;
85
- mode?: "current_client_snapshot" | undefined;
86
- schemaVersion?: string | undefined;
87
- }, {
88
- clientId: string;
89
- exportId: string;
90
- files: {
91
- fileName: string;
92
- tableName: string;
93
- downloadUrl?: string | null | undefined;
94
- mimeType?: string | undefined;
95
- rowCount?: number | undefined;
96
- sha256?: string | undefined;
97
- sizeBytes?: number | undefined;
98
- columns?: string[] | undefined;
99
- storageKey?: string | undefined;
100
- }[];
101
- completedAt?: number | undefined;
102
- createdAt?: number | undefined;
103
- format?: "csv" | undefined;
104
- medium?: "csv_bundle" | undefined;
105
- mode?: "current_client_snapshot" | undefined;
106
- schemaVersion?: string | undefined;
107
- totalRows?: number | undefined;
108
- }>>;
109
- export type ExportCreated = z.infer<typeof exportCreatedSchema>;
110
- export type ExportFile = z.infer<typeof exportFileSchema>;
111
- export type ExportManifest = z.output<typeof exportManifestSchema>;
112
- export type ExportManifestFile = ExportManifest["files"][number];
113
- export type ExportStatus = z.infer<typeof exportStatusSchema>;
114
- export interface PrismantixApiClientOptions {
158
+ }>;
159
+ export interface RecordGenerationStatus extends Schema.Schema.Type<typeof RecordGenerationStatusSchema> {
160
+ }
161
+ declare const ApiConfigurationError_base: Schema.Class<ApiConfigurationError, Schema.TaggedStruct<"ApiConfigurationError", {
162
+ readonly message: Schema.String;
163
+ }>, import("effect/Cause").YieldableError>;
164
+ export declare class ApiConfigurationError extends ApiConfigurationError_base {
165
+ }
166
+ declare const ApiHttpError_base: Schema.Class<ApiHttpError, Schema.TaggedStruct<"ApiHttpError", {
167
+ readonly message: Schema.String;
168
+ readonly status: Schema.Number;
169
+ }>, import("effect/Cause").YieldableError>;
170
+ export declare class ApiHttpError extends ApiHttpError_base {
171
+ }
172
+ declare const ApiTransportError_base: Schema.Class<ApiTransportError, Schema.TaggedStruct<"ApiTransportError", {
173
+ readonly message: Schema.String;
174
+ }>, import("effect/Cause").YieldableError>;
175
+ export declare class ApiTransportError extends ApiTransportError_base {
176
+ }
177
+ declare const ApiDecodeError_base: Schema.Class<ApiDecodeError, Schema.TaggedStruct<"ApiDecodeError", {
178
+ readonly message: Schema.String;
179
+ }>, import("effect/Cause").YieldableError>;
180
+ export declare class ApiDecodeError extends ApiDecodeError_base {
181
+ }
182
+ type ApiClientError = ApiConfigurationError | ApiDecodeError | ApiHttpError | ApiTransportError;
183
+ interface PrismantixApiClientService {
184
+ readonly cancelRecordGeneration: (operationId: string) => Effect.Effect<RecordGenerationStatus, ApiClientError>;
185
+ readonly createExport: (clientId: string) => Effect.Effect<ExportCreated, ApiClientError>;
186
+ readonly createRecordGeneration: (clientId: string, ontologyId: string, idempotencyKey: string) => Effect.Effect<RecordGenerationCreated, ApiClientError>;
187
+ readonly getExportStatus: (exportId: string) => Effect.Effect<ExportStatus, ApiClientError>;
188
+ readonly getFile: (exportId: string, tableName: string) => Effect.Effect<Response, ApiClientError>;
189
+ readonly getManifest: (exportId: string) => Effect.Effect<ExportManifest, ApiClientError>;
190
+ readonly getOntologyObject: (objectSlug: string) => Effect.Effect<OntologyObjectDetail, ApiClientError>;
191
+ readonly getRecordGeneration: (operationId: string) => Effect.Effect<RecordGenerationStatus, ApiClientError>;
192
+ readonly listOntologies: () => Effect.Effect<readonly OntologySummary[], ApiClientError>;
193
+ readonly listOntologyObjects: (ontologyId: string) => Effect.Effect<readonly OntologyObjectSummary[], ApiClientError>;
194
+ }
195
+ declare const PrismantixApiClient_base: Context.ServiceClass<PrismantixApiClient, "@prismantix/cli/PrismantixApiClient", PrismantixApiClientService>;
196
+ export declare class PrismantixApiClient extends PrismantixApiClient_base {
197
+ }
198
+ interface PrismantixApiClientLayerOptions {
115
199
  readonly apiBaseUrl?: string;
116
- readonly apiKey: string;
200
+ readonly apiKey?: string;
201
+ readonly configProvider?: ConfigProvider.ConfigProvider;
117
202
  readonly fetchImpl?: typeof fetch;
118
203
  }
119
- export declare class PrismantixApiClient {
120
- private readonly apiBaseUrl;
121
- private readonly apiKey;
122
- private readonly fetchImpl;
123
- constructor(options: PrismantixApiClientOptions);
124
- createExport(clientId: string): Promise<{
125
- clientId: string;
126
- exportId: string;
127
- manifestUrl?: string | undefined;
128
- status?: "queued" | undefined;
129
- statusUrl?: string | undefined;
130
- }>;
131
- getExportStatus(exportId: string): Promise<{
132
- clientId: string;
133
- exportId: string;
134
- files: {
135
- fileName: string;
136
- tableName: string;
137
- downloadUrl?: string | null | undefined;
138
- mimeType?: string | undefined;
139
- rowCount?: number | undefined;
140
- sha256?: string | undefined;
141
- sizeBytes?: number | undefined;
142
- }[];
143
- status: "queued" | "running" | "completed" | "failed";
144
- completedAt?: number | undefined;
145
- createdAt?: number | undefined;
146
- errorMessage?: string | undefined;
147
- failedAt?: number | undefined;
148
- manifestUrl?: string | null | undefined;
149
- startedAt?: number | undefined;
150
- totalFiles?: number | undefined;
151
- totalRows?: number | undefined;
152
- }>;
153
- getManifest(exportId: string): Promise<{
154
- totalRows: number;
155
- clientId: string;
156
- exportId: string;
157
- files: {
158
- fileName: string;
159
- tableName: string;
160
- downloadUrl?: string | null | undefined;
161
- mimeType?: string | undefined;
162
- rowCount?: number | undefined;
163
- sha256?: string | undefined;
164
- sizeBytes?: number | undefined;
165
- columns?: string[] | undefined;
166
- storageKey?: string | undefined;
167
- }[];
168
- completedAt?: number | undefined;
169
- createdAt?: number | undefined;
170
- format?: "csv" | undefined;
171
- medium?: "csv_bundle" | undefined;
172
- mode?: "current_client_snapshot" | undefined;
173
- schemaVersion?: string | undefined;
174
- }>;
175
- getFile(exportId: string, tableName: string): Promise<Response>;
176
- private request;
177
- }
204
+ export declare const makePrismantixApiClientLayer: (options?: PrismantixApiClientLayerOptions) => Layer.Layer<PrismantixApiClient, ApiConfigurationError, never>;
178
205
  export {};
179
206
  //# sourceMappingURL=api.d.ts.map
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,gBAAgB;;;;;;;;iBAQpB,CAAC;AAEH,QAAA,MAAM,mBAAmB;;;;;;iBAMvB,CAAC;AAEH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAatB,CAAC;AAOH,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkBtB,CAAC;AAEL,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACnE,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AACjE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM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