daishi-sdk 0.2.14 → 0.2.15
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/dist/generated.d.ts +252 -1
- package/dist/generated.js +110 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/generated.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type JsonObject = {
|
|
|
5
5
|
/** The API version these types describe. */
|
|
6
6
|
export declare const API_VERSION = "1.0.0";
|
|
7
7
|
/** Every error code the API documents. */
|
|
8
|
-
export type ErrorCode = 'token_required' | 'scope_required' | 'plan_api' | 'rate_limited' | 'handover' | 'bad_request' | 'bad_scenario' | 'bad_replicates' | 'profile_required' | 'bad_season_ticks' | 'bad_frame' | 'bad_env' | 'too_many_scenarios' | 'unknown_scenario' | 'bad_skill' | 'too_many_skills' | 'unknown_skill' | 'bad_roster' | 'bad_model' | 'bad_name' | 'bad_provider' | 'provider_key_required' | 'openrouter_key_required' | 'openrouter_balance_low' | 'billing_frozen' | 'email_unverified' | 'bad_trials' | 'bad_spend_cap' | 'plan_seats' | 'plan_ticks' | 'plan_series' | 'plan_quota' | 'too_many_runs' | 'run_history_full' | 'seed_not_allowed' | 'unknown_run' | 'unknown_batch' | 'unknown_experiment' | 'experiment_trial' | 'experiment_not_running' | 'experiment_arms' | 'bad_experiment' | 'experiment_scenario' | 'bad_game' | 'bad_arena' | 'experiment_world_only' | 'experiment_same_arms' | 'experiment_env_seed' | 'experiment_stopping' | 'bad_metric' | 'bad_design' | 'design_final' | 'design_late' | 'no_design' | 'experiment_effort_roster' | 'experiment_no_probe' | 'experiment_too_few_seats' | 'plan_experiment_arms' | 'plan_rerun' | 'unknown_log' | 'plan_invites' | 'invite_world' | 'invite_series' | 'too_many_open_worlds' | 'no_invite' | 'invite_fixed' | 'bad_invite' | 'never_played' | 'run_playing' | 'study_playing' | 'bad_note' | 'note_too_long' | 'run_launching' | 'internal_error';
|
|
8
|
+
export type ErrorCode = 'token_required' | 'scope_required' | 'plan_api' | 'rate_limited' | 'handover' | 'bad_request' | 'bad_scenario' | 'bad_replicates' | 'profile_required' | 'bad_season_ticks' | 'bad_frame' | 'bad_env' | 'too_many_scenarios' | 'unknown_scenario' | 'bad_skill' | 'too_many_skills' | 'unknown_skill' | 'bad_roster' | 'bad_model' | 'bad_name' | 'bad_provider' | 'provider_key_required' | 'openrouter_key_required' | 'openrouter_balance_low' | 'billing_frozen' | 'email_unverified' | 'bad_trials' | 'bad_spend_cap' | 'plan_seats' | 'plan_ticks' | 'plan_series' | 'plan_quota' | 'too_many_runs' | 'run_history_full' | 'seed_not_allowed' | 'unknown_run' | 'unknown_batch' | 'unknown_experiment' | 'experiment_trial' | 'experiment_not_running' | 'experiment_arms' | 'bad_experiment' | 'experiment_scenario' | 'bad_game' | 'bad_arena' | 'experiment_world_only' | 'experiment_same_arms' | 'experiment_env_seed' | 'experiment_stopping' | 'bad_metric' | 'bad_design' | 'design_final' | 'design_late' | 'no_design' | 'experiment_effort_roster' | 'experiment_no_probe' | 'experiment_too_few_seats' | 'plan_experiment_arms' | 'plan_rerun' | 'unknown_log' | 'plan_invites' | 'invite_world' | 'invite_series' | 'too_many_open_worlds' | 'no_invite' | 'invite_fixed' | 'bad_invite' | 'never_played' | 'run_playing' | 'study_playing' | 'bad_note' | 'note_too_long' | 'unknown_set' | 'unknown_setup' | 'bad_set' | 'set_full' | 'series_trial' | 'in_another_set' | 'guest_seats' | 'set_empty' | 'run_launching' | 'internal_error';
|
|
9
9
|
export type Method = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
10
10
|
export interface RequestParts {
|
|
11
11
|
query?: Record<string, string | number | boolean | undefined | null>;
|
|
@@ -172,6 +172,22 @@ export interface ExperimentReport {
|
|
|
172
172
|
/** The design document as the server received it: the SHA-256 of its UTF-8 bytes, its size, when it arrived, and its standing read from those times: `declared` (it arrived with the creation or before the first trial started, after which it cannot be replaced), `named` (it arrived later, and the experiment’s name, fixed at creation, carries `name_prefix`, the first 12 or more hex digits of its digest), or `after` (neither). The text is its own read. */
|
|
173
173
|
design: ExperimentDesign | null;
|
|
174
174
|
}
|
|
175
|
+
/** A run set: several of the account’s finished runs, standalone runs and whole series batches, published on its profile as one card, each filed under a setup the owner named. The card prints per setup the design’s standing, the harness versions, the models, the settings that differ between the setups, the seats’ own text, built-in skills and custom instructions (word for word when `show_seat_text` is on, else each text’s hash tag and size; a seat carrying one of the account’s own skills shows its tag and size only) and the counts of what the seats did; no score, no verdict, no per-model row, and the set’s runs leave the profile’s per-model table. `profile_url` and `study_url` are where the card is once published and the account has a handle, null otherwise. */
|
|
176
|
+
export interface RunSet {
|
|
177
|
+
set_id: string;
|
|
178
|
+
name: string;
|
|
179
|
+
note: string | null;
|
|
180
|
+
note_at_ms: number | null;
|
|
181
|
+
show_seat_text: boolean;
|
|
182
|
+
published: boolean;
|
|
183
|
+
published_at_ms: number | null;
|
|
184
|
+
created_at_ms: number;
|
|
185
|
+
updated_at_ms: number;
|
|
186
|
+
setups: RunSetSetup[];
|
|
187
|
+
members: RunSetMember[];
|
|
188
|
+
profile_url: string | null;
|
|
189
|
+
study_url: string | null;
|
|
190
|
+
}
|
|
175
191
|
export interface ScenarioBody {
|
|
176
192
|
/** Display name, shown in the run builder under "Your scenarios". */
|
|
177
193
|
name: string;
|
|
@@ -453,6 +469,97 @@ export interface ExtendInvitesBody {
|
|
|
453
469
|
/** The new deadline, minutes from now, for every open seat. */
|
|
454
470
|
minutes: number;
|
|
455
471
|
}
|
|
472
|
+
export interface ListSetsResponse {
|
|
473
|
+
sets: RunSet[];
|
|
474
|
+
}
|
|
475
|
+
export interface CreateSetBody {
|
|
476
|
+
/** The card’s title, kept on one line. Fixed once created. */
|
|
477
|
+
name: string;
|
|
478
|
+
/** The setups runs are filed under, in the order the card lists them. */
|
|
479
|
+
setups: CreateSetBodySetup[];
|
|
480
|
+
/** Your note on the set, shown on the card as your words, marked as yours. */
|
|
481
|
+
note?: string;
|
|
482
|
+
/** Print every seat’s custom instructions on the card. Default false. */
|
|
483
|
+
show_seat_text?: boolean;
|
|
484
|
+
}
|
|
485
|
+
export interface CreateSetResponse {
|
|
486
|
+
ok: boolean;
|
|
487
|
+
set: RunSet;
|
|
488
|
+
}
|
|
489
|
+
export interface GetSetResponse {
|
|
490
|
+
set: RunSet;
|
|
491
|
+
}
|
|
492
|
+
export interface UpdateSetBody {
|
|
493
|
+
/** The note, counted after trimming. "" or null: no note. */
|
|
494
|
+
note?: string | null;
|
|
495
|
+
/** Print every seat’s custom instructions on the card, or show only each text’s hash tag and size. */
|
|
496
|
+
show_seat_text?: boolean;
|
|
497
|
+
/** New labels by setup key, { "<key>": "<label>" }, for the setups named. */
|
|
498
|
+
labels?: JsonObject;
|
|
499
|
+
}
|
|
500
|
+
export interface UpdateSetResponse {
|
|
501
|
+
ok: boolean;
|
|
502
|
+
set: RunSet;
|
|
503
|
+
}
|
|
504
|
+
export interface DeleteSetResponse {
|
|
505
|
+
ok: boolean;
|
|
506
|
+
deleted: string;
|
|
507
|
+
unpublished: number;
|
|
508
|
+
}
|
|
509
|
+
export interface AddSetMembersBody {
|
|
510
|
+
/** The setup key to file them under. */
|
|
511
|
+
setup: string;
|
|
512
|
+
/** Run ids (run_...). */
|
|
513
|
+
runs?: string[];
|
|
514
|
+
/** Series batch ids (bat_...), each joining whole. */
|
|
515
|
+
batches?: string[];
|
|
516
|
+
}
|
|
517
|
+
export interface AddSetMembersResponse {
|
|
518
|
+
ok: boolean;
|
|
519
|
+
set: RunSet;
|
|
520
|
+
}
|
|
521
|
+
export interface RemoveSetMembersBody {
|
|
522
|
+
/** Run ids (run_...). */
|
|
523
|
+
runs?: string[];
|
|
524
|
+
/** Series batch ids (bat_...). */
|
|
525
|
+
batches?: string[];
|
|
526
|
+
}
|
|
527
|
+
export interface RemoveSetMembersResponse {
|
|
528
|
+
ok: boolean;
|
|
529
|
+
set: RunSet;
|
|
530
|
+
}
|
|
531
|
+
export interface AttachSetDesignBody {
|
|
532
|
+
/** The design document, as text (markdown or plain). */
|
|
533
|
+
design: string;
|
|
534
|
+
}
|
|
535
|
+
export interface AttachSetDesignResponse {
|
|
536
|
+
ok: boolean;
|
|
537
|
+
set: RunSet;
|
|
538
|
+
}
|
|
539
|
+
export interface GetSetDesignResponse {
|
|
540
|
+
set_id: string;
|
|
541
|
+
setup: string;
|
|
542
|
+
sha256: string;
|
|
543
|
+
bytes: number;
|
|
544
|
+
at_ms: number;
|
|
545
|
+
standing: 'declared' | 'named' | 'after';
|
|
546
|
+
name_prefix: string | null;
|
|
547
|
+
text: string;
|
|
548
|
+
}
|
|
549
|
+
export interface PublishSetResponse {
|
|
550
|
+
ok: boolean;
|
|
551
|
+
set: RunSet;
|
|
552
|
+
runs: Runs;
|
|
553
|
+
profile_url: string | null;
|
|
554
|
+
study_url: string | null;
|
|
555
|
+
}
|
|
556
|
+
export interface UnpublishSetResponse {
|
|
557
|
+
ok: boolean;
|
|
558
|
+
set: RunSet;
|
|
559
|
+
runs: Runs;
|
|
560
|
+
profile_url: string | null;
|
|
561
|
+
study_url: string | null;
|
|
562
|
+
}
|
|
456
563
|
export interface RunScenario {
|
|
457
564
|
id: string;
|
|
458
565
|
hash: string;
|
|
@@ -768,6 +875,52 @@ export interface ExperimentReportWhatDiffered {
|
|
|
768
875
|
label: string;
|
|
769
876
|
changes: string[];
|
|
770
877
|
}
|
|
878
|
+
/** One setup of a run set: how many runs are filed under it and the series batches among them, the harness versions their seats registered under (a set may span versions; nothing is pooled across them), when the earliest run ever filed under it started its match (a run moved out does not raise it), its design, and its counts summed over its runs (null while none carries one; `uncounted` runs whose match could not be read add nothing). */
|
|
879
|
+
export interface RunSetSetup {
|
|
880
|
+
key: string;
|
|
881
|
+
label: string;
|
|
882
|
+
runs: number;
|
|
883
|
+
batches: string[];
|
|
884
|
+
harness_versions: string[];
|
|
885
|
+
first_match_ms: number | null;
|
|
886
|
+
/** A setup’s design document as the server received it: the SHA-256 of its UTF-8 bytes, its size, when it arrived, and its standing read against the setup’s first match: `declared` (it arrived before the first run ever filed under the setup started its match; a run moved out later does not change that), `named` (it arrived later, and the set’s name, fixed at a creation that came before that first match, carries `name_prefix`, the first 12 or more hex digits of its digest; a set created after its matches can name nothing in advance, so its design reads `after`), or `after` (neither). The text is its own read. */
|
|
887
|
+
design: RunSetDesign | null;
|
|
888
|
+
/** Counts off the match’s event log, stamped when the run joined the set (`v` is the version of the reading): the roster seats and the house bots on the final board, the rounds the match played, the acts of force (an attack on an agent, a raid on a structure, a theft from a storehouse) sorted by who did them to whom, the pairs of seats that ended a round in one region summed over the rounds, and the completed trades and direct messages between seats, with how many of the trades handed the same goods in the same amounts both ways (`trades_identical_goods`). `pair_rounds_together` is null for a match that gave each seat more than one action a round, where a seat can step into another’s region and out again within the round. A setup’s record sums them over its runs, `seats` and `bots` at their largest, and its `pair_rounds_together` is null when any run’s is. */
|
|
889
|
+
counts: SeatCounts | null;
|
|
890
|
+
uncounted: number;
|
|
891
|
+
}
|
|
892
|
+
/** A setup’s design document as the server received it: the SHA-256 of its UTF-8 bytes, its size, when it arrived, and its standing read against the setup’s first match: `declared` (it arrived before the first run ever filed under the setup started its match; a run moved out later does not change that), `named` (it arrived later, and the set’s name, fixed at a creation that came before that first match, carries `name_prefix`, the first 12 or more hex digits of its digest; a set created after its matches can name nothing in advance, so its design reads `after`), or `after` (neither). The text is its own read. */
|
|
893
|
+
export interface RunSetDesign {
|
|
894
|
+
sha256: string;
|
|
895
|
+
bytes: number;
|
|
896
|
+
at_ms: number;
|
|
897
|
+
standing: 'declared' | 'named' | 'after';
|
|
898
|
+
name_prefix: string | null;
|
|
899
|
+
}
|
|
900
|
+
/** Counts off the match’s event log, stamped when the run joined the set (`v` is the version of the reading): the roster seats and the house bots on the final board, the rounds the match played, the acts of force (an attack on an agent, a raid on a structure, a theft from a storehouse) sorted by who did them to whom, the pairs of seats that ended a round in one region summed over the rounds, and the completed trades and direct messages between seats, with how many of the trades handed the same goods in the same amounts both ways (`trades_identical_goods`). `pair_rounds_together` is null for a match that gave each seat more than one action a round, where a seat can step into another’s region and out again within the round. A setup’s record sums them over its runs, `seats` and `bots` at their largest, and its `pair_rounds_together` is null when any run’s is. */
|
|
901
|
+
export interface SeatCounts {
|
|
902
|
+
v: number;
|
|
903
|
+
seats: number;
|
|
904
|
+
bots: number;
|
|
905
|
+
rounds: number;
|
|
906
|
+
force_seats_on_seats: number;
|
|
907
|
+
force_seats_on_bots: number;
|
|
908
|
+
force_bots_on_seats: number;
|
|
909
|
+
pair_rounds_together: number | null;
|
|
910
|
+
trades_between_seats: number;
|
|
911
|
+
trades_identical_goods: number;
|
|
912
|
+
messages_between_seats: number;
|
|
913
|
+
}
|
|
914
|
+
/** One run in a set: the setup it is filed under, the series batch it joined with (null for a standalone run), when it joined, its counts, and the harness versions its seats registered under as the archive recorded them (empty when the match is not on record). */
|
|
915
|
+
export interface RunSetMember {
|
|
916
|
+
run_id: string;
|
|
917
|
+
batch_id: string | null;
|
|
918
|
+
setup: string;
|
|
919
|
+
added_at_ms: number;
|
|
920
|
+
/** Counts off the match’s event log, stamped when the run joined the set (`v` is the version of the reading): the roster seats and the house bots on the final board, the rounds the match played, the acts of force (an attack on an agent, a raid on a structure, a theft from a storehouse) sorted by who did them to whom, the pairs of seats that ended a round in one region summed over the rounds, and the completed trades and direct messages between seats, with how many of the trades handed the same goods in the same amounts both ways (`trades_identical_goods`). `pair_rounds_together` is null for a match that gave each seat more than one action a round, where a seat can step into another’s region and out again within the round. A setup’s record sums them over its runs, `seats` and `bots` at their largest, and its `pair_rounds_together` is null when any run’s is. */
|
|
921
|
+
counts: SeatCounts | null;
|
|
922
|
+
harness: string[];
|
|
923
|
+
}
|
|
771
924
|
/** The environment. Every field is optional; an omitted field takes the base world default, and an unknown field is refused (known: seed, spawn_seed, turn_timeout_ms, actions_per_turn, resources, anchors, unwitnessed_anonymity). */
|
|
772
925
|
export interface Env {
|
|
773
926
|
/** World seed: fixes the map. Omit to draw a fresh one per run; the drawn seed is recorded on the run. */
|
|
@@ -830,6 +983,16 @@ export interface Study {
|
|
|
830
983
|
published: number;
|
|
831
984
|
pending: number;
|
|
832
985
|
}
|
|
986
|
+
export interface CreateSetBodySetup {
|
|
987
|
+
/** 1 to 32 characters of a-z, 0-9, _ or -, starting with a letter or digit. Fixed once created. */
|
|
988
|
+
key: string;
|
|
989
|
+
/** What the card calls the setup; the key when omitted. */
|
|
990
|
+
label?: string;
|
|
991
|
+
}
|
|
992
|
+
export interface Runs {
|
|
993
|
+
played: number;
|
|
994
|
+
published: number;
|
|
995
|
+
}
|
|
833
996
|
/** One method per API operation. The transport is the subclass's. */
|
|
834
997
|
export declare abstract class Operations {
|
|
835
998
|
protected abstract request<T>(method: Method, path: string, parts?: RequestParts): Promise<T>;
|
|
@@ -1220,4 +1383,92 @@ export declare abstract class Operations {
|
|
|
1220
1383
|
* @see https://daishi.ai/docs/developer/rest#ep-revoke-invite
|
|
1221
1384
|
*/
|
|
1222
1385
|
revokeInvite(id: string, inviteId: string): Promise<JsonObject>;
|
|
1386
|
+
/**
|
|
1387
|
+
* List run sets.
|
|
1388
|
+
*
|
|
1389
|
+
* Your run sets, newest first: several finished runs published on your profile as one card.
|
|
1390
|
+
*
|
|
1391
|
+
* @see https://daishi.ai/docs/developer/rest#ep-list-sets
|
|
1392
|
+
*/
|
|
1393
|
+
listSets(): Promise<ListSetsResponse>;
|
|
1394
|
+
/**
|
|
1395
|
+
* Create a run set.
|
|
1396
|
+
*
|
|
1397
|
+
* A new, empty run set with its setups named; nothing is public until you publish it.
|
|
1398
|
+
*
|
|
1399
|
+
* @see https://daishi.ai/docs/developer/rest#ep-create-set
|
|
1400
|
+
*/
|
|
1401
|
+
createSet(body: CreateSetBody): Promise<CreateSetResponse>;
|
|
1402
|
+
/**
|
|
1403
|
+
* Get a run set.
|
|
1404
|
+
*
|
|
1405
|
+
* One of your run sets, with every member run and its stamped counts.
|
|
1406
|
+
*
|
|
1407
|
+
* @see https://daishi.ai/docs/developer/rest#ep-get-set
|
|
1408
|
+
*/
|
|
1409
|
+
getSet(id: string): Promise<GetSetResponse>;
|
|
1410
|
+
/**
|
|
1411
|
+
* Update a run set’s words.
|
|
1412
|
+
*
|
|
1413
|
+
* Change the set’s note, whether the card prints the seats’ text, or the setups’ labels.
|
|
1414
|
+
*
|
|
1415
|
+
* @see https://daishi.ai/docs/developer/rest#ep-update-set
|
|
1416
|
+
*/
|
|
1417
|
+
updateSet(id: string, body: UpdateSetBody): Promise<UpdateSetResponse>;
|
|
1418
|
+
/**
|
|
1419
|
+
* Delete a run set.
|
|
1420
|
+
*
|
|
1421
|
+
* Delete the set and its designs; the runs themselves stay.
|
|
1422
|
+
*
|
|
1423
|
+
* @see https://daishi.ai/docs/developer/rest#ep-delete-set
|
|
1424
|
+
*/
|
|
1425
|
+
deleteSet(id: string): Promise<DeleteSetResponse>;
|
|
1426
|
+
/**
|
|
1427
|
+
* Add runs to a run set.
|
|
1428
|
+
*
|
|
1429
|
+
* File finished runs, and whole series batches, under one of the set’s setups.
|
|
1430
|
+
*
|
|
1431
|
+
* @see https://daishi.ai/docs/developer/rest#ep-add-set-members
|
|
1432
|
+
*/
|
|
1433
|
+
addSetMembers(id: string, body: AddSetMembersBody): Promise<AddSetMembersResponse>;
|
|
1434
|
+
/**
|
|
1435
|
+
* Remove runs from a run set.
|
|
1436
|
+
*
|
|
1437
|
+
* Take runs, or whole series batches, out of the set.
|
|
1438
|
+
*
|
|
1439
|
+
* @see https://daishi.ai/docs/developer/rest#ep-remove-set-members
|
|
1440
|
+
*/
|
|
1441
|
+
removeSetMembers(id: string, body: RemoveSetMembersBody): Promise<RemoveSetMembersResponse>;
|
|
1442
|
+
/**
|
|
1443
|
+
* Attach a setup’s design.
|
|
1444
|
+
*
|
|
1445
|
+
* Attach the design document of one setup of the set, kept with its SHA-256 and arrival time.
|
|
1446
|
+
*
|
|
1447
|
+
* @see https://daishi.ai/docs/developer/rest#ep-attach-set-design
|
|
1448
|
+
*/
|
|
1449
|
+
attachSetDesign(id: string, setup: string, body: AttachSetDesignBody): Promise<AttachSetDesignResponse>;
|
|
1450
|
+
/**
|
|
1451
|
+
* Get a setup’s design.
|
|
1452
|
+
*
|
|
1453
|
+
* One setup’s design document as the server received it, with its digest and standing.
|
|
1454
|
+
*
|
|
1455
|
+
* @see https://daishi.ai/docs/developer/rest#ep-get-set-design
|
|
1456
|
+
*/
|
|
1457
|
+
getSetDesign(id: string, setup: string): Promise<GetSetDesignResponse>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Publish a run set.
|
|
1460
|
+
*
|
|
1461
|
+
* List the set on your public profile as one card, and every run in it with it.
|
|
1462
|
+
*
|
|
1463
|
+
* @see https://daishi.ai/docs/developer/rest#ep-publish-set
|
|
1464
|
+
*/
|
|
1465
|
+
publishSet(id: string): Promise<PublishSetResponse>;
|
|
1466
|
+
/**
|
|
1467
|
+
* Unpublish a run set.
|
|
1468
|
+
*
|
|
1469
|
+
* Take the set and every run in it off your public profile.
|
|
1470
|
+
*
|
|
1471
|
+
* @see https://daishi.ai/docs/developer/rest#ep-unpublish-set
|
|
1472
|
+
*/
|
|
1473
|
+
unpublishSet(id: string): Promise<UnpublishSetResponse>;
|
|
1223
1474
|
}
|
package/dist/generated.js
CHANGED
|
@@ -484,4 +484,114 @@ export class Operations {
|
|
|
484
484
|
revokeInvite(id, inviteId) {
|
|
485
485
|
return this.request('POST', `/runs/${encodeURIComponent(id)}/invites/${encodeURIComponent(inviteId)}/revoke`);
|
|
486
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* List run sets.
|
|
489
|
+
*
|
|
490
|
+
* Your run sets, newest first: several finished runs published on your profile as one card.
|
|
491
|
+
*
|
|
492
|
+
* @see https://daishi.ai/docs/developer/rest#ep-list-sets
|
|
493
|
+
*/
|
|
494
|
+
listSets() {
|
|
495
|
+
return this.request('GET', '/sets');
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Create a run set.
|
|
499
|
+
*
|
|
500
|
+
* A new, empty run set with its setups named; nothing is public until you publish it.
|
|
501
|
+
*
|
|
502
|
+
* @see https://daishi.ai/docs/developer/rest#ep-create-set
|
|
503
|
+
*/
|
|
504
|
+
createSet(body) {
|
|
505
|
+
return this.request('POST', '/sets', { body });
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Get a run set.
|
|
509
|
+
*
|
|
510
|
+
* One of your run sets, with every member run and its stamped counts.
|
|
511
|
+
*
|
|
512
|
+
* @see https://daishi.ai/docs/developer/rest#ep-get-set
|
|
513
|
+
*/
|
|
514
|
+
getSet(id) {
|
|
515
|
+
return this.request('GET', `/sets/${encodeURIComponent(id)}`);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Update a run set’s words.
|
|
519
|
+
*
|
|
520
|
+
* Change the set’s note, whether the card prints the seats’ text, or the setups’ labels.
|
|
521
|
+
*
|
|
522
|
+
* @see https://daishi.ai/docs/developer/rest#ep-update-set
|
|
523
|
+
*/
|
|
524
|
+
updateSet(id, body) {
|
|
525
|
+
return this.request('POST', `/sets/${encodeURIComponent(id)}`, { body });
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Delete a run set.
|
|
529
|
+
*
|
|
530
|
+
* Delete the set and its designs; the runs themselves stay.
|
|
531
|
+
*
|
|
532
|
+
* @see https://daishi.ai/docs/developer/rest#ep-delete-set
|
|
533
|
+
*/
|
|
534
|
+
deleteSet(id) {
|
|
535
|
+
return this.request('DELETE', `/sets/${encodeURIComponent(id)}`);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Add runs to a run set.
|
|
539
|
+
*
|
|
540
|
+
* File finished runs, and whole series batches, under one of the set’s setups.
|
|
541
|
+
*
|
|
542
|
+
* @see https://daishi.ai/docs/developer/rest#ep-add-set-members
|
|
543
|
+
*/
|
|
544
|
+
addSetMembers(id, body) {
|
|
545
|
+
return this.request('POST', `/sets/${encodeURIComponent(id)}/members`, { body });
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Remove runs from a run set.
|
|
549
|
+
*
|
|
550
|
+
* Take runs, or whole series batches, out of the set.
|
|
551
|
+
*
|
|
552
|
+
* @see https://daishi.ai/docs/developer/rest#ep-remove-set-members
|
|
553
|
+
*/
|
|
554
|
+
removeSetMembers(id, body) {
|
|
555
|
+
return this.request('POST', `/sets/${encodeURIComponent(id)}/members/remove`, { body });
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Attach a setup’s design.
|
|
559
|
+
*
|
|
560
|
+
* Attach the design document of one setup of the set, kept with its SHA-256 and arrival time.
|
|
561
|
+
*
|
|
562
|
+
* @see https://daishi.ai/docs/developer/rest#ep-attach-set-design
|
|
563
|
+
*/
|
|
564
|
+
attachSetDesign(id, setup, body) {
|
|
565
|
+
return this.request('POST', `/sets/${encodeURIComponent(id)}/setups/${encodeURIComponent(setup)}/design`, { body });
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Get a setup’s design.
|
|
569
|
+
*
|
|
570
|
+
* One setup’s design document as the server received it, with its digest and standing.
|
|
571
|
+
*
|
|
572
|
+
* @see https://daishi.ai/docs/developer/rest#ep-get-set-design
|
|
573
|
+
*/
|
|
574
|
+
getSetDesign(id, setup) {
|
|
575
|
+
return this.request('GET', `/sets/${encodeURIComponent(id)}/setups/${encodeURIComponent(setup)}/design`);
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Publish a run set.
|
|
579
|
+
*
|
|
580
|
+
* List the set on your public profile as one card, and every run in it with it.
|
|
581
|
+
*
|
|
582
|
+
* @see https://daishi.ai/docs/developer/rest#ep-publish-set
|
|
583
|
+
*/
|
|
584
|
+
publishSet(id) {
|
|
585
|
+
return this.request('POST', `/sets/${encodeURIComponent(id)}/publish`);
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* Unpublish a run set.
|
|
589
|
+
*
|
|
590
|
+
* Take the set and every run in it off your public profile.
|
|
591
|
+
*
|
|
592
|
+
* @see https://daishi.ai/docs/developer/rest#ep-unpublish-set
|
|
593
|
+
*/
|
|
594
|
+
unpublishSet(id) {
|
|
595
|
+
return this.request('POST', `/sets/${encodeURIComponent(id)}/unpublish`);
|
|
596
|
+
}
|
|
487
597
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Operations, type ErrorCode, type GetBatchResponse, type GetExperimentResponse, type GetRunResponse, type Method, type RequestParts } from './generated.js';
|
|
2
2
|
export * from './generated.js';
|
|
3
|
-
export declare const VERSION = "0.2.
|
|
3
|
+
export declare const VERSION = "0.2.15";
|
|
4
4
|
export declare const DEFAULT_BASE_URL = "https://daishi.ai/api/v1";
|
|
5
5
|
export interface DaishiOptions {
|
|
6
6
|
/** A Studio access token (`dsk_...`). Default: the `DAISHI_TOKEN` environment variable. */
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Operations } from './generated.js';
|
|
2
2
|
export * from './generated.js';
|
|
3
|
-
export const VERSION = '0.2.
|
|
3
|
+
export const VERSION = '0.2.15';
|
|
4
4
|
export const DEFAULT_BASE_URL = 'https://daishi.ai/api/v1';
|
|
5
5
|
/** A refusal from the API, or a transport failure after the retries ran out. */
|
|
6
6
|
export class DaishiError extends Error {
|
package/package.json
CHANGED