@deepraxis/cli 0.2.2-dev.3656610 → 0.2.2-dev.36d48d0
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/COMMANDS.md +52 -6
- package/README.md +18 -6
- package/dist/praxis.js +3912 -77
- package/package.json +1 -1
package/dist/praxis.js
CHANGED
|
@@ -6946,6 +6946,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
6946
6946
|
|
|
6947
6947
|
// src/main.ts
|
|
6948
6948
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
6949
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
6949
6950
|
import { spawn as spawn2 } from "node:child_process";
|
|
6950
6951
|
import { createInterface } from "node:readline";
|
|
6951
6952
|
|
|
@@ -17166,7 +17167,7 @@ Execution errors include error.details.prints containing output printed before f
|
|
|
17166
17167
|
name: "folder",
|
|
17167
17168
|
type: "string",
|
|
17168
17169
|
required: false,
|
|
17169
|
-
description: "Optional destination path within the bound media library; omitted uses its default folder."
|
|
17170
|
+
description: "Optional destination path within the bound media library; omitted uses its default folder. Naming a binding or a folder also imports the finished video into that media library as an asset. Omit both and the export is a file only: read file.url to download it."
|
|
17170
17171
|
},
|
|
17171
17172
|
{
|
|
17172
17173
|
name: "name",
|
|
@@ -17184,7 +17185,7 @@ Execution errors include error.details.prints containing output printed before f
|
|
|
17184
17185
|
name: "binding",
|
|
17185
17186
|
type: "string",
|
|
17186
17187
|
required: false,
|
|
17187
|
-
description: "Writable binding name used as the export destination; omission uses default_upload."
|
|
17188
|
+
description: "Writable binding name used as the export destination; omission uses default_upload. Naming a binding or a folder also imports the finished video into that media library as an asset. Omit both and the export is a file only; read file.url to download it."
|
|
17188
17189
|
},
|
|
17189
17190
|
{
|
|
17190
17191
|
name: "revision",
|
|
@@ -18682,6 +18683,718 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
18682
18683
|
]
|
|
18683
18684
|
}
|
|
18684
18685
|
},
|
|
18686
|
+
{
|
|
18687
|
+
resource: "devops.environments.checkpoints",
|
|
18688
|
+
method: "list",
|
|
18689
|
+
summary: "List environment checkpoints",
|
|
18690
|
+
description: 'List where each target of an environment currently stands: the release and commit deployed to it, the promotion that put it there, and how far behind the default branch that commit is. Read it to answer "what is running in production right now" and to tell a promotion that will change something apart from one that will skip every target as unchanged. behindMain counts commits on the default branch that the deployed commit does not have, so zero means the environment carries the current branch head. Targets that were never deployed to have no checkpoints until something deploys to them.',
|
|
18691
|
+
http: "GET",
|
|
18692
|
+
path: "/devops/v1/environments/{id}/checkpoints",
|
|
18693
|
+
streaming: "no",
|
|
18694
|
+
pagination: false,
|
|
18695
|
+
pathParams: [
|
|
18696
|
+
{
|
|
18697
|
+
name: "id",
|
|
18698
|
+
sdkName: "id",
|
|
18699
|
+
description: "The environment identifier from a project's environment list; the tier or the display name is not an address."
|
|
18700
|
+
}
|
|
18701
|
+
],
|
|
18702
|
+
query: []
|
|
18703
|
+
},
|
|
18704
|
+
{
|
|
18705
|
+
resource: "devops.flags",
|
|
18706
|
+
method: "retrieve",
|
|
18707
|
+
summary: "Retrieve a flag",
|
|
18708
|
+
description: "Read one flag in full: every environment's configuration, the rules and rollouts each environment serves, the flag's lifecycle, and where code references its key as of the last scan. Call it before changing an environment so you can send the version you read, and after a release to confirm the flag reached the state you expected. An archived flag is still readable here — that is how its key and history stay answerable after it stopped evaluating. codeRefs.count tells you how much code still names the key, which is what decides whether removing the flag is safe.",
|
|
18709
|
+
http: "GET",
|
|
18710
|
+
path: "/devops/v1/flags/{id}",
|
|
18711
|
+
streaming: "no",
|
|
18712
|
+
pagination: false,
|
|
18713
|
+
pathParams: [
|
|
18714
|
+
{
|
|
18715
|
+
name: "id",
|
|
18716
|
+
sdkName: "id",
|
|
18717
|
+
description: "The flag identifier from a flag list or create answer; code names a flag by its key, while this API addresses it by id."
|
|
18718
|
+
}
|
|
18719
|
+
],
|
|
18720
|
+
query: []
|
|
18721
|
+
},
|
|
18722
|
+
{
|
|
18723
|
+
resource: "devops.flags",
|
|
18724
|
+
method: "update",
|
|
18725
|
+
summary: "Update a flag",
|
|
18726
|
+
description: "Change a flag's metadata — its name, description, owner, observation deadline, removal ticket or tags — without touching what any environment serves. Send the fields to change inside flag and name them in updateMask; a field present in flag but absent from the mask is left alone, and a mask naming a field this operation cannot change is refused rather than ignored. Sending null clears a nullable field such as observeUntil. Served values are not changed here: use the environment update for what an environment serves, which is versioned and checked. An archived flag cannot be updated.",
|
|
18727
|
+
http: "PATCH",
|
|
18728
|
+
path: "/devops/v1/flags/{id}",
|
|
18729
|
+
streaming: "no",
|
|
18730
|
+
pagination: false,
|
|
18731
|
+
pathParams: [
|
|
18732
|
+
{
|
|
18733
|
+
name: "id",
|
|
18734
|
+
sdkName: "id",
|
|
18735
|
+
description: "The flag identifier from a flag list or create answer; code names a flag by its key, while this API addresses it by id."
|
|
18736
|
+
}
|
|
18737
|
+
],
|
|
18738
|
+
query: [],
|
|
18739
|
+
body: {
|
|
18740
|
+
required: true,
|
|
18741
|
+
fields: [
|
|
18742
|
+
{
|
|
18743
|
+
name: "flag",
|
|
18744
|
+
type: "object",
|
|
18745
|
+
required: true,
|
|
18746
|
+
description: "The updatable fields of a flag, as the body of an update. Values left out are not touched, and null clears a nullable one."
|
|
18747
|
+
},
|
|
18748
|
+
{
|
|
18749
|
+
name: "updateMask",
|
|
18750
|
+
type: "array",
|
|
18751
|
+
itemType: "string",
|
|
18752
|
+
required: false,
|
|
18753
|
+
description: "Which fields to write, by name; omit it to write every field the flag object carries. A field not listed here is left as it is, even when the object carries it."
|
|
18754
|
+
}
|
|
18755
|
+
]
|
|
18756
|
+
}
|
|
18757
|
+
},
|
|
18758
|
+
{
|
|
18759
|
+
resource: "devops.flags.environments",
|
|
18760
|
+
method: "update",
|
|
18761
|
+
summary: "Update a flag's environment",
|
|
18762
|
+
description: "Change what one environment of a flag serves: whether it is on, its targeting rules, its prerequisite flags, its individually targeted keys, its fallthrough, and the progressive rollout it runs. This is the write that changes runtime behaviour, so it is versioned: send the version you read and a change based on a stale version is refused with FLAG_VERSION_CONFLICT instead of silently overwriting someone else's edit. comment records why the configuration changed, next to the change itself. Targets whose keys are not deployed yet are refused with FLAG_CODE_NOT_DEPLOYED, because serving a variation the running code cannot name would fail at evaluation time.",
|
|
18763
|
+
http: "PATCH",
|
|
18764
|
+
path: "/devops/v1/flags/{id}/environments/{environment}",
|
|
18765
|
+
streaming: "no",
|
|
18766
|
+
pagination: false,
|
|
18767
|
+
pathParams: [
|
|
18768
|
+
{
|
|
18769
|
+
name: "id",
|
|
18770
|
+
sdkName: "id",
|
|
18771
|
+
description: "The flag identifier from a flag list or create answer; code names a flag by its key, while this API addresses it by id."
|
|
18772
|
+
},
|
|
18773
|
+
{
|
|
18774
|
+
name: "environment",
|
|
18775
|
+
sdkName: "environment",
|
|
18776
|
+
description: "The environment whose configuration you are changing, from the flag's own environments map or the project's environment list."
|
|
18777
|
+
}
|
|
18778
|
+
],
|
|
18779
|
+
query: [],
|
|
18780
|
+
body: {
|
|
18781
|
+
required: true,
|
|
18782
|
+
fields: [
|
|
18783
|
+
{
|
|
18784
|
+
name: "version",
|
|
18785
|
+
type: "number",
|
|
18786
|
+
required: true,
|
|
18787
|
+
description: "The configuration version you read before making this change; when the environment has moved past it the write is refused with FLAG_VERSION_CONFLICT rather than overwriting."
|
|
18788
|
+
},
|
|
18789
|
+
{
|
|
18790
|
+
name: "comment",
|
|
18791
|
+
type: "string",
|
|
18792
|
+
required: true,
|
|
18793
|
+
description: "Why the configuration is changing, stored with the change so the history reads as decisions rather than as diffs."
|
|
18794
|
+
},
|
|
18795
|
+
{
|
|
18796
|
+
name: "config",
|
|
18797
|
+
type: "object",
|
|
18798
|
+
required: true,
|
|
18799
|
+
description: "The configuration to write for one environment. This call replaces the whole configuration, so send what you read with your change applied rather than only the changed part."
|
|
18800
|
+
}
|
|
18801
|
+
]
|
|
18802
|
+
}
|
|
18803
|
+
},
|
|
18804
|
+
{
|
|
18805
|
+
resource: "devops.flags",
|
|
18806
|
+
method: "archive",
|
|
18807
|
+
summary: "Archive a flag",
|
|
18808
|
+
description: "Archive a flag once it is no longer needed: it stops evaluating in every environment, leaves the ordinary flag list, and keeps its key and history. Use it for a flag whose code has been removed and whose key nothing names any more; codeRefs.count on the flag is what tells you whether that is true. Archiving is the terminal lifecycle state — an archived flag is never un-archived and its key is never reused, so a flag that may come back is turned off in its environment instead. The key stays reserved, which is why a later create with the same key is refused.",
|
|
18809
|
+
http: "POST",
|
|
18810
|
+
path: "/devops/v1/flags/{id}:archive",
|
|
18811
|
+
streaming: "no",
|
|
18812
|
+
pagination: false,
|
|
18813
|
+
pathParams: [
|
|
18814
|
+
{
|
|
18815
|
+
name: "id",
|
|
18816
|
+
sdkName: "id",
|
|
18817
|
+
description: "The flag identifier from a flag list or create answer; code names a flag by its key, while this API addresses it by id."
|
|
18818
|
+
}
|
|
18819
|
+
],
|
|
18820
|
+
query: []
|
|
18821
|
+
},
|
|
18822
|
+
{
|
|
18823
|
+
resource: "devops.flags",
|
|
18824
|
+
method: "conclude",
|
|
18825
|
+
summary: "Conclude a flag",
|
|
18826
|
+
description: "Record the decision a temporary flag's observation window ended with: promote makes the chosen variation the permanent behaviour and moves the flag to launched, rollback returns the environment to its off behaviour, and extend keeps observing with a new observeUntil deadline. reason is stored as the attribution of the decision. This is the act the observation flag machinery requires when the deadline arrives, so an expired flag is concluded rather than left standing. A promote or rollback finishes the flag's rollout; the code and the flag are then removed by the ticket the flag recorded, which this call does not do.",
|
|
18827
|
+
http: "POST",
|
|
18828
|
+
path: "/devops/v1/flags/{id}:conclude",
|
|
18829
|
+
streaming: "no",
|
|
18830
|
+
pagination: false,
|
|
18831
|
+
pathParams: [
|
|
18832
|
+
{
|
|
18833
|
+
name: "id",
|
|
18834
|
+
sdkName: "id",
|
|
18835
|
+
description: "The flag identifier from a flag list or create answer; code names a flag by its key, while this API addresses it by id."
|
|
18836
|
+
}
|
|
18837
|
+
],
|
|
18838
|
+
query: [],
|
|
18839
|
+
body: {
|
|
18840
|
+
required: true,
|
|
18841
|
+
fields: [
|
|
18842
|
+
{
|
|
18843
|
+
name: "action",
|
|
18844
|
+
type: "string",
|
|
18845
|
+
enum: [
|
|
18846
|
+
"promote",
|
|
18847
|
+
"rollback",
|
|
18848
|
+
"extend"
|
|
18849
|
+
],
|
|
18850
|
+
required: true,
|
|
18851
|
+
description: "What the deadline decided; promote and rollback finish the flag's rollout, while extend keeps it running with a new deadline."
|
|
18852
|
+
},
|
|
18853
|
+
{
|
|
18854
|
+
name: "observeUntil",
|
|
18855
|
+
type: "string",
|
|
18856
|
+
required: false,
|
|
18857
|
+
description: "The new deadline, required by extend and refused with the others; it must be later than the deadline being replaced."
|
|
18858
|
+
},
|
|
18859
|
+
{
|
|
18860
|
+
name: "reason",
|
|
18861
|
+
type: "string",
|
|
18862
|
+
required: true,
|
|
18863
|
+
description: "Why the decision went this way, recorded on the flag as the attribution the observation machinery requires."
|
|
18864
|
+
}
|
|
18865
|
+
]
|
|
18866
|
+
}
|
|
18867
|
+
},
|
|
18868
|
+
{
|
|
18869
|
+
resource: "devops.progressiveRollouts",
|
|
18870
|
+
method: "create",
|
|
18871
|
+
summary: "Create a progressive rollout",
|
|
18872
|
+
description: "Start a staged rollout of one variation of a flag in one environment: the steps are percentages with a hold time each, and the guard says which signals are watched and whether a bad reading pauses the rollout or rolls it back. Use it instead of turning a flag fully on, so a bad variation is caught at a small percentage. bucketBy names the context attribute that decides which bucket a caller falls into, so the same caller stays in the same bucket across steps. One progressive rollout runs per flag and environment; a second one while the first is active is refused with ROLLOUT_ALREADY_ACTIVE.",
|
|
18873
|
+
http: "POST",
|
|
18874
|
+
path: "/devops/v1/progressive-rollouts",
|
|
18875
|
+
streaming: "no",
|
|
18876
|
+
pagination: false,
|
|
18877
|
+
pathParams: [],
|
|
18878
|
+
query: [],
|
|
18879
|
+
body: {
|
|
18880
|
+
required: true,
|
|
18881
|
+
fields: [
|
|
18882
|
+
{
|
|
18883
|
+
name: "flag",
|
|
18884
|
+
type: "string",
|
|
18885
|
+
required: true,
|
|
18886
|
+
description: "The flag to ramp; it must not be archived, its environment must already be on, and its configuration must exist there."
|
|
18887
|
+
},
|
|
18888
|
+
{
|
|
18889
|
+
name: "environment",
|
|
18890
|
+
type: "string",
|
|
18891
|
+
required: true,
|
|
18892
|
+
description: "The environment to ramp in; the flag must be on there already, because ramping an off environment would serve nobody."
|
|
18893
|
+
},
|
|
18894
|
+
{
|
|
18895
|
+
name: "variation",
|
|
18896
|
+
type: "string",
|
|
18897
|
+
required: true,
|
|
18898
|
+
description: "The variation to ramp up; it must be one of the flag's variations and must not be the off variation, which is what the rest of the callers already get."
|
|
18899
|
+
},
|
|
18900
|
+
{
|
|
18901
|
+
name: "bucketBy",
|
|
18902
|
+
type: "string",
|
|
18903
|
+
required: false,
|
|
18904
|
+
description: "Which context attribute decides a caller's bucket; omit it to bucket by the targeting key, which keeps one caller on one side."
|
|
18905
|
+
},
|
|
18906
|
+
{
|
|
18907
|
+
name: "steps",
|
|
18908
|
+
type: "array",
|
|
18909
|
+
itemType: "object",
|
|
18910
|
+
required: true,
|
|
18911
|
+
description: "The steps to walk, at least one; percentages must be whole numbers from 0 to 100 that never decrease, and the first step takes effect immediately."
|
|
18912
|
+
},
|
|
18913
|
+
{
|
|
18914
|
+
name: "guard",
|
|
18915
|
+
type: "object",
|
|
18916
|
+
required: true,
|
|
18917
|
+
description: "What is watched while a rollout runs, and what happens when a reading is bad."
|
|
18918
|
+
}
|
|
18919
|
+
]
|
|
18920
|
+
}
|
|
18921
|
+
},
|
|
18922
|
+
{
|
|
18923
|
+
resource: "devops.progressiveRollouts",
|
|
18924
|
+
method: "retrieve",
|
|
18925
|
+
summary: "Retrieve a progressive rollout",
|
|
18926
|
+
description: "Read one progressive rollout: which step it is on, how much of the audience that is, when the next step is due, and every step it has already taken with who moved it and why. Poll it to follow a rollout, and read history to find out why it paused or rolled back — a guard that fired leaves the step and the reason there. state scheduled means the first step has not started, running means it is advancing on its hold times, and rolled_back is terminal. nextStepTime is the time the current hold ends.",
|
|
18927
|
+
http: "GET",
|
|
18928
|
+
path: "/devops/v1/progressive-rollouts/{id}",
|
|
18929
|
+
streaming: "no",
|
|
18930
|
+
pagination: false,
|
|
18931
|
+
pathParams: [
|
|
18932
|
+
{
|
|
18933
|
+
name: "id",
|
|
18934
|
+
sdkName: "id",
|
|
18935
|
+
description: "The progressive rollout identifier returned by the progressive rollout create answer."
|
|
18936
|
+
}
|
|
18937
|
+
],
|
|
18938
|
+
query: []
|
|
18939
|
+
},
|
|
18940
|
+
{
|
|
18941
|
+
resource: "devops.progressiveRollouts",
|
|
18942
|
+
method: "pause",
|
|
18943
|
+
summary: "Pause a progressive rollout",
|
|
18944
|
+
description: "Hold a running progressive rollout at its current percentage: no further step is taken until it is resumed, and the percentage already served keeps being served. Use it when a guard signal looks wrong but not wrong enough to roll back, so a person can look before the rollout advances. reason is recorded on the rollout as the attribution of the hold. Pausing a rollout that already completed or was rolled back is refused; read it first to see whether there is anything to hold.",
|
|
18945
|
+
http: "POST",
|
|
18946
|
+
path: "/devops/v1/progressive-rollouts/{id}:pause",
|
|
18947
|
+
streaming: "no",
|
|
18948
|
+
pagination: false,
|
|
18949
|
+
pathParams: [
|
|
18950
|
+
{
|
|
18951
|
+
name: "id",
|
|
18952
|
+
sdkName: "id",
|
|
18953
|
+
description: "The progressive rollout identifier returned by the progressive rollout create answer."
|
|
18954
|
+
}
|
|
18955
|
+
],
|
|
18956
|
+
query: [],
|
|
18957
|
+
body: {
|
|
18958
|
+
required: true,
|
|
18959
|
+
fields: [
|
|
18960
|
+
{
|
|
18961
|
+
name: "reason",
|
|
18962
|
+
type: "string",
|
|
18963
|
+
required: true,
|
|
18964
|
+
description: "Why the rollout is being paused or rolled back, recorded verbatim in the rollout's history as the attribution of the act."
|
|
18965
|
+
}
|
|
18966
|
+
]
|
|
18967
|
+
}
|
|
18968
|
+
},
|
|
18969
|
+
{
|
|
18970
|
+
resource: "devops.progressiveRollouts",
|
|
18971
|
+
method: "resume",
|
|
18972
|
+
summary: "Resume a progressive rollout",
|
|
18973
|
+
description: "Continue a paused progressive rollout from the step it stopped at, restarting the hold time for the current step rather than skipping it. Use it after a pause has been looked into and the rollout is judged safe to continue. A rollout that is running already, or that finished, is refused; read it first to see whether it is paused. The resumption is attributed to the credential that sends it and recorded in the rollout's step history.",
|
|
18974
|
+
http: "POST",
|
|
18975
|
+
path: "/devops/v1/progressive-rollouts/{id}:resume",
|
|
18976
|
+
streaming: "no",
|
|
18977
|
+
pagination: false,
|
|
18978
|
+
pathParams: [
|
|
18979
|
+
{
|
|
18980
|
+
name: "id",
|
|
18981
|
+
sdkName: "id",
|
|
18982
|
+
description: "The progressive rollout identifier returned by the progressive rollout create answer."
|
|
18983
|
+
}
|
|
18984
|
+
],
|
|
18985
|
+
query: []
|
|
18986
|
+
},
|
|
18987
|
+
{
|
|
18988
|
+
resource: "devops.progressiveRollouts",
|
|
18989
|
+
method: "rollback",
|
|
18990
|
+
summary: "Roll back a progressive rollout",
|
|
18991
|
+
description: "End a progressive rollout by returning the flag's environment to the variation it served before the rollout started, so the audience that was already switched over goes back. Use it when a guard signal says the variation is bad and waiting for the next step would expose more callers. reason is recorded on the rollout as the attribution of the decision. The rollback is terminal: the rollout does not restart, and a new rollout is created if the variation should be tried again. It changes what the environment serves, not the flag's other environments.",
|
|
18992
|
+
http: "POST",
|
|
18993
|
+
path: "/devops/v1/progressive-rollouts/{id}:rollback",
|
|
18994
|
+
streaming: "no",
|
|
18995
|
+
pagination: false,
|
|
18996
|
+
pathParams: [
|
|
18997
|
+
{
|
|
18998
|
+
name: "id",
|
|
18999
|
+
sdkName: "id",
|
|
19000
|
+
description: "The progressive rollout identifier returned by the progressive rollout create answer."
|
|
19001
|
+
}
|
|
19002
|
+
],
|
|
19003
|
+
query: [],
|
|
19004
|
+
body: {
|
|
19005
|
+
required: true,
|
|
19006
|
+
fields: [
|
|
19007
|
+
{
|
|
19008
|
+
name: "reason",
|
|
19009
|
+
type: "string",
|
|
19010
|
+
required: true,
|
|
19011
|
+
description: "Why the rollout is being paused or rolled back, recorded verbatim in the rollout's history as the attribution of the act."
|
|
19012
|
+
}
|
|
19013
|
+
]
|
|
19014
|
+
}
|
|
19015
|
+
},
|
|
19016
|
+
{
|
|
19017
|
+
resource: "devops.projects",
|
|
19018
|
+
method: "list",
|
|
19019
|
+
summary: "List projects",
|
|
19020
|
+
description: "List the delivery projects this organization has, newest first, with each project's repository binding and settings. Call this first when you do not already hold a project id: every other operation in this domain is addressed by one. A project from another organization is never listed, so an empty page means this organization has none rather than that they are hidden. The order is by creation time descending; follow nextPageToken until it is empty to see them all.",
|
|
19021
|
+
http: "GET",
|
|
19022
|
+
path: "/devops/v1/projects",
|
|
19023
|
+
streaming: "no",
|
|
19024
|
+
pagination: false,
|
|
19025
|
+
pathParams: [],
|
|
19026
|
+
query: [
|
|
19027
|
+
{
|
|
19028
|
+
name: "pageSize",
|
|
19029
|
+
type: "integer",
|
|
19030
|
+
required: false,
|
|
19031
|
+
description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
|
|
19032
|
+
},
|
|
19033
|
+
{
|
|
19034
|
+
name: "pageToken",
|
|
19035
|
+
type: "string",
|
|
19036
|
+
required: false,
|
|
19037
|
+
description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
|
|
19038
|
+
}
|
|
19039
|
+
]
|
|
19040
|
+
},
|
|
19041
|
+
{
|
|
19042
|
+
resource: "devops.projects",
|
|
19043
|
+
method: "retrieve",
|
|
19044
|
+
summary: "Retrieve a project",
|
|
19045
|
+
description: "Read one project by id: its repository binding, its release schedule and its gate settings. Use it to confirm a project's configuration before releasing into it, and to learn which environment a promotion order starts from. A project that was deleted, or that belongs to another organization, answers PROJECT_NOT_FOUND — the two are indistinguishable on purpose, so the answer never tells you whether a project exists elsewhere.",
|
|
19046
|
+
http: "GET",
|
|
19047
|
+
path: "/devops/v1/projects/{id}",
|
|
19048
|
+
streaming: "no",
|
|
19049
|
+
pagination: false,
|
|
19050
|
+
pathParams: [
|
|
19051
|
+
{
|
|
19052
|
+
name: "id",
|
|
19053
|
+
sdkName: "id",
|
|
19054
|
+
description: "The project identifier returned by the project list, not the project's display name or its repository name."
|
|
19055
|
+
}
|
|
19056
|
+
],
|
|
19057
|
+
query: []
|
|
19058
|
+
},
|
|
19059
|
+
{
|
|
19060
|
+
resource: "devops.projects.environments",
|
|
19061
|
+
method: "list",
|
|
19062
|
+
summary: "List environments",
|
|
19063
|
+
description: "List the project's environments in promotion order: development first, production last. order is the promotion sequence, so the environment before the one you are promoting into is the one that must have verified the release first. Each entry carries its tier, whether it requires approval, and whether its queue is idle or busy; a busy queue names the promotion holding it and how many wait behind. This collection is not paged: a project has few environments and the whole ordered list is the answer.",
|
|
19064
|
+
http: "GET",
|
|
19065
|
+
path: "/devops/v1/projects/{project}/environments",
|
|
19066
|
+
streaming: "no",
|
|
19067
|
+
pagination: false,
|
|
19068
|
+
pathParams: [
|
|
19069
|
+
{
|
|
19070
|
+
name: "project",
|
|
19071
|
+
sdkName: "project",
|
|
19072
|
+
description: "Identifies the project whose data you are reading, from the project list or create answer."
|
|
19073
|
+
}
|
|
19074
|
+
],
|
|
19075
|
+
query: []
|
|
19076
|
+
},
|
|
19077
|
+
{
|
|
19078
|
+
resource: "devops.projects.flags",
|
|
19079
|
+
method: "list",
|
|
19080
|
+
summary: "List flags",
|
|
19081
|
+
description: "List the project's flags with their per-environment configuration, newest first. Use it to find a flag by key when code names one, and to review the flags of a project — the entries carry lifecycle, staleness, the observation deadline and the removal ticket, which is what an expiry review reads. filter accepts exactly one term, lifecycle=archived, to list the archived flags instead of the live ones; any other filter or orderBy is refused rather than ignored. totalSize is answered on the first page only.",
|
|
19082
|
+
http: "GET",
|
|
19083
|
+
path: "/devops/v1/projects/{project}/flags",
|
|
19084
|
+
streaming: "no",
|
|
19085
|
+
pagination: false,
|
|
19086
|
+
pathParams: [
|
|
19087
|
+
{
|
|
19088
|
+
name: "project",
|
|
19089
|
+
sdkName: "project",
|
|
19090
|
+
description: "Identifies the project whose data you are reading, from the project list or create answer."
|
|
19091
|
+
}
|
|
19092
|
+
],
|
|
19093
|
+
query: [
|
|
19094
|
+
{
|
|
19095
|
+
name: "pageSize",
|
|
19096
|
+
type: "integer",
|
|
19097
|
+
required: false,
|
|
19098
|
+
description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
|
|
19099
|
+
},
|
|
19100
|
+
{
|
|
19101
|
+
name: "pageToken",
|
|
19102
|
+
type: "string",
|
|
19103
|
+
required: false,
|
|
19104
|
+
description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
|
|
19105
|
+
},
|
|
19106
|
+
{
|
|
19107
|
+
name: "filter",
|
|
19108
|
+
type: "string",
|
|
19109
|
+
required: false,
|
|
19110
|
+
description: "Exactly one filter term is accepted: lifecycle=archived lists the archived flags, which are hidden by default. Any other field, operator or value is refused with INVALID_ARGUMENT rather than ignored."
|
|
19111
|
+
}
|
|
19112
|
+
]
|
|
19113
|
+
},
|
|
19114
|
+
{
|
|
19115
|
+
resource: "devops.projects.flags",
|
|
19116
|
+
method: "create",
|
|
19117
|
+
summary: "Create a flag",
|
|
19118
|
+
description: "Create a feature flag in a project: its key, what kind of flag it is, the values it can serve, and which variation is served when it is off. The key is what code names, so it is unique per project and a key already in use is refused with FLAG_KEY_TAKEN rather than reused — an archived flag keeps its key. owner, observeUntil and removalTicket carry the flag's lifecycle: a release or experiment flag expects an observation deadline and the ticket that removes it, and a flag missing them is refused with FLAG_LIFECYCLE_INCOMPLETE. A new flag starts with every environment off, so creating one changes no runtime behaviour; turn an environment on with the environment update.",
|
|
19119
|
+
http: "POST",
|
|
19120
|
+
path: "/devops/v1/projects/{project}/flags",
|
|
19121
|
+
streaming: "no",
|
|
19122
|
+
pagination: false,
|
|
19123
|
+
pathParams: [
|
|
19124
|
+
{
|
|
19125
|
+
name: "project",
|
|
19126
|
+
sdkName: "project",
|
|
19127
|
+
description: "Identifies the project whose data you are reading, from the project list or create answer."
|
|
19128
|
+
}
|
|
19129
|
+
],
|
|
19130
|
+
query: [],
|
|
19131
|
+
body: {
|
|
19132
|
+
required: true,
|
|
19133
|
+
fields: [
|
|
19134
|
+
{
|
|
19135
|
+
name: "key",
|
|
19136
|
+
type: "string",
|
|
19137
|
+
required: true,
|
|
19138
|
+
description: "The name code will call this flag by; unique inside the project, and a key already in use is refused with FLAG_KEY_TAKEN rather than reused."
|
|
19139
|
+
},
|
|
19140
|
+
{
|
|
19141
|
+
name: "name",
|
|
19142
|
+
type: "string",
|
|
19143
|
+
required: true,
|
|
19144
|
+
description: "Display name of the flag, shown wherever it is listed."
|
|
19145
|
+
},
|
|
19146
|
+
{
|
|
19147
|
+
name: "description",
|
|
19148
|
+
type: "string",
|
|
19149
|
+
required: false,
|
|
19150
|
+
description: "What this flag does to the product, so a later reader does not have to trace the code to find out."
|
|
19151
|
+
},
|
|
19152
|
+
{
|
|
19153
|
+
name: "kind",
|
|
19154
|
+
type: "string",
|
|
19155
|
+
enum: [
|
|
19156
|
+
"release",
|
|
19157
|
+
"experiment",
|
|
19158
|
+
"ops",
|
|
19159
|
+
"permission"
|
|
19160
|
+
],
|
|
19161
|
+
required: true,
|
|
19162
|
+
description: "What sort of flag this is; it decides the expected lifetime, and a release or experiment flag must carry an observation deadline."
|
|
19163
|
+
},
|
|
19164
|
+
{
|
|
19165
|
+
name: "valueType",
|
|
19166
|
+
type: "string",
|
|
19167
|
+
enum: [
|
|
19168
|
+
"boolean",
|
|
19169
|
+
"string",
|
|
19170
|
+
"number",
|
|
19171
|
+
"object"
|
|
19172
|
+
],
|
|
19173
|
+
required: true,
|
|
19174
|
+
description: "The type every variation must have; a variation of another type is refused."
|
|
19175
|
+
},
|
|
19176
|
+
{
|
|
19177
|
+
name: "variations",
|
|
19178
|
+
type: "array",
|
|
19179
|
+
itemType: "object",
|
|
19180
|
+
required: true,
|
|
19181
|
+
description: "The values the flag can serve, at least two for a flag that decides anything; their ids are what defaults and rules name."
|
|
19182
|
+
},
|
|
19183
|
+
{
|
|
19184
|
+
name: "defaults",
|
|
19185
|
+
type: "object",
|
|
19186
|
+
required: true,
|
|
19187
|
+
description: "The variations a flag falls back to: what a caller that matches nothing gets when the flag is on, and what everyone gets when it is off."
|
|
19188
|
+
},
|
|
19189
|
+
{
|
|
19190
|
+
name: "owner",
|
|
19191
|
+
type: "object",
|
|
19192
|
+
required: false,
|
|
19193
|
+
description: "Who performed an action, so a state change or a run can be attributed rather than guessed at."
|
|
19194
|
+
},
|
|
19195
|
+
{
|
|
19196
|
+
name: "observeUntil",
|
|
19197
|
+
type: "string",
|
|
19198
|
+
required: false,
|
|
19199
|
+
description: "RFC 3339 UTC time this flag must be decided by; required for a release or experiment flag and refused with INVALID_ARGUMENT when it is missing."
|
|
19200
|
+
},
|
|
19201
|
+
{
|
|
19202
|
+
name: "removalTicket",
|
|
19203
|
+
type: "string",
|
|
19204
|
+
required: false,
|
|
19205
|
+
description: "The ticket that will remove the flag and its code; giving it here is what makes the removal traceable from the flag itself."
|
|
19206
|
+
},
|
|
19207
|
+
{
|
|
19208
|
+
name: "pullRequest",
|
|
19209
|
+
type: "string",
|
|
19210
|
+
required: false,
|
|
19211
|
+
description: "The pull request that declared this flag, when the flag comes from a code change rather than being created by hand."
|
|
19212
|
+
},
|
|
19213
|
+
{
|
|
19214
|
+
name: "requestId",
|
|
19215
|
+
type: "string",
|
|
19216
|
+
required: false,
|
|
19217
|
+
description: "Caller-chosen key that makes this create idempotent: repeating it answers the flag the first call created instead of refusing the key as taken."
|
|
19218
|
+
}
|
|
19219
|
+
]
|
|
19220
|
+
}
|
|
19221
|
+
},
|
|
19222
|
+
{
|
|
19223
|
+
resource: "devops.projects.promotions",
|
|
19224
|
+
method: "list",
|
|
19225
|
+
summary: "List promotions",
|
|
19226
|
+
description: `List the project's promotions, newest first, across every environment. Use it to see what is queued, what is observing, and what finished recently, without reading each environment separately. A promotion in a terminal state stays in this list, which is how a caller tells "never promoted" apart from "promoted and then rolled back". Neither filter nor orderBy is accepted yet, so page through with pageToken instead of narrowing the query.`,
|
|
19227
|
+
http: "GET",
|
|
19228
|
+
path: "/devops/v1/projects/{project}/promotions",
|
|
19229
|
+
streaming: "no",
|
|
19230
|
+
pagination: false,
|
|
19231
|
+
pathParams: [
|
|
19232
|
+
{
|
|
19233
|
+
name: "project",
|
|
19234
|
+
sdkName: "project",
|
|
19235
|
+
description: "Identifies the project whose data you are reading, from the project list or create answer."
|
|
19236
|
+
}
|
|
19237
|
+
],
|
|
19238
|
+
query: [
|
|
19239
|
+
{
|
|
19240
|
+
name: "pageSize",
|
|
19241
|
+
type: "integer",
|
|
19242
|
+
required: false,
|
|
19243
|
+
description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
|
|
19244
|
+
},
|
|
19245
|
+
{
|
|
19246
|
+
name: "pageToken",
|
|
19247
|
+
type: "string",
|
|
19248
|
+
required: false,
|
|
19249
|
+
description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
|
|
19250
|
+
}
|
|
19251
|
+
]
|
|
19252
|
+
},
|
|
19253
|
+
{
|
|
19254
|
+
resource: "devops.projects.releases",
|
|
19255
|
+
method: "list",
|
|
19256
|
+
summary: "List releases",
|
|
19257
|
+
description: "List the project's releases, newest first. Use it to find the release a promotion should carry, or to see what has been released recently and whether any of it was abandoned. The list carries the render state and the abandoned flag, so a caller can skip a release that is still rendering or that was withdrawn without reading each one. Neither filter nor orderBy is accepted on this collection yet; a request that sends one is refused rather than silently ignored.",
|
|
19258
|
+
http: "GET",
|
|
19259
|
+
path: "/devops/v1/projects/{project}/releases",
|
|
19260
|
+
streaming: "no",
|
|
19261
|
+
pagination: false,
|
|
19262
|
+
pathParams: [
|
|
19263
|
+
{
|
|
19264
|
+
name: "project",
|
|
19265
|
+
sdkName: "project",
|
|
19266
|
+
description: "Identifies the project whose data you are reading, from the project list or create answer."
|
|
19267
|
+
}
|
|
19268
|
+
],
|
|
19269
|
+
query: [
|
|
19270
|
+
{
|
|
19271
|
+
name: "pageSize",
|
|
19272
|
+
type: "integer",
|
|
19273
|
+
required: false,
|
|
19274
|
+
description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
|
|
19275
|
+
},
|
|
19276
|
+
{
|
|
19277
|
+
name: "pageToken",
|
|
19278
|
+
type: "string",
|
|
19279
|
+
required: false,
|
|
19280
|
+
description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
|
|
19281
|
+
}
|
|
19282
|
+
]
|
|
19283
|
+
},
|
|
19284
|
+
{
|
|
19285
|
+
resource: "devops.projects.releases",
|
|
19286
|
+
method: "create",
|
|
19287
|
+
summary: "Create a release",
|
|
19288
|
+
description: "Create a release: an immutable snapshot of what will be deployed, named and fingerprinted once so later promotions can be compared against it. Send commit to release a commit as it stands, or base plus picks to build a patch release on a release that is already in production; the two shapes are exclusive and the patch shape is refused with PATCH_NOT_ELIGIBLE when the picks do not qualify. Rendering starts immediately and the answer reports its state; a promotion refuses a release that is still rendering with RELEASE_NOT_READY rather than deploying half of it. Set validateOnly to see the plan and the refusals without writing a release, and requestId to make a retry of the same call answer the first release instead of creating a second.",
|
|
19289
|
+
http: "POST",
|
|
19290
|
+
path: "/devops/v1/projects/{project}/releases",
|
|
19291
|
+
streaming: "no",
|
|
19292
|
+
pagination: false,
|
|
19293
|
+
pathParams: [
|
|
19294
|
+
{
|
|
19295
|
+
name: "project",
|
|
19296
|
+
sdkName: "project",
|
|
19297
|
+
description: "Identifies the project whose data you are reading, from the project list or create answer."
|
|
19298
|
+
}
|
|
19299
|
+
],
|
|
19300
|
+
query: [],
|
|
19301
|
+
body: {
|
|
19302
|
+
required: true,
|
|
19303
|
+
fields: [
|
|
19304
|
+
{
|
|
19305
|
+
name: "commit",
|
|
19306
|
+
type: "string",
|
|
19307
|
+
required: false,
|
|
19308
|
+
description: "Full 40-character commit to release as it stands; give this or base with picks, never both."
|
|
19309
|
+
},
|
|
19310
|
+
{
|
|
19311
|
+
name: "base",
|
|
19312
|
+
type: "string",
|
|
19313
|
+
required: false,
|
|
19314
|
+
description: "The production release a patch is built on; give it together with picks, and only when production currently runs that release."
|
|
19315
|
+
},
|
|
19316
|
+
{
|
|
19317
|
+
name: "picks",
|
|
19318
|
+
type: "array",
|
|
19319
|
+
itemType: "string",
|
|
19320
|
+
required: false,
|
|
19321
|
+
description: "The commits to cherry-pick onto base, in the request; each must be on the default branch and already verified below production. Request order is not the order they land in."
|
|
19322
|
+
},
|
|
19323
|
+
{
|
|
19324
|
+
name: "validateOnly",
|
|
19325
|
+
type: "boolean",
|
|
19326
|
+
required: false,
|
|
19327
|
+
description: "True to check the request and answer the plan and its refusals without creating a release; use it to find out whether a patch qualifies before committing to it."
|
|
19328
|
+
},
|
|
19329
|
+
{
|
|
19330
|
+
name: "requestId",
|
|
19331
|
+
type: "string",
|
|
19332
|
+
required: false,
|
|
19333
|
+
description: "Caller-chosen key that makes this call idempotent: repeating it answers the release the first call created instead of cutting a second one. Reuse it only for the same content."
|
|
19334
|
+
}
|
|
19335
|
+
]
|
|
19336
|
+
}
|
|
19337
|
+
},
|
|
19338
|
+
{
|
|
19339
|
+
resource: "devops.projects.targets",
|
|
19340
|
+
method: "list",
|
|
19341
|
+
summary: "List targets",
|
|
19342
|
+
description: "List what the project deploys — one target per deployable path in the repository, with its kind, its destination and the targets it depends on. Targets are discovered from the code, not entered by hand, so this list is the service's reading of the repository rather than a configuration you maintain here. A project whose catalog has never been read has it read on the first call, at the default branch's head, so the first answer is already the catalog instead of an empty page. Archived targets, which the repository no longer deploys, are left out.",
|
|
19343
|
+
http: "GET",
|
|
19344
|
+
path: "/devops/v1/projects/{project}/targets",
|
|
19345
|
+
streaming: "no",
|
|
19346
|
+
pagination: false,
|
|
19347
|
+
pathParams: [
|
|
19348
|
+
{
|
|
19349
|
+
name: "project",
|
|
19350
|
+
sdkName: "project",
|
|
19351
|
+
description: "Identifies the project whose data you are reading, from the project list or create answer."
|
|
19352
|
+
}
|
|
19353
|
+
],
|
|
19354
|
+
query: [
|
|
19355
|
+
{
|
|
19356
|
+
name: "pageSize",
|
|
19357
|
+
type: "integer",
|
|
19358
|
+
required: false,
|
|
19359
|
+
description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
|
|
19360
|
+
},
|
|
19361
|
+
{
|
|
19362
|
+
name: "pageToken",
|
|
19363
|
+
type: "string",
|
|
19364
|
+
required: false,
|
|
19365
|
+
description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
|
|
19366
|
+
}
|
|
19367
|
+
]
|
|
19368
|
+
},
|
|
19369
|
+
{
|
|
19370
|
+
resource: "devops.projects.targets",
|
|
19371
|
+
method: "refresh",
|
|
19372
|
+
summary: "Refresh the target catalog",
|
|
19373
|
+
description: "Re-read the repository at a commit and answer the deployment targets it implies, recording what was found. Call it after adding or removing a deployable service so later promotions see the current layout; omit commit to read the default branch's head, or name one to read that commit. The answer includes the dependency graph and any cycles in it, and a cycle is reported rather than refused, matching how the deploy pipeline treats one. This is a read of the repository that also remembers what it read, so it is safe to call again; nothing is deployed by it.",
|
|
19374
|
+
http: "POST",
|
|
19375
|
+
path: "/devops/v1/projects/{project}/targets:refresh",
|
|
19376
|
+
streaming: "no",
|
|
19377
|
+
pagination: false,
|
|
19378
|
+
pathParams: [
|
|
19379
|
+
{
|
|
19380
|
+
name: "project",
|
|
19381
|
+
sdkName: "project",
|
|
19382
|
+
description: "Identifies the project whose data you are reading, from the project list or create answer."
|
|
19383
|
+
}
|
|
19384
|
+
],
|
|
19385
|
+
query: [],
|
|
19386
|
+
body: {
|
|
19387
|
+
required: false,
|
|
19388
|
+
fields: [
|
|
19389
|
+
{
|
|
19390
|
+
name: "commit",
|
|
19391
|
+
type: "string",
|
|
19392
|
+
required: false,
|
|
19393
|
+
description: "Full 40-character commit sha to read instead of the default branch's head; use it to see what a past commit implied rather than what the branch says now."
|
|
19394
|
+
}
|
|
19395
|
+
]
|
|
19396
|
+
}
|
|
19397
|
+
},
|
|
18685
19398
|
{
|
|
18686
19399
|
resource: "devops.projects.testCases",
|
|
18687
19400
|
method: "list",
|
|
@@ -19088,6 +19801,318 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
19088
19801
|
}
|
|
19089
19802
|
]
|
|
19090
19803
|
},
|
|
19804
|
+
{
|
|
19805
|
+
resource: "devops.promotions",
|
|
19806
|
+
method: "create",
|
|
19807
|
+
summary: "Create a promotion",
|
|
19808
|
+
description: "Promote a release into one environment: this is the operation that actually schedules a deployment. Name the release and the environment; path is regular for an ordinary promotion, patch to carry a patch release, targeted to deploy only the targets you list, and rollback to return the environment to an earlier release. The service reads the environment's promotion order and refuses when an upstream environment has not verified this release yet, unless a bypass carries the authorization for that gate. An environment takes one promotion at a time, so a create while another is running is queued behind it rather than refused. Set validateOnly to read the plan and its refusals — layers, skipped targets, pending migrations, missing configuration keys — without scheduling anything, which is the safe way to find out what a promotion will do.",
|
|
19809
|
+
http: "POST",
|
|
19810
|
+
path: "/devops/v1/promotions",
|
|
19811
|
+
streaming: "no",
|
|
19812
|
+
pagination: false,
|
|
19813
|
+
pathParams: [],
|
|
19814
|
+
query: [],
|
|
19815
|
+
body: {
|
|
19816
|
+
required: true,
|
|
19817
|
+
fields: [
|
|
19818
|
+
{
|
|
19819
|
+
name: "release",
|
|
19820
|
+
type: "string",
|
|
19821
|
+
required: true,
|
|
19822
|
+
description: "The release to promote, from a release list or create answer; promoting an abandoned release is refused."
|
|
19823
|
+
},
|
|
19824
|
+
{
|
|
19825
|
+
name: "environment",
|
|
19826
|
+
type: "string",
|
|
19827
|
+
required: true,
|
|
19828
|
+
description: "The environment to deploy into, from the project's environment list; the upstream environment must have verified the release unless a bypass covers that gate."
|
|
19829
|
+
},
|
|
19830
|
+
{
|
|
19831
|
+
name: "path",
|
|
19832
|
+
type: "string",
|
|
19833
|
+
enum: [
|
|
19834
|
+
"regular",
|
|
19835
|
+
"patch",
|
|
19836
|
+
"targeted",
|
|
19837
|
+
"rollback"
|
|
19838
|
+
],
|
|
19839
|
+
required: false,
|
|
19840
|
+
description: "How the release should travel; omit it for an ordinary promotion. A path other than regular is not creatable yet and is refused with NOT_IMPLEMENTED."
|
|
19841
|
+
},
|
|
19842
|
+
{
|
|
19843
|
+
name: "targets",
|
|
19844
|
+
type: "array",
|
|
19845
|
+
itemType: "string",
|
|
19846
|
+
required: false,
|
|
19847
|
+
description: "Deploy only these targets; omit it to let the plan choose from what changed. Naming a target the plan would skip does not force it — read skipped in the plan."
|
|
19848
|
+
},
|
|
19849
|
+
{
|
|
19850
|
+
name: "bypass",
|
|
19851
|
+
type: "array",
|
|
19852
|
+
itemType: "object",
|
|
19853
|
+
required: false,
|
|
19854
|
+
description: "Gates to skip, each naming the approval that authorizes it; a bypass is refused unless the project allows skipping upstream and the approval covers this release, environment and gate."
|
|
19855
|
+
},
|
|
19856
|
+
{
|
|
19857
|
+
name: "validateOnly",
|
|
19858
|
+
type: "boolean",
|
|
19859
|
+
required: false,
|
|
19860
|
+
description: "True to answer the plan without scheduling anything; use it to find out whether a promotion would be refused before committing to it. Nothing is deployed."
|
|
19861
|
+
},
|
|
19862
|
+
{
|
|
19863
|
+
name: "requestId",
|
|
19864
|
+
type: "string",
|
|
19865
|
+
required: false,
|
|
19866
|
+
description: "Caller-chosen key that makes this create idempotent: repeating it answers the promotion the first call made instead of scheduling a second one."
|
|
19867
|
+
}
|
|
19868
|
+
]
|
|
19869
|
+
}
|
|
19870
|
+
},
|
|
19871
|
+
{
|
|
19872
|
+
resource: "devops.promotions",
|
|
19873
|
+
method: "retrieve",
|
|
19874
|
+
summary: "Retrieve a promotion",
|
|
19875
|
+
description: "Read one promotion: its state, its approval, its plan, and the failure that stopped it when there is one. Poll this after creating a promotion to follow it to a terminal state, or read it to find out why a deployment stopped — failure.cause tells plan refusal apart from a failed deploy, and executor names the runs involved. Pass expand=rollouts to receive the per-target rollouts in the same answer instead of listing them separately. state observing means the environment is deployed and the observation window is running, so the promotion is not finished and conclude is still to come.",
|
|
19876
|
+
http: "GET",
|
|
19877
|
+
path: "/devops/v1/promotions/{id}",
|
|
19878
|
+
streaming: "no",
|
|
19879
|
+
pagination: false,
|
|
19880
|
+
pathParams: [
|
|
19881
|
+
{
|
|
19882
|
+
name: "id",
|
|
19883
|
+
sdkName: "id",
|
|
19884
|
+
description: "The promotion identifier returned by a promotion list or create answer."
|
|
19885
|
+
}
|
|
19886
|
+
],
|
|
19887
|
+
query: [
|
|
19888
|
+
{
|
|
19889
|
+
name: "expand",
|
|
19890
|
+
type: "string",
|
|
19891
|
+
enum: [
|
|
19892
|
+
"rollouts"
|
|
19893
|
+
],
|
|
19894
|
+
required: false,
|
|
19895
|
+
description: "Extra sections to inline in the answer; today only rollouts, which adds the per-target rollouts this promotion owns. Omit it for the promotion alone."
|
|
19896
|
+
}
|
|
19897
|
+
]
|
|
19898
|
+
},
|
|
19899
|
+
{
|
|
19900
|
+
resource: "devops.promotions",
|
|
19901
|
+
method: "approve",
|
|
19902
|
+
summary: "Approve or reject a promotion",
|
|
19903
|
+
description: "Answer the approval an environment asked for: send approved true to let the promotion proceed, false to reject it and end it in approval_rejected. This is the environment-level gate an environment with requireApproval raises, not the per-rollout approval. Comment records the reasoning next to the decision, which is what a later reader sees instead of the bare verdict. The call is refused with PROMOTION_NOT_AWAITING_APPROVAL when the promotion is not waiting for one, so a stale approval cannot restart something that already finished. Approving is attributed to the credential that sends it.",
|
|
19904
|
+
http: "POST",
|
|
19905
|
+
path: "/devops/v1/promotions/{id}:approve",
|
|
19906
|
+
streaming: "no",
|
|
19907
|
+
pagination: false,
|
|
19908
|
+
pathParams: [
|
|
19909
|
+
{
|
|
19910
|
+
name: "id",
|
|
19911
|
+
sdkName: "id",
|
|
19912
|
+
description: "The promotion identifier returned by a promotion list or create answer."
|
|
19913
|
+
}
|
|
19914
|
+
],
|
|
19915
|
+
query: [],
|
|
19916
|
+
body: {
|
|
19917
|
+
required: true,
|
|
19918
|
+
fields: [
|
|
19919
|
+
{
|
|
19920
|
+
name: "approved",
|
|
19921
|
+
type: "boolean",
|
|
19922
|
+
required: true,
|
|
19923
|
+
description: "True to approve, which lets the promotion deploy; false rejects it and ends the promotion as approval_rejected."
|
|
19924
|
+
},
|
|
19925
|
+
{
|
|
19926
|
+
name: "comment",
|
|
19927
|
+
type: "string",
|
|
19928
|
+
required: false,
|
|
19929
|
+
description: "What the approver wants recorded with the decision, stored verbatim; omit it when there is nothing to add."
|
|
19930
|
+
}
|
|
19931
|
+
]
|
|
19932
|
+
}
|
|
19933
|
+
},
|
|
19934
|
+
{
|
|
19935
|
+
resource: "devops.promotions",
|
|
19936
|
+
method: "cancel",
|
|
19937
|
+
summary: "Cancel a promotion",
|
|
19938
|
+
description: "Stop a promotion that has not finished, moving it through cancelling to cancelled and stopping the deploys it had scheduled. Use it to halt a deployment that is failing or that should no longer continue; reason is recorded as the attribution of the stop. Cancelling does not undo what already deployed: an environment whose targets were written keeps those targets, and returning them to an earlier release is a separate rollback promotion. A promotion that already reached a terminal state is refused with PROMOTION_ALREADY_FINISHED rather than silently ignored.",
|
|
19939
|
+
http: "POST",
|
|
19940
|
+
path: "/devops/v1/promotions/{id}:cancel",
|
|
19941
|
+
streaming: "no",
|
|
19942
|
+
pagination: false,
|
|
19943
|
+
pathParams: [
|
|
19944
|
+
{
|
|
19945
|
+
name: "id",
|
|
19946
|
+
sdkName: "id",
|
|
19947
|
+
description: "The promotion identifier returned by a promotion list or create answer."
|
|
19948
|
+
}
|
|
19949
|
+
],
|
|
19950
|
+
query: [],
|
|
19951
|
+
body: {
|
|
19952
|
+
required: true,
|
|
19953
|
+
fields: [
|
|
19954
|
+
{
|
|
19955
|
+
name: "reason",
|
|
19956
|
+
type: "string",
|
|
19957
|
+
required: true,
|
|
19958
|
+
description: "Why the promotion is being cancelled, stored on it as the attribution of the act."
|
|
19959
|
+
}
|
|
19960
|
+
]
|
|
19961
|
+
}
|
|
19962
|
+
},
|
|
19963
|
+
{
|
|
19964
|
+
resource: "devops.promotions",
|
|
19965
|
+
method: "conclude",
|
|
19966
|
+
summary: "Conclude an observation",
|
|
19967
|
+
description: `Record the verdict on a promotion that is observing: send keep to accept the deployment as the environment's new state, or rollback to return the environment to the release it held before. This is the decision the observation window exists for, so a promotion in observing state stays open until it is concluded; reason is stored as the attribution. Concluding with rollback schedules the return, it does not merely label the promotion. A promotion that is not observing is refused with PROMOTION_NOT_OBSERVING, which is how a caller tells "already concluded" apart from a call that had no effect.`,
|
|
19968
|
+
http: "POST",
|
|
19969
|
+
path: "/devops/v1/promotions/{id}:conclude",
|
|
19970
|
+
streaming: "no",
|
|
19971
|
+
pagination: false,
|
|
19972
|
+
pathParams: [
|
|
19973
|
+
{
|
|
19974
|
+
name: "id",
|
|
19975
|
+
sdkName: "id",
|
|
19976
|
+
description: "The promotion identifier returned by a promotion list or create answer."
|
|
19977
|
+
}
|
|
19978
|
+
],
|
|
19979
|
+
query: [],
|
|
19980
|
+
body: {
|
|
19981
|
+
required: true,
|
|
19982
|
+
fields: [
|
|
19983
|
+
{
|
|
19984
|
+
name: "action",
|
|
19985
|
+
type: "string",
|
|
19986
|
+
enum: [
|
|
19987
|
+
"keep",
|
|
19988
|
+
"rollback"
|
|
19989
|
+
],
|
|
19990
|
+
required: true,
|
|
19991
|
+
description: "Which way the window is decided; a rollback schedules the return of the environment rather than only labelling the promotion."
|
|
19992
|
+
},
|
|
19993
|
+
{
|
|
19994
|
+
name: "reason",
|
|
19995
|
+
type: "string",
|
|
19996
|
+
required: true,
|
|
19997
|
+
description: "Why the window was decided that way, recorded on the promotion's observation as the attribution of the verdict."
|
|
19998
|
+
}
|
|
19999
|
+
]
|
|
20000
|
+
}
|
|
20001
|
+
},
|
|
20002
|
+
{
|
|
20003
|
+
resource: "devops.promotions",
|
|
20004
|
+
method: "retry",
|
|
20005
|
+
summary: "Retry a promotion",
|
|
20006
|
+
description: "Continue a promotion that stopped part-way, such as one in halted where some targets succeeded and others failed. The retry re-runs the targets that did not succeed and leaves the ones that did alone, so a partially deployed environment is completed rather than redeployed from the start. A promotion that is still running is refused, and so is one that already reached a terminal state; read the promotion first and retry only a halted or errored one. The retry is attributed to the credential that sends it and is recorded on the promotion.",
|
|
20007
|
+
http: "POST",
|
|
20008
|
+
path: "/devops/v1/promotions/{id}:retry",
|
|
20009
|
+
streaming: "no",
|
|
20010
|
+
pagination: false,
|
|
20011
|
+
pathParams: [
|
|
20012
|
+
{
|
|
20013
|
+
name: "id",
|
|
20014
|
+
sdkName: "id",
|
|
20015
|
+
description: "The promotion identifier returned by a promotion list or create answer."
|
|
20016
|
+
}
|
|
20017
|
+
],
|
|
20018
|
+
query: []
|
|
20019
|
+
},
|
|
20020
|
+
{
|
|
20021
|
+
resource: "devops.promotions.rollouts",
|
|
20022
|
+
method: "list",
|
|
20023
|
+
summary: "List a promotion's rollouts",
|
|
20024
|
+
description: "List the per-target rollouts of one promotion: which target each is deploying, which layer it waits on, and where in its phases it has got to. Call it when a promotion is halted or failed to find the target that stopped, since the promotion's own state summarises what the rollouts show one by one. A promotion with nothing to deploy answers an empty page rather than a refusal. Neither filter nor orderBy is accepted here, and the rollouts come in the order the plan laid them out.",
|
|
20025
|
+
http: "GET",
|
|
20026
|
+
path: "/devops/v1/promotions/{promotion}/rollouts",
|
|
20027
|
+
streaming: "no",
|
|
20028
|
+
pagination: false,
|
|
20029
|
+
pathParams: [
|
|
20030
|
+
{
|
|
20031
|
+
name: "promotion",
|
|
20032
|
+
sdkName: "promotion",
|
|
20033
|
+
description: "The promotion whose rollouts you are reading, from a promotion list or create answer."
|
|
20034
|
+
}
|
|
20035
|
+
],
|
|
20036
|
+
query: [
|
|
20037
|
+
{
|
|
20038
|
+
name: "pageSize",
|
|
20039
|
+
type: "integer",
|
|
20040
|
+
required: false,
|
|
20041
|
+
description: "How many items this page returns, 1 to 100; omitted uses 50. A larger value is capped at 100 rather than refused, and 0 falls back to the default, so a paging loop never fails on a size alone."
|
|
20042
|
+
},
|
|
20043
|
+
{
|
|
20044
|
+
name: "pageToken",
|
|
20045
|
+
type: "string",
|
|
20046
|
+
required: false,
|
|
20047
|
+
description: "The cursor from the previous page's nextPageToken. Treat it as opaque and never build one yourself; omit it for the first page."
|
|
20048
|
+
}
|
|
20049
|
+
]
|
|
20050
|
+
},
|
|
20051
|
+
{
|
|
20052
|
+
resource: "devops.releases",
|
|
20053
|
+
method: "retrieve",
|
|
20054
|
+
summary: "Retrieve a release",
|
|
20055
|
+
description: "Read one release in full: the commit it carries, the targets and source digests it was rendered from, which environments have verified it, and where it currently runs. Call it before promoting to confirm the release is not abandoned and that its render succeeded, and after deploying to learn which environments already hold it so the same release is not promoted twice. A release from another organization answers RELEASE_NOT_FOUND, which is also the answer for one that never existed.",
|
|
20056
|
+
http: "GET",
|
|
20057
|
+
path: "/devops/v1/releases/{id}",
|
|
20058
|
+
streaming: "no",
|
|
20059
|
+
pagination: false,
|
|
20060
|
+
pathParams: [
|
|
20061
|
+
{
|
|
20062
|
+
name: "id",
|
|
20063
|
+
sdkName: "id",
|
|
20064
|
+
description: "The release identifier returned by a release list or create answer; a release is addressed by this id, never by its display name."
|
|
20065
|
+
}
|
|
20066
|
+
],
|
|
20067
|
+
query: []
|
|
20068
|
+
},
|
|
20069
|
+
{
|
|
20070
|
+
resource: "devops.releases",
|
|
20071
|
+
method: "abandon",
|
|
20072
|
+
summary: "Abandon a release",
|
|
20073
|
+
description: "Withdraw a release so it can no longer be promoted: a later promotion of it is refused with RELEASE_ABANDONED. Use it when a release was created by mistake or has been superseded, and record why in reason — the reason is stored on the release as the attribution of the act. A release with a promotion still in flight cannot be abandoned, because the queue is mid-flight on it; cancel that promotion first, which is the door for stopping a deployment. Abandoning is one-way: a withdrawn release is never un-abandoned, and a new release is created instead.",
|
|
20074
|
+
http: "POST",
|
|
20075
|
+
path: "/devops/v1/releases/{id}:abandon",
|
|
20076
|
+
streaming: "no",
|
|
20077
|
+
pagination: false,
|
|
20078
|
+
pathParams: [
|
|
20079
|
+
{
|
|
20080
|
+
name: "id",
|
|
20081
|
+
sdkName: "id",
|
|
20082
|
+
description: "The release identifier returned by a release list or create answer; a release is addressed by this id, never by its display name."
|
|
20083
|
+
}
|
|
20084
|
+
],
|
|
20085
|
+
query: [],
|
|
20086
|
+
body: {
|
|
20087
|
+
required: true,
|
|
20088
|
+
fields: [
|
|
20089
|
+
{
|
|
20090
|
+
name: "reason",
|
|
20091
|
+
type: "string",
|
|
20092
|
+
required: true,
|
|
20093
|
+
description: "Why this release no longer should be promoted, recorded verbatim on the release for whoever reads it later."
|
|
20094
|
+
}
|
|
20095
|
+
]
|
|
20096
|
+
}
|
|
20097
|
+
},
|
|
20098
|
+
{
|
|
20099
|
+
resource: "devops.rollouts",
|
|
20100
|
+
method: "retrieve",
|
|
20101
|
+
summary: "Retrieve a rollout",
|
|
20102
|
+
description: "Read one rollout in full: its phases and the jobs inside them, each job's most recent attempt, the checkpoint it was deploying from, and why it failed when it did. This is the level that names the failing step — a promotion tells you that a target failed, a rollout tells you which job run did and what it reported. Use logFileId or a job run's eventLogPath to reach the logs that step produced. A rollout from another organization answers ROLLOUT_NOT_FOUND, the same answer as one that never existed.",
|
|
20103
|
+
http: "GET",
|
|
20104
|
+
path: "/devops/v1/rollouts/{id}",
|
|
20105
|
+
streaming: "no",
|
|
20106
|
+
pagination: false,
|
|
20107
|
+
pathParams: [
|
|
20108
|
+
{
|
|
20109
|
+
name: "id",
|
|
20110
|
+
sdkName: "id",
|
|
20111
|
+
description: "The rollout identifier from a promotion's rollout list or a promotion read with expand=rollouts."
|
|
20112
|
+
}
|
|
20113
|
+
],
|
|
20114
|
+
query: []
|
|
20115
|
+
},
|
|
19091
20116
|
{
|
|
19092
20117
|
resource: "devops.testCases",
|
|
19093
20118
|
method: "retrieve",
|
|
@@ -20678,6 +21703,41 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
20678
21703
|
]
|
|
20679
21704
|
}
|
|
20680
21705
|
},
|
|
21706
|
+
{
|
|
21707
|
+
resource: "media.libraries",
|
|
21708
|
+
method: "retrieveDefault",
|
|
21709
|
+
summary: "Get default library",
|
|
21710
|
+
description: "Return this organization’s default library. Calling ensures the organization’s default library exists (ADR-093): the first call creates it and later calls return the same library, so this is the method to call before writing when no library id is known. Generated and edited media land here when no library is named. The path segment {lib} accepts the literal default, which resolves to this library before the credential check — so an agent that has never listed libraries can still write to the right place. Returns the same Library object as libraries.retrieve; a credential bound to one library reaches this only when that binding covers the default library.",
|
|
21711
|
+
http: "GET",
|
|
21712
|
+
path: "/media/v1/libraries/default",
|
|
21713
|
+
streaming: "no",
|
|
21714
|
+
pagination: false,
|
|
21715
|
+
pathParams: [],
|
|
21716
|
+
query: []
|
|
21717
|
+
},
|
|
21718
|
+
{
|
|
21719
|
+
resource: "media.libraries",
|
|
21720
|
+
method: "setDefault",
|
|
21721
|
+
summary: "Set default library",
|
|
21722
|
+
description: "Point this organization’s default library at an existing library. Calling ensures the organization’s default library exists (ADR-093): the path is resolved before the credential check, so a first call creates the default library when there is none and then repoints it. The path segment {lib} accepts the literal default, which resolves to this library before the credential check. Supply library_id from library creation or listing; the library must be active and belong to the organization. This changes where library-less generation and uploads land across the whole organization, so it affects other callers as well as this one. It does not move or copy any asset — assets already in the previous default library stay there. Returns the library now set as the default. Deleting the default library is refused with LIBRARY_IS_DEFAULT until another library is made the default.",
|
|
21723
|
+
http: "PUT",
|
|
21724
|
+
path: "/media/v1/libraries/default",
|
|
21725
|
+
streaming: "no",
|
|
21726
|
+
pagination: false,
|
|
21727
|
+
pathParams: [],
|
|
21728
|
+
query: [],
|
|
21729
|
+
body: {
|
|
21730
|
+
required: true,
|
|
21731
|
+
fields: [
|
|
21732
|
+
{
|
|
21733
|
+
name: "library_id",
|
|
21734
|
+
type: "string",
|
|
21735
|
+
required: true,
|
|
21736
|
+
description: "Identifier of a library belonging to the caller."
|
|
21737
|
+
}
|
|
21738
|
+
]
|
|
21739
|
+
}
|
|
21740
|
+
},
|
|
20681
21741
|
{
|
|
20682
21742
|
resource: "media.libraries",
|
|
20683
21743
|
method: "delete",
|
|
@@ -20802,6 +21862,25 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
20802
21862
|
required: false,
|
|
20803
21863
|
description: "image, video (including audio), raw; auto is accepted by Upload actions only, and listing with auto returns 400."
|
|
20804
21864
|
},
|
|
21865
|
+
{
|
|
21866
|
+
name: "material_type",
|
|
21867
|
+
type: "string",
|
|
21868
|
+
enum: [
|
|
21869
|
+
"image",
|
|
21870
|
+
"video",
|
|
21871
|
+
"audio",
|
|
21872
|
+
"voice",
|
|
21873
|
+
"sticker",
|
|
21874
|
+
"font",
|
|
21875
|
+
"text_style",
|
|
21876
|
+
"text_template",
|
|
21877
|
+
"animation_preset",
|
|
21878
|
+
"lut",
|
|
21879
|
+
"transition_map"
|
|
21880
|
+
],
|
|
21881
|
+
required: false,
|
|
21882
|
+
description: "Filter assets to one kind of material, independent of the stored resource_type. Omit to list every material type. Assets stored before this field existed match no material_type filter."
|
|
21883
|
+
},
|
|
20805
21884
|
{
|
|
20806
21885
|
name: "cursor",
|
|
20807
21886
|
type: "string",
|
|
@@ -21162,6 +22241,68 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21162
22241
|
]
|
|
21163
22242
|
}
|
|
21164
22243
|
},
|
|
22244
|
+
{
|
|
22245
|
+
resource: "media.assets",
|
|
22246
|
+
method: "edit",
|
|
22247
|
+
summary: "Edit asset",
|
|
22248
|
+
description: "Edit an existing asset and store the result as a new asset. Use library_id from creation or listing and asset_id from asset creation or listing; library_id also accepts the literal default, which resolves to the organization’s default library before the credential check. The source asset is never overwritten: the new asset hangs under it in the edit chain, records it in derived_from, and reads back with assets.lineage, so earlier steps stay reachable. The body is operation plus the optional model, asset_folder, understanding and idempotency_key; operation.type selects the edit and carries that operation’s own fields. This release performs variations, inpaint, erase, replace_object, recolor, remove_background and replace_background on images; every other type in the operation vocabulary — the video and audio edits — is refused with OPERATION_NOT_SUPPORTED. inpaint takes mask, a PNG File identifier beginning with file- whose transparent area marks the region to replace, plus the prompt describing what belongs there. Aspects beyond the source asset’s material type return REFERENCE_TYPE_MISMATCH. Editing is charged through Router and the job records the charge in usage. The response is 202 with a queued Job whose type is image, whose operation is the edit applied, and whose source_asset_id is the asset edited; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until it is completed or failed, then read the produced asset. Example: POST /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/edits with {\"operation\":{\"type\":\"variations\",\"strength\":\"subtle\"}}.",
|
|
22249
|
+
http: "POST",
|
|
22250
|
+
path: "/media/v1/libraries/{library_id}/assets/{asset_id}/edits",
|
|
22251
|
+
streaming: "no",
|
|
22252
|
+
pagination: false,
|
|
22253
|
+
pathParams: [
|
|
22254
|
+
{
|
|
22255
|
+
name: "library_id",
|
|
22256
|
+
sdkName: "library_id",
|
|
22257
|
+
description: "Library ID returned by creation."
|
|
22258
|
+
},
|
|
22259
|
+
{
|
|
22260
|
+
name: "asset_id",
|
|
22261
|
+
sdkName: "asset_id",
|
|
22262
|
+
description: "32-character asset ID."
|
|
22263
|
+
}
|
|
22264
|
+
],
|
|
22265
|
+
query: [],
|
|
22266
|
+
body: {
|
|
22267
|
+
required: true,
|
|
22268
|
+
fields: [
|
|
22269
|
+
{
|
|
22270
|
+
name: "operation",
|
|
22271
|
+
type: "object",
|
|
22272
|
+
required: true,
|
|
22273
|
+
description: "One edit to apply to the source asset. type selects the operation and the discriminating branch carries that operation’s fields. This release performs variations, inpaint, erase, replace_object, recolor, remove_background and replace_background on images; every other type here describes the operation vocabulary and is refused with OPERATION_NOT_SUPPORTED."
|
|
22274
|
+
},
|
|
22275
|
+
{
|
|
22276
|
+
name: "model",
|
|
22277
|
+
type: "string",
|
|
22278
|
+
required: false,
|
|
22279
|
+
description: "Router model that performs the edit; omit it to use the library default image model."
|
|
22280
|
+
},
|
|
22281
|
+
{
|
|
22282
|
+
name: "asset_folder",
|
|
22283
|
+
type: "string",
|
|
22284
|
+
required: false,
|
|
22285
|
+
description: "Folder the produced asset is filed under; defaults to the source asset’s folder. New path segments containing U+FFFD or consisting only of question marks are rejected with INVALID_PARAMS; send UTF-8 names. Existing affected folders remain readable and assets can be moved out."
|
|
22286
|
+
},
|
|
22287
|
+
{
|
|
22288
|
+
name: "understanding",
|
|
22289
|
+
type: "string",
|
|
22290
|
+
enum: [
|
|
22291
|
+
"auto",
|
|
22292
|
+
"skip"
|
|
22293
|
+
],
|
|
22294
|
+
required: false,
|
|
22295
|
+
description: "Understanding behavior for the produced asset; defaults to auto."
|
|
22296
|
+
},
|
|
22297
|
+
{
|
|
22298
|
+
name: "idempotency_key",
|
|
22299
|
+
type: "string",
|
|
22300
|
+
required: false,
|
|
22301
|
+
description: "Stable key so a retried request reuses the same job instead of editing and charging again; reusing it with different content is rejected."
|
|
22302
|
+
}
|
|
22303
|
+
]
|
|
22304
|
+
}
|
|
22305
|
+
},
|
|
21165
22306
|
{
|
|
21166
22307
|
resource: "media.libraries.assets.frames",
|
|
21167
22308
|
method: "create",
|
|
@@ -21208,6 +22349,29 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21208
22349
|
]
|
|
21209
22350
|
}
|
|
21210
22351
|
},
|
|
22352
|
+
{
|
|
22353
|
+
resource: "media.assets",
|
|
22354
|
+
method: "lineage",
|
|
22355
|
+
summary: "Get asset lineage",
|
|
22356
|
+
description: "Read the whole edit tree containing one asset, so a caller sees what it was edited from and what was edited from it. Use library_id from creation or listing and asset_id from asset creation or listing; library_id also accepts the literal default, which resolves to the organization’s default library before the credential check. The response names the root the tree descends from, the asset asked about, and every step between them, each with the operation, prompt and creation time that produced it. Deleted assets stay in the tree, marked deleted, so the chain stays connected after cleanup. This is a read: it starts no processing and changes no asset. Example: GET /media/v1/libraries/lib_example/assets/9dfa312ef9bc4b00816339b598b1152c/lineage.",
|
|
22357
|
+
http: "GET",
|
|
22358
|
+
path: "/media/v1/libraries/{library_id}/assets/{asset_id}/lineage",
|
|
22359
|
+
streaming: "no",
|
|
22360
|
+
pagination: false,
|
|
22361
|
+
pathParams: [
|
|
22362
|
+
{
|
|
22363
|
+
name: "library_id",
|
|
22364
|
+
sdkName: "library_id",
|
|
22365
|
+
description: "Library ID returned by creation."
|
|
22366
|
+
},
|
|
22367
|
+
{
|
|
22368
|
+
name: "asset_id",
|
|
22369
|
+
sdkName: "asset_id",
|
|
22370
|
+
description: "32-character asset ID."
|
|
22371
|
+
}
|
|
22372
|
+
],
|
|
22373
|
+
query: []
|
|
22374
|
+
},
|
|
21211
22375
|
{
|
|
21212
22376
|
resource: "media.libraries.assets.reprocess",
|
|
21213
22377
|
method: "create",
|
|
@@ -21345,6 +22509,73 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21345
22509
|
]
|
|
21346
22510
|
}
|
|
21347
22511
|
},
|
|
22512
|
+
{
|
|
22513
|
+
resource: "media.speech",
|
|
22514
|
+
method: "create",
|
|
22515
|
+
summary: "Create speech",
|
|
22516
|
+
description: "Synthesise speech from text and store the recording straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still synthesise. input is the text to speak and voice is required; speed is passed to the provider unchanged, and instructions and language are refused with OPERATION_NOT_SUPPORTED in this release. A voice that names a voice material of this library is refused the same way — voice cloning opens with voices.create. The provider caps one request at a short stretch of text, so a long input is cut into segments at paragraph and sentence boundaries and synthesised in order, then joined into the single recording the library receives: nothing is spoken twice and nothing is dropped. Because the segments are joined byte for byte, a multi-segment input accepts only response_format mp3 (the default) or pcm; opus is available for a single-segment input. A speech job has one result however many segments it took. Synthesis is charged through Router and the job records the charge in usage; a request refused before it starts costs nothing. The response is 202 with a queued Job whose type is speech and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced asset from the library — the recording carries material_type audio, audio_role voice, ai_generated true, and provenance naming this job, the text spoken and the model. Send Idempotency-Key, or idempotency_key in the body, to retry without synthesising and charging twice. Example: POST /media/v1/libraries/default/audio/speech with {\"input\":\"A red kite above a calm sea at sunrise.\",\"voice\":\"alloy\"}.",
|
|
22517
|
+
http: "POST",
|
|
22518
|
+
path: "/media/v1/libraries/{library_id}/audio/speech",
|
|
22519
|
+
streaming: "no",
|
|
22520
|
+
pagination: false,
|
|
22521
|
+
pathParams: [
|
|
22522
|
+
{
|
|
22523
|
+
name: "library_id",
|
|
22524
|
+
sdkName: "library_id",
|
|
22525
|
+
description: "Library ID returned by creation."
|
|
22526
|
+
}
|
|
22527
|
+
],
|
|
22528
|
+
query: [],
|
|
22529
|
+
body: {
|
|
22530
|
+
required: true,
|
|
22531
|
+
fields: [
|
|
22532
|
+
{
|
|
22533
|
+
name: "input",
|
|
22534
|
+
type: "string",
|
|
22535
|
+
required: true,
|
|
22536
|
+
description: "Text to synthesize; long text is synthesized paragraph by paragraph."
|
|
22537
|
+
},
|
|
22538
|
+
{
|
|
22539
|
+
name: "voice",
|
|
22540
|
+
type: "string",
|
|
22541
|
+
required: true,
|
|
22542
|
+
description: "Voice identifier or platform voice name."
|
|
22543
|
+
},
|
|
22544
|
+
{
|
|
22545
|
+
name: "instructions",
|
|
22546
|
+
type: "string",
|
|
22547
|
+
required: false,
|
|
22548
|
+
description: "Emotion and style guidance for the synthesized speech."
|
|
22549
|
+
},
|
|
22550
|
+
{
|
|
22551
|
+
name: "speed",
|
|
22552
|
+
type: "number",
|
|
22553
|
+
required: false,
|
|
22554
|
+
description: "Speaking-rate multiplier; 1 is the model default."
|
|
22555
|
+
},
|
|
22556
|
+
{
|
|
22557
|
+
name: "response_format",
|
|
22558
|
+
type: "string",
|
|
22559
|
+
enum: [
|
|
22560
|
+
"mp3",
|
|
22561
|
+
"wav",
|
|
22562
|
+
"opus",
|
|
22563
|
+
"aac",
|
|
22564
|
+
"flac",
|
|
22565
|
+
"pcm"
|
|
22566
|
+
],
|
|
22567
|
+
required: false,
|
|
22568
|
+
description: "Audio encoding of the synthesized speech."
|
|
22569
|
+
},
|
|
22570
|
+
{
|
|
22571
|
+
name: "language",
|
|
22572
|
+
type: "string",
|
|
22573
|
+
required: false,
|
|
22574
|
+
description: "Language of the text, when the voice supports several."
|
|
22575
|
+
}
|
|
22576
|
+
]
|
|
22577
|
+
}
|
|
22578
|
+
},
|
|
21348
22579
|
{
|
|
21349
22580
|
resource: "media.libraries.batches",
|
|
21350
22581
|
method: "create",
|
|
@@ -21609,6 +22840,126 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21609
22840
|
]
|
|
21610
22841
|
}
|
|
21611
22842
|
},
|
|
22843
|
+
{
|
|
22844
|
+
resource: "media.images",
|
|
22845
|
+
method: "generate",
|
|
22846
|
+
summary: "Generate image",
|
|
22847
|
+
description: "Generate one or more images from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. The request body is the image request itself: prompt is required, and n, size, background, output_format, output, references, seed, model, asset_folder and understanding are optional. Set output to sticker for a cut-out with a transparent background. references attach existing assets with a role — edit_target, style, structure or subject — and a model that cannot honour a role returns REFERENCE_TYPE_MISMATCH. Aspect ratio is not accepted for images; name size instead. Generation is charged through Router and the job records the charge in usage; nothing is charged for a request refused before it starts. The response is 202 with a queued Job whose type is image and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/images/generations with {\"prompt\":\"A red kite above a calm sea at sunrise\",\"n\":1,\"output\":\"sticker\"}.",
|
|
22848
|
+
http: "POST",
|
|
22849
|
+
path: "/media/v1/libraries/{library_id}/images/generations",
|
|
22850
|
+
streaming: "no",
|
|
22851
|
+
pagination: false,
|
|
22852
|
+
pathParams: [
|
|
22853
|
+
{
|
|
22854
|
+
name: "library_id",
|
|
22855
|
+
sdkName: "library_id",
|
|
22856
|
+
description: "Library ID returned by creation."
|
|
22857
|
+
}
|
|
22858
|
+
],
|
|
22859
|
+
query: [],
|
|
22860
|
+
body: {
|
|
22861
|
+
required: true,
|
|
22862
|
+
fields: [
|
|
22863
|
+
{
|
|
22864
|
+
name: "prompt",
|
|
22865
|
+
type: "string",
|
|
22866
|
+
required: true,
|
|
22867
|
+
description: "Text prompt describing the image to generate; Router forwards it to the image model unchanged."
|
|
22868
|
+
},
|
|
22869
|
+
{
|
|
22870
|
+
name: "negative_prompt",
|
|
22871
|
+
type: "string",
|
|
22872
|
+
required: false,
|
|
22873
|
+
description: "What the image must not contain. Models without a negative-prompt control ignore it."
|
|
22874
|
+
},
|
|
22875
|
+
{
|
|
22876
|
+
name: "n",
|
|
22877
|
+
type: "integer",
|
|
22878
|
+
required: false,
|
|
22879
|
+
description: "Images to generate in one job, from 1 to 10; defaults to 1. Each produced image is charged separately."
|
|
22880
|
+
},
|
|
22881
|
+
{
|
|
22882
|
+
name: "size",
|
|
22883
|
+
type: "string",
|
|
22884
|
+
required: false,
|
|
22885
|
+
description: "Requested pixel size written as width x height. Router validates it against the chosen model and rejects an unsupported size with INVALID_PARAMS."
|
|
22886
|
+
},
|
|
22887
|
+
{
|
|
22888
|
+
name: "background",
|
|
22889
|
+
type: "string",
|
|
22890
|
+
enum: [
|
|
22891
|
+
"transparent",
|
|
22892
|
+
"opaque",
|
|
22893
|
+
"auto"
|
|
22894
|
+
],
|
|
22895
|
+
required: false,
|
|
22896
|
+
description: "Background handling; defaults to auto. Whether transparency is honoured depends on the model."
|
|
22897
|
+
},
|
|
22898
|
+
{
|
|
22899
|
+
name: "output_format",
|
|
22900
|
+
type: "string",
|
|
22901
|
+
enum: [
|
|
22902
|
+
"png",
|
|
22903
|
+
"jpeg",
|
|
22904
|
+
"webp"
|
|
22905
|
+
],
|
|
22906
|
+
required: false,
|
|
22907
|
+
description: "Encoding of the stored image; defaults to png. Transparency requires png or webp."
|
|
22908
|
+
},
|
|
22909
|
+
{
|
|
22910
|
+
name: "output",
|
|
22911
|
+
type: "string",
|
|
22912
|
+
enum: [
|
|
22913
|
+
"image",
|
|
22914
|
+
"sticker"
|
|
22915
|
+
],
|
|
22916
|
+
required: false,
|
|
22917
|
+
description: "How the result is stored: image for a normal picture, or sticker for a cut-out committed with material_type sticker; defaults to image."
|
|
22918
|
+
},
|
|
22919
|
+
{
|
|
22920
|
+
name: "references",
|
|
22921
|
+
type: "array",
|
|
22922
|
+
itemType: "object",
|
|
22923
|
+
required: false,
|
|
22924
|
+
description: "Existing assets the model may use, each with the role it plays. Router answers REFERENCE_TYPE_MISMATCH when the chosen model cannot honour a role."
|
|
22925
|
+
},
|
|
22926
|
+
{
|
|
22927
|
+
name: "seed",
|
|
22928
|
+
type: "integer",
|
|
22929
|
+
required: false,
|
|
22930
|
+
description: "Seed for reproducible sampling; omit it to let the model choose one."
|
|
22931
|
+
},
|
|
22932
|
+
{
|
|
22933
|
+
name: "model",
|
|
22934
|
+
type: "string",
|
|
22935
|
+
required: false,
|
|
22936
|
+
description: "Router model with image-generation capability; omit it to use the library default image model."
|
|
22937
|
+
},
|
|
22938
|
+
{
|
|
22939
|
+
name: "asset_folder",
|
|
22940
|
+
type: "string",
|
|
22941
|
+
required: false,
|
|
22942
|
+
description: "Folder the produced asset is filed under; defaults to the library root. New path segments containing U+FFFD or consisting only of question marks are rejected with INVALID_PARAMS; send UTF-8 names. Existing affected folders remain readable and assets can be moved out."
|
|
22943
|
+
},
|
|
22944
|
+
{
|
|
22945
|
+
name: "understanding",
|
|
22946
|
+
type: "string",
|
|
22947
|
+
enum: [
|
|
22948
|
+
"auto",
|
|
22949
|
+
"skip"
|
|
22950
|
+
],
|
|
22951
|
+
required: false,
|
|
22952
|
+
description: "Understanding behavior for the produced asset; defaults to auto."
|
|
22953
|
+
},
|
|
22954
|
+
{
|
|
22955
|
+
name: "idempotency_key",
|
|
22956
|
+
type: "string",
|
|
22957
|
+
required: false,
|
|
22958
|
+
description: "Stable key so a retried request reuses the same job instead of generating and charging again; reusing it with different content is rejected."
|
|
22959
|
+
}
|
|
22960
|
+
]
|
|
22961
|
+
}
|
|
22962
|
+
},
|
|
21612
22963
|
{
|
|
21613
22964
|
resource: "media.libraries.jobs",
|
|
21614
22965
|
method: "list",
|
|
@@ -21631,11 +22982,13 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21631
22982
|
type: "string",
|
|
21632
22983
|
enum: [
|
|
21633
22984
|
"queued",
|
|
22985
|
+
"in_progress",
|
|
21634
22986
|
"running",
|
|
21635
22987
|
"completed",
|
|
21636
22988
|
"completed_with_errors",
|
|
21637
22989
|
"failed",
|
|
21638
|
-
"cancelled"
|
|
22990
|
+
"cancelled",
|
|
22991
|
+
"canceled"
|
|
21639
22992
|
],
|
|
21640
22993
|
required: false,
|
|
21641
22994
|
description: "Filter jobs by their current status."
|
|
@@ -21834,7 +23187,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21834
23187
|
name: "top_k",
|
|
21835
23188
|
type: "integer",
|
|
21836
23189
|
required: false,
|
|
21837
|
-
description: "Maximum search hits, from 1 to 50; defaults to 20."
|
|
23190
|
+
description: "Maximum search hits, from 1 to 50; defaults to 20. top_k takes effect and bounds how many distinct hits come back, counting collapsed duplicates as one hit."
|
|
21838
23191
|
},
|
|
21839
23192
|
{
|
|
21840
23193
|
name: "mode",
|
|
@@ -21845,6 +23198,25 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21845
23198
|
],
|
|
21846
23199
|
required: false,
|
|
21847
23200
|
description: "Ranking mode: hybrid combines semantic and keyword matches; semantic uses vector similarity only. Defaults to hybrid."
|
|
23201
|
+
},
|
|
23202
|
+
{
|
|
23203
|
+
name: "material_type",
|
|
23204
|
+
type: "string",
|
|
23205
|
+
enum: [
|
|
23206
|
+
"image",
|
|
23207
|
+
"video",
|
|
23208
|
+
"audio",
|
|
23209
|
+
"voice",
|
|
23210
|
+
"sticker",
|
|
23211
|
+
"font",
|
|
23212
|
+
"text_style",
|
|
23213
|
+
"text_template",
|
|
23214
|
+
"animation_preset",
|
|
23215
|
+
"lut",
|
|
23216
|
+
"transition_map"
|
|
23217
|
+
],
|
|
23218
|
+
required: false,
|
|
23219
|
+
description: "What this asset is as a reusable material, as opposed to resource_type (its stored file category). Omitted on assets stored before this field existed and on raw assets that are not materials."
|
|
21848
23220
|
}
|
|
21849
23221
|
]
|
|
21850
23222
|
}
|
|
@@ -21957,7 +23329,7 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21957
23329
|
name: "top_k",
|
|
21958
23330
|
type: "integer",
|
|
21959
23331
|
required: false,
|
|
21960
|
-
description: "Maximum search hits, from 1 to 50; defaults to 20."
|
|
23332
|
+
description: "Maximum search hits, from 1 to 50; defaults to 20. top_k takes effect and bounds how many distinct hits come back, counting collapsed duplicates as one hit."
|
|
21961
23333
|
},
|
|
21962
23334
|
{
|
|
21963
23335
|
name: "mode",
|
|
@@ -21968,6 +23340,25 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
21968
23340
|
],
|
|
21969
23341
|
required: false,
|
|
21970
23342
|
description: "Ranking mode: hybrid combines semantic and keyword matches; semantic uses vector similarity only. Defaults to hybrid."
|
|
23343
|
+
},
|
|
23344
|
+
{
|
|
23345
|
+
name: "material_type",
|
|
23346
|
+
type: "string",
|
|
23347
|
+
enum: [
|
|
23348
|
+
"image",
|
|
23349
|
+
"video",
|
|
23350
|
+
"audio",
|
|
23351
|
+
"voice",
|
|
23352
|
+
"sticker",
|
|
23353
|
+
"font",
|
|
23354
|
+
"text_style",
|
|
23355
|
+
"text_template",
|
|
23356
|
+
"animation_preset",
|
|
23357
|
+
"lut",
|
|
23358
|
+
"transition_map"
|
|
23359
|
+
],
|
|
23360
|
+
required: false,
|
|
23361
|
+
description: "What this asset is as a reusable material, as opposed to resource_type (its stored file category). Omitted on assets stored before this field existed and on raw assets that are not materials."
|
|
21971
23362
|
}
|
|
21972
23363
|
]
|
|
21973
23364
|
}
|
|
@@ -22080,6 +23471,152 @@ The default is return=minimal: success returns HTTP 201 with an empty body. Send
|
|
|
22080
23471
|
],
|
|
22081
23472
|
query: []
|
|
22082
23473
|
},
|
|
23474
|
+
{
|
|
23475
|
+
resource: "media.videos",
|
|
23476
|
+
method: "generate",
|
|
23477
|
+
summary: "Generate video",
|
|
23478
|
+
description: "Generate one or more videos from a text prompt and store them straight into the library. Use library_id from creation or listing; the path segment {library_id} also accepts the literal default, which resolves to the organization’s default library before the credential check, so an agent that has never listed a library can still generate. mode says what the video is anchored to: text needs only a prompt, image animates the existing image named by first_frame, and first_last interpolates between first_frame and last_frame. The frames must be image or sticker assets of the same library; Router is sent a fetchable URL for each, recorded in the produced asset’s provenance. mode reference and output gif are refused with OPERATION_NOT_SUPPORTED in this release, and negative_prompt, references and an unknown mode are refused before anything is charged. Every output lands in the library as a video asset as soon as it is ready — there is no candidate state and nothing expires, so outputs.save is not part of this lane. Generation is charged per second through Router and the job records the charge in usage; a refused request costs nothing. The response is 202 with a queued Job whose type is video and whose operation is generate; poll GET /media/v1/libraries/{library_id}/jobs/{job_id} until its status is completed or failed, then read the produced assets from the library. Send Idempotency-Key, or idempotency_key in the body, to retry without generating and charging twice. Example: POST /media/v1/libraries/default/videos/generations with {\"prompt\":\"A red kite above a calm sea at sunrise\",\"mode\":\"text\",\"n\":1}.",
|
|
23479
|
+
http: "POST",
|
|
23480
|
+
path: "/media/v1/libraries/{library_id}/videos/generations",
|
|
23481
|
+
streaming: "no",
|
|
23482
|
+
pagination: false,
|
|
23483
|
+
pathParams: [
|
|
23484
|
+
{
|
|
23485
|
+
name: "library_id",
|
|
23486
|
+
sdkName: "library_id",
|
|
23487
|
+
description: "Library ID returned by creation."
|
|
23488
|
+
}
|
|
23489
|
+
],
|
|
23490
|
+
query: [],
|
|
23491
|
+
body: {
|
|
23492
|
+
required: true,
|
|
23493
|
+
fields: [
|
|
23494
|
+
{
|
|
23495
|
+
name: "prompt",
|
|
23496
|
+
type: "string",
|
|
23497
|
+
required: true,
|
|
23498
|
+
description: "Text prompt describing the video to generate; Router forwards it to the video model unchanged."
|
|
23499
|
+
},
|
|
23500
|
+
{
|
|
23501
|
+
name: "negative_prompt",
|
|
23502
|
+
type: "string",
|
|
23503
|
+
required: false,
|
|
23504
|
+
description: "What the video must not contain. Models without a negative-prompt control ignore it."
|
|
23505
|
+
},
|
|
23506
|
+
{
|
|
23507
|
+
name: "mode",
|
|
23508
|
+
type: "string",
|
|
23509
|
+
enum: [
|
|
23510
|
+
"text",
|
|
23511
|
+
"image",
|
|
23512
|
+
"first_last",
|
|
23513
|
+
"reference"
|
|
23514
|
+
],
|
|
23515
|
+
required: true,
|
|
23516
|
+
description: "What the video is anchored to. text needs only a prompt; image animates first_frame; first_last bookends first_frame and last_frame; reference is refused with OPERATION_NOT_SUPPORTED in this release."
|
|
23517
|
+
},
|
|
23518
|
+
{
|
|
23519
|
+
name: "first_frame",
|
|
23520
|
+
type: "string",
|
|
23521
|
+
required: false,
|
|
23522
|
+
description: "Asset identifier returned by upload or asset listing; distinct from public_id and content hashes."
|
|
23523
|
+
},
|
|
23524
|
+
{
|
|
23525
|
+
name: "last_frame",
|
|
23526
|
+
type: "string",
|
|
23527
|
+
required: false,
|
|
23528
|
+
description: "Asset identifier returned by upload or asset listing; distinct from public_id and content hashes."
|
|
23529
|
+
},
|
|
23530
|
+
{
|
|
23531
|
+
name: "references",
|
|
23532
|
+
type: "array",
|
|
23533
|
+
itemType: "object",
|
|
23534
|
+
required: false,
|
|
23535
|
+
description: "Existing assets the model may use, each with the role it plays. Not supported by the video lane in this release: sending it is refused with OPERATION_NOT_SUPPORTED."
|
|
23536
|
+
},
|
|
23537
|
+
{
|
|
23538
|
+
name: "duration_seconds",
|
|
23539
|
+
type: "integer",
|
|
23540
|
+
required: false,
|
|
23541
|
+
description: "Requested video length in seconds. Router validates it against the chosen model’s supported durations and rejects an unsupported value with INVALID_PARAMS."
|
|
23542
|
+
},
|
|
23543
|
+
{
|
|
23544
|
+
name: "resolution",
|
|
23545
|
+
type: "string",
|
|
23546
|
+
enum: [
|
|
23547
|
+
"480p",
|
|
23548
|
+
"720p",
|
|
23549
|
+
"1080p",
|
|
23550
|
+
"4k"
|
|
23551
|
+
],
|
|
23552
|
+
required: false,
|
|
23553
|
+
description: "Requested output resolution; Router validates it against the chosen model."
|
|
23554
|
+
},
|
|
23555
|
+
{
|
|
23556
|
+
name: "aspect_ratio",
|
|
23557
|
+
type: "string",
|
|
23558
|
+
required: false,
|
|
23559
|
+
description: "Output aspect ratio written as width:height; defaults to 16:9. Router validates it against the chosen model and rejects an unsupported ratio with INVALID_PARAMS."
|
|
23560
|
+
},
|
|
23561
|
+
{
|
|
23562
|
+
name: "generate_audio",
|
|
23563
|
+
type: "boolean",
|
|
23564
|
+
required: false,
|
|
23565
|
+
description: "True to generate an audio track with the video. Whether audio is produced depends on the model."
|
|
23566
|
+
},
|
|
23567
|
+
{
|
|
23568
|
+
name: "output",
|
|
23569
|
+
type: "string",
|
|
23570
|
+
enum: [
|
|
23571
|
+
"mp4",
|
|
23572
|
+
"gif"
|
|
23573
|
+
],
|
|
23574
|
+
required: false,
|
|
23575
|
+
description: "Container of the produced video; defaults to mp4. gif is refused with OPERATION_NOT_SUPPORTED because this release has no GIF encoding for the lane."
|
|
23576
|
+
},
|
|
23577
|
+
{
|
|
23578
|
+
name: "n",
|
|
23579
|
+
type: "integer",
|
|
23580
|
+
required: false,
|
|
23581
|
+
description: "Videos to generate in one job, from 1 to 4; defaults to 1. Each produced video is charged separately."
|
|
23582
|
+
},
|
|
23583
|
+
{
|
|
23584
|
+
name: "seed",
|
|
23585
|
+
type: "integer",
|
|
23586
|
+
required: false,
|
|
23587
|
+
description: "Seed for reproducible sampling; omit it to let the model choose one."
|
|
23588
|
+
},
|
|
23589
|
+
{
|
|
23590
|
+
name: "model",
|
|
23591
|
+
type: "string",
|
|
23592
|
+
required: false,
|
|
23593
|
+
description: "Router model with video-generation capability; omit it to use the library default video model."
|
|
23594
|
+
},
|
|
23595
|
+
{
|
|
23596
|
+
name: "asset_folder",
|
|
23597
|
+
type: "string",
|
|
23598
|
+
required: false,
|
|
23599
|
+
description: "Folder the produced asset is filed under; defaults to the library root. New path segments containing U+FFFD or consisting only of question marks are rejected with INVALID_PARAMS; send UTF-8 names. Existing affected folders remain readable and assets can be moved out."
|
|
23600
|
+
},
|
|
23601
|
+
{
|
|
23602
|
+
name: "understanding",
|
|
23603
|
+
type: "string",
|
|
23604
|
+
enum: [
|
|
23605
|
+
"auto",
|
|
23606
|
+
"skip"
|
|
23607
|
+
],
|
|
23608
|
+
required: false,
|
|
23609
|
+
description: "Understanding behavior for the produced asset; defaults to auto."
|
|
23610
|
+
},
|
|
23611
|
+
{
|
|
23612
|
+
name: "idempotency_key",
|
|
23613
|
+
type: "string",
|
|
23614
|
+
required: false,
|
|
23615
|
+
description: "Stable key so a retried request reuses the same job instead of generating and charging again; reusing it with different content is rejected."
|
|
23616
|
+
}
|
|
23617
|
+
]
|
|
23618
|
+
}
|
|
23619
|
+
},
|
|
22083
23620
|
{
|
|
22084
23621
|
resource: "meta.docs",
|
|
22085
23622
|
method: "search",
|
|
@@ -24652,7 +26189,7 @@ for more details.`
|
|
|
24652
26189
|
resource: "ontology.nodes",
|
|
24653
26190
|
method: "create",
|
|
24654
26191
|
summary: "Create node",
|
|
24655
|
-
description: "Record one entity in the graph, for a system mirroring a record it owns. type must already be registered and ref, when given, must match that type's ref_prefix. Send an Idempotency-Key header; repeating the same key with the same content returns the first result instead of creating a second node. This writes structure only
|
|
26192
|
+
description: "Record one entity in the graph, for a system mirroring a record it owns. type must already be registered and ref, when given, must match that type's ref_prefix. Send an Idempotency-Key header; repeating the same key with the same content returns the first result instead of creating a second node. This writes structure only; it does not give any agent a memory.",
|
|
24656
26193
|
http: "POST",
|
|
24657
26194
|
path: "/ontology/v1/nodes",
|
|
24658
26195
|
streaming: "no",
|
|
@@ -24926,7 +26463,7 @@ for more details.`
|
|
|
24926
26463
|
resource: "ontology.relations",
|
|
24927
26464
|
method: "create",
|
|
24928
26465
|
summary: "Create relation",
|
|
24929
|
-
description: "Record one fact between two existing nodes, for a system mirroring a relationship it owns. type must be registered and must admit these endpoints; fact states the relationship in one sentence. Send an Idempotency-Key header; repeating the same key returns the first result instead of writing a second relation. This writes structure only
|
|
26466
|
+
description: "Record one fact between two existing nodes, for a system mirroring a relationship it owns. type must be registered and must admit these endpoints; fact states the relationship in one sentence. Send an Idempotency-Key header; repeating the same key returns the first result instead of writing a second relation. This writes structure only; it does not give any agent a memory.",
|
|
24930
26467
|
http: "POST",
|
|
24931
26468
|
path: "/ontology/v1/relations",
|
|
24932
26469
|
streaming: "no",
|
|
@@ -25038,7 +26575,7 @@ for more details.`
|
|
|
25038
26575
|
resource: "ontology.search",
|
|
25039
26576
|
method: "create",
|
|
25040
26577
|
summary: "Search nodes",
|
|
25041
|
-
description: "Resolve text to the nodes it most likely names, when a mirror holds a name and needs the node id it corresponds to. Results are ranked candidates, not an answer, each reporting whether the match came from the node's name, an alias, its description or a relation's fact. Narrow with types, and cap the result count with limit (1–50, default 20). This reads structure; it is not an agent recall
|
|
26578
|
+
description: "Resolve text to the nodes it most likely names, when a mirror holds a name and needs the node id it corresponds to. Results are ranked candidates, not an answer, each reporting whether the match came from the node's name, an alias, its description or a relation's fact. Narrow with types, and cap the result count with limit (1–50, default 20). This reads structure; it is not an agent's recall, which reads the graph from that agent's own viewpoint inside its sessions.",
|
|
25042
26579
|
http: "POST",
|
|
25043
26580
|
path: "/ontology/v1/search",
|
|
25044
26581
|
streaming: "no",
|
|
@@ -27712,7 +29249,7 @@ for more details.`
|
|
|
27712
29249
|
required: true,
|
|
27713
29250
|
fields: [
|
|
27714
29251
|
{
|
|
27715
|
-
name: "
|
|
29252
|
+
name: "update_mask",
|
|
27716
29253
|
type: "array",
|
|
27717
29254
|
itemType: "string",
|
|
27718
29255
|
required: true,
|
|
@@ -27955,7 +29492,7 @@ for more details.`
|
|
|
27955
29492
|
required: true,
|
|
27956
29493
|
fields: [
|
|
27957
29494
|
{
|
|
27958
|
-
name: "
|
|
29495
|
+
name: "update_mask",
|
|
27959
29496
|
type: "array",
|
|
27960
29497
|
itemType: "string",
|
|
27961
29498
|
required: true,
|
|
@@ -28266,7 +29803,7 @@ for more details.`
|
|
|
28266
29803
|
required: true,
|
|
28267
29804
|
fields: [
|
|
28268
29805
|
{
|
|
28269
|
-
name: "
|
|
29806
|
+
name: "update_mask",
|
|
28270
29807
|
type: "array",
|
|
28271
29808
|
itemType: "string",
|
|
28272
29809
|
required: true,
|
|
@@ -28427,7 +29964,7 @@ for more details.`
|
|
|
28427
29964
|
resource: "studio.themes",
|
|
28428
29965
|
method: "list",
|
|
28429
29966
|
summary: "List the rendition themes of a platform",
|
|
28430
|
-
description: "List themes: the layouts a rendition is produced with, for one platform or for all of them. Pass a platform to see only the themes that platform can use. A theme decides the page or card a rendition is built into, so read the chosen theme before creating a rendition rather than after the output looks wrong.",
|
|
29967
|
+
description: "List themes: the layouts a rendition is produced with, for one platform or for all of them. Pass a platform to see only the themes that platform can use. The first page starts with the built-in themes (builtin true, such as warm-card@1 for Xiaohongshu cards and plain-mono@1 for WeChat articles), which every organization can use and nobody can change or delete; your organization's own themes follow. A theme decides the page or card a rendition is built into, so read the chosen theme before creating a rendition rather than after the output looks wrong.",
|
|
28431
29968
|
http: "GET",
|
|
28432
29969
|
path: "/studio/v1/themes",
|
|
28433
29970
|
streaming: "no",
|
|
@@ -28576,7 +30113,7 @@ for more details.`
|
|
|
28576
30113
|
required: true,
|
|
28577
30114
|
fields: [
|
|
28578
30115
|
{
|
|
28579
|
-
name: "
|
|
30116
|
+
name: "update_mask",
|
|
28580
30117
|
type: "array",
|
|
28581
30118
|
itemType: "string",
|
|
28582
30119
|
required: true,
|
|
@@ -28716,7 +30253,7 @@ for more details.`
|
|
|
28716
30253
|
description: "Caller-chosen key and value pairs kept on a resource; the keys are the caller's own names and no platform meaning is attached to them."
|
|
28717
30254
|
},
|
|
28718
30255
|
{
|
|
28719
|
-
name: "
|
|
30256
|
+
name: "request_id",
|
|
28720
30257
|
type: "string",
|
|
28721
30258
|
required: false,
|
|
28722
30259
|
description: "Caller-chosen key that makes this create safe to repeat: the same value answers the first result instead of creating a second work."
|
|
@@ -28789,14 +30326,14 @@ for more details.`
|
|
|
28789
30326
|
required: true,
|
|
28790
30327
|
fields: [
|
|
28791
30328
|
{
|
|
28792
|
-
name: "
|
|
30329
|
+
name: "update_mask",
|
|
28793
30330
|
type: "array",
|
|
28794
30331
|
itemType: "string",
|
|
28795
30332
|
required: true,
|
|
28796
30333
|
description: "Field paths this call changes, spelled as they appear in the work, such as title or goal.message; a field left out keeps its value."
|
|
28797
30334
|
},
|
|
28798
30335
|
{
|
|
28799
|
-
name: "
|
|
30336
|
+
name: "expected_revision",
|
|
28800
30337
|
type: "integer",
|
|
28801
30338
|
required: false,
|
|
28802
30339
|
description: "Work revision the caller read; when the work moved past it the write is refused with REVISION_CONFLICT and nothing changes."
|
|
@@ -28868,7 +30405,7 @@ for more details.`
|
|
|
28868
30405
|
required: true,
|
|
28869
30406
|
fields: [
|
|
28870
30407
|
{
|
|
28871
|
-
name: "
|
|
30408
|
+
name: "expected_revision",
|
|
28872
30409
|
type: "integer",
|
|
28873
30410
|
required: false,
|
|
28874
30411
|
description: "Brief revision the caller read; a mismatch is refused with REVISION_CONFLICT rather than merged."
|
|
@@ -28887,21 +30424,21 @@ for more details.`
|
|
|
28887
30424
|
description: "Source files to keep with the brief, added to the ones already attached."
|
|
28888
30425
|
},
|
|
28889
30426
|
{
|
|
28890
|
-
name: "
|
|
30427
|
+
name: "add_points",
|
|
28891
30428
|
type: "array",
|
|
28892
|
-
itemType: "
|
|
30429
|
+
itemType: "object",
|
|
28893
30430
|
required: false,
|
|
28894
|
-
description: "New requirement points to split out of the brief; each receives the next free key in order."
|
|
30431
|
+
description: "New requirement points to split out of the brief; each receives the next free key in order. A plain string is a unit point; pass { text, scope: work } for a constraint on the whole piece (period, voice, point of view, cast, words to avoid)."
|
|
28895
30432
|
},
|
|
28896
30433
|
{
|
|
28897
|
-
name: "
|
|
30434
|
+
name: "edit_points",
|
|
28898
30435
|
type: "array",
|
|
28899
30436
|
itemType: "object",
|
|
28900
30437
|
required: false,
|
|
28901
30438
|
description: "Existing points to reword, each naming the key it keeps and the text that replaces it."
|
|
28902
30439
|
},
|
|
28903
30440
|
{
|
|
28904
|
-
name: "
|
|
30441
|
+
name: "remove_points",
|
|
28905
30442
|
type: "array",
|
|
28906
30443
|
itemType: "string",
|
|
28907
30444
|
required: false,
|
|
@@ -28984,7 +30521,7 @@ for more details.`
|
|
|
28984
30521
|
description: "Unit tree to create the draft with, given by the caller instead of a template; children nest, and a unit without a kind takes the genre default for its position."
|
|
28985
30522
|
},
|
|
28986
30523
|
{
|
|
28987
|
-
name: "
|
|
30524
|
+
name: "derived_from",
|
|
28988
30525
|
type: "object",
|
|
28989
30526
|
required: false,
|
|
28990
30527
|
description: "What the new draft should be derived from, so the service can record the source revision for later staleness checks."
|
|
@@ -28996,7 +30533,7 @@ for more details.`
|
|
|
28996
30533
|
description: "Initial values for the genre properties, keyed by property key; a value the genre does not define is refused rather than stored."
|
|
28997
30534
|
},
|
|
28998
30535
|
{
|
|
28999
|
-
name: "
|
|
30536
|
+
name: "request_id",
|
|
29000
30537
|
type: "string",
|
|
29001
30538
|
required: false,
|
|
29002
30539
|
description: "Caller-chosen key that makes this create safe to repeat: the same value answers the first draft instead of creating a second one."
|
|
@@ -29065,14 +30602,14 @@ for more details.`
|
|
|
29065
30602
|
required: true,
|
|
29066
30603
|
fields: [
|
|
29067
30604
|
{
|
|
29068
|
-
name: "
|
|
30605
|
+
name: "update_mask",
|
|
29069
30606
|
type: "array",
|
|
29070
30607
|
itemType: "string",
|
|
29071
30608
|
required: true,
|
|
29072
30609
|
description: "Field paths this call changes, such as title, key or props.topics; a field left out keeps its value."
|
|
29073
30610
|
},
|
|
29074
30611
|
{
|
|
29075
|
-
name: "
|
|
30612
|
+
name: "expected_revision",
|
|
29076
30613
|
type: "integer",
|
|
29077
30614
|
required: false,
|
|
29078
30615
|
description: "Draft revision the caller read; a mismatch is refused with REVISION_CONFLICT and nothing changes. Omit it only for structure calls that genuinely do not depend on the current state."
|
|
@@ -29171,6 +30708,64 @@ for more details.`
|
|
|
29171
30708
|
],
|
|
29172
30709
|
query: []
|
|
29173
30710
|
},
|
|
30711
|
+
{
|
|
30712
|
+
resource: "studio.works.drafts.renditions",
|
|
30713
|
+
method: "create",
|
|
30714
|
+
summary: "Create a rendition of a draft for a platform",
|
|
30715
|
+
description: "Create a rendition: the form of one draft that a platform receives, such as a Xiaohongshu card set, a DOCX file or a Markdown file. Read the platform first with the platform call and pass its versioned key; pass a theme only to override the platform's default layout. Pass render true to render in the same call and read render_state and issues in the answer; without it the rendition starts as pending and the render call produces it. Rendering a Xiaohongshu card set is billed by Browser Rendering time (meter browser_ms, product studio-render); DOCX and Markdown renditions are not billed. A draft with no body renders as invalid with a draft_empty issue, and an unavailable render service leaves render_state failed with a render_unavailable issue, so repeat the render call later. Send a request_id to make a repeated call return the first rendition instead of creating another. Next, publish the rendition to export it.",
|
|
30716
|
+
http: "POST",
|
|
30717
|
+
path: "/studio/v1/works/{work}/drafts/{draft}/renditions",
|
|
30718
|
+
streaming: "no",
|
|
30719
|
+
pagination: false,
|
|
30720
|
+
pathParams: [
|
|
30721
|
+
{
|
|
30722
|
+
name: "work",
|
|
30723
|
+
sdkName: "work",
|
|
30724
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
30725
|
+
},
|
|
30726
|
+
{
|
|
30727
|
+
name: "draft",
|
|
30728
|
+
sdkName: "draft",
|
|
30729
|
+
description: "Draft being addressed, either its in-work key such as novel or its drf_ identifier; a key renamed earlier still resolves through its previous value."
|
|
30730
|
+
}
|
|
30731
|
+
],
|
|
30732
|
+
query: [],
|
|
30733
|
+
body: {
|
|
30734
|
+
required: true,
|
|
30735
|
+
fields: [
|
|
30736
|
+
{
|
|
30737
|
+
name: "platform",
|
|
30738
|
+
type: "string",
|
|
30739
|
+
required: true,
|
|
30740
|
+
description: "Versioned platform key from the platform list. Export platforms today are markdown@1, docx@1 and xiaohongshu@1; a platform that only publishes to an account answers PLATFORM_NOT_AVAILABLE."
|
|
30741
|
+
},
|
|
30742
|
+
{
|
|
30743
|
+
name: "theme",
|
|
30744
|
+
type: "string",
|
|
30745
|
+
required: false,
|
|
30746
|
+
description: "Theme to render with, a thm_ identifier or a built-in key from the theme list; omit it to use the platform default."
|
|
30747
|
+
},
|
|
30748
|
+
{
|
|
30749
|
+
name: "settings",
|
|
30750
|
+
type: "object",
|
|
30751
|
+
required: false,
|
|
30752
|
+
description: "Per-rendition settings; each platform reads only the settings that apply to it and ignores the rest."
|
|
30753
|
+
},
|
|
30754
|
+
{
|
|
30755
|
+
name: "render",
|
|
30756
|
+
type: "boolean",
|
|
30757
|
+
required: false,
|
|
30758
|
+
description: "Whether to render in the same call. True returns a rendition that is already rendered, invalid or failed; false or omitted returns it pending, to be rendered by the render operation."
|
|
30759
|
+
},
|
|
30760
|
+
{
|
|
30761
|
+
name: "request_id",
|
|
30762
|
+
type: "string",
|
|
30763
|
+
required: false,
|
|
30764
|
+
description: "Caller-chosen key that makes a repeated create return the first rendition instead of making another; use a new value for each distinct rendition."
|
|
30765
|
+
}
|
|
30766
|
+
]
|
|
30767
|
+
}
|
|
30768
|
+
},
|
|
29174
30769
|
{
|
|
29175
30770
|
resource: "studio.works.drafts",
|
|
29176
30771
|
method: "retrieveReview",
|
|
@@ -29416,7 +31011,7 @@ for more details.`
|
|
|
29416
31011
|
required: false,
|
|
29417
31012
|
fields: [
|
|
29418
31013
|
{
|
|
29419
|
-
name: "
|
|
31014
|
+
name: "expected_revision",
|
|
29420
31015
|
type: "integer",
|
|
29421
31016
|
required: false,
|
|
29422
31017
|
description: "Draft revision the caller read; a mismatch is refused rather than confirming a draft that changed under the caller."
|
|
@@ -29424,6 +31019,212 @@ for more details.`
|
|
|
29424
31019
|
]
|
|
29425
31020
|
}
|
|
29426
31021
|
},
|
|
31022
|
+
{
|
|
31023
|
+
resource: "studio.works.renditions",
|
|
31024
|
+
method: "list",
|
|
31025
|
+
summary: "List the renditions of a work",
|
|
31026
|
+
description: "List the renditions of one work, each with its platform, render state, stale flag and publish state. Pass draft to see only the renditions of one draft. Use it to find the rendition to publish or to render again, and read stale before exporting: a stale rendition was built from an older draft and cannot be exported until the render call has rebuilt it. The answer is one page; keep following next_page_token while it is present.",
|
|
31027
|
+
http: "GET",
|
|
31028
|
+
path: "/studio/v1/works/{work}/renditions",
|
|
31029
|
+
streaming: "no",
|
|
31030
|
+
pagination: false,
|
|
31031
|
+
pathParams: [
|
|
31032
|
+
{
|
|
31033
|
+
name: "work",
|
|
31034
|
+
sdkName: "work",
|
|
31035
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
31036
|
+
}
|
|
31037
|
+
],
|
|
31038
|
+
query: [
|
|
31039
|
+
{
|
|
31040
|
+
name: "draft",
|
|
31041
|
+
type: "string",
|
|
31042
|
+
required: false,
|
|
31043
|
+
description: "Draft key such as novel or its drf_ identifier; when given, only the renditions of that draft are returned. Omit it to list the renditions of every draft in the work."
|
|
31044
|
+
},
|
|
31045
|
+
{
|
|
31046
|
+
name: "page_size",
|
|
31047
|
+
type: "integer",
|
|
31048
|
+
required: false,
|
|
31049
|
+
description: "How many items this page returns, 1 to 100; omitted uses the service default. Treat the answer as one page, not the whole set, and keep following next_page_token while it is present."
|
|
31050
|
+
},
|
|
31051
|
+
{
|
|
31052
|
+
name: "page_token",
|
|
31053
|
+
type: "string",
|
|
31054
|
+
required: false,
|
|
31055
|
+
description: "Cursor from the previous answer's next_page_token; it is opaque, so pass it back unchanged and never build one from an id or an offset."
|
|
31056
|
+
}
|
|
31057
|
+
]
|
|
31058
|
+
},
|
|
31059
|
+
{
|
|
31060
|
+
resource: "studio.works.renditions",
|
|
31061
|
+
method: "delete",
|
|
31062
|
+
summary: "Delete a rendition",
|
|
31063
|
+
description: "Delete a rendition and stop listing it. The draft it was built from is untouched, and a new rendition can be created from it at any time. Files already downloaded from an earlier export are not affected. Use it to clear a failed or abandoned rendition; to refresh one, call the render operation instead.",
|
|
31064
|
+
http: "DELETE",
|
|
31065
|
+
path: "/studio/v1/works/{work}/renditions/{rendition}",
|
|
31066
|
+
streaming: "no",
|
|
31067
|
+
pagination: false,
|
|
31068
|
+
pathParams: [
|
|
31069
|
+
{
|
|
31070
|
+
name: "work",
|
|
31071
|
+
sdkName: "work",
|
|
31072
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
31073
|
+
},
|
|
31074
|
+
{
|
|
31075
|
+
name: "rendition",
|
|
31076
|
+
sdkName: "rendition",
|
|
31077
|
+
description: "Rendition being addressed, by its rnd_ identifier from the rendition list or from the create answer."
|
|
31078
|
+
}
|
|
31079
|
+
],
|
|
31080
|
+
query: []
|
|
31081
|
+
},
|
|
31082
|
+
{
|
|
31083
|
+
resource: "studio.works.renditions",
|
|
31084
|
+
method: "retrieve",
|
|
31085
|
+
summary: "Read one rendition",
|
|
31086
|
+
description: "Read one rendition in full: its render state, the validation issues the render found, the parts (one per card page or thread post), the files it produced and its publish state. Call it after create, render or publish to see the outcome, because a render that finished invalid or failed is reported here and not as an HTTP error. stale is true when the draft has changed since source_revision; call the render operation before exporting a stale rendition.",
|
|
31087
|
+
http: "GET",
|
|
31088
|
+
path: "/studio/v1/works/{work}/renditions/{rendition}",
|
|
31089
|
+
streaming: "no",
|
|
31090
|
+
pagination: false,
|
|
31091
|
+
pathParams: [
|
|
31092
|
+
{
|
|
31093
|
+
name: "work",
|
|
31094
|
+
sdkName: "work",
|
|
31095
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
31096
|
+
},
|
|
31097
|
+
{
|
|
31098
|
+
name: "rendition",
|
|
31099
|
+
sdkName: "rendition",
|
|
31100
|
+
description: "Rendition being addressed, by its rnd_ identifier from the rendition list or from the create answer."
|
|
31101
|
+
}
|
|
31102
|
+
],
|
|
31103
|
+
query: []
|
|
31104
|
+
},
|
|
31105
|
+
{
|
|
31106
|
+
resource: "studio.works.renditions",
|
|
31107
|
+
method: "update",
|
|
31108
|
+
summary: "Change the theme or settings of a rendition",
|
|
31109
|
+
description: "Change a rendition's theme or settings. Send update_mask naming exactly the fields you change, such as theme or settings; a field left out keeps its value. The produced files are not rebuilt by this call, so call the render operation afterwards to apply the change. A rendition whose export or publish has started is locked and answers RENDITION_PUBLISH_LOCKED; create a new rendition for new content.",
|
|
31110
|
+
http: "PATCH",
|
|
31111
|
+
path: "/studio/v1/works/{work}/renditions/{rendition}",
|
|
31112
|
+
streaming: "no",
|
|
31113
|
+
pagination: false,
|
|
31114
|
+
pathParams: [
|
|
31115
|
+
{
|
|
31116
|
+
name: "work",
|
|
31117
|
+
sdkName: "work",
|
|
31118
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
31119
|
+
},
|
|
31120
|
+
{
|
|
31121
|
+
name: "rendition",
|
|
31122
|
+
sdkName: "rendition",
|
|
31123
|
+
description: "Rendition being addressed, by its rnd_ identifier from the rendition list or from the create answer."
|
|
31124
|
+
}
|
|
31125
|
+
],
|
|
31126
|
+
query: [],
|
|
31127
|
+
body: {
|
|
31128
|
+
required: true,
|
|
31129
|
+
fields: [
|
|
31130
|
+
{
|
|
31131
|
+
name: "update_mask",
|
|
31132
|
+
type: "array",
|
|
31133
|
+
itemType: "string",
|
|
31134
|
+
required: true,
|
|
31135
|
+
description: "Field paths this call changes: theme, settings or both; a field left out keeps its value."
|
|
31136
|
+
},
|
|
31137
|
+
{
|
|
31138
|
+
name: "theme",
|
|
31139
|
+
type: "string",
|
|
31140
|
+
required: false,
|
|
31141
|
+
description: "New theme, a thm_ identifier or a built-in key, used when theme is named in the update mask; render again to apply it."
|
|
31142
|
+
},
|
|
31143
|
+
{
|
|
31144
|
+
name: "settings",
|
|
31145
|
+
type: "object",
|
|
31146
|
+
required: false,
|
|
31147
|
+
description: "Per-rendition settings; each platform reads only the settings that apply to it and ignores the rest."
|
|
31148
|
+
}
|
|
31149
|
+
]
|
|
31150
|
+
}
|
|
31151
|
+
},
|
|
31152
|
+
{
|
|
31153
|
+
resource: "studio.works.renditions",
|
|
31154
|
+
method: "retrieveContent",
|
|
31155
|
+
summary: "Get a download URL for a rendition file",
|
|
31156
|
+
description: "Get a signed, short-lived URL to download what a rendition produced. Without part it points to the rendition's own first file: the ZIP of pages for a card rendition, the DOCX for docx@1. With part it points to that part's first file, such as one card PNG; a part that has no file, or a rendition not rendered yet, answers RENDITION_NOT_RENDERED, and an index no part has answers INVALID_PARAMS. Call it after a successful render or export, download the url before expire_time, and call again for a fresh one when it has expired. The URL is a credential: do not store or share it.",
|
|
31157
|
+
http: "GET",
|
|
31158
|
+
path: "/studio/v1/works/{work}/renditions/{rendition}/content",
|
|
31159
|
+
streaming: "no",
|
|
31160
|
+
pagination: false,
|
|
31161
|
+
pathParams: [
|
|
31162
|
+
{
|
|
31163
|
+
name: "work",
|
|
31164
|
+
sdkName: "work",
|
|
31165
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
31166
|
+
},
|
|
31167
|
+
{
|
|
31168
|
+
name: "rendition",
|
|
31169
|
+
sdkName: "rendition",
|
|
31170
|
+
description: "Rendition being addressed, by its rnd_ identifier from the rendition list or from the create answer."
|
|
31171
|
+
}
|
|
31172
|
+
],
|
|
31173
|
+
query: [
|
|
31174
|
+
{
|
|
31175
|
+
name: "part",
|
|
31176
|
+
type: "integer",
|
|
31177
|
+
required: false,
|
|
31178
|
+
description: "Index of the part to download, the index value of an entry in the rendition's parts list; omit it to get the rendition's own first file."
|
|
31179
|
+
}
|
|
31180
|
+
]
|
|
31181
|
+
},
|
|
31182
|
+
{
|
|
31183
|
+
resource: "studio.works.renditions",
|
|
31184
|
+
method: "publish",
|
|
31185
|
+
summary: "Export a rendition",
|
|
31186
|
+
description: "Export a rendition for the platforms that deliver a file: markdown@1, docx@1 and xiaohongshu@1 end with publish.state exported, and a card rendition gains one ZIP of its pages in files. Publishing to a platform account such as X or WeChat is not available yet and answers PLATFORM_NOT_AVAILABLE; export instead. The rendition must be rendered, not stale and without error-level issues: RENDITION_NOT_RENDERED means call the render operation first, RENDITION_STALE means the draft changed so render again, RENDITION_INVALID means fix the draft problems listed in issues and render again. Exporting the same rendition twice at once answers REVISION_CONFLICT; retry shortly. Next, call the content operation to download the file.",
|
|
31187
|
+
http: "POST",
|
|
31188
|
+
path: "/studio/v1/works/{work}/renditions/{rendition}:publish",
|
|
31189
|
+
streaming: "no",
|
|
31190
|
+
pagination: false,
|
|
31191
|
+
pathParams: [
|
|
31192
|
+
{
|
|
31193
|
+
name: "work",
|
|
31194
|
+
sdkName: "work",
|
|
31195
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
31196
|
+
},
|
|
31197
|
+
{
|
|
31198
|
+
name: "rendition",
|
|
31199
|
+
sdkName: "rendition",
|
|
31200
|
+
description: "Rendition being addressed, by its rnd_ identifier from the rendition list or from the create answer."
|
|
31201
|
+
}
|
|
31202
|
+
],
|
|
31203
|
+
query: []
|
|
31204
|
+
},
|
|
31205
|
+
{
|
|
31206
|
+
resource: "studio.works.renditions",
|
|
31207
|
+
method: "render",
|
|
31208
|
+
summary: "Render a rendition again from the current draft",
|
|
31209
|
+
description: "Render the rendition from the draft as it is now, replacing its parts and files and clearing stale. Call it after the draft changed, after a theme or settings change, or after a failed render. The answer carries render_state: rendered, invalid when the draft has an error-level issue (for example draft_empty on a draft with no body), or failed when the render service was unavailable (issue render_unavailable; repeat later). A render does not fail the HTTP call for those outcomes, so read render_state and issues. Rendering a Xiaohongshu card set is billed by Browser Rendering time (meter browser_ms, product studio-render); DOCX and Markdown are not billed. Rendering the same rendition twice at once answers REVISION_CONFLICT; retry shortly. Next, publish the rendition to export it.",
|
|
31210
|
+
http: "POST",
|
|
31211
|
+
path: "/studio/v1/works/{work}/renditions/{rendition}:render",
|
|
31212
|
+
streaming: "no",
|
|
31213
|
+
pagination: false,
|
|
31214
|
+
pathParams: [
|
|
31215
|
+
{
|
|
31216
|
+
name: "work",
|
|
31217
|
+
sdkName: "work",
|
|
31218
|
+
description: "The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value."
|
|
31219
|
+
},
|
|
31220
|
+
{
|
|
31221
|
+
name: "rendition",
|
|
31222
|
+
sdkName: "rendition",
|
|
31223
|
+
description: "Rendition being addressed, by its rnd_ identifier from the rendition list or from the create answer."
|
|
31224
|
+
}
|
|
31225
|
+
],
|
|
31226
|
+
query: []
|
|
31227
|
+
},
|
|
29427
31228
|
{
|
|
29428
31229
|
resource: "studio.works.units",
|
|
29429
31230
|
method: "retrieve",
|
|
@@ -38352,6 +40153,341 @@ var devopsTestReportsUpload = (options) => (options.client ?? client).post({
|
|
|
38352
40153
|
...options.headers
|
|
38353
40154
|
}
|
|
38354
40155
|
});
|
|
40156
|
+
var devopsProjectsList = (options) => (options?.client ?? client).get({
|
|
40157
|
+
security: [{
|
|
40158
|
+
key: "devops-bearerAuth",
|
|
40159
|
+
scheme: "bearer",
|
|
40160
|
+
type: "http"
|
|
40161
|
+
}],
|
|
40162
|
+
url: "/devops/v1/projects",
|
|
40163
|
+
...options
|
|
40164
|
+
});
|
|
40165
|
+
var devopsProjectsGet = (options) => (options.client ?? client).get({
|
|
40166
|
+
security: [{
|
|
40167
|
+
key: "devops-bearerAuth",
|
|
40168
|
+
scheme: "bearer",
|
|
40169
|
+
type: "http"
|
|
40170
|
+
}],
|
|
40171
|
+
url: "/devops/v1/projects/{id}",
|
|
40172
|
+
...options
|
|
40173
|
+
});
|
|
40174
|
+
var devopsReleasesList = (options) => (options.client ?? client).get({
|
|
40175
|
+
security: [{
|
|
40176
|
+
key: "devops-bearerAuth",
|
|
40177
|
+
scheme: "bearer",
|
|
40178
|
+
type: "http"
|
|
40179
|
+
}],
|
|
40180
|
+
url: "/devops/v1/projects/{project}/releases",
|
|
40181
|
+
...options
|
|
40182
|
+
});
|
|
40183
|
+
var devopsReleasesCreate = (options) => (options.client ?? client).post({
|
|
40184
|
+
security: [{
|
|
40185
|
+
key: "devops-bearerAuth",
|
|
40186
|
+
scheme: "bearer",
|
|
40187
|
+
type: "http"
|
|
40188
|
+
}],
|
|
40189
|
+
url: "/devops/v1/projects/{project}/releases",
|
|
40190
|
+
...options,
|
|
40191
|
+
headers: {
|
|
40192
|
+
"Content-Type": "application/json",
|
|
40193
|
+
...options.headers
|
|
40194
|
+
}
|
|
40195
|
+
});
|
|
40196
|
+
var devopsReleasesGet = (options) => (options.client ?? client).get({
|
|
40197
|
+
security: [{
|
|
40198
|
+
key: "devops-bearerAuth",
|
|
40199
|
+
scheme: "bearer",
|
|
40200
|
+
type: "http"
|
|
40201
|
+
}],
|
|
40202
|
+
url: "/devops/v1/releases/{id}",
|
|
40203
|
+
...options
|
|
40204
|
+
});
|
|
40205
|
+
var devopsReleasesAbandon = (options) => (options.client ?? client).post({
|
|
40206
|
+
security: [{
|
|
40207
|
+
key: "devops-bearerAuth",
|
|
40208
|
+
scheme: "bearer",
|
|
40209
|
+
type: "http"
|
|
40210
|
+
}],
|
|
40211
|
+
url: "/devops/v1/releases/{id}:abandon",
|
|
40212
|
+
...options,
|
|
40213
|
+
headers: {
|
|
40214
|
+
"Content-Type": "application/json",
|
|
40215
|
+
...options.headers
|
|
40216
|
+
}
|
|
40217
|
+
});
|
|
40218
|
+
var devopsPromotionsCreate = (options) => (options.client ?? client).post({
|
|
40219
|
+
security: [{
|
|
40220
|
+
key: "devops-bearerAuth",
|
|
40221
|
+
scheme: "bearer",
|
|
40222
|
+
type: "http"
|
|
40223
|
+
}],
|
|
40224
|
+
url: "/devops/v1/promotions",
|
|
40225
|
+
...options,
|
|
40226
|
+
headers: {
|
|
40227
|
+
"Content-Type": "application/json",
|
|
40228
|
+
...options.headers
|
|
40229
|
+
}
|
|
40230
|
+
});
|
|
40231
|
+
var devopsPromotionsList = (options) => (options.client ?? client).get({
|
|
40232
|
+
security: [{
|
|
40233
|
+
key: "devops-bearerAuth",
|
|
40234
|
+
scheme: "bearer",
|
|
40235
|
+
type: "http"
|
|
40236
|
+
}],
|
|
40237
|
+
url: "/devops/v1/projects/{project}/promotions",
|
|
40238
|
+
...options
|
|
40239
|
+
});
|
|
40240
|
+
var devopsPromotionsGet = (options) => (options.client ?? client).get({
|
|
40241
|
+
security: [{
|
|
40242
|
+
key: "devops-bearerAuth",
|
|
40243
|
+
scheme: "bearer",
|
|
40244
|
+
type: "http"
|
|
40245
|
+
}],
|
|
40246
|
+
url: "/devops/v1/promotions/{id}",
|
|
40247
|
+
...options
|
|
40248
|
+
});
|
|
40249
|
+
var devopsPromotionsApprove = (options) => (options.client ?? client).post({
|
|
40250
|
+
security: [{
|
|
40251
|
+
key: "devops-bearerAuth",
|
|
40252
|
+
scheme: "bearer",
|
|
40253
|
+
type: "http"
|
|
40254
|
+
}],
|
|
40255
|
+
url: "/devops/v1/promotions/{id}:approve",
|
|
40256
|
+
...options,
|
|
40257
|
+
headers: {
|
|
40258
|
+
"Content-Type": "application/json",
|
|
40259
|
+
...options.headers
|
|
40260
|
+
}
|
|
40261
|
+
});
|
|
40262
|
+
var devopsPromotionsCancel = (options) => (options.client ?? client).post({
|
|
40263
|
+
security: [{
|
|
40264
|
+
key: "devops-bearerAuth",
|
|
40265
|
+
scheme: "bearer",
|
|
40266
|
+
type: "http"
|
|
40267
|
+
}],
|
|
40268
|
+
url: "/devops/v1/promotions/{id}:cancel",
|
|
40269
|
+
...options,
|
|
40270
|
+
headers: {
|
|
40271
|
+
"Content-Type": "application/json",
|
|
40272
|
+
...options.headers
|
|
40273
|
+
}
|
|
40274
|
+
});
|
|
40275
|
+
var devopsPromotionsRetry = (options) => (options.client ?? client).post({
|
|
40276
|
+
security: [{
|
|
40277
|
+
key: "devops-bearerAuth",
|
|
40278
|
+
scheme: "bearer",
|
|
40279
|
+
type: "http"
|
|
40280
|
+
}],
|
|
40281
|
+
url: "/devops/v1/promotions/{id}:retry",
|
|
40282
|
+
...options
|
|
40283
|
+
});
|
|
40284
|
+
var devopsPromotionsConclude = (options) => (options.client ?? client).post({
|
|
40285
|
+
security: [{
|
|
40286
|
+
key: "devops-bearerAuth",
|
|
40287
|
+
scheme: "bearer",
|
|
40288
|
+
type: "http"
|
|
40289
|
+
}],
|
|
40290
|
+
url: "/devops/v1/promotions/{id}:conclude",
|
|
40291
|
+
...options,
|
|
40292
|
+
headers: {
|
|
40293
|
+
"Content-Type": "application/json",
|
|
40294
|
+
...options.headers
|
|
40295
|
+
}
|
|
40296
|
+
});
|
|
40297
|
+
var devopsRolloutsList = (options) => (options.client ?? client).get({
|
|
40298
|
+
security: [{
|
|
40299
|
+
key: "devops-bearerAuth",
|
|
40300
|
+
scheme: "bearer",
|
|
40301
|
+
type: "http"
|
|
40302
|
+
}],
|
|
40303
|
+
url: "/devops/v1/promotions/{promotion}/rollouts",
|
|
40304
|
+
...options
|
|
40305
|
+
});
|
|
40306
|
+
var devopsRolloutsGet = (options) => (options.client ?? client).get({
|
|
40307
|
+
security: [{
|
|
40308
|
+
key: "devops-bearerAuth",
|
|
40309
|
+
scheme: "bearer",
|
|
40310
|
+
type: "http"
|
|
40311
|
+
}],
|
|
40312
|
+
url: "/devops/v1/rollouts/{id}",
|
|
40313
|
+
...options
|
|
40314
|
+
});
|
|
40315
|
+
var devopsEnvironmentsList = (options) => (options.client ?? client).get({
|
|
40316
|
+
security: [{
|
|
40317
|
+
key: "devops-bearerAuth",
|
|
40318
|
+
scheme: "bearer",
|
|
40319
|
+
type: "http"
|
|
40320
|
+
}],
|
|
40321
|
+
url: "/devops/v1/projects/{project}/environments",
|
|
40322
|
+
...options
|
|
40323
|
+
});
|
|
40324
|
+
var devopsEnvironmentsCheckpointsList = (options) => (options.client ?? client).get({
|
|
40325
|
+
security: [{
|
|
40326
|
+
key: "devops-bearerAuth",
|
|
40327
|
+
scheme: "bearer",
|
|
40328
|
+
type: "http"
|
|
40329
|
+
}],
|
|
40330
|
+
url: "/devops/v1/environments/{id}/checkpoints",
|
|
40331
|
+
...options
|
|
40332
|
+
});
|
|
40333
|
+
var devopsTargetsList = (options) => (options.client ?? client).get({
|
|
40334
|
+
security: [{
|
|
40335
|
+
key: "devops-bearerAuth",
|
|
40336
|
+
scheme: "bearer",
|
|
40337
|
+
type: "http"
|
|
40338
|
+
}],
|
|
40339
|
+
url: "/devops/v1/projects/{project}/targets",
|
|
40340
|
+
...options
|
|
40341
|
+
});
|
|
40342
|
+
var devopsTargetsRefresh = (options) => (options.client ?? client).post({
|
|
40343
|
+
security: [{
|
|
40344
|
+
key: "devops-bearerAuth",
|
|
40345
|
+
scheme: "bearer",
|
|
40346
|
+
type: "http"
|
|
40347
|
+
}],
|
|
40348
|
+
url: "/devops/v1/projects/{project}/targets:refresh",
|
|
40349
|
+
...options,
|
|
40350
|
+
headers: {
|
|
40351
|
+
"Content-Type": "application/json",
|
|
40352
|
+
...options.headers
|
|
40353
|
+
}
|
|
40354
|
+
});
|
|
40355
|
+
var devopsFlagsList = (options) => (options.client ?? client).get({
|
|
40356
|
+
security: [{
|
|
40357
|
+
key: "devops-bearerAuth",
|
|
40358
|
+
scheme: "bearer",
|
|
40359
|
+
type: "http"
|
|
40360
|
+
}],
|
|
40361
|
+
url: "/devops/v1/projects/{project}/flags",
|
|
40362
|
+
...options
|
|
40363
|
+
});
|
|
40364
|
+
var devopsFlagsCreate = (options) => (options.client ?? client).post({
|
|
40365
|
+
security: [{
|
|
40366
|
+
key: "devops-bearerAuth",
|
|
40367
|
+
scheme: "bearer",
|
|
40368
|
+
type: "http"
|
|
40369
|
+
}],
|
|
40370
|
+
url: "/devops/v1/projects/{project}/flags",
|
|
40371
|
+
...options,
|
|
40372
|
+
headers: {
|
|
40373
|
+
"Content-Type": "application/json",
|
|
40374
|
+
...options.headers
|
|
40375
|
+
}
|
|
40376
|
+
});
|
|
40377
|
+
var devopsFlagsGet = (options) => (options.client ?? client).get({
|
|
40378
|
+
security: [{
|
|
40379
|
+
key: "devops-bearerAuth",
|
|
40380
|
+
scheme: "bearer",
|
|
40381
|
+
type: "http"
|
|
40382
|
+
}],
|
|
40383
|
+
url: "/devops/v1/flags/{id}",
|
|
40384
|
+
...options
|
|
40385
|
+
});
|
|
40386
|
+
var devopsFlagsUpdate = (options) => (options.client ?? client).patch({
|
|
40387
|
+
security: [{
|
|
40388
|
+
key: "devops-bearerAuth",
|
|
40389
|
+
scheme: "bearer",
|
|
40390
|
+
type: "http"
|
|
40391
|
+
}],
|
|
40392
|
+
url: "/devops/v1/flags/{id}",
|
|
40393
|
+
...options,
|
|
40394
|
+
headers: {
|
|
40395
|
+
"Content-Type": "application/json",
|
|
40396
|
+
...options.headers
|
|
40397
|
+
}
|
|
40398
|
+
});
|
|
40399
|
+
var devopsFlagsUpdateEnvironment = (options) => (options.client ?? client).patch({
|
|
40400
|
+
security: [{
|
|
40401
|
+
key: "devops-bearerAuth",
|
|
40402
|
+
scheme: "bearer",
|
|
40403
|
+
type: "http"
|
|
40404
|
+
}],
|
|
40405
|
+
url: "/devops/v1/flags/{id}/environments/{environment}",
|
|
40406
|
+
...options,
|
|
40407
|
+
headers: {
|
|
40408
|
+
"Content-Type": "application/json",
|
|
40409
|
+
...options.headers
|
|
40410
|
+
}
|
|
40411
|
+
});
|
|
40412
|
+
var devopsFlagsConclude = (options) => (options.client ?? client).post({
|
|
40413
|
+
security: [{
|
|
40414
|
+
key: "devops-bearerAuth",
|
|
40415
|
+
scheme: "bearer",
|
|
40416
|
+
type: "http"
|
|
40417
|
+
}],
|
|
40418
|
+
url: "/devops/v1/flags/{id}:conclude",
|
|
40419
|
+
...options,
|
|
40420
|
+
headers: {
|
|
40421
|
+
"Content-Type": "application/json",
|
|
40422
|
+
...options.headers
|
|
40423
|
+
}
|
|
40424
|
+
});
|
|
40425
|
+
var devopsFlagsArchive = (options) => (options.client ?? client).post({
|
|
40426
|
+
security: [{
|
|
40427
|
+
key: "devops-bearerAuth",
|
|
40428
|
+
scheme: "bearer",
|
|
40429
|
+
type: "http"
|
|
40430
|
+
}],
|
|
40431
|
+
url: "/devops/v1/flags/{id}:archive",
|
|
40432
|
+
...options
|
|
40433
|
+
});
|
|
40434
|
+
var devopsProgressiveRolloutsCreate = (options) => (options.client ?? client).post({
|
|
40435
|
+
security: [{
|
|
40436
|
+
key: "devops-bearerAuth",
|
|
40437
|
+
scheme: "bearer",
|
|
40438
|
+
type: "http"
|
|
40439
|
+
}],
|
|
40440
|
+
url: "/devops/v1/progressive-rollouts",
|
|
40441
|
+
...options,
|
|
40442
|
+
headers: {
|
|
40443
|
+
"Content-Type": "application/json",
|
|
40444
|
+
...options.headers
|
|
40445
|
+
}
|
|
40446
|
+
});
|
|
40447
|
+
var devopsProgressiveRolloutsGet = (options) => (options.client ?? client).get({
|
|
40448
|
+
security: [{
|
|
40449
|
+
key: "devops-bearerAuth",
|
|
40450
|
+
scheme: "bearer",
|
|
40451
|
+
type: "http"
|
|
40452
|
+
}],
|
|
40453
|
+
url: "/devops/v1/progressive-rollouts/{id}",
|
|
40454
|
+
...options
|
|
40455
|
+
});
|
|
40456
|
+
var devopsProgressiveRolloutsPause = (options) => (options.client ?? client).post({
|
|
40457
|
+
security: [{
|
|
40458
|
+
key: "devops-bearerAuth",
|
|
40459
|
+
scheme: "bearer",
|
|
40460
|
+
type: "http"
|
|
40461
|
+
}],
|
|
40462
|
+
url: "/devops/v1/progressive-rollouts/{id}:pause",
|
|
40463
|
+
...options,
|
|
40464
|
+
headers: {
|
|
40465
|
+
"Content-Type": "application/json",
|
|
40466
|
+
...options.headers
|
|
40467
|
+
}
|
|
40468
|
+
});
|
|
40469
|
+
var devopsProgressiveRolloutsResume = (options) => (options.client ?? client).post({
|
|
40470
|
+
security: [{
|
|
40471
|
+
key: "devops-bearerAuth",
|
|
40472
|
+
scheme: "bearer",
|
|
40473
|
+
type: "http"
|
|
40474
|
+
}],
|
|
40475
|
+
url: "/devops/v1/progressive-rollouts/{id}:resume",
|
|
40476
|
+
...options
|
|
40477
|
+
});
|
|
40478
|
+
var devopsProgressiveRolloutsRollback = (options) => (options.client ?? client).post({
|
|
40479
|
+
security: [{
|
|
40480
|
+
key: "devops-bearerAuth",
|
|
40481
|
+
scheme: "bearer",
|
|
40482
|
+
type: "http"
|
|
40483
|
+
}],
|
|
40484
|
+
url: "/devops/v1/progressive-rollouts/{id}:rollback",
|
|
40485
|
+
...options,
|
|
40486
|
+
headers: {
|
|
40487
|
+
"Content-Type": "application/json",
|
|
40488
|
+
...options.headers
|
|
40489
|
+
}
|
|
40490
|
+
});
|
|
38355
40491
|
var knowledgeListVectorStores = (options) => (options?.client ?? client).get({
|
|
38356
40492
|
security: [{
|
|
38357
40493
|
key: "knowledge-bearerAuth",
|
|
@@ -38873,6 +41009,89 @@ var mediaCreateDeliveryToken = (options) => (options.client ?? client).post({
|
|
|
38873
41009
|
...options.headers
|
|
38874
41010
|
}
|
|
38875
41011
|
});
|
|
41012
|
+
var mediaGetDefaultLibrary = (options) => (options?.client ?? client).get({
|
|
41013
|
+
security: [{
|
|
41014
|
+
key: "media-BearerAuth",
|
|
41015
|
+
scheme: "bearer",
|
|
41016
|
+
type: "http"
|
|
41017
|
+
}],
|
|
41018
|
+
url: "/media/v1/libraries/default",
|
|
41019
|
+
...options
|
|
41020
|
+
});
|
|
41021
|
+
var mediaSetDefaultLibrary = (options) => (options.client ?? client).put({
|
|
41022
|
+
security: [{
|
|
41023
|
+
key: "media-BearerAuth",
|
|
41024
|
+
scheme: "bearer",
|
|
41025
|
+
type: "http"
|
|
41026
|
+
}],
|
|
41027
|
+
url: "/media/v1/libraries/default",
|
|
41028
|
+
...options,
|
|
41029
|
+
headers: {
|
|
41030
|
+
"Content-Type": "application/json",
|
|
41031
|
+
...options.headers
|
|
41032
|
+
}
|
|
41033
|
+
});
|
|
41034
|
+
var mediaGetAssetLineage = (options) => (options.client ?? client).get({
|
|
41035
|
+
security: [{
|
|
41036
|
+
key: "media-BearerAuth",
|
|
41037
|
+
scheme: "bearer",
|
|
41038
|
+
type: "http"
|
|
41039
|
+
}],
|
|
41040
|
+
url: "/media/v1/libraries/{library_id}/assets/{asset_id}/lineage",
|
|
41041
|
+
...options
|
|
41042
|
+
});
|
|
41043
|
+
var mediaGenerateImage = (options) => (options.client ?? client).post({
|
|
41044
|
+
security: [{
|
|
41045
|
+
key: "media-BearerAuth",
|
|
41046
|
+
scheme: "bearer",
|
|
41047
|
+
type: "http"
|
|
41048
|
+
}],
|
|
41049
|
+
url: "/media/v1/libraries/{library_id}/images/generations",
|
|
41050
|
+
...options,
|
|
41051
|
+
headers: {
|
|
41052
|
+
"Content-Type": "application/json",
|
|
41053
|
+
...options.headers
|
|
41054
|
+
}
|
|
41055
|
+
});
|
|
41056
|
+
var mediaGenerateVideo = (options) => (options.client ?? client).post({
|
|
41057
|
+
security: [{
|
|
41058
|
+
key: "media-BearerAuth",
|
|
41059
|
+
scheme: "bearer",
|
|
41060
|
+
type: "http"
|
|
41061
|
+
}],
|
|
41062
|
+
url: "/media/v1/libraries/{library_id}/videos/generations",
|
|
41063
|
+
...options,
|
|
41064
|
+
headers: {
|
|
41065
|
+
"Content-Type": "application/json",
|
|
41066
|
+
...options.headers
|
|
41067
|
+
}
|
|
41068
|
+
});
|
|
41069
|
+
var mediaEditAsset = (options) => (options.client ?? client).post({
|
|
41070
|
+
security: [{
|
|
41071
|
+
key: "media-BearerAuth",
|
|
41072
|
+
scheme: "bearer",
|
|
41073
|
+
type: "http"
|
|
41074
|
+
}],
|
|
41075
|
+
url: "/media/v1/libraries/{library_id}/assets/{asset_id}/edits",
|
|
41076
|
+
...options,
|
|
41077
|
+
headers: {
|
|
41078
|
+
"Content-Type": "application/json",
|
|
41079
|
+
...options.headers
|
|
41080
|
+
}
|
|
41081
|
+
});
|
|
41082
|
+
var mediaCreateSpeech = (options) => (options.client ?? client).post({
|
|
41083
|
+
security: [{
|
|
41084
|
+
key: "media-BearerAuth",
|
|
41085
|
+
scheme: "bearer",
|
|
41086
|
+
type: "http"
|
|
41087
|
+
}],
|
|
41088
|
+
url: "/media/v1/libraries/{library_id}/audio/speech",
|
|
41089
|
+
...options,
|
|
41090
|
+
headers: {
|
|
41091
|
+
"Content-Type": "application/json",
|
|
41092
|
+
...options.headers
|
|
41093
|
+
}
|
|
41094
|
+
});
|
|
38876
41095
|
var mediaUnderstandingFailureSummary = (options) => (options.client ?? client).get({
|
|
38877
41096
|
security: [{
|
|
38878
41097
|
key: "media-BearerAuth",
|
|
@@ -40791,6 +43010,118 @@ var studioThemesUpdate = (options) => (options.client ?? client).patch({
|
|
|
40791
43010
|
...options.headers
|
|
40792
43011
|
}
|
|
40793
43012
|
});
|
|
43013
|
+
var studioRenditionsCreate = (options) => (options.client ?? client).post({
|
|
43014
|
+
security: [{
|
|
43015
|
+
key: "BearerAuth",
|
|
43016
|
+
scheme: "bearer",
|
|
43017
|
+
type: "http"
|
|
43018
|
+
}, {
|
|
43019
|
+
key: "ApiKeyAuth",
|
|
43020
|
+
name: "X-API-Key",
|
|
43021
|
+
type: "apiKey"
|
|
43022
|
+
}],
|
|
43023
|
+
url: "/studio/v1/works/{work}/drafts/{draft}/renditions",
|
|
43024
|
+
...options,
|
|
43025
|
+
headers: {
|
|
43026
|
+
"Content-Type": "application/json",
|
|
43027
|
+
...options.headers
|
|
43028
|
+
}
|
|
43029
|
+
});
|
|
43030
|
+
var studioRenditionsList = (options) => (options.client ?? client).get({
|
|
43031
|
+
security: [{
|
|
43032
|
+
key: "BearerAuth",
|
|
43033
|
+
scheme: "bearer",
|
|
43034
|
+
type: "http"
|
|
43035
|
+
}, {
|
|
43036
|
+
key: "ApiKeyAuth",
|
|
43037
|
+
name: "X-API-Key",
|
|
43038
|
+
type: "apiKey"
|
|
43039
|
+
}],
|
|
43040
|
+
url: "/studio/v1/works/{work}/renditions",
|
|
43041
|
+
...options
|
|
43042
|
+
});
|
|
43043
|
+
var studioRenditionsDelete = (options) => (options.client ?? client).delete({
|
|
43044
|
+
security: [{
|
|
43045
|
+
key: "BearerAuth",
|
|
43046
|
+
scheme: "bearer",
|
|
43047
|
+
type: "http"
|
|
43048
|
+
}, {
|
|
43049
|
+
key: "ApiKeyAuth",
|
|
43050
|
+
name: "X-API-Key",
|
|
43051
|
+
type: "apiKey"
|
|
43052
|
+
}],
|
|
43053
|
+
url: "/studio/v1/works/{work}/renditions/{rendition}",
|
|
43054
|
+
...options
|
|
43055
|
+
});
|
|
43056
|
+
var studioRenditionsGet = (options) => (options.client ?? client).get({
|
|
43057
|
+
security: [{
|
|
43058
|
+
key: "BearerAuth",
|
|
43059
|
+
scheme: "bearer",
|
|
43060
|
+
type: "http"
|
|
43061
|
+
}, {
|
|
43062
|
+
key: "ApiKeyAuth",
|
|
43063
|
+
name: "X-API-Key",
|
|
43064
|
+
type: "apiKey"
|
|
43065
|
+
}],
|
|
43066
|
+
url: "/studio/v1/works/{work}/renditions/{rendition}",
|
|
43067
|
+
...options
|
|
43068
|
+
});
|
|
43069
|
+
var studioRenditionsUpdate = (options) => (options.client ?? client).patch({
|
|
43070
|
+
security: [{
|
|
43071
|
+
key: "BearerAuth",
|
|
43072
|
+
scheme: "bearer",
|
|
43073
|
+
type: "http"
|
|
43074
|
+
}, {
|
|
43075
|
+
key: "ApiKeyAuth",
|
|
43076
|
+
name: "X-API-Key",
|
|
43077
|
+
type: "apiKey"
|
|
43078
|
+
}],
|
|
43079
|
+
url: "/studio/v1/works/{work}/renditions/{rendition}",
|
|
43080
|
+
...options,
|
|
43081
|
+
headers: {
|
|
43082
|
+
"Content-Type": "application/json",
|
|
43083
|
+
...options.headers
|
|
43084
|
+
}
|
|
43085
|
+
});
|
|
43086
|
+
var studioRenditionsRender = (options) => (options.client ?? client).post({
|
|
43087
|
+
security: [{
|
|
43088
|
+
key: "BearerAuth",
|
|
43089
|
+
scheme: "bearer",
|
|
43090
|
+
type: "http"
|
|
43091
|
+
}, {
|
|
43092
|
+
key: "ApiKeyAuth",
|
|
43093
|
+
name: "X-API-Key",
|
|
43094
|
+
type: "apiKey"
|
|
43095
|
+
}],
|
|
43096
|
+
url: "/studio/v1/works/{work}/renditions/{rendition}:render",
|
|
43097
|
+
...options
|
|
43098
|
+
});
|
|
43099
|
+
var studioRenditionsPublish = (options) => (options.client ?? client).post({
|
|
43100
|
+
security: [{
|
|
43101
|
+
key: "BearerAuth",
|
|
43102
|
+
scheme: "bearer",
|
|
43103
|
+
type: "http"
|
|
43104
|
+
}, {
|
|
43105
|
+
key: "ApiKeyAuth",
|
|
43106
|
+
name: "X-API-Key",
|
|
43107
|
+
type: "apiKey"
|
|
43108
|
+
}],
|
|
43109
|
+
url: "/studio/v1/works/{work}/renditions/{rendition}:publish",
|
|
43110
|
+
...options
|
|
43111
|
+
});
|
|
43112
|
+
var studioRenditionsContentUrl = (options) => (options.client ?? client).get({
|
|
43113
|
+
security: [{
|
|
43114
|
+
key: "BearerAuth",
|
|
43115
|
+
scheme: "bearer",
|
|
43116
|
+
type: "http"
|
|
43117
|
+
}, {
|
|
43118
|
+
key: "ApiKeyAuth",
|
|
43119
|
+
name: "X-API-Key",
|
|
43120
|
+
type: "apiKey"
|
|
43121
|
+
}],
|
|
43122
|
+
url: "/studio/v1/works/{work}/renditions/{rendition}/content",
|
|
43123
|
+
...options
|
|
43124
|
+
});
|
|
40794
43125
|
var vaultListVaults = (options) => (options?.client ?? client).get({
|
|
40795
43126
|
security: [{
|
|
40796
43127
|
key: "vault-bearerAuth",
|
|
@@ -42248,8 +44579,49 @@ function createDatabase(transport) {
|
|
|
42248
44579
|
}
|
|
42249
44580
|
function createDevops(transport) {
|
|
42250
44581
|
return {
|
|
44582
|
+
environments: {
|
|
44583
|
+
checkpoints: {
|
|
44584
|
+
list: bind(transport, devopsEnvironmentsCheckpointsList)
|
|
44585
|
+
}
|
|
44586
|
+
},
|
|
44587
|
+
flags: {
|
|
44588
|
+
archive: bind(transport, devopsFlagsArchive),
|
|
44589
|
+
conclude: bind(transport, devopsFlagsConclude),
|
|
44590
|
+
environments: {
|
|
44591
|
+
update: bind(transport, devopsFlagsUpdateEnvironment)
|
|
44592
|
+
},
|
|
44593
|
+
retrieve: bind(transport, devopsFlagsGet),
|
|
44594
|
+
update: bind(transport, devopsFlagsUpdate)
|
|
44595
|
+
},
|
|
44596
|
+
progressiveRollouts: {
|
|
44597
|
+
create: bind(transport, devopsProgressiveRolloutsCreate),
|
|
44598
|
+
pause: bind(transport, devopsProgressiveRolloutsPause),
|
|
44599
|
+
resume: bind(transport, devopsProgressiveRolloutsResume),
|
|
44600
|
+
retrieve: bind(transport, devopsProgressiveRolloutsGet),
|
|
44601
|
+
rollback: bind(transport, devopsProgressiveRolloutsRollback)
|
|
44602
|
+
},
|
|
42251
44603
|
projects: {
|
|
44604
|
+
environments: {
|
|
44605
|
+
list: bind(transport, devopsEnvironmentsList)
|
|
44606
|
+
},
|
|
44607
|
+
flags: {
|
|
44608
|
+
create: bind(transport, devopsFlagsCreate),
|
|
44609
|
+
list: bind(transport, devopsFlagsList)
|
|
44610
|
+
},
|
|
44611
|
+
list: bind(transport, devopsProjectsList),
|
|
44612
|
+
promotions: {
|
|
44613
|
+
list: bind(transport, devopsPromotionsList)
|
|
44614
|
+
},
|
|
44615
|
+
releases: {
|
|
44616
|
+
create: bind(transport, devopsReleasesCreate),
|
|
44617
|
+
list: bind(transport, devopsReleasesList)
|
|
44618
|
+
},
|
|
44619
|
+
retrieve: bind(transport, devopsProjectsGet),
|
|
42252
44620
|
retrieveTestCatalog: bind(transport, devopsTestCatalogGet),
|
|
44621
|
+
targets: {
|
|
44622
|
+
list: bind(transport, devopsTargetsList),
|
|
44623
|
+
refresh: bind(transport, devopsTargetsRefresh)
|
|
44624
|
+
},
|
|
42253
44625
|
testCases: {
|
|
42254
44626
|
list: bind(transport, devopsTestCasesList)
|
|
42255
44627
|
},
|
|
@@ -42268,6 +44640,24 @@ function createDevops(transport) {
|
|
|
42268
44640
|
list: bind(transport, devopsTestSuitesList)
|
|
42269
44641
|
}
|
|
42270
44642
|
},
|
|
44643
|
+
promotions: {
|
|
44644
|
+
approve: bind(transport, devopsPromotionsApprove),
|
|
44645
|
+
cancel: bind(transport, devopsPromotionsCancel),
|
|
44646
|
+
conclude: bind(transport, devopsPromotionsConclude),
|
|
44647
|
+
create: bind(transport, devopsPromotionsCreate),
|
|
44648
|
+
retrieve: bind(transport, devopsPromotionsGet),
|
|
44649
|
+
retry: bind(transport, devopsPromotionsRetry),
|
|
44650
|
+
rollouts: {
|
|
44651
|
+
list: bind(transport, devopsRolloutsList)
|
|
44652
|
+
}
|
|
44653
|
+
},
|
|
44654
|
+
releases: {
|
|
44655
|
+
abandon: bind(transport, devopsReleasesAbandon),
|
|
44656
|
+
retrieve: bind(transport, devopsReleasesGet)
|
|
44657
|
+
},
|
|
44658
|
+
rollouts: {
|
|
44659
|
+
retrieve: bind(transport, devopsRolloutsGet)
|
|
44660
|
+
},
|
|
42271
44661
|
testCases: {
|
|
42272
44662
|
retrieve: bind(transport, devopsTestCasesGet)
|
|
42273
44663
|
},
|
|
@@ -42366,11 +44756,18 @@ function createKnowledge(transport) {
|
|
|
42366
44756
|
}
|
|
42367
44757
|
function createMedia(transport) {
|
|
42368
44758
|
return {
|
|
44759
|
+
assets: {
|
|
44760
|
+
edit: bind(transport, mediaEditAsset),
|
|
44761
|
+
lineage: bind(transport, mediaGetAssetLineage)
|
|
44762
|
+
},
|
|
42369
44763
|
generation: {
|
|
42370
44764
|
capabilities: {
|
|
42371
44765
|
list: bind(transport, mediaGetGenerationCapabilities)
|
|
42372
44766
|
}
|
|
42373
44767
|
},
|
|
44768
|
+
images: {
|
|
44769
|
+
generate: bind(transport, mediaGenerateImage)
|
|
44770
|
+
},
|
|
42374
44771
|
libraries: {
|
|
42375
44772
|
assets: {
|
|
42376
44773
|
batch: bind(transport, mediaBatchAssets),
|
|
@@ -42426,6 +44823,7 @@ function createMedia(transport) {
|
|
|
42426
44823
|
},
|
|
42427
44824
|
restore: bind(transport, mediaRestoreLibrary),
|
|
42428
44825
|
retrieve: bind(transport, mediaGetLibrary),
|
|
44826
|
+
retrieveDefault: bind(transport, mediaGetDefaultLibrary),
|
|
42429
44827
|
search: {
|
|
42430
44828
|
create: bind(transport, mediaSearch),
|
|
42431
44829
|
expression: {
|
|
@@ -42438,11 +44836,18 @@ function createMedia(transport) {
|
|
|
42438
44836
|
create: bind(transport, mediaVisualSearch)
|
|
42439
44837
|
}
|
|
42440
44838
|
},
|
|
44839
|
+
setDefault: bind(transport, mediaSetDefaultLibrary),
|
|
42441
44840
|
understandings: {
|
|
42442
44841
|
list: bindPage(transport, mediaListUnderstandingsByLibrary),
|
|
42443
44842
|
retrieveFailureSummary: bind(transport, mediaUnderstandingFailureSummary)
|
|
42444
44843
|
},
|
|
42445
44844
|
update: bind(transport, mediaUpdateLibrary)
|
|
44845
|
+
},
|
|
44846
|
+
speech: {
|
|
44847
|
+
create: bind(transport, mediaCreateSpeech)
|
|
44848
|
+
},
|
|
44849
|
+
videos: {
|
|
44850
|
+
generate: bind(transport, mediaGenerateVideo)
|
|
42446
44851
|
}
|
|
42447
44852
|
};
|
|
42448
44853
|
}
|
|
@@ -42746,6 +45151,9 @@ function createStudio(transport) {
|
|
|
42746
45151
|
create: bind(transport, studioDraftsCreate),
|
|
42747
45152
|
list: bind(transport, studioDraftsList),
|
|
42748
45153
|
rebase: bind(transport, studioDraftsRebase),
|
|
45154
|
+
renditions: {
|
|
45155
|
+
create: bind(transport, studioRenditionsCreate)
|
|
45156
|
+
},
|
|
42749
45157
|
retrieve: bind(transport, studioDraftsGet),
|
|
42750
45158
|
retrieveExport: bind(transport, studioDraftsExport),
|
|
42751
45159
|
retrieveOutline: bind(transport, studioDraftsOutline),
|
|
@@ -42761,6 +45169,15 @@ function createStudio(transport) {
|
|
|
42761
45169
|
update: bind(transport, studioDraftsUpdate)
|
|
42762
45170
|
},
|
|
42763
45171
|
list: bind(transport, studioWorksList),
|
|
45172
|
+
renditions: {
|
|
45173
|
+
delete: bind(transport, studioRenditionsDelete),
|
|
45174
|
+
list: bind(transport, studioRenditionsList),
|
|
45175
|
+
publish: bind(transport, studioRenditionsPublish),
|
|
45176
|
+
render: bind(transport, studioRenditionsRender),
|
|
45177
|
+
retrieve: bind(transport, studioRenditionsGet),
|
|
45178
|
+
retrieveContent: bind(transport, studioRenditionsContentUrl),
|
|
45179
|
+
update: bind(transport, studioRenditionsUpdate)
|
|
45180
|
+
},
|
|
42764
45181
|
resolve: bind(transport, studioWorksResolve),
|
|
42765
45182
|
retrieve: bind(transport, studioWorksGet),
|
|
42766
45183
|
units: {
|
|
@@ -43007,9 +45424,22 @@ function defaultReadFile(path) {
|
|
|
43007
45424
|
return null;
|
|
43008
45425
|
}
|
|
43009
45426
|
}
|
|
45427
|
+
function credentialsEnv(env) {
|
|
45428
|
+
const declared = nonEmpty(env.PRAXIS_ENV);
|
|
45429
|
+
if (declared && /^[A-Za-z0-9_-]+$/.test(declared))
|
|
45430
|
+
return declared;
|
|
45431
|
+
const apiUrl = nonEmpty(env.PRAXIS_API_URL);
|
|
45432
|
+
if (apiUrl) {
|
|
45433
|
+
try {
|
|
45434
|
+
if (new URL(apiUrl).hostname.includes("-develop."))
|
|
45435
|
+
return "develop";
|
|
45436
|
+
} catch {}
|
|
45437
|
+
}
|
|
45438
|
+
return "production";
|
|
45439
|
+
}
|
|
43010
45440
|
function credentialsPath(env) {
|
|
43011
45441
|
const home = nonEmpty(env.HOME) ?? nonEmpty(env.USERPROFILE);
|
|
43012
|
-
return home ? `${home.replace(
|
|
45442
|
+
return home ? `${home.replace(/[/\\]+$/, "")}/.praxis/cli/${credentialsEnv(env)}.json` : null;
|
|
43013
45443
|
}
|
|
43014
45444
|
function resolveDefaultCredentials(env = globalThis.process?.env ?? {}, readFile = defaultReadFile) {
|
|
43015
45445
|
const envToken = nonEmpty(env.PRAXIS_API_TOKEN);
|
|
@@ -43022,7 +45452,7 @@ function resolveDefaultCredentials(env = globalThis.process?.env ?? {}, readFile
|
|
|
43022
45452
|
return envUrl ? { apiUrl: envUrl } : {};
|
|
43023
45453
|
try {
|
|
43024
45454
|
const file = JSON.parse(text);
|
|
43025
|
-
const token = nonEmpty(file.
|
|
45455
|
+
const token = nonEmpty(file.access_token);
|
|
43026
45456
|
const apiUrl = envUrl ?? nonEmpty(file.api_url);
|
|
43027
45457
|
return { ...token ? { token } : {}, ...apiUrl ? { apiUrl } : {} };
|
|
43028
45458
|
} catch {
|
|
@@ -44735,6 +47165,7 @@ var workflows = [
|
|
|
44735
47165
|
{ words: ["app", "rollback"], usage: "app rollback [--dir <path>] [--to <version_id>]", summary: "Deploy the previous version again (or --to a given version) and wait until it is active.", example: "praxis app rollback --to <version_id>" },
|
|
44736
47166
|
{ words: ["devops", "deploy", "plan"], usage: "devops deploy plan [--env <name>] [--since <commit>]", summary: "Plan this repository's deploy: the targets by dependency layer, and with --since the ones a change touches. Local facts only — no login, no request.", example: "praxis devops deploy plan --env develop --since HEAD~1" },
|
|
44737
47167
|
{ words: ["devops", "test", "run"], usage: "devops test run --remote [--project <dvp_…>] [--no-wait] [--repeat <n>] [--select <kind:value>]", summary: "Run the DevOps test selection for the pushed HEAD on the Praxis cloud, wait for the verdict and list the failed cases.", example: "praxis devops test run --remote --select smoke" },
|
|
47168
|
+
{ words: ["canvas", "import"], usage: "canvas import <file.pen> [--name <name>] [--canvas <cvs_…> --yes] [--frames <id,id>] [--image-root <dir>] [--dry-run]", summary: "Import a Pencil .pen file as a canvas, uploading the images it references first.", example: 'praxis canvas import design.pen --name "Landing page"' },
|
|
44738
47169
|
{ words: ["skill"], usage: "skill [--install <dir>]", summary: "Print the AI skill, or write <dir>/praxis-cli/SKILL.md." }
|
|
44739
47170
|
];
|
|
44740
47171
|
var workflowNouns = [...new Set(workflows.filter((w) => w.words.length > 1).map((w) => w.words[0]))];
|
|
@@ -44901,6 +47332,10 @@ function loadTokens(path) {
|
|
|
44901
47332
|
return null;
|
|
44902
47333
|
}
|
|
44903
47334
|
}
|
|
47335
|
+
function loadManagedLogin(path) {
|
|
47336
|
+
const stored = loadTokens(path);
|
|
47337
|
+
return stored?.managed === true ? stored : null;
|
|
47338
|
+
}
|
|
44904
47339
|
function deleteTokens(path) {
|
|
44905
47340
|
if (!existsSync(path))
|
|
44906
47341
|
return false;
|
|
@@ -44913,6 +47348,10 @@ function createTokenStore(env, path = tokenPath(env), secret = systemSecretStore
|
|
|
44913
47348
|
location: () => location,
|
|
44914
47349
|
async load() {
|
|
44915
47350
|
const file = loadTokens(path);
|
|
47351
|
+
if (file?.managed === true) {
|
|
47352
|
+
location = `file ${path}`;
|
|
47353
|
+
return file;
|
|
47354
|
+
}
|
|
44916
47355
|
if (file) {
|
|
44917
47356
|
await session.save(file);
|
|
44918
47357
|
return file;
|
|
@@ -44931,6 +47370,8 @@ function createTokenStore(env, path = tokenPath(env), secret = systemSecretStore
|
|
|
44931
47370
|
}
|
|
44932
47371
|
},
|
|
44933
47372
|
async save(tokens) {
|
|
47373
|
+
if (tokens.managed === true || loadManagedLogin(path))
|
|
47374
|
+
throw new PraxisError({ code: "MANAGED_LOGIN_READ_ONLY", message: `This machine has a managed login (${path}) that the platform renews; it is already signed in and cannot be replaced locally.` });
|
|
44934
47375
|
try {
|
|
44935
47376
|
await secret.set(env, JSON.stringify(tokens));
|
|
44936
47377
|
} catch {
|
|
@@ -44941,6 +47382,8 @@ function createTokenStore(env, path = tokenPath(env), secret = systemSecretStore
|
|
|
44941
47382
|
return location = "keychain";
|
|
44942
47383
|
},
|
|
44943
47384
|
async delete() {
|
|
47385
|
+
if (loadManagedLogin(path))
|
|
47386
|
+
throw new PraxisError({ code: "MANAGED_LOGIN_READ_ONLY", message: `This machine has a managed login (${path}) that the platform renews, so there is nothing to log out of here.` });
|
|
44944
47387
|
let removed = false;
|
|
44945
47388
|
try {
|
|
44946
47389
|
removed = await secret.delete(env);
|
|
@@ -45120,8 +47563,15 @@ async function withLock(lockPath, run, ports = {}) {
|
|
|
45120
47563
|
}
|
|
45121
47564
|
|
|
45122
47565
|
// src/auth/credentials.ts
|
|
45123
|
-
function
|
|
45124
|
-
return
|
|
47566
|
+
function apiKeyVariable(env) {
|
|
47567
|
+
return env === "develop" ? "PRAXIS_API_KEY_DEVELOP" : "PRAXIS_API_KEY";
|
|
47568
|
+
}
|
|
47569
|
+
function credentialSource(vars, env, readManaged) {
|
|
47570
|
+
if (vars[apiKeyVariable(env)])
|
|
47571
|
+
return "api-key";
|
|
47572
|
+
if (vars.PRAXIS_API_TOKEN)
|
|
47573
|
+
return "machine-token";
|
|
47574
|
+
return readManaged() ? "managed-login" : "login";
|
|
45125
47575
|
}
|
|
45126
47576
|
async function identityRpc(config, fetchImpl, method, params, token) {
|
|
45127
47577
|
const response = await fetchImpl(`${config.gatewayUrl}/rpc/practice-identity`, {
|
|
@@ -45151,8 +47601,10 @@ function jwtFetch(fetchImpl, token) {
|
|
|
45151
47601
|
function credentials(config, vars, ports) {
|
|
45152
47602
|
const path = ports.path ?? tokenPath(config.env);
|
|
45153
47603
|
const store = ports.store ?? createTokenStore(config.env, path, ports.secretStore);
|
|
45154
|
-
const
|
|
45155
|
-
const
|
|
47604
|
+
const readManagedLogin = ports.readManagedLogin ?? (() => loadManagedLogin(path));
|
|
47605
|
+
const source = credentialSource(vars, config.env, () => readManagedLogin() !== null);
|
|
47606
|
+
const keyVariable = apiKeyVariable(config.env);
|
|
47607
|
+
const apiKey = vars[keyVariable];
|
|
45156
47608
|
const machineToken = source === "machine-token" ? vars.PRAXIS_API_TOKEN : undefined;
|
|
45157
47609
|
const remember = ports.remember ?? (() => {});
|
|
45158
47610
|
if (apiKey)
|
|
@@ -45164,10 +47616,20 @@ function credentials(config, vars, ports) {
|
|
|
45164
47616
|
let pending;
|
|
45165
47617
|
const requireLogin = () => {
|
|
45166
47618
|
if (apiKey)
|
|
45167
|
-
throw new UsageError("The API Key determines the organization; listing or switching login organizations is unavailable.",
|
|
47619
|
+
throw new UsageError("The API Key determines the organization; listing or switching login organizations is unavailable.", `Unset ${keyVariable} and run \`praxis login\`, then retry the org command.`);
|
|
45168
47620
|
if (machineToken)
|
|
45169
47621
|
throw new UsageError("The machine token determines the organization; listing or switching login organizations is unavailable.", "Unset PRAXIS_API_TOKEN and run `praxis login`, then retry the org command.");
|
|
47622
|
+
if (source === "managed-login")
|
|
47623
|
+
throw new UsageError("The managed login determines the organization; listing or switching login organizations is unavailable.", "Run `praxis login` on your own computer, then retry the org command.");
|
|
45170
47624
|
};
|
|
47625
|
+
function managedCredential(first) {
|
|
47626
|
+
const stale = (stored) => stored.expires_at - REFRESH_SKEW_MS <= ports.now();
|
|
47627
|
+
const current = stale(first) ? readManagedLogin() ?? first : first;
|
|
47628
|
+
if (stale(current))
|
|
47629
|
+
throw new PraxisError({ code: "MANAGED_LOGIN_EXPIRED", message: "Managed login expired; the platform renews it — retry in a minute, or run praxis login" });
|
|
47630
|
+
remember(current.access_token);
|
|
47631
|
+
return { source: "managed-login", storedIn: `file ${path}`, token: current.access_token, expiresAt: current.expires_at, ...current.organization_id ? { organizationId: current.organization_id } : {} };
|
|
47632
|
+
}
|
|
45171
47633
|
async function exchange(organizationId) {
|
|
45172
47634
|
const stored = await store.load();
|
|
45173
47635
|
if (stored) {
|
|
@@ -45188,7 +47650,7 @@ function credentials(config, vars, ports) {
|
|
|
45188
47650
|
async function get(org) {
|
|
45189
47651
|
if (apiKey) {
|
|
45190
47652
|
if (org)
|
|
45191
|
-
throw new UsageError("--org cannot override an API Key organization",
|
|
47653
|
+
throw new UsageError("--org cannot override an API Key organization", `Remove --org or unset ${keyVariable} and run \`praxis login\`.`);
|
|
45192
47654
|
return { source: "api-key", token: apiKey };
|
|
45193
47655
|
}
|
|
45194
47656
|
if (machineToken) {
|
|
@@ -45196,6 +47658,12 @@ function credentials(config, vars, ports) {
|
|
|
45196
47658
|
throw new UsageError("--org cannot override a machine token organization", "Remove --org or unset PRAXIS_API_TOKEN and run `praxis login`.");
|
|
45197
47659
|
return { source: "machine-token", token: machineToken };
|
|
45198
47660
|
}
|
|
47661
|
+
const managed = readManagedLogin();
|
|
47662
|
+
if (managed) {
|
|
47663
|
+
if (org)
|
|
47664
|
+
throw new UsageError("--org cannot override a managed login organization", "Remove --org; the managed login and its organization come from the platform.");
|
|
47665
|
+
return managedCredential(managed);
|
|
47666
|
+
}
|
|
45199
47667
|
const stored = await store.load();
|
|
45200
47668
|
const selected = org ?? stored?.organization_id;
|
|
45201
47669
|
const opaqueFresh = stored !== null && stored.expires_at - 30000 > ports.now();
|
|
@@ -45271,13 +47739,13 @@ function skillDocument(commands) {
|
|
|
45271
47739
|
"## General rules",
|
|
45272
47740
|
"",
|
|
45273
47741
|
"- Select the environment only with `PRAXIS_ENV`; there is no `--env` option. The dev package defaults to develop.",
|
|
45274
|
-
"- Authenticate with `PRAXIS_API_KEY
|
|
47742
|
+
"- Authenticate with the API key of the environment (`PRAXIS_API_KEY` for production, `PRAXIS_API_KEY_DEVELOP` for develop; a key only works in the environment that issued it), `PRAXIS_API_TOKEN` (a machine token, sent in the Authorization header) or the stored login, in that order. On a computer the platform manages you are already signed in: it writes the login file (`~/.praxis/cli/<env>.json`, marked `managed`) that the CLI and the SDK read, and it renews that file before the token expires — never run `praxis login` there. On your own computer `praxis login` writes the same file through a browser device code. Login saves the session even when an environment credential takes precedence; unset the named variable in its warning to use the saved login. API keys, machine tokens and managed logins determine the organization; a personal login session can use `--org <organization_id>`. `PRAXIS_API_URL` overrides the API base and must be an https deepraxis.com URL.",
|
|
45275
47743
|
"- AI mode is enabled automatically in supported agent environments. Use `--format agent` to select it explicitly.",
|
|
45276
47744
|
"- Use `--json` for the complete JSON response without presentation truncation. Successful JSON output goes to stdout; errors go to stderr.",
|
|
45277
47745
|
"- Supply bodies with `--data JSON`, `--data @file.json`, or `--data -` for stdin. Scalar field options override matching JSON fields. Structured fields require `--data`. Multipart binary fields accept local file paths (or @paths), with repeatable flags for arrays. A binary field named data uses `--data <path>` instead of JSON.",
|
|
45278
47746
|
"- Deletion requires `--yes` in AI mode. Confirm the intended resource before using it.",
|
|
45279
47747
|
"- Use `--limit N` to limit a server page for SDK-paginated commands. Other lists apply it only to displayed rows; `--param-limit` still sends the API parameter when available. `--all` follows supported pagination and cannot be combined with `--limit`.",
|
|
45280
|
-
"- Error JSON has an `error` object: `code` identifies the failure, `message` describes it, `hint` suggests recovery, `env` identifies the environment, `command` identifies the command, `status` is the HTTP status, and `request_id` correlates diagnostics. Authentication failures also include `credential_source` (api-key, machine-token, or login); follow the source-specific hint. Unavailable fields are null. Exit codes: 0 success, 1 runtime/API error, 2 usage error.",
|
|
47748
|
+
"- Error JSON has an `error` object: `code` identifies the failure, `message` describes it, `hint` suggests recovery, `env` identifies the environment, `command` identifies the command, `status` is the HTTP status, and `request_id` correlates diagnostics. Authentication failures also include `credential_source` (api-key, machine-token, managed-login, or login); follow the source-specific hint. Unavailable fields are null. Exit codes: 0 success, 1 runtime/API error, 2 usage error.",
|
|
45281
47749
|
"- Append `--help` to a command for its optional parameters. Required scalar body options below can also be supplied as fields in `--data`.",
|
|
45282
47750
|
"- Two layers: top-level commands (`login`, `org`, `skill`, …) are workflows and session commands; every API operation is under `praxis api <domain> …`. `praxis api <METHOD> <path>` sends a raw request (the method is uppercase).",
|
|
45283
47751
|
"",
|
|
@@ -45305,7 +47773,22 @@ function skillDocument(commands) {
|
|
|
45305
47773
|
"- `--select` narrows the run: `tag:<tag>` (a bare word reads as a tag), `package:<path>`, `suite:<path>`, `file:<path>`. `--repeat N` runs each selected case N times (a flake then shows up as flaky, not as a failure).",
|
|
45306
47774
|
"- The run waits by default and polls every 5s; `--no-wait` returns as soon as the run exists, with `result` still `pending`.",
|
|
45307
47775
|
"- Exit code 0 means the verdict passed (or is still pending); 1 means failed, errored, cancelled or timed out — the failed cases are listed, up to 20, with the run URL for the rest; 2 is a usage error.",
|
|
45308
|
-
"- The run URL is on the Console of the environment the CLI talks to; the run id is also on stdout with `--json`."
|
|
47776
|
+
"- The run URL is on the Console of the environment the CLI talks to; the run id is also on stdout with `--json`.",
|
|
47777
|
+
"",
|
|
47778
|
+
"## canvas import (workflow)",
|
|
47779
|
+
"",
|
|
47780
|
+
"Import a Pencil `.pen` file as a canvas, uploading the images it references first:",
|
|
47781
|
+
"",
|
|
47782
|
+
"- Use it for a `.pen` file on this machine. The canvas API itself only takes nodes that already point at platform file ids, and a codemode program runs in the cloud where it cannot read your files — this command is the local half.",
|
|
47783
|
+
"- Node ids, component references, variables and themes are preserved as written: the file imports as it is, not as a redraw.",
|
|
47784
|
+
"- `--name <name>` names a new canvas (default: the file name without `.pen`). `--canvas <cvs_…>` imports into an existing canvas instead, which **clears every node already on it** — that is why it also requires `--yes`.",
|
|
47785
|
+
"- `--frames <id,id>` imports only these top-level nodes, in document order. The top-level nodes their `ref`s need come along automatically and are listed as `added`.",
|
|
47786
|
+
"- Images: an image fill must name a platform file id (`file-…`). Each non-`file-` url is looked up beside the `.pen` file, then under each `--image-root <dir>` (repeatable), then by file name under each root, and uploaded with a signed URL. Identical content uploads once.",
|
|
47787
|
+
"- An image that is not found locally is **not** a failure: it is listed under `images.missing` and `warnings` and the import continues. The canvas then shows a placeholder there — fix the path and re-import rather than leaving it.",
|
|
47788
|
+
"- `--dry-run` reads the local file and prints the plan (top-level nodes, added dependencies, node count, images found/missing, chunk count) without logging in or sending any request. Use it to check a document before it reaches a canvas.",
|
|
47789
|
+
"- Large documents go up in chunks of at most 1.5 M JSON characters; the first chunk resets the canvas and carries the variables and themes. The command is not atomic across chunks: a failure part-way leaves what already arrived, so re-run it (`--canvas … --yes` replaces the whole canvas).",
|
|
47790
|
+
"- Exit code 0 means the import completed, warnings included; 2 is a usage error (missing `--yes` with `--canvas`, an unreadable or non-`.pen` file).",
|
|
47791
|
+
"- `--format json` prints `{ canvas_id, viewer_url, revision, frames, added, nodes, images: { uploaded, reused, missing }, chunks, warnings, dry_run }`. Warnings are `FRAME_NOT_FOUND`, `REF_DANGLING`, `IMAGE_UNMAPPED` (planned) and `UNSUPPORTED_IMAGE_URL` (the service could not resolve one)."
|
|
45309
47792
|
];
|
|
45310
47793
|
let domain;
|
|
45311
47794
|
for (const command of commands) {
|
|
@@ -45429,7 +47912,7 @@ Enter code: ${code.user_code}` });
|
|
|
45429
47912
|
const location = await (ports.store ?? createTokenStore(config.env, path)).save(toStored(flow.tokens, ports.now()));
|
|
45430
47913
|
if (location !== "keychain")
|
|
45431
47914
|
ports.emit({ kind: "message", channel: "stderr", text: "stored in a file (no system keychain available)" });
|
|
45432
|
-
const shadowedBy = ports.source === "api-key" ?
|
|
47915
|
+
const shadowedBy = ports.source === "api-key" ? apiKeyVariable(config.env) : ports.source === "machine-token" ? "PRAXIS_API_TOKEN" : undefined;
|
|
45433
47916
|
ports.emit({ kind: "message", text: `Logged in (${config.env}).` });
|
|
45434
47917
|
if (shadowedBy)
|
|
45435
47918
|
ports.emit({ kind: "message", channel: "stderr", text: `Note: ${shadowedBy} is set and takes precedence over this login. Unset it (unset ${shadowedBy}) to use the login.` });
|
|
@@ -45446,7 +47929,7 @@ async function whoami(auth, env, org) {
|
|
|
45446
47929
|
source: credential.source,
|
|
45447
47930
|
...credential.storedIn ? { "stored in": credential.storedIn } : {},
|
|
45448
47931
|
expires_at: credential.expiresAt ? new Date(credential.expiresAt).toISOString() : null,
|
|
45449
|
-
...credential.source === "api-key" ? { note: "The API key determines the organization." } : credential.source === "machine-token" ? { note: "The machine token determines the organization." } : {}
|
|
47932
|
+
...credential.source === "api-key" ? { note: "The API key determines the organization." } : credential.source === "machine-token" ? { note: "The machine token determines the organization." } : credential.source === "managed-login" ? { note: "The managed login determines the organization; the platform renews it." } : {}
|
|
45450
47933
|
};
|
|
45451
47934
|
}
|
|
45452
47935
|
|
|
@@ -46121,6 +48604,13 @@ function workerNameOf(config) {
|
|
|
46121
48604
|
const name = config?.name;
|
|
46122
48605
|
return typeof name === "string" && name !== "" ? name : undefined;
|
|
46123
48606
|
}
|
|
48607
|
+
function productionBlockOf(config) {
|
|
48608
|
+
const env = config?.env;
|
|
48609
|
+
if (env === null || typeof env !== "object")
|
|
48610
|
+
return;
|
|
48611
|
+
const block = env.production;
|
|
48612
|
+
return block !== null && typeof block === "object" ? block : undefined;
|
|
48613
|
+
}
|
|
46124
48614
|
function bindingReferences(config) {
|
|
46125
48615
|
const references = [];
|
|
46126
48616
|
const own = workerNameOf(config);
|
|
@@ -46200,18 +48690,23 @@ function packageManifestOf(text) {
|
|
|
46200
48690
|
return null;
|
|
46201
48691
|
const name = parsed.name;
|
|
46202
48692
|
const dependencies = new Set;
|
|
46203
|
-
|
|
48693
|
+
const devOnly = new Set;
|
|
48694
|
+
for (const field of ["dependencies", "peerDependencies", "optionalDependencies", "devDependencies"]) {
|
|
46204
48695
|
const block = parsed[field];
|
|
46205
48696
|
if (block === null || typeof block !== "object" || Array.isArray(block))
|
|
46206
48697
|
continue;
|
|
46207
48698
|
for (const [dependency, version] of Object.entries(block)) {
|
|
46208
|
-
if (typeof version
|
|
46209
|
-
|
|
48699
|
+
if (typeof version !== "string" || !version.startsWith("workspace:") || dependencies.has(dependency))
|
|
48700
|
+
continue;
|
|
48701
|
+
dependencies.add(dependency);
|
|
48702
|
+
if (field === "devDependencies")
|
|
48703
|
+
devOnly.add(dependency);
|
|
46210
48704
|
}
|
|
46211
48705
|
}
|
|
46212
48706
|
return {
|
|
46213
48707
|
...typeof name === "string" && name !== "" ? { name } : {},
|
|
46214
|
-
workspaceDependencies: [...dependencies].sort()
|
|
48708
|
+
workspaceDependencies: [...dependencies].sort(),
|
|
48709
|
+
devOnlyWorkspaceDependencies: [...devOnly].sort()
|
|
46215
48710
|
};
|
|
46216
48711
|
}
|
|
46217
48712
|
function lifecycleOf(text) {
|
|
@@ -46390,7 +48885,8 @@ var WORKSPACE_PASSES = Symbol("deploy-core.workspace-passes");
|
|
|
46390
48885
|
async function readWorkspacesOnce(facts, options) {
|
|
46391
48886
|
const tree = new Set(facts.tree);
|
|
46392
48887
|
const index = await workspaceIndexOf(facts, options);
|
|
46393
|
-
|
|
48888
|
+
const limit = options.readConcurrency !== undefined && options.readConcurrency >= 1 ? Math.floor(options.readConcurrency) : READ_CONCURRENCY;
|
|
48889
|
+
return await mapBounded(index.packages, limit, async (entry) => {
|
|
46394
48890
|
const manifest = manifestPathIn(entry.dir, tree);
|
|
46395
48891
|
const [manifestText, configText] = await Promise.all([
|
|
46396
48892
|
facts.read(entry.packageJson),
|
|
@@ -46405,7 +48901,8 @@ async function readWorkspacesOnce(facts, options) {
|
|
|
46405
48901
|
config,
|
|
46406
48902
|
...workerNameOf(config) === undefined ? {} : { workerName: workerNameOf(config) },
|
|
46407
48903
|
lifecycle: lifecycleOf(manifestText),
|
|
46408
|
-
workspaceDependencies: pkg?.workspaceDependencies ?? []
|
|
48904
|
+
workspaceDependencies: pkg?.workspaceDependencies ?? [],
|
|
48905
|
+
devOnlyWorkspaceDependencies: pkg?.devOnlyWorkspaceDependencies ?? []
|
|
46409
48906
|
};
|
|
46410
48907
|
});
|
|
46411
48908
|
}
|
|
@@ -46447,7 +48944,9 @@ function workspaceCloudflareProvider(options = {}) {
|
|
|
46447
48944
|
name: workspace.packageName ?? (workspace.dir === "." ? "app" : workspace.dir.split("/").at(-1)),
|
|
46448
48945
|
destination: "cloudflare",
|
|
46449
48946
|
...workspace.workerName === undefined ? {} : { workerName: workspace.workerName },
|
|
46450
|
-
...environments === undefined ? {} : { environments }
|
|
48947
|
+
...environments === undefined ? {} : { environments },
|
|
48948
|
+
production: productionBlockOf(workspace.config) !== undefined,
|
|
48949
|
+
onTrain: lifecycle?.train !== false
|
|
46451
48950
|
});
|
|
46452
48951
|
}
|
|
46453
48952
|
return { targets: [...partial.targets, ...targets] };
|
|
@@ -46496,19 +48995,50 @@ function closePlan(drafts, workspaces) {
|
|
|
46496
48995
|
const configOf = new Map(workspaces.map((workspace) => [workspace.dir, workspace.config]));
|
|
46497
48996
|
const edges = wranglerEdges(drafts.map((draft) => ({ id: draft.path, config: configOf.get(draft.path) ?? null })));
|
|
46498
48997
|
const byName = directoriesOfPackageNames(workspaces);
|
|
46499
|
-
const dependenciesOf = (dir) =>
|
|
48998
|
+
const dependenciesOf = (dir) => {
|
|
48999
|
+
const workspace = workspaces.find((entry) => entry.dir === dir);
|
|
49000
|
+
if (workspace === undefined)
|
|
49001
|
+
return [];
|
|
49002
|
+
const devOnly = new Set(workspace.devOnlyWorkspaceDependencies ?? []);
|
|
49003
|
+
return workspace.workspaceDependencies.filter((name) => {
|
|
49004
|
+
if (!devOnly.has(name))
|
|
49005
|
+
return true;
|
|
49006
|
+
const path = byName.get(name);
|
|
49007
|
+
return path === undefined || !isDeployToolDependency(name, path);
|
|
49008
|
+
});
|
|
49009
|
+
};
|
|
46500
49010
|
return drafts.map((draft) => ({
|
|
46501
49011
|
path: draft.path,
|
|
46502
49012
|
name: draft.name,
|
|
46503
49013
|
destination: draft.destination,
|
|
46504
49014
|
dependsOn: edges.get(draft.path) ?? [],
|
|
46505
49015
|
...draft.environments === undefined ? {} : { environments: draft.environments },
|
|
49016
|
+
production: draft.production === true,
|
|
49017
|
+
onTrain: draft.onTrain !== false,
|
|
46506
49018
|
workspaceDeps: workspaceClosureOf(draft.path, byName, dependenciesOf)
|
|
46507
49019
|
})).sort((a, b) => a.path.localeCompare(b.path));
|
|
46508
49020
|
}
|
|
49021
|
+
function isDeployToolDependency(name, path) {
|
|
49022
|
+
const directory = path.replace(/^(\.\/)+/, "").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
49023
|
+
if (directory === "packages/mise" || directory.startsWith("packages/mise/"))
|
|
49024
|
+
return true;
|
|
49025
|
+
if (directory === "packages/testing" || directory.startsWith("packages/testing/"))
|
|
49026
|
+
return true;
|
|
49027
|
+
return name.startsWith("@mise/");
|
|
49028
|
+
}
|
|
46509
49029
|
function targetsFor(plan, environment2) {
|
|
46510
49030
|
return plan.targets.filter((target) => target.environments === undefined || target.environments.includes(environment2));
|
|
46511
49031
|
}
|
|
49032
|
+
var TARGET_EXTERNAL_INPUTS = {
|
|
49033
|
+
"apps/docs": [
|
|
49034
|
+
"apps/api/openapi/openapi.yaml",
|
|
49035
|
+
"packages/praxis/rpc-kit/src/errors.ts",
|
|
49036
|
+
"services/agent/src/domain/error-codes.ts",
|
|
49037
|
+
...["application", "database", "knowledge"].map((s) => `services/${s}/src/api/error-exit.ts`),
|
|
49038
|
+
...["router", "vault", "browser", "search"].map((s) => `services/${s}/src/api/rpc-contract.ts`),
|
|
49039
|
+
...["media", "automation", "sandbox", "file", "billing", "config", "eventbus", "lakehouse", "identity", "notification", "ops", "registry"].map((s) => `services/${s}/src/api/contract.ts`)
|
|
49040
|
+
]
|
|
49041
|
+
};
|
|
46512
49042
|
function diffTargets(plan, changedPaths) {
|
|
46513
49043
|
const changed = new Set(changedPaths);
|
|
46514
49044
|
const touches = (dir) => {
|
|
@@ -46520,7 +49050,8 @@ function diffTargets(plan, changedPaths) {
|
|
|
46520
49050
|
return true;
|
|
46521
49051
|
return false;
|
|
46522
49052
|
};
|
|
46523
|
-
|
|
49053
|
+
const readsChangedInput = (dir) => (TARGET_EXTERNAL_INPUTS[dir] ?? []).some((file) => changed.has(file));
|
|
49054
|
+
return plan.targets.filter((target) => touches(target.path) || target.workspaceDeps.some(touches) || readsChangedInput(target.path) || target.workspaceDeps.some(readsChangedInput)).map((target) => target.path);
|
|
46524
49055
|
}
|
|
46525
49056
|
function layersOf(plan) {
|
|
46526
49057
|
const paths = plan.targets.map((target) => target.path);
|
|
@@ -46690,6 +49221,1231 @@ async function devopsDeployPlan(args, ports) {
|
|
|
46690
49221
|
ports.human(renderDeployPlan(view));
|
|
46691
49222
|
}
|
|
46692
49223
|
|
|
49224
|
+
// src/commands/canvas-import.ts
|
|
49225
|
+
import { basename as basename2, dirname as dirname2, join as join5, resolve as resolve3 } from "node:path";
|
|
49226
|
+
|
|
49227
|
+
// ../../packages/canvas/document/src/types.ts
|
|
49228
|
+
class OpRejectedError extends Error {
|
|
49229
|
+
rejection;
|
|
49230
|
+
constructor(rejection) {
|
|
49231
|
+
super(`${rejection.code}: ${JSON.stringify(rejection)}`);
|
|
49232
|
+
this.rejection = rejection;
|
|
49233
|
+
}
|
|
49234
|
+
}
|
|
49235
|
+
var CONTAINER_TYPES = new Set(["frame", "group"]);
|
|
49236
|
+
// ../../packages/canvas/document/src/legacy-props.ts
|
|
49237
|
+
function ownIconProps(node2) {
|
|
49238
|
+
const out = { ...node2 };
|
|
49239
|
+
if ((node2.type === "icon" || node2.type === undefined) && "iconName" in node2) {
|
|
49240
|
+
if (!("icon" in node2))
|
|
49241
|
+
out.icon = node2.iconName;
|
|
49242
|
+
delete out.iconName;
|
|
49243
|
+
}
|
|
49244
|
+
return out;
|
|
49245
|
+
}
|
|
49246
|
+
function migrateLegacyIconProps(node2) {
|
|
49247
|
+
const out = ownIconProps(node2);
|
|
49248
|
+
if (node2.descendants && typeof node2.descendants === "object" && !Array.isArray(node2.descendants))
|
|
49249
|
+
out.descendants = Object.fromEntries(Object.entries(node2.descendants).map(([key, value]) => [
|
|
49250
|
+
key,
|
|
49251
|
+
value && typeof value === "object" && !Array.isArray(value) ? migrateLegacyIconProps(value) : value
|
|
49252
|
+
]));
|
|
49253
|
+
if (Array.isArray(node2.children))
|
|
49254
|
+
out.children = node2.children.map((child) => migrateLegacyIconProps(child));
|
|
49255
|
+
return out;
|
|
49256
|
+
}
|
|
49257
|
+
function migrateLegacyProps(node2) {
|
|
49258
|
+
const out = ownIconProps(node2);
|
|
49259
|
+
const stroke = node2.stroke;
|
|
49260
|
+
if (stroke && typeof stroke === "object" && !Array.isArray(stroke) && "fill" in stroke) {
|
|
49261
|
+
const old = stroke;
|
|
49262
|
+
out.stroke = old.fill;
|
|
49263
|
+
if (!("strokeWidth" in node2) && "thickness" in old)
|
|
49264
|
+
out.strokeWidth = old.thickness;
|
|
49265
|
+
if (!("strokeAlignment" in node2) && "align" in old) {
|
|
49266
|
+
out.strokeAlignment = old.align === "inside" ? "inner" : old.align === "outside" ? "outer" : old.align;
|
|
49267
|
+
}
|
|
49268
|
+
}
|
|
49269
|
+
if (Array.isArray(node2.children))
|
|
49270
|
+
out.children = node2.children.map((child) => migrateLegacyProps(child));
|
|
49271
|
+
if (node2.descendants && typeof node2.descendants === "object" && !Array.isArray(node2.descendants))
|
|
49272
|
+
out.descendants = Object.fromEntries(Object.entries(node2.descendants).map(([key, value]) => [
|
|
49273
|
+
key,
|
|
49274
|
+
value && typeof value === "object" && !Array.isArray(value) ? migrateLegacyProps(value) : value
|
|
49275
|
+
]));
|
|
49276
|
+
return out;
|
|
49277
|
+
}
|
|
49278
|
+
|
|
49279
|
+
// ../../packages/canvas/document/src/store.ts
|
|
49280
|
+
var DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
49281
|
+
var BASE = DIGITS.length;
|
|
49282
|
+
function midpoint(a, b) {
|
|
49283
|
+
if (b !== null) {
|
|
49284
|
+
let n = 0;
|
|
49285
|
+
while ((a[n] ?? "0") === b[n])
|
|
49286
|
+
n++;
|
|
49287
|
+
if (n > 0)
|
|
49288
|
+
return b.slice(0, n) + midpoint(a.slice(n), b.slice(n));
|
|
49289
|
+
}
|
|
49290
|
+
const da = a ? DIGITS.indexOf(a[0]) : 0;
|
|
49291
|
+
const db = b !== null ? DIGITS.indexOf(b[0]) : BASE;
|
|
49292
|
+
if (db - da > 1)
|
|
49293
|
+
return DIGITS[Math.floor((da + db) / 2)];
|
|
49294
|
+
if (b !== null && b.length > 1)
|
|
49295
|
+
return b.slice(0, 1);
|
|
49296
|
+
return DIGITS[da] + midpoint(a.slice(1), null);
|
|
49297
|
+
}
|
|
49298
|
+
function between(a, b) {
|
|
49299
|
+
return midpoint(a ?? "", b);
|
|
49300
|
+
}
|
|
49301
|
+
function spacedKeys(n) {
|
|
49302
|
+
let width = 1;
|
|
49303
|
+
while (BASE ** width < n + 2)
|
|
49304
|
+
width++;
|
|
49305
|
+
const keys = [];
|
|
49306
|
+
for (let i = 1;i <= n; i++) {
|
|
49307
|
+
let v = i;
|
|
49308
|
+
let s = "";
|
|
49309
|
+
for (let d = 0;d < width; d++) {
|
|
49310
|
+
s = DIGITS[v % BASE] + s;
|
|
49311
|
+
v = Math.floor(v / BASE);
|
|
49312
|
+
}
|
|
49313
|
+
keys.push(s + "V");
|
|
49314
|
+
}
|
|
49315
|
+
return keys;
|
|
49316
|
+
}
|
|
49317
|
+
|
|
49318
|
+
class MapNodeStore {
|
|
49319
|
+
nodes = new Map;
|
|
49320
|
+
kids = new Map;
|
|
49321
|
+
vars = {};
|
|
49322
|
+
themeAxes = {};
|
|
49323
|
+
rev = 0;
|
|
49324
|
+
get(id) {
|
|
49325
|
+
return this.nodes.get(id);
|
|
49326
|
+
}
|
|
49327
|
+
children(id) {
|
|
49328
|
+
return this.kids.get(id) ?? [];
|
|
49329
|
+
}
|
|
49330
|
+
variables() {
|
|
49331
|
+
return this.vars;
|
|
49332
|
+
}
|
|
49333
|
+
themes() {
|
|
49334
|
+
return this.themeAxes;
|
|
49335
|
+
}
|
|
49336
|
+
revision() {
|
|
49337
|
+
return this.rev;
|
|
49338
|
+
}
|
|
49339
|
+
unlink(n) {
|
|
49340
|
+
const list = this.kids.get(n.parent);
|
|
49341
|
+
if (!list)
|
|
49342
|
+
return;
|
|
49343
|
+
const i = list.indexOf(n.id);
|
|
49344
|
+
if (i >= 0)
|
|
49345
|
+
list.splice(i, 1);
|
|
49346
|
+
}
|
|
49347
|
+
link(n) {
|
|
49348
|
+
let list = this.kids.get(n.parent);
|
|
49349
|
+
if (!list)
|
|
49350
|
+
this.kids.set(n.parent, list = []);
|
|
49351
|
+
let lo = 0;
|
|
49352
|
+
let hi = list.length;
|
|
49353
|
+
if (hi && this.nodes.get(list[hi - 1]).ord < n.ord)
|
|
49354
|
+
lo = hi;
|
|
49355
|
+
while (lo < hi) {
|
|
49356
|
+
const mid = lo + hi >> 1;
|
|
49357
|
+
const o = this.nodes.get(list[mid]).ord;
|
|
49358
|
+
if (o < n.ord || o === n.ord && list[mid] < n.id)
|
|
49359
|
+
lo = mid + 1;
|
|
49360
|
+
else
|
|
49361
|
+
hi = mid;
|
|
49362
|
+
}
|
|
49363
|
+
list.splice(lo, 0, n.id);
|
|
49364
|
+
}
|
|
49365
|
+
put(node2) {
|
|
49366
|
+
const prev = this.nodes.get(node2.id);
|
|
49367
|
+
if (prev && (prev.parent !== node2.parent || prev.ord !== node2.ord))
|
|
49368
|
+
this.unlink(prev);
|
|
49369
|
+
this.nodes.set(node2.id, node2);
|
|
49370
|
+
if (!prev || prev.parent !== node2.parent || prev.ord !== node2.ord)
|
|
49371
|
+
this.link(node2);
|
|
49372
|
+
}
|
|
49373
|
+
remove(id) {
|
|
49374
|
+
const prev = this.nodes.get(id);
|
|
49375
|
+
if (!prev)
|
|
49376
|
+
return;
|
|
49377
|
+
this.unlink(prev);
|
|
49378
|
+
this.kids.delete(id);
|
|
49379
|
+
this.nodes.delete(id);
|
|
49380
|
+
}
|
|
49381
|
+
setVariables(vars, themes) {
|
|
49382
|
+
this.vars = vars;
|
|
49383
|
+
this.themeAxes = themes;
|
|
49384
|
+
}
|
|
49385
|
+
setRevision(rev) {
|
|
49386
|
+
this.rev = rev;
|
|
49387
|
+
}
|
|
49388
|
+
size() {
|
|
49389
|
+
return this.nodes.size;
|
|
49390
|
+
}
|
|
49391
|
+
reindex() {}
|
|
49392
|
+
}
|
|
49393
|
+
function ownProps(node2) {
|
|
49394
|
+
const { children: _c, ...rest } = node2;
|
|
49395
|
+
return rest;
|
|
49396
|
+
}
|
|
49397
|
+
function flatten(nodes, parent, top, rev, out = []) {
|
|
49398
|
+
const keys = spacedKeys(nodes.length);
|
|
49399
|
+
nodes.forEach((n, i) => {
|
|
49400
|
+
const t = top ?? n.id;
|
|
49401
|
+
const props = ownProps(n);
|
|
49402
|
+
const ord = typeof props.__ord === "string" ? props.__ord : keys[i];
|
|
49403
|
+
delete props.__ord;
|
|
49404
|
+
out.push({ id: n.id, parent, ord, top: t, props, rev });
|
|
49405
|
+
if (Array.isArray(n.children) && n.children.length)
|
|
49406
|
+
flatten(n.children, n.id, t, rev, out);
|
|
49407
|
+
});
|
|
49408
|
+
return out;
|
|
49409
|
+
}
|
|
49410
|
+
function subtree(store, id, depth = Infinity, withOrd = false) {
|
|
49411
|
+
const row = store.get(id);
|
|
49412
|
+
if (!row)
|
|
49413
|
+
throw new Error(`node ${id} not found`);
|
|
49414
|
+
const node2 = migrateLegacyIconProps(row.props);
|
|
49415
|
+
if (withOrd)
|
|
49416
|
+
node2.__ord = row.ord;
|
|
49417
|
+
const kids = store.children(id);
|
|
49418
|
+
if (kids.length) {
|
|
49419
|
+
if (depth <= 0)
|
|
49420
|
+
node2.children = "...";
|
|
49421
|
+
else
|
|
49422
|
+
node2.children = kids.map((k) => subtree(store, k, depth - 1, withOrd));
|
|
49423
|
+
}
|
|
49424
|
+
return node2;
|
|
49425
|
+
}
|
|
49426
|
+
// ../../packages/canvas/document/src/apply.ts
|
|
49427
|
+
function applyOp(store, op, rev) {
|
|
49428
|
+
switch (op.op) {
|
|
49429
|
+
case "insert": {
|
|
49430
|
+
const top = op.parent === null ? null : store.get(op.parent).top;
|
|
49431
|
+
const rows = flatten([op.node], op.parent, top, rev);
|
|
49432
|
+
rows[0] = { ...rows[0], ord: op.ord };
|
|
49433
|
+
for (const r of rows)
|
|
49434
|
+
store.put(r);
|
|
49435
|
+
return [rows[0].top];
|
|
49436
|
+
}
|
|
49437
|
+
case "update": {
|
|
49438
|
+
const row = store.get(op.id);
|
|
49439
|
+
const props = { ...row.props };
|
|
49440
|
+
for (const [k, v] of Object.entries(op.patch)) {
|
|
49441
|
+
if (v === undefined || v === null)
|
|
49442
|
+
delete props[k];
|
|
49443
|
+
else
|
|
49444
|
+
props[k] = v;
|
|
49445
|
+
}
|
|
49446
|
+
store.put({ ...row, props, rev });
|
|
49447
|
+
return [row.top];
|
|
49448
|
+
}
|
|
49449
|
+
case "delete": {
|
|
49450
|
+
const row = store.get(op.id);
|
|
49451
|
+
removeSubtree(store, op.id);
|
|
49452
|
+
return [row.top];
|
|
49453
|
+
}
|
|
49454
|
+
case "move": {
|
|
49455
|
+
const row = store.get(op.id);
|
|
49456
|
+
const oldTop = row.top;
|
|
49457
|
+
const newTop = op.parent === null ? op.id : store.get(op.parent).top;
|
|
49458
|
+
store.put({ ...row, parent: op.parent, ord: op.ord, top: newTop, rev });
|
|
49459
|
+
if (newTop !== oldTop)
|
|
49460
|
+
retop(store, op.id, newTop, rev);
|
|
49461
|
+
return oldTop === newTop ? [newTop] : [oldTop, newTop];
|
|
49462
|
+
}
|
|
49463
|
+
case "setVariables": {
|
|
49464
|
+
const vars = op.replace ? op.variables : { ...store.variables(), ...op.variables };
|
|
49465
|
+
const themes = { ...store.themes() };
|
|
49466
|
+
for (const [axis, values] of Object.entries(op.themes)) {
|
|
49467
|
+
const cur = themes[axis] ?? [];
|
|
49468
|
+
themes[axis] = [...cur, ...values.filter((v) => !cur.includes(v))];
|
|
49469
|
+
}
|
|
49470
|
+
store.setVariables(vars, themes);
|
|
49471
|
+
return [];
|
|
49472
|
+
}
|
|
49473
|
+
}
|
|
49474
|
+
}
|
|
49475
|
+
function removeSubtree(store, id) {
|
|
49476
|
+
for (const c of store.children(id))
|
|
49477
|
+
removeSubtree(store, c);
|
|
49478
|
+
store.remove(id);
|
|
49479
|
+
}
|
|
49480
|
+
function retop(store, id, top, rev) {
|
|
49481
|
+
for (const c of store.children(id)) {
|
|
49482
|
+
const row = store.get(c);
|
|
49483
|
+
store.put({ ...row, top, rev });
|
|
49484
|
+
retop(store, c, top, rev);
|
|
49485
|
+
}
|
|
49486
|
+
}
|
|
49487
|
+
// ../../packages/canvas/document/src/expand.ts
|
|
49488
|
+
function defaultTheme(themes) {
|
|
49489
|
+
const t = {};
|
|
49490
|
+
for (const [axis, values] of Object.entries(themes))
|
|
49491
|
+
if (values.length)
|
|
49492
|
+
t[axis] = values[0];
|
|
49493
|
+
return t;
|
|
49494
|
+
}
|
|
49495
|
+
function resolveVariable(name, vars, theme, depth = 0) {
|
|
49496
|
+
const def = vars[name];
|
|
49497
|
+
if (!def || depth > 8)
|
|
49498
|
+
return;
|
|
49499
|
+
let v;
|
|
49500
|
+
if (Array.isArray(def.value)) {
|
|
49501
|
+
let best;
|
|
49502
|
+
for (const e of def.value) {
|
|
49503
|
+
const keys = Object.keys(e.theme ?? {});
|
|
49504
|
+
if (keys.every((k) => theme[k] === e.theme[k]) && (!best || keys.length > best.score))
|
|
49505
|
+
best = { value: e.value, score: keys.length };
|
|
49506
|
+
}
|
|
49507
|
+
v = best?.value ?? def.value[0]?.value;
|
|
49508
|
+
} else
|
|
49509
|
+
v = def.value;
|
|
49510
|
+
if (typeof v === "string" && v.startsWith("$") && vars[v.slice(1)])
|
|
49511
|
+
return resolveVariable(v.slice(1), vars, theme, depth + 1);
|
|
49512
|
+
return v;
|
|
49513
|
+
}
|
|
49514
|
+
function resolveDeep(value, vars, theme) {
|
|
49515
|
+
if (typeof value === "string") {
|
|
49516
|
+
if (value.startsWith("$") && vars[value.slice(1)] !== undefined)
|
|
49517
|
+
return resolveVariable(value.slice(1), vars, theme);
|
|
49518
|
+
return value;
|
|
49519
|
+
}
|
|
49520
|
+
if (Array.isArray(value))
|
|
49521
|
+
return value.map((v) => resolveDeep(v, vars, theme));
|
|
49522
|
+
if (value && typeof value === "object") {
|
|
49523
|
+
const out = {};
|
|
49524
|
+
for (const [k, v] of Object.entries(value))
|
|
49525
|
+
out[k] = resolveDeep(v, vars, theme);
|
|
49526
|
+
return out;
|
|
49527
|
+
}
|
|
49528
|
+
return value;
|
|
49529
|
+
}
|
|
49530
|
+
var SKIP_RESOLVE = new Set(["id", "type", "ref", "descendants", "name", "content", "children"]);
|
|
49531
|
+
function resolveProps(props, vars, theme) {
|
|
49532
|
+
const out = {};
|
|
49533
|
+
for (const [k, v] of Object.entries(props))
|
|
49534
|
+
out[k] = SKIP_RESOLVE.has(k) ? v : resolveDeep(v, vars, theme);
|
|
49535
|
+
if (typeof props.content === "string" && props.content.startsWith("$") && vars[props.content.slice(1)] !== undefined)
|
|
49536
|
+
out.content = String(resolveVariable(props.content.slice(1), vars, theme));
|
|
49537
|
+
return out;
|
|
49538
|
+
}
|
|
49539
|
+
function propsOf(store, src) {
|
|
49540
|
+
if (src.kind === "store")
|
|
49541
|
+
return store.get(src.id)?.props;
|
|
49542
|
+
const { children: _c, ...rest } = src.node;
|
|
49543
|
+
return rest;
|
|
49544
|
+
}
|
|
49545
|
+
function childrenOf(store, src) {
|
|
49546
|
+
if (src.kind === "store")
|
|
49547
|
+
return store.children(src.id).map((id) => ({ kind: "store", id }));
|
|
49548
|
+
return (src.node.children ?? []).map((node2) => ({ kind: "inline", node: node2 }));
|
|
49549
|
+
}
|
|
49550
|
+
function expandNode(store, id, parentTheme) {
|
|
49551
|
+
return expandSrc({ store, vars: store.variables(), stack: [] }, { kind: "store", id }, parentTheme, null, {});
|
|
49552
|
+
}
|
|
49553
|
+
function expandSrc(ctx, src, parentTheme, pathPrefix, overrides) {
|
|
49554
|
+
let props = propsOf(ctx.store, src);
|
|
49555
|
+
if (!props)
|
|
49556
|
+
return null;
|
|
49557
|
+
const ownId = props.id;
|
|
49558
|
+
const path = pathPrefix ? `${pathPrefix}/${ownId}` : ownId;
|
|
49559
|
+
const ov = pathPrefix ? overrides[ownId] : undefined;
|
|
49560
|
+
if (ov && typeof ov.type === "string") {
|
|
49561
|
+
const repl = ov;
|
|
49562
|
+
const replId = typeof repl.id === "string" ? repl.id : ownId;
|
|
49563
|
+
const e = expandSrc(ctx, { kind: "inline", node: { ...repl, id: replId } }, parentTheme, null, {});
|
|
49564
|
+
return e ? { ...e, role: "instance-child" } : null;
|
|
49565
|
+
}
|
|
49566
|
+
if (ov)
|
|
49567
|
+
props = { ...props, ...ov };
|
|
49568
|
+
const theme = props.theme && typeof props.theme === "object" ? { ...parentTheme, ...props.theme } : parentTheme;
|
|
49569
|
+
if (props.type === "ref")
|
|
49570
|
+
return expandRef(ctx, props, path, theme, pathPrefix ? childOverrides(overrides, ownId) : {});
|
|
49571
|
+
const resolved = resolveProps(props, ctx.vars, theme);
|
|
49572
|
+
const children = [];
|
|
49573
|
+
for (const c of childrenOf(ctx.store, src)) {
|
|
49574
|
+
const e = expandSrc(ctx, c, theme, pathPrefix, overrides);
|
|
49575
|
+
if (e)
|
|
49576
|
+
children.push(e);
|
|
49577
|
+
}
|
|
49578
|
+
return {
|
|
49579
|
+
path,
|
|
49580
|
+
type: props.type,
|
|
49581
|
+
props: resolved,
|
|
49582
|
+
children,
|
|
49583
|
+
theme,
|
|
49584
|
+
role: pathPrefix ? "instance-child" : props.reusable ? "component" : "plain"
|
|
49585
|
+
};
|
|
49586
|
+
}
|
|
49587
|
+
function childOverrides(overrides, id) {
|
|
49588
|
+
const out = {};
|
|
49589
|
+
const prefix = id + "/";
|
|
49590
|
+
for (const [k, v] of Object.entries(overrides))
|
|
49591
|
+
if (k.startsWith(prefix))
|
|
49592
|
+
out[k.slice(prefix.length)] = v;
|
|
49593
|
+
return out;
|
|
49594
|
+
}
|
|
49595
|
+
function expandRef(ctx, ref, path, theme, inherited) {
|
|
49596
|
+
const target = ref.ref;
|
|
49597
|
+
const comp = ctx.store.get(target);
|
|
49598
|
+
if (!comp || ctx.stack.includes(target))
|
|
49599
|
+
return null;
|
|
49600
|
+
const descendants = { ...ref.descendants ?? {} };
|
|
49601
|
+
for (const [id, override] of Object.entries(inherited)) {
|
|
49602
|
+
descendants[id] = typeof override.type === "string" ? override : { ...descendants[id], ...override };
|
|
49603
|
+
}
|
|
49604
|
+
const { id: _i, type: _t, ref: _r, descendants: _d, reusable: _re, ...refOwn } = ref;
|
|
49605
|
+
const root = { ...comp.props, ...refOwn, id: ref.id };
|
|
49606
|
+
delete root.reusable;
|
|
49607
|
+
ctx.stack.push(target);
|
|
49608
|
+
const rootTheme = root.theme && typeof root.theme === "object" ? { ...theme, ...root.theme } : theme;
|
|
49609
|
+
const children = [];
|
|
49610
|
+
for (const c of ctx.store.children(target)) {
|
|
49611
|
+
const e = expandSrc(ctx, { kind: "store", id: c }, rootTheme, path, descendants);
|
|
49612
|
+
if (e)
|
|
49613
|
+
children.push(e);
|
|
49614
|
+
}
|
|
49615
|
+
ctx.stack.pop();
|
|
49616
|
+
return { path, type: root.type, props: resolveProps(root, ctx.vars, rootTheme), children, theme: rootTheme, role: "instance" };
|
|
49617
|
+
}
|
|
49618
|
+
// ../../packages/canvas/document/src/known-props.ts
|
|
49619
|
+
var ENTITY = "id type name context reusable theme enabled opacity flipX flipY layoutPosition metadata rotation x y children";
|
|
49620
|
+
var SIZE = "width height";
|
|
49621
|
+
var STROKE = "stroke strokeWidth strokeLinecap strokeLinejoin strokeAlignment";
|
|
49622
|
+
var EFFECTS = "effect";
|
|
49623
|
+
var GRAPHICS = `${EFFECTS} ${STROKE} fill`;
|
|
49624
|
+
var TEXT = "fontFamily fontSize fontWeight letterSpacing fontStyle underline lineHeight textAlign textAlignVertical strikethrough href";
|
|
49625
|
+
var LAYOUT = "layout gap layoutIncludeStroke padding justifyContent alignItems";
|
|
49626
|
+
var RECTANGLE = `${SIZE} ${GRAPHICS} cornerRadius`;
|
|
49627
|
+
var keys = (extra) => new Set(`${ENTITY} ${extra}`.split(/\s+/));
|
|
49628
|
+
var KNOWN_PROPS = {
|
|
49629
|
+
rectangle: keys(RECTANGLE),
|
|
49630
|
+
ellipse: keys(`${SIZE} ${GRAPHICS} innerRadius startAngle sweepAngle`),
|
|
49631
|
+
polygon: keys(`${SIZE} ${GRAPHICS} polygonCount cornerRadius`),
|
|
49632
|
+
path: keys(`${SIZE} ${GRAPHICS} fillRule geometry viewBox`),
|
|
49633
|
+
text: keys(`${SIZE} ${GRAPHICS} ${TEXT} content textGrowth`),
|
|
49634
|
+
frame: keys(`${RECTANGLE} ${LAYOUT} clip placeholder slot`),
|
|
49635
|
+
group: keys(EFFECTS),
|
|
49636
|
+
note: keys(`${SIZE} ${TEXT} content`),
|
|
49637
|
+
prompt: keys(`${SIZE} ${TEXT} content model`),
|
|
49638
|
+
context: keys(`${SIZE} ${TEXT} content`),
|
|
49639
|
+
icon: keys(`${SIZE} ${EFFECTS} library icon weight fill`),
|
|
49640
|
+
script: keys(`${SIZE} clip scriptUri inputs`),
|
|
49641
|
+
browser: keys(`${SIZE} ${EFFECTS} ${STROKE} url deviceId zoom scrollX scrollY cornerRadius`),
|
|
49642
|
+
ref: keys("ref descendants")
|
|
49643
|
+
};
|
|
49644
|
+
function unknownProperties(node2, type) {
|
|
49645
|
+
if (type === "ref")
|
|
49646
|
+
return [];
|
|
49647
|
+
const allowed = Object.hasOwn(KNOWN_PROPS, type) ? KNOWN_PROPS[type] : keys("");
|
|
49648
|
+
return Object.keys(node2).filter((key) => !key.startsWith("__") && !allowed.has(key));
|
|
49649
|
+
}
|
|
49650
|
+
function iconNameOf(node2) {
|
|
49651
|
+
for (const key of ["icon", "iconName"]) {
|
|
49652
|
+
const value = node2[key];
|
|
49653
|
+
if (typeof value === "string" && value.trim() !== "")
|
|
49654
|
+
return value;
|
|
49655
|
+
}
|
|
49656
|
+
return "";
|
|
49657
|
+
}
|
|
49658
|
+
function hasUnsupportedImageUrl(node2) {
|
|
49659
|
+
const invalid = (paint) => {
|
|
49660
|
+
if (Array.isArray(paint))
|
|
49661
|
+
return paint.some(invalid);
|
|
49662
|
+
if (!paint || typeof paint !== "object")
|
|
49663
|
+
return false;
|
|
49664
|
+
const fill = paint;
|
|
49665
|
+
return fill.type === "image" && (typeof fill.url !== "string" || !/^file-[0-9A-Za-z]{24}$/.test(fill.url));
|
|
49666
|
+
};
|
|
49667
|
+
return invalid(node2.fill) || invalid(node2.stroke);
|
|
49668
|
+
}
|
|
49669
|
+
|
|
49670
|
+
// ../../packages/canvas/document/src/execute-api.ts
|
|
49671
|
+
var LIMITS = { ops: 5000, printBytes: 64 * 1024, screenshots: 4 };
|
|
49672
|
+
var ID_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
|
49673
|
+
class ExecuteApi {
|
|
49674
|
+
store;
|
|
49675
|
+
rec;
|
|
49676
|
+
bounds;
|
|
49677
|
+
rev;
|
|
49678
|
+
random;
|
|
49679
|
+
document = "document";
|
|
49680
|
+
layoutCache = new Map;
|
|
49681
|
+
constructor(store, rec, bounds, rev, random = Math.random) {
|
|
49682
|
+
this.store = store;
|
|
49683
|
+
this.rec = rec;
|
|
49684
|
+
this.bounds = bounds;
|
|
49685
|
+
this.rev = rev;
|
|
49686
|
+
this.random = random;
|
|
49687
|
+
}
|
|
49688
|
+
mint() {
|
|
49689
|
+
for (;; ) {
|
|
49690
|
+
let id = "";
|
|
49691
|
+
for (let i = 0;i < 5; i++)
|
|
49692
|
+
id += ID_CHARS[Math.floor(this.random() * ID_CHARS.length)];
|
|
49693
|
+
if (!this.store.get(id))
|
|
49694
|
+
return id;
|
|
49695
|
+
}
|
|
49696
|
+
}
|
|
49697
|
+
commit(op) {
|
|
49698
|
+
if (this.rec.ops.length >= LIMITS.ops)
|
|
49699
|
+
throw new Error(`SCRIPT_LIMIT: more than ${LIMITS.ops} operations in one execute`);
|
|
49700
|
+
const touched = applyOp(this.store, op, this.rev);
|
|
49701
|
+
this.mutations++;
|
|
49702
|
+
this.rec.ops.push(op);
|
|
49703
|
+
if (op.op === "setVariables")
|
|
49704
|
+
this.rec.allTouched = true;
|
|
49705
|
+
for (const t of touched) {
|
|
49706
|
+
this.rec.touchedTop.add(t);
|
|
49707
|
+
this.layoutCache.delete(t);
|
|
49708
|
+
}
|
|
49709
|
+
if (op.op === "setVariables")
|
|
49710
|
+
this.layoutCache.clear();
|
|
49711
|
+
}
|
|
49712
|
+
parentId(parent) {
|
|
49713
|
+
if (parent === "document" || parent === "" || parent == null)
|
|
49714
|
+
return null;
|
|
49715
|
+
if (parent.includes("/"))
|
|
49716
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: "parent", reason: "cannot insert inside a component instance; use Replace on the instance child" });
|
|
49717
|
+
const row = this.store.get(parent);
|
|
49718
|
+
if (!row)
|
|
49719
|
+
throw new OpRejectedError({ code: "PARENT_NOT_FOUND", path: parent });
|
|
49720
|
+
if (!CONTAINER_TYPES.has(row.props.type))
|
|
49721
|
+
throw new OpRejectedError({ code: "CANNOT_HAVE_CHILDREN", parent, type: row.props.type });
|
|
49722
|
+
return parent;
|
|
49723
|
+
}
|
|
49724
|
+
lastOrd(parent) {
|
|
49725
|
+
const kids = this.store.children(parent);
|
|
49726
|
+
return kids.length ? this.store.get(kids[kids.length - 1]).ord : null;
|
|
49727
|
+
}
|
|
49728
|
+
withIds(node2) {
|
|
49729
|
+
if (typeof node2 !== "object" || node2 === null || typeof node2.type !== "string")
|
|
49730
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: "type", reason: "node needs a type" });
|
|
49731
|
+
if (node2.type === "ref") {
|
|
49732
|
+
const target = node2.ref;
|
|
49733
|
+
if (!this.store.get(target))
|
|
49734
|
+
throw new OpRejectedError({ code: "UNKNOWN_REF", ref: target });
|
|
49735
|
+
}
|
|
49736
|
+
for (const k of ["width", "height"]) {
|
|
49737
|
+
const v = node2[k];
|
|
49738
|
+
if (typeof v === "number" && v < 0)
|
|
49739
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: k, reason: "negative size" });
|
|
49740
|
+
if (typeof v === "string" && /%|vh|vw|calc/.test(v))
|
|
49741
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: k, reason: "percentage and viewport sizes are not supported" });
|
|
49742
|
+
}
|
|
49743
|
+
const id = this.mint();
|
|
49744
|
+
const out = { ...node2, id };
|
|
49745
|
+
if (typeof node2.name === "string")
|
|
49746
|
+
this.rec.created[node2.name] = id;
|
|
49747
|
+
if (Array.isArray(node2.children)) {
|
|
49748
|
+
if (!CONTAINER_TYPES.has(node2.type))
|
|
49749
|
+
throw new OpRejectedError({ code: "CANNOT_HAVE_CHILDREN", parent: id, type: node2.type });
|
|
49750
|
+
out.children = node2.children.map((c) => this.withIds(c));
|
|
49751
|
+
}
|
|
49752
|
+
return out;
|
|
49753
|
+
}
|
|
49754
|
+
warnProps(data, type, nodeId) {
|
|
49755
|
+
if (hasUnsupportedImageUrl(data) && this.rec.warnings.length < 20 && !this.rec.warnings.some((w) => w.code === "UNSUPPORTED_IMAGE_URL" && w.nodeId === nodeId))
|
|
49756
|
+
this.rec.warnings.push({ code: "UNSUPPORTED_IMAGE_URL", nodeId, message: "image fill url must be a file id (file-…)" });
|
|
49757
|
+
if (data.type === "icon" && !iconNameOf(data) && this.rec.warnings.length < 20 && !this.rec.warnings.some((w) => w.code === "ICON_NAME_MISSING" && w.nodeId === nodeId))
|
|
49758
|
+
this.rec.warnings.push({ code: "ICON_NAME_MISSING", nodeId, message: "icon node has no icon: set icon to a lucide name (name is the node's name, not the icon)" });
|
|
49759
|
+
for (const prop of unknownProperties(data, type)) {
|
|
49760
|
+
const message = `${prop} is not a .pen property`;
|
|
49761
|
+
if (this.rec.warnings.length >= 20)
|
|
49762
|
+
break;
|
|
49763
|
+
if (!this.rec.warnings.some((w) => w.code === "UNKNOWN_PROPERTY" && w.nodeId === nodeId && w.message === message))
|
|
49764
|
+
this.rec.warnings.push({ code: "UNKNOWN_PROPERTY", nodeId, message });
|
|
49765
|
+
}
|
|
49766
|
+
for (const child of Array.isArray(data.children) ? data.children : [])
|
|
49767
|
+
this.warnProps(child, child.type, child.id ?? nodeId);
|
|
49768
|
+
if (data.descendants && typeof data.descendants === "object") {
|
|
49769
|
+
const descendants = typeof data.ref === "string" ? this.resolveDescendantKeys(data.ref, data.descendants) : data.descendants;
|
|
49770
|
+
for (const [key, value] of Object.entries(descendants)) {
|
|
49771
|
+
if (!value || typeof value !== "object")
|
|
49772
|
+
continue;
|
|
49773
|
+
const patch = value;
|
|
49774
|
+
const target = this.store.get(key)?.props.type ?? (typeof data.ref === "string" ? this.expandedAt(`${data.ref}/${key}`, {})?.node.type : undefined);
|
|
49775
|
+
this.warnProps(patch, typeof patch.type === "string" ? patch.type : target ?? "ref", `${nodeId}/${key}`);
|
|
49776
|
+
}
|
|
49777
|
+
}
|
|
49778
|
+
}
|
|
49779
|
+
splitInstancePath(path) {
|
|
49780
|
+
const i = path.indexOf("/");
|
|
49781
|
+
if (i < 0)
|
|
49782
|
+
return null;
|
|
49783
|
+
return { owner: path.slice(0, i), rest: path.slice(i + 1) };
|
|
49784
|
+
}
|
|
49785
|
+
resolveDescendantKeys(rootId, desc) {
|
|
49786
|
+
const byName = new Map;
|
|
49787
|
+
const walk = (id) => {
|
|
49788
|
+
for (const c of this.store.children(id)) {
|
|
49789
|
+
const n = this.store.get(c).props;
|
|
49790
|
+
if (n.name)
|
|
49791
|
+
byName.set(n.name, [...byName.get(n.name) ?? [], c]);
|
|
49792
|
+
walk(c);
|
|
49793
|
+
}
|
|
49794
|
+
};
|
|
49795
|
+
walk(rootId);
|
|
49796
|
+
const out = {};
|
|
49797
|
+
for (const [k, v] of Object.entries(desc)) {
|
|
49798
|
+
let key = k;
|
|
49799
|
+
if (!k.includes("/") && !this.store.get(k)) {
|
|
49800
|
+
const hits = byName.get(k);
|
|
49801
|
+
if (hits?.length === 1)
|
|
49802
|
+
key = hits[0];
|
|
49803
|
+
}
|
|
49804
|
+
out[key] = v;
|
|
49805
|
+
}
|
|
49806
|
+
return out;
|
|
49807
|
+
}
|
|
49808
|
+
Insert(parent, nodeData) {
|
|
49809
|
+
const p = this.parentId(parent);
|
|
49810
|
+
let node2 = this.withIds(migrateLegacyProps(nodeData));
|
|
49811
|
+
if (node2.type === "ref" && node2.descendants && typeof node2.descendants === "object")
|
|
49812
|
+
node2 = { ...node2, descendants: this.resolveDescendantKeys(node2.ref, node2.descendants) };
|
|
49813
|
+
this.warnProps(node2, node2.type, node2.id);
|
|
49814
|
+
this.commit({ op: "insert", parent: p, ord: between(this.lastOrd(p), null), node: node2 });
|
|
49815
|
+
return node2.id;
|
|
49816
|
+
}
|
|
49817
|
+
Copy(path, parent, copyNodeData = {}) {
|
|
49818
|
+
if (path.includes("/"))
|
|
49819
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: "path", reason: "copying an instance child is not supported in this spike" });
|
|
49820
|
+
const src = this.store.get(path);
|
|
49821
|
+
if (!src)
|
|
49822
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49823
|
+
const p = this.parentId(parent);
|
|
49824
|
+
const { descendants, ...over } = migrateLegacyProps(copyNodeData);
|
|
49825
|
+
let node2;
|
|
49826
|
+
if (src.props.reusable) {
|
|
49827
|
+
node2 = { type: "ref", ref: src.id, ...over };
|
|
49828
|
+
if (descendants)
|
|
49829
|
+
node2.descendants = this.resolveDescendantKeys(src.id, descendants);
|
|
49830
|
+
node2 = this.withIds(node2);
|
|
49831
|
+
} else {
|
|
49832
|
+
const tree = subtree(this.store, src.id);
|
|
49833
|
+
const descMap = descendants ? this.resolveDescendantKeys(src.id, descendants) : {};
|
|
49834
|
+
const apply = (n) => {
|
|
49835
|
+
const d = descMap[n.id];
|
|
49836
|
+
let out = d && typeof d.type === "string" ? { ...d } : { ...n, ...d ?? {} };
|
|
49837
|
+
if (Array.isArray(n.children) && !(d && typeof d.type === "string"))
|
|
49838
|
+
out = { ...out, children: n.children.map(apply) };
|
|
49839
|
+
return out;
|
|
49840
|
+
};
|
|
49841
|
+
node2 = this.withIds({ ...apply(tree), ...over });
|
|
49842
|
+
}
|
|
49843
|
+
this.warnProps(node2, node2.type, node2.id);
|
|
49844
|
+
this.commit({ op: "insert", parent: p, ord: between(this.lastOrd(p), null), node: node2 });
|
|
49845
|
+
return node2.id;
|
|
49846
|
+
}
|
|
49847
|
+
Update(path, updateData) {
|
|
49848
|
+
updateData = migrateLegacyProps(updateData);
|
|
49849
|
+
const inst = this.splitInstancePath(path);
|
|
49850
|
+
if (inst) {
|
|
49851
|
+
const owner = this.store.get(inst.owner);
|
|
49852
|
+
if (!owner || owner.props.type !== "ref")
|
|
49853
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49854
|
+
const desc = { ...owner.props.descendants ?? {} };
|
|
49855
|
+
this.warnProps(updateData, this.expandedAt(path, {})?.node.type ?? "ref", path);
|
|
49856
|
+
desc[inst.rest] = { ...desc[inst.rest] ?? {}, ...updateData };
|
|
49857
|
+
this.commit({ op: "update", id: owner.id, patch: { descendants: desc } });
|
|
49858
|
+
return;
|
|
49859
|
+
}
|
|
49860
|
+
const row = this.store.get(path);
|
|
49861
|
+
if (!row)
|
|
49862
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49863
|
+
for (const f of ["id", "type", "ref"])
|
|
49864
|
+
if (f in updateData && updateData[f] !== row.props[f])
|
|
49865
|
+
throw new OpRejectedError({ code: "IMMUTABLE_FIELD", field: f });
|
|
49866
|
+
if ("children" in updateData)
|
|
49867
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: "children", reason: "use Replace to change children" });
|
|
49868
|
+
const { id: _i, type: _t, ref: _r, ...patch } = updateData;
|
|
49869
|
+
if (patch.descendants && row.props.type === "ref")
|
|
49870
|
+
patch.descendants = { ...row.props.descendants ?? {}, ...this.resolveDescendantKeys(row.props.ref, patch.descendants) };
|
|
49871
|
+
this.warnProps({ ...patch, ...row.props.type === "ref" ? { ref: row.props.ref } : {} }, row.props.type, row.id);
|
|
49872
|
+
this.commit({ op: "update", id: row.id, patch });
|
|
49873
|
+
}
|
|
49874
|
+
Replace(path, nodeData) {
|
|
49875
|
+
const inst = this.splitInstancePath(path);
|
|
49876
|
+
if (inst) {
|
|
49877
|
+
const owner = this.store.get(inst.owner);
|
|
49878
|
+
if (!owner || owner.props.type !== "ref")
|
|
49879
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49880
|
+
const node3 = this.withIds(migrateLegacyProps(nodeData));
|
|
49881
|
+
this.warnProps(node3, node3.type, node3.id);
|
|
49882
|
+
const desc = { ...owner.props.descendants ?? {}, [inst.rest]: node3 };
|
|
49883
|
+
this.commit({ op: "update", id: owner.id, patch: { descendants: desc } });
|
|
49884
|
+
return node3.id;
|
|
49885
|
+
}
|
|
49886
|
+
const row = this.store.get(path);
|
|
49887
|
+
if (!row)
|
|
49888
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49889
|
+
const node2 = this.withIds(migrateLegacyProps(nodeData));
|
|
49890
|
+
this.warnProps(node2, node2.type, node2.id);
|
|
49891
|
+
this.commit({ op: "delete", id: row.id });
|
|
49892
|
+
this.commit({ op: "insert", parent: row.parent, ord: row.ord, node: node2 });
|
|
49893
|
+
return node2.id;
|
|
49894
|
+
}
|
|
49895
|
+
Move(path, parent, index) {
|
|
49896
|
+
if (path.includes("/"))
|
|
49897
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: "path", reason: "instance children cannot be moved; edit the component" });
|
|
49898
|
+
const row = this.store.get(path);
|
|
49899
|
+
if (!row)
|
|
49900
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49901
|
+
const p = parent === undefined ? row.parent : this.parentId(parent);
|
|
49902
|
+
for (let cur = p;cur !== null; cur = this.store.get(cur)?.parent ?? null)
|
|
49903
|
+
if (cur === row.id)
|
|
49904
|
+
throw new OpRejectedError({ code: "CYCLE", id: row.id, parent: p });
|
|
49905
|
+
const siblings = this.store.children(p).filter((s) => s !== row.id);
|
|
49906
|
+
const i = index === undefined ? siblings.length : Math.max(0, Math.min(index, siblings.length));
|
|
49907
|
+
const before = i > 0 ? this.store.get(siblings[i - 1]).ord : null;
|
|
49908
|
+
const after = i < siblings.length ? this.store.get(siblings[i]).ord : null;
|
|
49909
|
+
this.commit({ op: "move", id: row.id, parent: p, ord: between(before, after) });
|
|
49910
|
+
}
|
|
49911
|
+
Delete(path) {
|
|
49912
|
+
if (path === "document")
|
|
49913
|
+
throw new OpRejectedError({ code: "ROOT_PROTECTED" });
|
|
49914
|
+
if (path.includes("/"))
|
|
49915
|
+
throw new OpRejectedError({ code: "INSTANCE_CHILD_DELETE", path });
|
|
49916
|
+
if (!this.store.get(path))
|
|
49917
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49918
|
+
this.commit({ op: "delete", id: path });
|
|
49919
|
+
}
|
|
49920
|
+
SetVariables(variables, replace = false) {
|
|
49921
|
+
const themes = {};
|
|
49922
|
+
for (const [name, def] of Object.entries(variables ?? {})) {
|
|
49923
|
+
if (name.startsWith("$"))
|
|
49924
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: name, reason: "variable names must not start with $" });
|
|
49925
|
+
if (!def || typeof def !== "object" || !("type" in def) || !("value" in def))
|
|
49926
|
+
throw new OpRejectedError({ code: "INVALID_VALUE", property: name, reason: "expected { type, value }" });
|
|
49927
|
+
if (Array.isArray(def.value))
|
|
49928
|
+
for (const e of def.value)
|
|
49929
|
+
for (const [axis, v] of Object.entries(e.theme ?? {}))
|
|
49930
|
+
themes[axis] = [...new Set([...themes[axis] ?? [], v])];
|
|
49931
|
+
}
|
|
49932
|
+
this.commit({ op: "setVariables", variables, themes, replace });
|
|
49933
|
+
}
|
|
49934
|
+
GetVariables() {
|
|
49935
|
+
return { variables: this.store.variables(), themes: this.store.themes() };
|
|
49936
|
+
}
|
|
49937
|
+
Get(a, b, c) {
|
|
49938
|
+
let path = null;
|
|
49939
|
+
let visit2 = null;
|
|
49940
|
+
let opts = {};
|
|
49941
|
+
for (const arg of [a, b, c]) {
|
|
49942
|
+
if (typeof arg === "string")
|
|
49943
|
+
path = arg;
|
|
49944
|
+
else if (typeof arg === "function")
|
|
49945
|
+
visit2 = arg;
|
|
49946
|
+
else if (arg && typeof arg === "object")
|
|
49947
|
+
opts = arg;
|
|
49948
|
+
}
|
|
49949
|
+
if (!path && !visit2)
|
|
49950
|
+
throw new Error("Reading the whole document without a visitor would return everything! Pass a visitor or target a specific node.");
|
|
49951
|
+
if (!visit2)
|
|
49952
|
+
return this.readNode(path, opts);
|
|
49953
|
+
const out = [];
|
|
49954
|
+
const roots = path && path !== "document" ? [path] : this.store.children(null);
|
|
49955
|
+
for (const r of roots)
|
|
49956
|
+
this.visitFrom(r, visit2, opts, out);
|
|
49957
|
+
return out;
|
|
49958
|
+
}
|
|
49959
|
+
readNode(path, opts) {
|
|
49960
|
+
if (opts.resolveInstances || opts.resolveVariables || path.includes("/")) {
|
|
49961
|
+
const e = this.expandedAt(path, opts);
|
|
49962
|
+
if (!e)
|
|
49963
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49964
|
+
return toPen(e.node, opts.depth ?? Infinity, !!opts.resolveVariables, opts.resolveInstances !== false || path.includes("/"));
|
|
49965
|
+
}
|
|
49966
|
+
if (!this.store.get(path))
|
|
49967
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path });
|
|
49968
|
+
return subtree(this.store, path, opts.depth ?? Infinity);
|
|
49969
|
+
}
|
|
49970
|
+
expandedCache = new Map;
|
|
49971
|
+
mutations = 0;
|
|
49972
|
+
expandedAt(path, _opts) {
|
|
49973
|
+
const first = path.split("/")[0];
|
|
49974
|
+
const row = this.store.get(first);
|
|
49975
|
+
if (!row)
|
|
49976
|
+
return null;
|
|
49977
|
+
let hit = this.expandedCache.get(row.top);
|
|
49978
|
+
if (!hit || hit.rev !== this.mutations) {
|
|
49979
|
+
const tree = expandNode(this.store, row.top, defaultTheme(this.store.themes()));
|
|
49980
|
+
if (!tree)
|
|
49981
|
+
return null;
|
|
49982
|
+
const index = new Map;
|
|
49983
|
+
const walk = (n) => {
|
|
49984
|
+
index.set(n.path, n);
|
|
49985
|
+
n.children.forEach(walk);
|
|
49986
|
+
};
|
|
49987
|
+
walk(tree);
|
|
49988
|
+
hit = { rev: this.mutations, index };
|
|
49989
|
+
this.expandedCache.set(row.top, hit);
|
|
49990
|
+
if (this.expandedCache.size > 8)
|
|
49991
|
+
this.expandedCache.delete(this.expandedCache.keys().next().value);
|
|
49992
|
+
}
|
|
49993
|
+
const node2 = hit.index.get(path);
|
|
49994
|
+
return node2 ? { node: node2, top: row.top } : null;
|
|
49995
|
+
}
|
|
49996
|
+
layoutOf(top) {
|
|
49997
|
+
let l = this.layoutCache.get(top);
|
|
49998
|
+
if (!l) {
|
|
49999
|
+
l = this.bounds.layout(top);
|
|
50000
|
+
this.layoutCache.set(top, l);
|
|
50001
|
+
if (this.layoutCache.size > 8)
|
|
50002
|
+
this.layoutCache.delete(this.layoutCache.keys().next().value);
|
|
50003
|
+
}
|
|
50004
|
+
return l;
|
|
50005
|
+
}
|
|
50006
|
+
visitFrom(startPath, visit2, opts, out) {
|
|
50007
|
+
const at = this.expandedAt(startPath, opts);
|
|
50008
|
+
if (!at)
|
|
50009
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path: startPath });
|
|
50010
|
+
const self = this;
|
|
50011
|
+
const withInstances = !!opts.resolveInstances;
|
|
50012
|
+
const walk = (e, parentCtx, depth, index) => {
|
|
50013
|
+
if (opts.depth !== undefined && depth > opts.depth)
|
|
50014
|
+
return;
|
|
50015
|
+
let skip = false;
|
|
50016
|
+
const node2 = toPen(e, 0, !!opts.resolveVariables, withInstances, true);
|
|
50017
|
+
const ctx = {
|
|
50018
|
+
node: node2,
|
|
50019
|
+
parentCtx,
|
|
50020
|
+
depth,
|
|
50021
|
+
index,
|
|
50022
|
+
get bounds() {
|
|
50023
|
+
const b = self.layoutOf(at.top).boxes.get(e.path);
|
|
50024
|
+
return b ? { x: b.x, y: b.y, width: b.width, height: b.height } : { x: 0, y: 0, width: 0, height: 0 };
|
|
50025
|
+
},
|
|
50026
|
+
get problems() {
|
|
50027
|
+
const p = self.layoutOf(at.top).problems.find((q) => q.path === e.path && (q.code === "PARTIALLY_CLIPPED" || q.code === "FULLY_CLIPPED"));
|
|
50028
|
+
return p ? p.code === "FULLY_CLIPPED" ? "fully clipped" : "partially clipped" : undefined;
|
|
50029
|
+
},
|
|
50030
|
+
skipChildren() {
|
|
50031
|
+
skip = true;
|
|
50032
|
+
}
|
|
50033
|
+
};
|
|
50034
|
+
const r = visit2(node2, ctx);
|
|
50035
|
+
if (r !== undefined)
|
|
50036
|
+
out.push(r);
|
|
50037
|
+
if (skip)
|
|
50038
|
+
return;
|
|
50039
|
+
if (e.role === "instance" && !withInstances)
|
|
50040
|
+
return;
|
|
50041
|
+
e.children.forEach((c, i) => walk(c, ctx, depth + 1, i));
|
|
50042
|
+
};
|
|
50043
|
+
walk(at.node, undefined, 0, 0);
|
|
50044
|
+
}
|
|
50045
|
+
level(root, parent, opts) {
|
|
50046
|
+
const withInstances = !!opts.resolveInstances;
|
|
50047
|
+
const conv = (e) => ({
|
|
50048
|
+
node: toPen(e, 0, !!opts.resolveVariables, withInstances, true),
|
|
50049
|
+
path: e.path,
|
|
50050
|
+
more: e.children.length > 0 && !(e.role === "instance" && !withInstances)
|
|
50051
|
+
});
|
|
50052
|
+
if (parent === null) {
|
|
50053
|
+
const roots = root && root !== "document" ? [root] : this.store.children(null);
|
|
50054
|
+
return roots.map((r) => {
|
|
50055
|
+
const at2 = this.expandedAt(r, opts);
|
|
50056
|
+
if (!at2)
|
|
50057
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path: r });
|
|
50058
|
+
return conv(at2.node);
|
|
50059
|
+
});
|
|
50060
|
+
}
|
|
50061
|
+
const at = this.expandedAt(parent, opts);
|
|
50062
|
+
return at ? at.node.children.map(conv) : [];
|
|
50063
|
+
}
|
|
50064
|
+
tree(path, opts) {
|
|
50065
|
+
const withInstances = !!opts.resolveInstances;
|
|
50066
|
+
const roots = path && path !== "document" ? [path] : this.store.children(null);
|
|
50067
|
+
const out = [];
|
|
50068
|
+
for (const r of roots) {
|
|
50069
|
+
const at = this.expandedAt(r, opts);
|
|
50070
|
+
if (!at)
|
|
50071
|
+
throw new OpRejectedError({ code: "NODE_NOT_FOUND", path: r });
|
|
50072
|
+
const conv = (e, depth) => ({
|
|
50073
|
+
node: toPen(e, 0, !!opts.resolveVariables, withInstances, true),
|
|
50074
|
+
path: e.path,
|
|
50075
|
+
children: e.role === "instance" && !withInstances || opts.depth !== undefined && depth >= opts.depth ? [] : e.children.map((c) => conv(c, depth + 1))
|
|
50076
|
+
});
|
|
50077
|
+
out.push(conv(at.node, 0));
|
|
50078
|
+
}
|
|
50079
|
+
return out;
|
|
50080
|
+
}
|
|
50081
|
+
boundsOf(path) {
|
|
50082
|
+
const first = path.split("/")[0];
|
|
50083
|
+
const row = this.store.get(first);
|
|
50084
|
+
if (!row)
|
|
50085
|
+
return { bounds: { x: 0, y: 0, width: 0, height: 0 } };
|
|
50086
|
+
const l = this.layoutOf(row.top);
|
|
50087
|
+
const b = l.boxes.get(path);
|
|
50088
|
+
const p = l.problems.find((q) => q.path === path && (q.code === "PARTIALLY_CLIPPED" || q.code === "FULLY_CLIPPED"));
|
|
50089
|
+
return {
|
|
50090
|
+
bounds: b ? { x: b.x, y: b.y, width: b.width, height: b.height } : { x: 0, y: 0, width: 0, height: 0 },
|
|
50091
|
+
problems: p ? p.code === "FULLY_CLIPPED" ? "fully clipped" : "partially clipped" : undefined
|
|
50092
|
+
};
|
|
50093
|
+
}
|
|
50094
|
+
FindEmptySpace(input) {
|
|
50095
|
+
const dir = input.direction ?? "right";
|
|
50096
|
+
const pad = input.padding ?? 0;
|
|
50097
|
+
const rects = [];
|
|
50098
|
+
const tops = input.nodeId ? [input.nodeId] : this.store.children(null);
|
|
50099
|
+
for (const t of tops) {
|
|
50100
|
+
const row = this.store.get(t);
|
|
50101
|
+
if (!row)
|
|
50102
|
+
continue;
|
|
50103
|
+
const b = this.layoutOf(row.top).boxes.get(t);
|
|
50104
|
+
if (b)
|
|
50105
|
+
rects.push({ x: b.wx, y: b.wy, width: b.width, height: b.height });
|
|
50106
|
+
}
|
|
50107
|
+
if (!rects.length)
|
|
50108
|
+
return { x: 0, y: 0 };
|
|
50109
|
+
const minX = Math.min(...rects.map((r) => r.x));
|
|
50110
|
+
const minY = Math.min(...rects.map((r) => r.y));
|
|
50111
|
+
const maxX = Math.max(...rects.map((r) => r.x + r.width));
|
|
50112
|
+
const maxY = Math.max(...rects.map((r) => r.y + r.height));
|
|
50113
|
+
if (dir === "right")
|
|
50114
|
+
return { x: maxX + pad, y: minY };
|
|
50115
|
+
if (dir === "left")
|
|
50116
|
+
return { x: minX - pad - input.width, y: minY };
|
|
50117
|
+
if (dir === "bottom")
|
|
50118
|
+
return { x: minX, y: maxY + pad };
|
|
50119
|
+
return { x: minX, y: minY - pad - input.height };
|
|
50120
|
+
}
|
|
50121
|
+
Print(...values) {
|
|
50122
|
+
const line = values.map((v) => typeof v === "string" ? v : JSON.stringify(v)).join(" ");
|
|
50123
|
+
this.rec.printBytes += line.length;
|
|
50124
|
+
if (this.rec.printBytes > LIMITS.printBytes)
|
|
50125
|
+
throw new Error(`SCRIPT_LIMIT: Print output over ${LIMITS.printBytes} bytes`);
|
|
50126
|
+
this.rec.prints.push(line);
|
|
50127
|
+
}
|
|
50128
|
+
TakeScreenshot(nodeIds) {
|
|
50129
|
+
for (const id of nodeIds)
|
|
50130
|
+
if (this.rec.screenshots.length < LIMITS.screenshots)
|
|
50131
|
+
this.rec.screenshots.push(id);
|
|
50132
|
+
}
|
|
50133
|
+
}
|
|
50134
|
+
function toPen(e, depth, _resolved, _instances, shallow = false) {
|
|
50135
|
+
const node2 = { ...e.props, id: e.path, type: e.type };
|
|
50136
|
+
if (!shallow && e.children.length) {
|
|
50137
|
+
if (depth <= 0)
|
|
50138
|
+
node2.children = "...";
|
|
50139
|
+
else
|
|
50140
|
+
node2.children = e.children.map((c) => toPen(c, depth - 1, _resolved, _instances));
|
|
50141
|
+
}
|
|
50142
|
+
return node2;
|
|
50143
|
+
}
|
|
50144
|
+
// ../../packages/canvas/document/src/pen-import.ts
|
|
50145
|
+
var FILE_ID = /^file-/;
|
|
50146
|
+
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
50147
|
+
var isImage = (node2) => node2.type === "image" && typeof node2.url === "string";
|
|
50148
|
+
var isRef = (node2) => node2.type === "ref" && typeof node2.ref === "string";
|
|
50149
|
+
function visit2(value, nodeId, fn) {
|
|
50150
|
+
if (Array.isArray(value)) {
|
|
50151
|
+
for (const item of value)
|
|
50152
|
+
visit2(item, nodeId, fn);
|
|
50153
|
+
return;
|
|
50154
|
+
}
|
|
50155
|
+
const node2 = asRecord(value);
|
|
50156
|
+
if (!node2)
|
|
50157
|
+
return;
|
|
50158
|
+
const id = typeof node2.id === "string" ? node2.id : nodeId;
|
|
50159
|
+
fn(node2, id);
|
|
50160
|
+
for (const key of Object.keys(node2))
|
|
50161
|
+
visit2(node2[key], id, fn);
|
|
50162
|
+
}
|
|
50163
|
+
function indexTops(tops) {
|
|
50164
|
+
const owner = new Map;
|
|
50165
|
+
for (const top of tops) {
|
|
50166
|
+
visit2(top, top.id, (node2) => {
|
|
50167
|
+
if (typeof node2.id === "string")
|
|
50168
|
+
owner.set(node2.id, top.id);
|
|
50169
|
+
});
|
|
50170
|
+
}
|
|
50171
|
+
return owner;
|
|
50172
|
+
}
|
|
50173
|
+
var clone = (value) => JSON.parse(JSON.stringify(value));
|
|
50174
|
+
function penImageUrls(nodes) {
|
|
50175
|
+
const urls = [];
|
|
50176
|
+
const seen = new Set;
|
|
50177
|
+
for (const node2 of nodes) {
|
|
50178
|
+
visit2(node2, node2.id, (value) => {
|
|
50179
|
+
if (!isImage(value))
|
|
50180
|
+
return;
|
|
50181
|
+
const url = value.url;
|
|
50182
|
+
if (FILE_ID.test(url) || seen.has(url))
|
|
50183
|
+
return;
|
|
50184
|
+
seen.add(url);
|
|
50185
|
+
urls.push(url);
|
|
50186
|
+
});
|
|
50187
|
+
}
|
|
50188
|
+
return urls;
|
|
50189
|
+
}
|
|
50190
|
+
function planPenImport(doc, opts = {}) {
|
|
50191
|
+
const tops = Array.isArray(doc.children) ? doc.children : [];
|
|
50192
|
+
const warnings = [];
|
|
50193
|
+
const selected = new Set;
|
|
50194
|
+
const added = [];
|
|
50195
|
+
if (opts.frames === undefined) {
|
|
50196
|
+
for (const top of tops)
|
|
50197
|
+
selected.add(top.id);
|
|
50198
|
+
} else {
|
|
50199
|
+
const frames = new Set(opts.frames);
|
|
50200
|
+
for (const id of frames) {
|
|
50201
|
+
if (!tops.some((top) => top.id === id))
|
|
50202
|
+
warnings.push({ code: "FRAME_NOT_FOUND", id });
|
|
50203
|
+
else
|
|
50204
|
+
selected.add(id);
|
|
50205
|
+
}
|
|
50206
|
+
const owner = indexTops(tops);
|
|
50207
|
+
const byId = new Map(tops.map((top) => [top.id, top]));
|
|
50208
|
+
const dangling = new Set;
|
|
50209
|
+
for (let queue = [...selected];queue.length > 0; ) {
|
|
50210
|
+
const top = byId.get(queue.shift());
|
|
50211
|
+
if (!top)
|
|
50212
|
+
continue;
|
|
50213
|
+
visit2(top, top.id, (node2, nodeId) => {
|
|
50214
|
+
if (!isRef(node2))
|
|
50215
|
+
return;
|
|
50216
|
+
const ref = node2.ref;
|
|
50217
|
+
const target = owner.get(ref);
|
|
50218
|
+
if (target === undefined) {
|
|
50219
|
+
const key = `${ref}\x00${nodeId}`;
|
|
50220
|
+
if (dangling.has(key))
|
|
50221
|
+
return;
|
|
50222
|
+
dangling.add(key);
|
|
50223
|
+
warnings.push({ code: "REF_DANGLING", ref, nodeId });
|
|
50224
|
+
return;
|
|
50225
|
+
}
|
|
50226
|
+
if (selected.has(target))
|
|
50227
|
+
return;
|
|
50228
|
+
selected.add(target);
|
|
50229
|
+
queue.push(target);
|
|
50230
|
+
});
|
|
50231
|
+
}
|
|
50232
|
+
for (const top of tops)
|
|
50233
|
+
if (selected.has(top.id) && !frames.has(top.id))
|
|
50234
|
+
added.push(top.id);
|
|
50235
|
+
}
|
|
50236
|
+
const images = opts.images ?? {};
|
|
50237
|
+
const unmapped = new Map;
|
|
50238
|
+
const children = tops.filter((top) => selected.has(top.id)).map((top) => clone(top));
|
|
50239
|
+
for (const node2 of children) {
|
|
50240
|
+
visit2(node2, node2.id, (value, nodeId) => {
|
|
50241
|
+
if (!isImage(value))
|
|
50242
|
+
return;
|
|
50243
|
+
const url = value.url;
|
|
50244
|
+
if (FILE_ID.test(url))
|
|
50245
|
+
return;
|
|
50246
|
+
const fileId = Object.hasOwn(images, url) ? images[url] : undefined;
|
|
50247
|
+
if (typeof fileId === "string") {
|
|
50248
|
+
value.url = fileId;
|
|
50249
|
+
return;
|
|
50250
|
+
}
|
|
50251
|
+
const nodeIds = unmapped.get(url);
|
|
50252
|
+
if (nodeIds) {
|
|
50253
|
+
if (!nodeIds.includes(nodeId))
|
|
50254
|
+
nodeIds.push(nodeId);
|
|
50255
|
+
} else
|
|
50256
|
+
unmapped.set(url, [nodeId]);
|
|
50257
|
+
});
|
|
50258
|
+
}
|
|
50259
|
+
for (const [url, nodeIds] of unmapped)
|
|
50260
|
+
warnings.push({ code: "IMAGE_UNMAPPED", url, nodeIds });
|
|
50261
|
+
return {
|
|
50262
|
+
children,
|
|
50263
|
+
...doc.variables ? { variables: clone(doc.variables) } : {},
|
|
50264
|
+
...doc.themes ? { themes: clone(doc.themes) } : {},
|
|
50265
|
+
added,
|
|
50266
|
+
warnings
|
|
50267
|
+
};
|
|
50268
|
+
}
|
|
50269
|
+
// src/commands/canvas-import.ts
|
|
50270
|
+
var CHUNK_CHARS = 1500000;
|
|
50271
|
+
function countNodes(nodes) {
|
|
50272
|
+
let total = 0;
|
|
50273
|
+
const walk = (list) => {
|
|
50274
|
+
for (const node2 of list) {
|
|
50275
|
+
total++;
|
|
50276
|
+
if (Array.isArray(node2.children))
|
|
50277
|
+
walk(node2.children);
|
|
50278
|
+
}
|
|
50279
|
+
};
|
|
50280
|
+
walk(nodes);
|
|
50281
|
+
return total;
|
|
50282
|
+
}
|
|
50283
|
+
function chunkTopNodes(nodes, limit = CHUNK_CHARS) {
|
|
50284
|
+
const chunks = [];
|
|
50285
|
+
let current = [];
|
|
50286
|
+
let size = 0;
|
|
50287
|
+
for (const node2 of nodes) {
|
|
50288
|
+
const length = JSON.stringify(node2).length;
|
|
50289
|
+
if (current.length && size + length > limit) {
|
|
50290
|
+
chunks.push(current);
|
|
50291
|
+
current = [];
|
|
50292
|
+
size = 0;
|
|
50293
|
+
}
|
|
50294
|
+
current.push(node2);
|
|
50295
|
+
size += length;
|
|
50296
|
+
}
|
|
50297
|
+
if (current.length)
|
|
50298
|
+
chunks.push(current);
|
|
50299
|
+
return chunks;
|
|
50300
|
+
}
|
|
50301
|
+
var CONTENT_TYPES = {
|
|
50302
|
+
png: "image/png",
|
|
50303
|
+
jpg: "image/jpeg",
|
|
50304
|
+
jpeg: "image/jpeg",
|
|
50305
|
+
webp: "image/webp",
|
|
50306
|
+
gif: "image/gif",
|
|
50307
|
+
svg: "image/svg+xml",
|
|
50308
|
+
avif: "image/avif"
|
|
50309
|
+
};
|
|
50310
|
+
var contentTypeOf = (url) => CONTENT_TYPES[url.split(".").pop()?.toLowerCase() ?? ""] ?? "application/octet-stream";
|
|
50311
|
+
var viewerUrlFor = (canvasId, env) => `https://console${env === "develop" ? "-develop" : ""}.deepraxis.com/canvases/${canvasId}`;
|
|
50312
|
+
function imageCandidates(url, penFile, roots) {
|
|
50313
|
+
const name = basename2(url);
|
|
50314
|
+
return [...new Set([
|
|
50315
|
+
join5(dirname2(penFile), url),
|
|
50316
|
+
...roots.map((root) => join5(root, url)),
|
|
50317
|
+
...roots.map((root) => join5(root, name))
|
|
50318
|
+
])];
|
|
50319
|
+
}
|
|
50320
|
+
var isMissing = (error) => error?.code === "ENOENT";
|
|
50321
|
+
var reason = (error) => error instanceof Error ? error.message : String(error);
|
|
50322
|
+
async function findImage(url, candidates, ports) {
|
|
50323
|
+
for (const path of candidates) {
|
|
50324
|
+
try {
|
|
50325
|
+
return await ports.readBytes(path);
|
|
50326
|
+
} catch (error) {
|
|
50327
|
+
if (!isMissing(error))
|
|
50328
|
+
throw new UsageError(`cannot read ${path}, needed for image ${url}`, reason(error));
|
|
50329
|
+
}
|
|
50330
|
+
}
|
|
50331
|
+
return;
|
|
50332
|
+
}
|
|
50333
|
+
var warningKey = (warning) => `${warning.code}\x00${"url" in warning ? warning.url : ("id" in warning) ? warning.id : warning.ref}\x00${"nodeId" in warning ? warning.nodeId : ""}`;
|
|
50334
|
+
var warningLine = (warning) => {
|
|
50335
|
+
switch (warning.code) {
|
|
50336
|
+
case "IMAGE_UNMAPPED":
|
|
50337
|
+
return `${warning.code}: ${warning.url} (${warning.nodeIds.length} node(s))`;
|
|
50338
|
+
case "REF_DANGLING":
|
|
50339
|
+
return `${warning.code}: ${warning.ref} at ${warning.nodeId}`;
|
|
50340
|
+
case "FRAME_NOT_FOUND":
|
|
50341
|
+
return `${warning.code}: ${warning.id}`;
|
|
50342
|
+
default:
|
|
50343
|
+
return `${warning.code}: ${warning.url}`;
|
|
50344
|
+
}
|
|
50345
|
+
};
|
|
50346
|
+
async function canvasImport(args, ports) {
|
|
50347
|
+
if (args.canvas !== undefined && !args.yes) {
|
|
50348
|
+
throw new UsageError(`--canvas ${args.canvas} clears every node already on that canvas`, "It is a whole-canvas replacement, not a merge. Re-run with --yes, or omit --canvas to import into a new canvas.");
|
|
50349
|
+
}
|
|
50350
|
+
const file = resolve3(ports.cwd, args.file);
|
|
50351
|
+
let text;
|
|
50352
|
+
try {
|
|
50353
|
+
text = await ports.readFile(file);
|
|
50354
|
+
} catch (error) {
|
|
50355
|
+
throw new UsageError(`cannot read ${args.file}`, isMissing(error) ? "Check the path: `praxis canvas import <file.pen>`." : reason(error));
|
|
50356
|
+
}
|
|
50357
|
+
let doc;
|
|
50358
|
+
try {
|
|
50359
|
+
doc = JSON.parse(text);
|
|
50360
|
+
} catch (error) {
|
|
50361
|
+
throw new UsageError(`${args.file} is not valid JSON`, reason(error));
|
|
50362
|
+
}
|
|
50363
|
+
if (!Array.isArray(doc.children))
|
|
50364
|
+
throw new UsageError(`${args.file} has no children array`, "A .pen document is an object with a children array of top-level nodes.");
|
|
50365
|
+
const frames = args.frames?.filter((frame) => frame !== "");
|
|
50366
|
+
const roots = (args.imageRoots ?? []).map((root) => resolve3(ports.cwd, root));
|
|
50367
|
+
const selection = planPenImport(doc, frames ? { frames } : {});
|
|
50368
|
+
const urls = penImageUrls(selection.children);
|
|
50369
|
+
const found = new Map;
|
|
50370
|
+
const missing = [];
|
|
50371
|
+
for (const url of urls) {
|
|
50372
|
+
const bytes = await findImage(url, imageCandidates(url, file, roots), ports);
|
|
50373
|
+
if (bytes === undefined)
|
|
50374
|
+
missing.push(url);
|
|
50375
|
+
else
|
|
50376
|
+
found.set(url, { bytes, digest: await ports.hash(bytes) });
|
|
50377
|
+
}
|
|
50378
|
+
const images = {};
|
|
50379
|
+
let uploaded = 0;
|
|
50380
|
+
let reused = 0;
|
|
50381
|
+
if (!args.dryRun) {
|
|
50382
|
+
const byDigest = new Map;
|
|
50383
|
+
for (const [url, { bytes, digest }] of found) {
|
|
50384
|
+
const existing = byDigest.get(digest);
|
|
50385
|
+
if (existing !== undefined) {
|
|
50386
|
+
images[url] = existing;
|
|
50387
|
+
reused++;
|
|
50388
|
+
continue;
|
|
50389
|
+
}
|
|
50390
|
+
const id = await ports.upload({ filename: basename2(url), bytes, contentType: contentTypeOf(url) });
|
|
50391
|
+
byDigest.set(digest, id);
|
|
50392
|
+
images[url] = id;
|
|
50393
|
+
uploaded++;
|
|
50394
|
+
}
|
|
50395
|
+
}
|
|
50396
|
+
const plan = planPenImport(doc, { ...frames ? { frames } : {}, images });
|
|
50397
|
+
const chunks = chunkTopNodes(plan.children);
|
|
50398
|
+
const nodes = countNodes(plan.children);
|
|
50399
|
+
const warnings = plan.warnings.filter((warning) => !(args.dryRun && warning.code === "IMAGE_UNMAPPED" && !missing.includes(warning.url)));
|
|
50400
|
+
let canvasId = null;
|
|
50401
|
+
let revision = null;
|
|
50402
|
+
if (!args.dryRun) {
|
|
50403
|
+
canvasId = args.canvas ?? (await ports.rpc("canvas.canvases.create", { name: args.name ?? basename2(file).replace(/\.pen$/, "") })).id;
|
|
50404
|
+
for (let index = 0;index < chunks.length; index++) {
|
|
50405
|
+
const result2 = await ports.rpc("canvas.canvases.import", {
|
|
50406
|
+
canvasId,
|
|
50407
|
+
reset: index === 0,
|
|
50408
|
+
...index === 0 && plan.variables ? { variables: plan.variables } : {},
|
|
50409
|
+
...index === 0 && plan.themes ? { themes: plan.themes } : {},
|
|
50410
|
+
children: chunks[index]
|
|
50411
|
+
});
|
|
50412
|
+
revision = result2.revision;
|
|
50413
|
+
const seen = new Set(warnings.map(warningKey));
|
|
50414
|
+
for (const warning of result2.warnings ?? []) {
|
|
50415
|
+
if (seen.has(warningKey(warning)))
|
|
50416
|
+
continue;
|
|
50417
|
+
seen.add(warningKey(warning));
|
|
50418
|
+
warnings.push(warning);
|
|
50419
|
+
}
|
|
50420
|
+
}
|
|
50421
|
+
}
|
|
50422
|
+
const result = {
|
|
50423
|
+
canvas_id: canvasId,
|
|
50424
|
+
viewer_url: canvasId === null ? null : viewerUrlFor(canvasId, ports.env),
|
|
50425
|
+
revision,
|
|
50426
|
+
frames: plan.children.map((node2) => node2.id),
|
|
50427
|
+
added: plan.added,
|
|
50428
|
+
nodes,
|
|
50429
|
+
images: { uploaded, reused, missing },
|
|
50430
|
+
chunks: chunks.length,
|
|
50431
|
+
warnings,
|
|
50432
|
+
dry_run: args.dryRun
|
|
50433
|
+
};
|
|
50434
|
+
ports.emit({ kind: "object", data: result });
|
|
50435
|
+
const name = args.name ?? basename2(file).replace(/\.pen$/, "");
|
|
50436
|
+
const headline = `${plan.children.length} top-level nodes (${plan.added.length} added as component dependencies), ${nodes} nodes, ${chunks.length} chunk(s)`;
|
|
50437
|
+
ports.human([
|
|
50438
|
+
args.dryRun ? `${file}: ${headline}` : `${canvasId} ${name} — ${headline}, ${uploaded} image(s) uploaded${reused ? `, ${reused} reused` : ""}`,
|
|
50439
|
+
...result.viewer_url ? [result.viewer_url] : [],
|
|
50440
|
+
...plan.added.length ? [`added as dependencies: ${plan.added.join(", ")}`] : [],
|
|
50441
|
+
`${urls.length - missing.length}/${urls.length} image(s) found locally`,
|
|
50442
|
+
...missing.length ? [`not found (they will not render): ${missing.join(", ")}`] : [],
|
|
50443
|
+
...warnings.map(warningLine)
|
|
50444
|
+
].join(`
|
|
50445
|
+
`));
|
|
50446
|
+
return 0;
|
|
50447
|
+
}
|
|
50448
|
+
|
|
46693
50449
|
// src/main.ts
|
|
46694
50450
|
import { spawnSync } from "node:child_process";
|
|
46695
50451
|
|
|
@@ -46749,13 +50505,13 @@ var groups = [["id"], ["name", "title", "display_name"], ["status", "state"], ["
|
|
|
46749
50505
|
var isExtraColumn = (key) => !groups.some((group) => group.includes(key));
|
|
46750
50506
|
function columnsFor(items) {
|
|
46751
50507
|
const rows = items.map(record);
|
|
46752
|
-
const
|
|
50508
|
+
const keys2 = [...new Set(rows.flatMap((row) => Object.keys(row)))];
|
|
46753
50509
|
const chosen = groups.flatMap((group) => {
|
|
46754
|
-
const key = group.find((k) =>
|
|
50510
|
+
const key = group.find((k) => keys2.includes(k));
|
|
46755
50511
|
return key ? [key] : [];
|
|
46756
50512
|
});
|
|
46757
50513
|
const standard = new Set([...groups.flat(), "object"]);
|
|
46758
|
-
const extra =
|
|
50514
|
+
const extra = keys2.filter((key) => !standard.has(key) && rows.some((row) => row[key] !== null && row[key] !== undefined) && rows.every((row) => {
|
|
46759
50515
|
const v = row[key];
|
|
46760
50516
|
return v === null || v === undefined || typeof v === "boolean" || typeof v === "number" || typeof v === "string" && [...v].length <= 24;
|
|
46761
50517
|
})).slice(0, 2);
|
|
@@ -46810,9 +50566,9 @@ class ModelStream {
|
|
|
46810
50566
|
const data = streamData(event), message = record(data.message), response = record(data.response);
|
|
46811
50567
|
this.chunks.push(streamText(event));
|
|
46812
50568
|
const choices = Array.isArray(data.choices) ? data.choices : [];
|
|
46813
|
-
const
|
|
46814
|
-
if (typeof
|
|
46815
|
-
this.finishReason =
|
|
50569
|
+
const reason2 = choices.map((c) => record(c).finish_reason).find((r) => typeof r === "string" && r) ?? record(data.delta).stop_reason ?? message.stop_reason ?? data.stop_reason ?? record(response.incomplete_details).reason ?? response.status;
|
|
50570
|
+
if (typeof reason2 === "string" && reason2)
|
|
50571
|
+
this.finishReason = reason2;
|
|
46816
50572
|
else if (["response.completed", "response.incomplete", "response.failed"].includes(String(data.type)))
|
|
46817
50573
|
this.finishReason = String(data.type).slice("response.".length);
|
|
46818
50574
|
for (const usage of [message.usage, data.usage, response.usage]) {
|
|
@@ -47247,14 +51003,17 @@ var humanize = (code) => {
|
|
|
47247
51003
|
const words = code.toLowerCase().split("_").filter(Boolean).join(" ");
|
|
47248
51004
|
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
47249
51005
|
};
|
|
47250
|
-
function authHint(source) {
|
|
51006
|
+
function authHint(source, env) {
|
|
51007
|
+
const keyVariable = apiKeyVariable(env);
|
|
47251
51008
|
switch (source) {
|
|
47252
51009
|
case "api-key":
|
|
47253
|
-
return
|
|
51010
|
+
return `The ${env} API key from ${keyVariable} was rejected; check or replace it, or unset it to use \`praxis login\`.`;
|
|
47254
51011
|
case "machine-token":
|
|
47255
51012
|
return "The machine token from PRAXIS_API_TOKEN was rejected (it may have expired); unset it to use `praxis login`, or refresh it.";
|
|
51013
|
+
case "managed-login":
|
|
51014
|
+
return "The managed login the platform wrote was rejected or has expired; the platform renews it — retry in a minute. Run `praxis login` on your own computer to use a personal login instead.";
|
|
47256
51015
|
case "login":
|
|
47257
|
-
return
|
|
51016
|
+
return `Run \`praxis login\` or set ${keyVariable}.`;
|
|
47258
51017
|
}
|
|
47259
51018
|
}
|
|
47260
51019
|
function errorInput(error, ctx) {
|
|
@@ -47276,7 +51035,7 @@ function errorInput(error, ctx) {
|
|
|
47276
51035
|
message = `${humanize(code)}${message ? `: ${message}` : ""}`;
|
|
47277
51036
|
const status = sdk?.status, request_id = sdk?.requestId;
|
|
47278
51037
|
message = serverText(problem?.detail) ?? serverText(problem?.title) ?? message;
|
|
47279
|
-
const authFailure = status === 401 || ["NOT_LOGGED_IN", "UNAUTHENTICATED", "TOKEN_REVOKED", "LOGIN_FAILED"].includes(code);
|
|
51038
|
+
const authFailure = status === 401 || ["NOT_LOGGED_IN", "UNAUTHENTICATED", "TOKEN_REVOKED", "LOGIN_FAILED", "MANAGED_LOGIN_EXPIRED"].includes(code);
|
|
47280
51039
|
const source = ctx.credentialSource ?? "login";
|
|
47281
51040
|
let hint2 = genericHint;
|
|
47282
51041
|
if (error instanceof UsageError)
|
|
@@ -47284,7 +51043,7 @@ function errorInput(error, ctx) {
|
|
|
47284
51043
|
else if (serverText(problem?.hint))
|
|
47285
51044
|
hint2 = serverText(problem?.hint);
|
|
47286
51045
|
else if (authFailure)
|
|
47287
|
-
hint2 = authHint(source);
|
|
51046
|
+
hint2 = authHint(source, ctx.env === "develop" ? "develop" : "production");
|
|
47288
51047
|
else if (status === 404)
|
|
47289
51048
|
hint2 = ctx.listCommand ? `Check the id; list existing ones with \`${ctx.listCommand}\`` : "Check the id.";
|
|
47290
51049
|
else if (status === 403)
|
|
@@ -47323,7 +51082,7 @@ function startProgress(ctx, write = (text) => writeOutput({ stderr: text })) {
|
|
|
47323
51082
|
}
|
|
47324
51083
|
|
|
47325
51084
|
// src/main.ts
|
|
47326
|
-
var version = "0.2.2-dev.
|
|
51085
|
+
var version = "0.2.2-dev.36d48d0";
|
|
47327
51086
|
var commands = commandTree(operations);
|
|
47328
51087
|
var manual = [...workflows.map((w) => w.words), [API_WORD]];
|
|
47329
51088
|
function route(argv) {
|
|
@@ -47360,19 +51119,21 @@ var defaults = {
|
|
|
47360
51119
|
stderrIsTTY: Boolean(process.stderr.isTTY),
|
|
47361
51120
|
columns: process.stdout.columns ?? 100,
|
|
47362
51121
|
readFile: (path) => readFile3(path, "utf8"),
|
|
51122
|
+
readBytes: (path) => readFile3(path),
|
|
51123
|
+
sha256: async (bytes) => createHash3("sha256").update(bytes).digest("hex"),
|
|
47363
51124
|
async readStdin() {
|
|
47364
51125
|
const chunks = [];
|
|
47365
51126
|
for await (const chunk of process.stdin)
|
|
47366
51127
|
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
47367
51128
|
return Buffer.concat(chunks).toString("utf8");
|
|
47368
51129
|
},
|
|
47369
|
-
ask: () => new Promise((
|
|
51130
|
+
ask: () => new Promise((resolve4) => {
|
|
47370
51131
|
const input = createInterface({ input: process.stdin, terminal: false });
|
|
47371
51132
|
input.once("line", (line) => {
|
|
47372
|
-
|
|
51133
|
+
resolve4(/^(y|yes)$/i.test(line.trim()));
|
|
47373
51134
|
input.close();
|
|
47374
51135
|
});
|
|
47375
|
-
input.once("close", () =>
|
|
51136
|
+
input.once("close", () => resolve4(false));
|
|
47376
51137
|
}),
|
|
47377
51138
|
async openBrowser(url) {
|
|
47378
51139
|
try {
|
|
@@ -47380,27 +51141,27 @@ var defaults = {
|
|
|
47380
51141
|
if (!["https:", "http:"].includes(parsed.protocol))
|
|
47381
51142
|
return;
|
|
47382
51143
|
const cmd = process.platform === "darwin" ? ["open", url] : process.platform === "win32" ? ["rundll32", "url.dll,FileProtocolHandler", url] : ["xdg-open", url];
|
|
47383
|
-
await new Promise((
|
|
51144
|
+
await new Promise((resolve4, reject) => {
|
|
47384
51145
|
const child = spawn2(cmd[0], cmd.slice(1), { stdio: "ignore" });
|
|
47385
51146
|
child.once("error", reject);
|
|
47386
|
-
child.once("close", () =>
|
|
51147
|
+
child.once("close", () => resolve4());
|
|
47387
51148
|
});
|
|
47388
51149
|
} catch {}
|
|
47389
51150
|
},
|
|
47390
|
-
wait: (ms) => new Promise((
|
|
51151
|
+
wait: (ms) => new Promise((resolve4) => setTimeout(resolve4, ms)),
|
|
47391
51152
|
render,
|
|
47392
|
-
spawn: (cmd, args, options) => new Promise((
|
|
51153
|
+
spawn: (cmd, args, options) => new Promise((resolve4, reject) => {
|
|
47393
51154
|
const child = spawn2(cmd, args, { cwd: options.cwd, stdio: ["ignore", 2, 2] });
|
|
47394
51155
|
child.once("error", reject);
|
|
47395
|
-
child.once("close", (code) =>
|
|
51156
|
+
child.once("close", (code) => resolve4(code ?? 1));
|
|
47396
51157
|
}),
|
|
47397
|
-
spawnCapture: (cmd, args, options) => new Promise((
|
|
51158
|
+
spawnCapture: (cmd, args, options) => new Promise((resolve4, reject) => {
|
|
47398
51159
|
const child = spawn2(cmd, args, { cwd: options.cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
47399
51160
|
const chunks = [];
|
|
47400
51161
|
child.stdout.on("data", (c) => chunks.push(c));
|
|
47401
51162
|
child.stderr.on("data", (c) => chunks.push(c));
|
|
47402
51163
|
child.once("error", reject);
|
|
47403
|
-
child.once("close", (code) =>
|
|
51164
|
+
child.once("close", (code) => resolve4({ code: code ?? 1, output: Buffer.concat(chunks).toString("utf8") }));
|
|
47404
51165
|
}),
|
|
47405
51166
|
has: (bin) => spawnSync(process.platform === "win32" ? "where" : "which", [bin], { stdio: "ignore" }).status === 0,
|
|
47406
51167
|
cwd: process.cwd()
|
|
@@ -47419,6 +51180,13 @@ var appOptions = {
|
|
|
47419
51180
|
{ name: "no-wait", type: "boolean", description: "Return as soon as the run exists instead of waiting for a verdict." },
|
|
47420
51181
|
{ name: "repeat", type: "string", description: "How many times each selected case runs (default: 1)." },
|
|
47421
51182
|
{ name: "select", type: "string", repeated: true, description: "Narrow the selection; repeatable. tag:<tag> (a bare word reads as a tag), package:<path>, suite:<path> or file:<path>." }
|
|
51183
|
+
],
|
|
51184
|
+
"canvas import": [
|
|
51185
|
+
{ name: "name", type: "string", description: "Name for the new canvas (default: the file name without .pen)." },
|
|
51186
|
+
{ name: "canvas", type: "string", description: "Import into this existing canvas instead of a new one. Whole-canvas replacement: it clears what is already there and requires --yes." },
|
|
51187
|
+
{ name: "frames", type: "string", description: "Comma-separated top-level node ids to import. The components they reference come along automatically." },
|
|
51188
|
+
{ name: "image-root", type: "string", repeated: true, description: "Directory to resolve image paths against; repeatable. Tried after the .pen file's own directory, then by file name." },
|
|
51189
|
+
{ name: "dry-run", type: "boolean", description: "Read the local file and print the plan. No login and no request." }
|
|
47422
51190
|
]
|
|
47423
51191
|
};
|
|
47424
51192
|
async function main(argv, injected = {}) {
|
|
@@ -47427,6 +51195,8 @@ async function main(argv, injected = {}) {
|
|
|
47427
51195
|
const write = outputSession((result, context) => ports.render(redact(result, secrets), context));
|
|
47428
51196
|
if (ports.env.PRAXIS_API_KEY)
|
|
47429
51197
|
secrets.push(ports.env.PRAXIS_API_KEY);
|
|
51198
|
+
if (ports.env.PRAXIS_API_KEY_DEVELOP)
|
|
51199
|
+
secrets.push(ports.env.PRAXIS_API_KEY_DEVELOP);
|
|
47430
51200
|
if (ports.env.PRAXIS_API_TOKEN)
|
|
47431
51201
|
secrets.push(ports.env.PRAXIS_API_TOKEN);
|
|
47432
51202
|
let ctx = {
|
|
@@ -47516,7 +51286,7 @@ Examples:
|
|
|
47516
51286
|
return 0;
|
|
47517
51287
|
}
|
|
47518
51288
|
const path = ports.tokenPath ?? tokenPath(config.env);
|
|
47519
|
-
const
|
|
51289
|
+
const store2 = createTokenStore(config.env, path, selectSecretStore(ports.env, ports.secretStore));
|
|
47520
51290
|
const wireFetch = async (input, init) => {
|
|
47521
51291
|
const request = new Request(input, init);
|
|
47522
51292
|
request.headers.set("User-Agent", `praxis-cli/${version}${ctx.mode === "agent" ? ` agent/${ctx.agentName ?? "unknown"}` : ""}`);
|
|
@@ -47526,7 +51296,7 @@ Examples:
|
|
|
47526
51296
|
}
|
|
47527
51297
|
return ports.fetch(request);
|
|
47528
51298
|
};
|
|
47529
|
-
const auth = credentials(config, ports.env, { fetch: wireFetch, now: ports.now, path, store, remember: (s) => {
|
|
51299
|
+
const auth = credentials(config, ports.env, { fetch: wireFetch, now: ports.now, path, store: store2, remember: (s) => {
|
|
47530
51300
|
secrets.push(s);
|
|
47531
51301
|
} });
|
|
47532
51302
|
ctx.credentialSource = auth.source;
|
|
@@ -47602,7 +51372,7 @@ Examples:
|
|
|
47602
51372
|
return 0;
|
|
47603
51373
|
}
|
|
47604
51374
|
const name = selected.words.join(" ");
|
|
47605
|
-
const arity = name === "api" ? 2 : name === "org switch" || name === "app create" ? 1 : 0;
|
|
51375
|
+
const arity = name === "api" ? 2 : name === "org switch" || name === "app create" || name === "canvas import" ? 1 : 0;
|
|
47606
51376
|
if (parsed.positional.length !== arity)
|
|
47607
51377
|
throw new UsageError(`${name} expects ${arity} positional argument(s)`);
|
|
47608
51378
|
if (name === "devops deploy plan") {
|
|
@@ -47635,12 +51405,16 @@ Examples:
|
|
|
47635
51405
|
switch (name) {
|
|
47636
51406
|
case "login":
|
|
47637
51407
|
if (flags["no-input"] || quiet)
|
|
47638
|
-
throw new UsageError("login requires displaying a device code", "Remove --no-input / --quiet or set PRAXIS_API_KEY for scripts.");
|
|
51408
|
+
throw new UsageError("login requires displaying a device code", "Remove --no-input / --quiet, or set PRAXIS_API_KEY (production) / PRAXIS_API_KEY_DEVELOP (develop) for scripts.");
|
|
51409
|
+
if (auth.source === "managed-login")
|
|
51410
|
+
throw new UsageError("This machine has a managed login the platform renews; it is already signed in", "Use it as it is. `praxis login` is for your own computer, where no platform writes the login file.");
|
|
47639
51411
|
ctx.credentialSource = "login";
|
|
47640
|
-
await login(config, path, { ...ports, source: auth.source, json: ctx.mode === "json", store, fetch: wireFetch, emit, remember: (s) => secrets.push(s) });
|
|
51412
|
+
await login(config, path, { ...ports, source: auth.source, json: ctx.mode === "json", store: store2, fetch: wireFetch, emit, remember: (s) => secrets.push(s) });
|
|
47641
51413
|
break;
|
|
47642
51414
|
case "logout":
|
|
47643
|
-
|
|
51415
|
+
if (auth.source === "managed-login")
|
|
51416
|
+
throw new UsageError("This machine has a managed login the platform renews; there is nothing to log out of", "Nothing here is a session of yours to end. `praxis logout` removes a login you made on your own computer.");
|
|
51417
|
+
emit({ kind: "message", text: await store2.delete() ? "Logged out." : "Not logged in." });
|
|
47644
51418
|
break;
|
|
47645
51419
|
case "whoami":
|
|
47646
51420
|
emit({ kind: "object", data: await whoami(auth, config.env, org) });
|
|
@@ -47699,6 +51473,67 @@ Examples:
|
|
|
47699
51473
|
cwd: ports.cwd
|
|
47700
51474
|
});
|
|
47701
51475
|
}
|
|
51476
|
+
case "canvas import": {
|
|
51477
|
+
const authorize = async () => {
|
|
51478
|
+
const credential = await auth.get(org);
|
|
51479
|
+
return { Authorization: `Bearer ${credential.token}`, ...credential.source === "api-key" ? { "X-API-Key": credential.token } : {} };
|
|
51480
|
+
};
|
|
51481
|
+
const rpc = async (method, params) => {
|
|
51482
|
+
const response = await wireFetch(`${config.apiUrl}/canvas/v1/rpc`, {
|
|
51483
|
+
method: "POST",
|
|
51484
|
+
headers: { ...await authorize(), "content-type": "application/json" },
|
|
51485
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }),
|
|
51486
|
+
signal: AbortSignal.timeout(120000),
|
|
51487
|
+
redirect: "error"
|
|
51488
|
+
});
|
|
51489
|
+
const reply = await response.json();
|
|
51490
|
+
if (!response.ok || reply.error)
|
|
51491
|
+
throw new PraxisError({ code: "CANVAS_RPC_ERROR", message: `${method}: ${reply.error?.message ?? `HTTP ${response.status}`}` });
|
|
51492
|
+
if (!Object.hasOwn(reply, "result"))
|
|
51493
|
+
throw new PraxisError({ code: "INVALID_RESPONSE", message: `${method} answered no result` });
|
|
51494
|
+
return reply.result;
|
|
51495
|
+
};
|
|
51496
|
+
const upload = async ({ filename, bytes, contentType }) => {
|
|
51497
|
+
const signed = await wireFetch(`${config.apiUrl}/file/v1/uploads/signed`, {
|
|
51498
|
+
method: "POST",
|
|
51499
|
+
headers: { ...await authorize(), "content-type": "application/json" },
|
|
51500
|
+
body: JSON.stringify({ filename, bytes: bytes.length, content_type: contentType, purpose: "user_data" }),
|
|
51501
|
+
signal: AbortSignal.timeout(60000),
|
|
51502
|
+
redirect: "error"
|
|
51503
|
+
});
|
|
51504
|
+
const session = await signed.json();
|
|
51505
|
+
if (!signed.ok || typeof session.url !== "string")
|
|
51506
|
+
throw new PraxisError({ code: "UPLOAD_REJECTED", message: `signed upload for ${filename} failed (HTTP ${signed.status})` });
|
|
51507
|
+
const sent = await wireFetch(session.url, { method: "PUT", headers: { "content-type": contentType, "content-length": String(bytes.length) }, body: bytes, signal: AbortSignal.timeout(120000), redirect: "error" });
|
|
51508
|
+
const file = await sent.json();
|
|
51509
|
+
if (!sent.ok || typeof file.id !== "string")
|
|
51510
|
+
throw new PraxisError({ code: "UPLOAD_FAILED", message: `uploading ${filename} failed (HTTP ${sent.status})` });
|
|
51511
|
+
return file.id;
|
|
51512
|
+
};
|
|
51513
|
+
return await canvasImport({
|
|
51514
|
+
file: parsed.positional[0],
|
|
51515
|
+
name: parsed.flags.name?.[0],
|
|
51516
|
+
canvas: parsed.flags.canvas?.[0],
|
|
51517
|
+
frames: typeof parsed.flags.frames?.[0] === "string" ? parsed.flags.frames[0].split(",").map((frame) => frame.trim()).filter(Boolean) : undefined,
|
|
51518
|
+
imageRoots: parsed.flags["image-root"],
|
|
51519
|
+
dryRun: Boolean(parsed.flags["dry-run"]?.[0]),
|
|
51520
|
+
yes: Boolean(flags.yes)
|
|
51521
|
+
}, {
|
|
51522
|
+
readFile: ports.readFile,
|
|
51523
|
+
readBytes: ports.readBytes,
|
|
51524
|
+
hash: ports.sha256,
|
|
51525
|
+
env: config.env,
|
|
51526
|
+
mode: ctx.mode,
|
|
51527
|
+
emit,
|
|
51528
|
+
cwd: ports.cwd,
|
|
51529
|
+
rpc,
|
|
51530
|
+
upload,
|
|
51531
|
+
human: (text) => {
|
|
51532
|
+
if (ctx.mode === "human")
|
|
51533
|
+
emit({ kind: "message", channel: "stdout", text });
|
|
51534
|
+
}
|
|
51535
|
+
});
|
|
51536
|
+
}
|
|
47702
51537
|
case "api": {
|
|
47703
51538
|
const method = parsed.positional[0];
|
|
47704
51539
|
if (!HTTP_METHOD.test(method))
|