@vibedropio/publisher 0.25.4 → 0.25.6
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git-publisher",
|
|
3
3
|
"displayName": "Git Publisher",
|
|
4
|
-
"version": "0.25.
|
|
4
|
+
"version": "0.25.6",
|
|
5
5
|
"description": "Publish an app folder to the platform and keep it updated (\"publish my app\", \"update my app\", \"fetch the engineered version\").",
|
|
6
6
|
"author": { "name": "VibeDrop" },
|
|
7
7
|
"keywords": ["git", "publish", "deploy", "serverless"]
|
package/dist/publisher.cjs
CHANGED
|
@@ -19781,10 +19781,10 @@ var getRepos = {
|
|
|
19781
19781
|
answers: {
|
|
19782
19782
|
200: external_exports.object({
|
|
19783
19783
|
repositories: external_exports.array(external_exports.object({
|
|
19784
|
-
repoId: external_exports.string()
|
|
19784
|
+
repoId: external_exports.string(),
|
|
19785
19785
|
name: external_exports.string(),
|
|
19786
|
-
createdAt: external_exports.string()
|
|
19787
|
-
createdBy: external_exports.string()
|
|
19786
|
+
createdAt: external_exports.string(),
|
|
19787
|
+
createdBy: external_exports.string(),
|
|
19788
19788
|
generation: external_exports.int().min(0),
|
|
19789
19789
|
refCount: external_exports.int().min(0),
|
|
19790
19790
|
size: external_exports.object({
|
|
@@ -19793,7 +19793,7 @@ var getRepos = {
|
|
|
19793
19793
|
packCount: external_exports.int()
|
|
19794
19794
|
}),
|
|
19795
19795
|
archived: external_exports.union([
|
|
19796
|
-
external_exports.string()
|
|
19796
|
+
external_exports.string(),
|
|
19797
19797
|
external_exports.null()
|
|
19798
19798
|
]),
|
|
19799
19799
|
lastTransaction: external_exports.union([
|
|
@@ -19801,7 +19801,7 @@ var getRepos = {
|
|
|
19801
19801
|
id: external_exports.string(),
|
|
19802
19802
|
kind: external_exports.string(),
|
|
19803
19803
|
generation: external_exports.int().min(0),
|
|
19804
|
-
committedAt: external_exports.string()
|
|
19804
|
+
committedAt: external_exports.string()
|
|
19805
19805
|
}),
|
|
19806
19806
|
external_exports.null()
|
|
19807
19807
|
])
|
|
@@ -19819,11 +19819,11 @@ var postRepos = {
|
|
|
19819
19819
|
objectFormat: external_exports.literal("sha1").optional(),
|
|
19820
19820
|
grants: external_exports.array(external_exports.xor([
|
|
19821
19821
|
external_exports.object({
|
|
19822
|
-
principal: external_exports.string().regex(new RegExp("^[a-zA-Z0-9][a-zA-Z0-9._
|
|
19822
|
+
principal: external_exports.string().regex(new RegExp("^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$")),
|
|
19823
19823
|
role: external_exports.literal("admin")
|
|
19824
19824
|
}),
|
|
19825
19825
|
external_exports.object({
|
|
19826
|
-
principal: external_exports.string().regex(new RegExp("^[a-zA-Z0-9][a-zA-Z0-9._
|
|
19826
|
+
principal: external_exports.string().regex(new RegExp("^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$")),
|
|
19827
19827
|
role: external_exports.literal("collaborator"),
|
|
19828
19828
|
canRead: external_exports.boolean(),
|
|
19829
19829
|
write: external_exports.array(external_exports.string().min(1).max(512)).max(64).optional(),
|
|
@@ -19835,21 +19835,21 @@ var postRepos = {
|
|
|
19835
19835
|
answers: {
|
|
19836
19836
|
200: external_exports.object({
|
|
19837
19837
|
repository: external_exports.object({
|
|
19838
|
-
repoId: external_exports.string()
|
|
19838
|
+
repoId: external_exports.string(),
|
|
19839
19839
|
name: external_exports.string(),
|
|
19840
|
-
objectFormat: external_exports.literal("sha1"),
|
|
19840
|
+
objectFormat: external_exports.union([external_exports.literal("sha1"), external_exports.string()]),
|
|
19841
19841
|
generation: external_exports.int().min(0),
|
|
19842
19842
|
head: external_exports.object({
|
|
19843
19843
|
symbolic: external_exports.string().min(1).max(512)
|
|
19844
19844
|
}),
|
|
19845
|
-
refs: external_exports.record(external_exports.string().min(1).max(512), external_exports.string()
|
|
19846
|
-
createdAt: external_exports.string()
|
|
19845
|
+
refs: external_exports.record(external_exports.string().min(1).max(512), external_exports.string()),
|
|
19846
|
+
createdAt: external_exports.string(),
|
|
19847
19847
|
archived: external_exports.union([
|
|
19848
|
-
external_exports.string()
|
|
19848
|
+
external_exports.string(),
|
|
19849
19849
|
external_exports.null()
|
|
19850
19850
|
]),
|
|
19851
19851
|
movedTo: external_exports.union([
|
|
19852
|
-
external_exports.string()
|
|
19852
|
+
external_exports.string(),
|
|
19853
19853
|
external_exports.null()
|
|
19854
19854
|
]),
|
|
19855
19855
|
size: external_exports.object({
|
|
@@ -19862,7 +19862,7 @@ var postRepos = {
|
|
|
19862
19862
|
id: external_exports.string(),
|
|
19863
19863
|
kind: external_exports.string(),
|
|
19864
19864
|
generation: external_exports.int().min(0),
|
|
19865
|
-
committedAt: external_exports.string()
|
|
19865
|
+
committedAt: external_exports.string()
|
|
19866
19866
|
}),
|
|
19867
19867
|
external_exports.null()
|
|
19868
19868
|
]),
|
|
@@ -19894,21 +19894,21 @@ var postRepos = {
|
|
|
19894
19894
|
}),
|
|
19895
19895
|
201: external_exports.object({
|
|
19896
19896
|
repository: external_exports.object({
|
|
19897
|
-
repoId: external_exports.string()
|
|
19897
|
+
repoId: external_exports.string(),
|
|
19898
19898
|
name: external_exports.string(),
|
|
19899
|
-
objectFormat: external_exports.literal("sha1"),
|
|
19899
|
+
objectFormat: external_exports.union([external_exports.literal("sha1"), external_exports.string()]),
|
|
19900
19900
|
generation: external_exports.int().min(0),
|
|
19901
19901
|
head: external_exports.object({
|
|
19902
19902
|
symbolic: external_exports.string().min(1).max(512)
|
|
19903
19903
|
}),
|
|
19904
|
-
refs: external_exports.record(external_exports.string().min(1).max(512), external_exports.string()
|
|
19905
|
-
createdAt: external_exports.string()
|
|
19904
|
+
refs: external_exports.record(external_exports.string().min(1).max(512), external_exports.string()),
|
|
19905
|
+
createdAt: external_exports.string(),
|
|
19906
19906
|
archived: external_exports.union([
|
|
19907
|
-
external_exports.string()
|
|
19907
|
+
external_exports.string(),
|
|
19908
19908
|
external_exports.null()
|
|
19909
19909
|
]),
|
|
19910
19910
|
movedTo: external_exports.union([
|
|
19911
|
-
external_exports.string()
|
|
19911
|
+
external_exports.string(),
|
|
19912
19912
|
external_exports.null()
|
|
19913
19913
|
]),
|
|
19914
19914
|
size: external_exports.object({
|
|
@@ -19921,7 +19921,7 @@ var postRepos = {
|
|
|
19921
19921
|
id: external_exports.string(),
|
|
19922
19922
|
kind: external_exports.string(),
|
|
19923
19923
|
generation: external_exports.int().min(0),
|
|
19924
|
-
committedAt: external_exports.string()
|
|
19924
|
+
committedAt: external_exports.string()
|
|
19925
19925
|
}),
|
|
19926
19926
|
external_exports.null()
|
|
19927
19927
|
]),
|
|
@@ -19958,21 +19958,21 @@ var getReposByRepoId = {
|
|
|
19958
19958
|
answers: {
|
|
19959
19959
|
200: external_exports.object({
|
|
19960
19960
|
repository: external_exports.object({
|
|
19961
|
-
repoId: external_exports.string()
|
|
19961
|
+
repoId: external_exports.string(),
|
|
19962
19962
|
name: external_exports.string(),
|
|
19963
|
-
objectFormat: external_exports.literal("sha1"),
|
|
19963
|
+
objectFormat: external_exports.union([external_exports.literal("sha1"), external_exports.string()]),
|
|
19964
19964
|
generation: external_exports.int().min(0),
|
|
19965
19965
|
head: external_exports.object({
|
|
19966
19966
|
symbolic: external_exports.string().min(1).max(512)
|
|
19967
19967
|
}),
|
|
19968
|
-
refs: external_exports.record(external_exports.string().min(1).max(512), external_exports.string()
|
|
19969
|
-
createdAt: external_exports.string()
|
|
19968
|
+
refs: external_exports.record(external_exports.string().min(1).max(512), external_exports.string()),
|
|
19969
|
+
createdAt: external_exports.string(),
|
|
19970
19970
|
archived: external_exports.union([
|
|
19971
|
-
external_exports.string()
|
|
19971
|
+
external_exports.string(),
|
|
19972
19972
|
external_exports.null()
|
|
19973
19973
|
]),
|
|
19974
19974
|
movedTo: external_exports.union([
|
|
19975
|
-
external_exports.string()
|
|
19975
|
+
external_exports.string(),
|
|
19976
19976
|
external_exports.null()
|
|
19977
19977
|
]),
|
|
19978
19978
|
size: external_exports.object({
|
|
@@ -19985,7 +19985,7 @@ var getReposByRepoId = {
|
|
|
19985
19985
|
id: external_exports.string(),
|
|
19986
19986
|
kind: external_exports.string(),
|
|
19987
19987
|
generation: external_exports.int().min(0),
|
|
19988
|
-
committedAt: external_exports.string()
|
|
19988
|
+
committedAt: external_exports.string()
|
|
19989
19989
|
}),
|
|
19990
19990
|
external_exports.null()
|
|
19991
19991
|
]),
|
|
@@ -20025,21 +20025,21 @@ var getReposBundle = {
|
|
|
20025
20025
|
head: external_exports.object({
|
|
20026
20026
|
symbolic: external_exports.string().min(1).max(512)
|
|
20027
20027
|
}),
|
|
20028
|
-
refs: external_exports.record(external_exports.string().min(1).max(512), external_exports.string()
|
|
20028
|
+
refs: external_exports.record(external_exports.string().min(1).max(512), external_exports.string()),
|
|
20029
20029
|
base: external_exports.union([
|
|
20030
20030
|
external_exports.object({
|
|
20031
|
-
url: external_exports.
|
|
20032
|
-
sha256: external_exports.string()
|
|
20031
|
+
url: external_exports.string(),
|
|
20032
|
+
sha256: external_exports.string(),
|
|
20033
20033
|
size: external_exports.int().min(0),
|
|
20034
|
-
expiresAt: external_exports.string()
|
|
20034
|
+
expiresAt: external_exports.string()
|
|
20035
20035
|
}),
|
|
20036
20036
|
external_exports.null()
|
|
20037
20037
|
]),
|
|
20038
20038
|
packs: external_exports.array(external_exports.object({
|
|
20039
|
-
url: external_exports.
|
|
20040
|
-
sha256: external_exports.string()
|
|
20039
|
+
url: external_exports.string(),
|
|
20040
|
+
sha256: external_exports.string(),
|
|
20041
20041
|
size: external_exports.int().min(0),
|
|
20042
|
-
expiresAt: external_exports.string()
|
|
20042
|
+
expiresAt: external_exports.string()
|
|
20043
20043
|
}))
|
|
20044
20044
|
})
|
|
20045
20045
|
}
|
|
@@ -20047,7 +20047,7 @@ var getReposBundle = {
|
|
|
20047
20047
|
var postReposPublications = {
|
|
20048
20048
|
path: (params) => `/v1/repos/${encodeURIComponent(params.repoId)}/publications`,
|
|
20049
20049
|
body: external_exports.object({
|
|
20050
|
-
publicationId: external_exports.string().regex(new RegExp("^
|
|
20050
|
+
publicationId: external_exports.string().regex(new RegExp("^pub-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$")),
|
|
20051
20051
|
baseGeneration: external_exports.int().min(0),
|
|
20052
20052
|
refUpdates: external_exports.array(external_exports.object({
|
|
20053
20053
|
ref: external_exports.string().min(1).max(512),
|
|
@@ -20079,16 +20079,16 @@ var postReposPublications = {
|
|
|
20079
20079
|
answers: {
|
|
20080
20080
|
200: external_exports.object({
|
|
20081
20081
|
publication: external_exports.object({
|
|
20082
|
-
publicationId: external_exports.string()
|
|
20083
|
-
repoId: external_exports.string()
|
|
20084
|
-
state: external_exports.enum(["created", "finalizing", "accepted", "rejected", "unknown"]),
|
|
20082
|
+
publicationId: external_exports.string(),
|
|
20083
|
+
repoId: external_exports.string(),
|
|
20084
|
+
state: external_exports.union([external_exports.enum(["created", "finalizing", "accepted", "rejected", "unknown"]), external_exports.string()]),
|
|
20085
20085
|
baseGeneration: external_exports.int().min(0),
|
|
20086
20086
|
resultGeneration: external_exports.union([
|
|
20087
20087
|
external_exports.int().min(0),
|
|
20088
20088
|
external_exports.null()
|
|
20089
20089
|
]),
|
|
20090
20090
|
refs: external_exports.union([
|
|
20091
|
-
external_exports.record(external_exports.string().min(1).max(512), external_exports.string()
|
|
20091
|
+
external_exports.record(external_exports.string().min(1).max(512), external_exports.string()),
|
|
20092
20092
|
external_exports.null()
|
|
20093
20093
|
]),
|
|
20094
20094
|
rejection: external_exports.union([
|
|
@@ -20103,39 +20103,39 @@ var postReposPublications = {
|
|
|
20103
20103
|
external_exports.object({
|
|
20104
20104
|
id: external_exports.string(),
|
|
20105
20105
|
committedAt: external_exports.union([
|
|
20106
|
-
external_exports.string()
|
|
20106
|
+
external_exports.string(),
|
|
20107
20107
|
external_exports.null()
|
|
20108
20108
|
])
|
|
20109
20109
|
}),
|
|
20110
20110
|
external_exports.null()
|
|
20111
20111
|
]),
|
|
20112
20112
|
attempts: external_exports.int(),
|
|
20113
|
-
createdAt: external_exports.string()
|
|
20114
|
-
finalizeUntil: external_exports.string()
|
|
20115
|
-
updatedAt: external_exports.string()
|
|
20113
|
+
createdAt: external_exports.string(),
|
|
20114
|
+
finalizeUntil: external_exports.string(),
|
|
20115
|
+
updatedAt: external_exports.string()
|
|
20116
20116
|
}),
|
|
20117
20117
|
upload: external_exports.union([
|
|
20118
20118
|
external_exports.object({
|
|
20119
20119
|
method: external_exports.literal("PUT"),
|
|
20120
|
-
url: external_exports.
|
|
20120
|
+
url: external_exports.string(),
|
|
20121
20121
|
headers: external_exports.record(external_exports.string(), external_exports.string()),
|
|
20122
|
-
expiresAt: external_exports.string()
|
|
20122
|
+
expiresAt: external_exports.string()
|
|
20123
20123
|
}),
|
|
20124
20124
|
external_exports.null()
|
|
20125
20125
|
])
|
|
20126
20126
|
}),
|
|
20127
20127
|
201: external_exports.object({
|
|
20128
20128
|
publication: external_exports.object({
|
|
20129
|
-
publicationId: external_exports.string()
|
|
20130
|
-
repoId: external_exports.string()
|
|
20131
|
-
state: external_exports.enum(["created", "finalizing", "accepted", "rejected", "unknown"]),
|
|
20129
|
+
publicationId: external_exports.string(),
|
|
20130
|
+
repoId: external_exports.string(),
|
|
20131
|
+
state: external_exports.union([external_exports.enum(["created", "finalizing", "accepted", "rejected", "unknown"]), external_exports.string()]),
|
|
20132
20132
|
baseGeneration: external_exports.int().min(0),
|
|
20133
20133
|
resultGeneration: external_exports.union([
|
|
20134
20134
|
external_exports.int().min(0),
|
|
20135
20135
|
external_exports.null()
|
|
20136
20136
|
]),
|
|
20137
20137
|
refs: external_exports.union([
|
|
20138
|
-
external_exports.record(external_exports.string().min(1).max(512), external_exports.string()
|
|
20138
|
+
external_exports.record(external_exports.string().min(1).max(512), external_exports.string()),
|
|
20139
20139
|
external_exports.null()
|
|
20140
20140
|
]),
|
|
20141
20141
|
rejection: external_exports.union([
|
|
@@ -20150,23 +20150,23 @@ var postReposPublications = {
|
|
|
20150
20150
|
external_exports.object({
|
|
20151
20151
|
id: external_exports.string(),
|
|
20152
20152
|
committedAt: external_exports.union([
|
|
20153
|
-
external_exports.string()
|
|
20153
|
+
external_exports.string(),
|
|
20154
20154
|
external_exports.null()
|
|
20155
20155
|
])
|
|
20156
20156
|
}),
|
|
20157
20157
|
external_exports.null()
|
|
20158
20158
|
]),
|
|
20159
20159
|
attempts: external_exports.int(),
|
|
20160
|
-
createdAt: external_exports.string()
|
|
20161
|
-
finalizeUntil: external_exports.string()
|
|
20162
|
-
updatedAt: external_exports.string()
|
|
20160
|
+
createdAt: external_exports.string(),
|
|
20161
|
+
finalizeUntil: external_exports.string(),
|
|
20162
|
+
updatedAt: external_exports.string()
|
|
20163
20163
|
}),
|
|
20164
20164
|
upload: external_exports.union([
|
|
20165
20165
|
external_exports.object({
|
|
20166
20166
|
method: external_exports.literal("PUT"),
|
|
20167
|
-
url: external_exports.
|
|
20167
|
+
url: external_exports.string(),
|
|
20168
20168
|
headers: external_exports.record(external_exports.string(), external_exports.string()),
|
|
20169
|
-
expiresAt: external_exports.string()
|
|
20169
|
+
expiresAt: external_exports.string()
|
|
20170
20170
|
}),
|
|
20171
20171
|
external_exports.null()
|
|
20172
20172
|
])
|
|
@@ -20181,16 +20181,16 @@ var getReposPublications = {
|
|
|
20181
20181
|
answers: {
|
|
20182
20182
|
200: external_exports.object({
|
|
20183
20183
|
publication: external_exports.object({
|
|
20184
|
-
publicationId: external_exports.string()
|
|
20185
|
-
repoId: external_exports.string()
|
|
20186
|
-
state: external_exports.enum(["created", "finalizing", "accepted", "rejected", "unknown"]),
|
|
20184
|
+
publicationId: external_exports.string(),
|
|
20185
|
+
repoId: external_exports.string(),
|
|
20186
|
+
state: external_exports.union([external_exports.enum(["created", "finalizing", "accepted", "rejected", "unknown"]), external_exports.string()]),
|
|
20187
20187
|
baseGeneration: external_exports.int().min(0),
|
|
20188
20188
|
resultGeneration: external_exports.union([
|
|
20189
20189
|
external_exports.int().min(0),
|
|
20190
20190
|
external_exports.null()
|
|
20191
20191
|
]),
|
|
20192
20192
|
refs: external_exports.union([
|
|
20193
|
-
external_exports.record(external_exports.string().min(1).max(512), external_exports.string()
|
|
20193
|
+
external_exports.record(external_exports.string().min(1).max(512), external_exports.string()),
|
|
20194
20194
|
external_exports.null()
|
|
20195
20195
|
]),
|
|
20196
20196
|
rejection: external_exports.union([
|
|
@@ -20205,16 +20205,16 @@ var getReposPublications = {
|
|
|
20205
20205
|
external_exports.object({
|
|
20206
20206
|
id: external_exports.string(),
|
|
20207
20207
|
committedAt: external_exports.union([
|
|
20208
|
-
external_exports.string()
|
|
20208
|
+
external_exports.string(),
|
|
20209
20209
|
external_exports.null()
|
|
20210
20210
|
])
|
|
20211
20211
|
}),
|
|
20212
20212
|
external_exports.null()
|
|
20213
20213
|
]),
|
|
20214
20214
|
attempts: external_exports.int(),
|
|
20215
|
-
createdAt: external_exports.string()
|
|
20216
|
-
finalizeUntil: external_exports.string()
|
|
20217
|
-
updatedAt: external_exports.string()
|
|
20215
|
+
createdAt: external_exports.string(),
|
|
20216
|
+
finalizeUntil: external_exports.string(),
|
|
20217
|
+
updatedAt: external_exports.string()
|
|
20218
20218
|
})
|
|
20219
20219
|
})
|
|
20220
20220
|
}
|
|
@@ -20224,16 +20224,16 @@ var postReposPublicationsFinalize = {
|
|
|
20224
20224
|
answers: {
|
|
20225
20225
|
202: external_exports.object({
|
|
20226
20226
|
publication: external_exports.object({
|
|
20227
|
-
publicationId: external_exports.string()
|
|
20228
|
-
repoId: external_exports.string()
|
|
20229
|
-
state: external_exports.enum(["created", "finalizing", "accepted", "rejected", "unknown"]),
|
|
20227
|
+
publicationId: external_exports.string(),
|
|
20228
|
+
repoId: external_exports.string(),
|
|
20229
|
+
state: external_exports.union([external_exports.enum(["created", "finalizing", "accepted", "rejected", "unknown"]), external_exports.string()]),
|
|
20230
20230
|
baseGeneration: external_exports.int().min(0),
|
|
20231
20231
|
resultGeneration: external_exports.union([
|
|
20232
20232
|
external_exports.int().min(0),
|
|
20233
20233
|
external_exports.null()
|
|
20234
20234
|
]),
|
|
20235
20235
|
refs: external_exports.union([
|
|
20236
|
-
external_exports.record(external_exports.string().min(1).max(512), external_exports.string()
|
|
20236
|
+
external_exports.record(external_exports.string().min(1).max(512), external_exports.string()),
|
|
20237
20237
|
external_exports.null()
|
|
20238
20238
|
]),
|
|
20239
20239
|
rejection: external_exports.union([
|
|
@@ -20248,16 +20248,16 @@ var postReposPublicationsFinalize = {
|
|
|
20248
20248
|
external_exports.object({
|
|
20249
20249
|
id: external_exports.string(),
|
|
20250
20250
|
committedAt: external_exports.union([
|
|
20251
|
-
external_exports.string()
|
|
20251
|
+
external_exports.string(),
|
|
20252
20252
|
external_exports.null()
|
|
20253
20253
|
])
|
|
20254
20254
|
}),
|
|
20255
20255
|
external_exports.null()
|
|
20256
20256
|
]),
|
|
20257
20257
|
attempts: external_exports.int(),
|
|
20258
|
-
createdAt: external_exports.string()
|
|
20259
|
-
finalizeUntil: external_exports.string()
|
|
20260
|
-
updatedAt: external_exports.string()
|
|
20258
|
+
createdAt: external_exports.string(),
|
|
20259
|
+
finalizeUntil: external_exports.string(),
|
|
20260
|
+
updatedAt: external_exports.string()
|
|
20261
20261
|
})
|
|
20262
20262
|
})
|
|
20263
20263
|
}
|
|
@@ -20270,6 +20270,7 @@ var CLIENT_HEADER = "x-publisher-client";
|
|
|
20270
20270
|
var MAX_WAIT_SECONDS = 5;
|
|
20271
20271
|
var answered = getReposByRepoId.answers[200].shape.repository;
|
|
20272
20272
|
var RepositoryInfo = answered.extend({
|
|
20273
|
+
repoId: answered.shape.repoId.min(1),
|
|
20273
20274
|
archived: answered.shape.archived.default(null),
|
|
20274
20275
|
movedTo: answered.shape.movedTo.default(null)
|
|
20275
20276
|
});
|
|
@@ -20289,7 +20290,7 @@ function ulid3(now = Date.now()) {
|
|
|
20289
20290
|
return timeChars.join("") + tail;
|
|
20290
20291
|
}
|
|
20291
20292
|
function newPublicationId() {
|
|
20292
|
-
return `
|
|
20293
|
+
return `pub-${(0, import_node_crypto.randomUUID)()}`;
|
|
20293
20294
|
}
|
|
20294
20295
|
function newCreationId() {
|
|
20295
20296
|
return ulid3();
|
|
@@ -20738,8 +20739,15 @@ var import_node_path2 = require("node:path");
|
|
|
20738
20739
|
var import_node_crypto2 = require("node:crypto");
|
|
20739
20740
|
|
|
20740
20741
|
// ../client/src/git/objects.ts
|
|
20742
|
+
var OBJECT_ID = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
20743
|
+
function objectId(oid) {
|
|
20744
|
+
if (!OBJECT_ID.test(oid)) {
|
|
20745
|
+
throw new PublisherError("GIT", `not a git object id: ${JSON.stringify(oid.slice(0, 80))}`);
|
|
20746
|
+
}
|
|
20747
|
+
return oid;
|
|
20748
|
+
}
|
|
20741
20749
|
async function presentObjects(dir, oids) {
|
|
20742
|
-
const input2 = Array.from(oids).join("\n") + "\n";
|
|
20750
|
+
const input2 = Array.from(oids, objectId).join("\n") + "\n";
|
|
20743
20751
|
const { stdout } = await runGit(["cat-file", "--batch-check=%(objectname) %(objecttype)"], { cwd: dir, input: input2, maxStdoutBytes: 512 * 1024 * 1024 });
|
|
20744
20752
|
const present = /* @__PURE__ */ new Set();
|
|
20745
20753
|
for (const line of stdout.toString("utf8").split("\n")) {
|
|
@@ -20790,8 +20798,8 @@ async function refTransaction(dir, updates) {
|
|
|
20790
20798
|
if (update.ref.includes("\n") || update.ref.includes("\0")) {
|
|
20791
20799
|
throw new PublisherError("INVALID_REF_NAME", "newline in ref");
|
|
20792
20800
|
}
|
|
20793
|
-
const old = update.old === void 0 ? "" : ` ${update.old
|
|
20794
|
-
lines.push(update.new === null ? `delete ${update.ref}${old}` : `update ${update.ref} ${update.new}${old}`);
|
|
20801
|
+
const old = update.old === void 0 ? "" : ` ${update.old === null ? "0".repeat(40) : objectId(update.old)}`;
|
|
20802
|
+
lines.push(update.new === null ? `delete ${update.ref}${old}` : `update ${update.ref} ${objectId(update.new)}${old}`);
|
|
20795
20803
|
}
|
|
20796
20804
|
lines.push("prepare", "commit", "");
|
|
20797
20805
|
await runGit(["update-ref", "--stdin"], { cwd: dir, input: lines.join("\n"), label: "update-ref" });
|
|
@@ -21259,6 +21267,11 @@ var import_promises3 = require("node:fs/promises");
|
|
|
21259
21267
|
var import_node_os2 = require("node:os");
|
|
21260
21268
|
var import_node_path3 = require("node:path");
|
|
21261
21269
|
|
|
21270
|
+
// ../client/src/shell-word.ts
|
|
21271
|
+
function shellWord(value) {
|
|
21272
|
+
return /^[A-Za-z0-9_./:-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`;
|
|
21273
|
+
}
|
|
21274
|
+
|
|
21262
21275
|
// ../client/src/clients/credentials/form-post.ts
|
|
21263
21276
|
var FORM_POST_TIMEOUT_MS = 1e4;
|
|
21264
21277
|
async function postForm(base, path, fields, fetchImpl = globalThis.fetch) {
|
|
@@ -21554,7 +21567,7 @@ function nextStep(status2) {
|
|
|
21554
21567
|
action: "reauthenticate",
|
|
21555
21568
|
// Nothing to ask: the sign-in opens a browser and asks them there.
|
|
21556
21569
|
ask: null,
|
|
21557
|
-
command: r.profile ? `publisher login --profile ${r.profile} --json` : `publisher login --endpoint ${r.endpoint} --json`,
|
|
21570
|
+
command: r.profile ? `publisher login --profile ${shellWord(r.profile)} --json` : `publisher login --endpoint ${shellWord(r.endpoint)} --json`,
|
|
21558
21571
|
profiles
|
|
21559
21572
|
};
|
|
21560
21573
|
}
|
|
@@ -21670,7 +21683,7 @@ var getApiTerminalRepositoriesPreparation = {
|
|
|
21670
21683
|
200: external_exports.object({
|
|
21671
21684
|
id: external_exports.string(),
|
|
21672
21685
|
revision: external_exports.int(),
|
|
21673
|
-
status: external_exports.enum(["queued", "running", "needs-choice", "ready", "blocked", "canceled"]),
|
|
21686
|
+
status: external_exports.union([external_exports.enum(["queued", "running", "needs-choice", "ready", "blocked", "canceled"]), external_exports.string()]),
|
|
21674
21687
|
message: external_exports.string(),
|
|
21675
21688
|
questions: external_exports.array(external_exports.object({
|
|
21676
21689
|
id: external_exports.string(),
|
|
@@ -21697,7 +21710,7 @@ var postApiTerminalRepositoriesPreparation = {
|
|
|
21697
21710
|
200: external_exports.object({
|
|
21698
21711
|
id: external_exports.string(),
|
|
21699
21712
|
revision: external_exports.int(),
|
|
21700
|
-
status: external_exports.enum(["queued", "running", "needs-choice", "ready", "blocked", "canceled"]),
|
|
21713
|
+
status: external_exports.union([external_exports.enum(["queued", "running", "needs-choice", "ready", "blocked", "canceled"]), external_exports.string()]),
|
|
21701
21714
|
message: external_exports.string(),
|
|
21702
21715
|
questions: external_exports.array(external_exports.object({
|
|
21703
21716
|
id: external_exports.string(),
|
|
@@ -21723,7 +21736,7 @@ var postApiTerminalApplications = {
|
|
|
21723
21736
|
name: external_exports.string().min(1).max(80),
|
|
21724
21737
|
creationId: external_exports.string().regex(new RegExp("^[0-9a-hjkmnp-tv-z]{26}$")),
|
|
21725
21738
|
defaultBranch: external_exports.string().regex(new RegExp("^(?!.*\\.\\.)(?!\\/)(?!.*\\/$)[A-Za-z0-9._/-]{1,200}$")).nullable().optional(),
|
|
21726
|
-
cell: external_exports.string().regex(new RegExp("^(platform|[0-9a-f]{8})$")).nullable().optional()
|
|
21739
|
+
cell: external_exports.string().regex(new RegExp("^(platform|cel-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$")).nullable().optional()
|
|
21727
21740
|
}),
|
|
21728
21741
|
answers: {
|
|
21729
21742
|
200: external_exports.object({
|
|
@@ -21920,10 +21933,14 @@ async function createApplication(input2, opts) {
|
|
|
21920
21933
|
}
|
|
21921
21934
|
throw new PublisherError("UNAVAILABLE", `could not make the application: ${lastOutage}; run init again`, { isRetryable: true });
|
|
21922
21935
|
}
|
|
21936
|
+
function answerOf(created) {
|
|
21937
|
+
const answer2 = postApiTerminalApplications.answers[created ? 201 : 200];
|
|
21938
|
+
return answer2.extend({ placement: answer2.shape.placement.catch(void 0) });
|
|
21939
|
+
}
|
|
21923
21940
|
function read(body, created) {
|
|
21924
|
-
const answer2 =
|
|
21941
|
+
const answer2 = answerOf(created).safeParse(body);
|
|
21925
21942
|
const repository = RepositoryInfo.safeParse(answer2.data?.repository);
|
|
21926
|
-
if (!answer2.success || !repository.success) {
|
|
21943
|
+
if (!answer2.success || !repository.success || answer2.data.application.appId === "") {
|
|
21927
21944
|
throw new PublisherError("UNAVAILABLE", "the portal answered with an application this version cannot read");
|
|
21928
21945
|
}
|
|
21929
21946
|
return { appId: answer2.data.application.appId, created, repository: repository.data, placement: answer2.data.placement ?? null };
|
|
@@ -22152,9 +22169,14 @@ function sleep(ms, signal) {
|
|
|
22152
22169
|
}
|
|
22153
22170
|
|
|
22154
22171
|
// ../client/src/clients/applications/run-progress.ts
|
|
22155
|
-
var RUN_STAGES = ["received", "running", "deploying", "live"];
|
|
22156
22172
|
var STAGE_WORDS = { received: "received", running: "checked", deploying: "going live", live: "live" };
|
|
22157
|
-
var
|
|
22173
|
+
var FINISHED = /* @__PURE__ */ new Set(["done", "failed", "skipped"]);
|
|
22174
|
+
function isKnownStage(stage) {
|
|
22175
|
+
return Object.hasOwn(STAGE_WORDS, stage);
|
|
22176
|
+
}
|
|
22177
|
+
function wordOf(stage) {
|
|
22178
|
+
return isKnownStage(stage) ? STAGE_WORDS[stage] : stage;
|
|
22179
|
+
}
|
|
22158
22180
|
function readStages(run2) {
|
|
22159
22181
|
if (!isRecord(run2)) {
|
|
22160
22182
|
return { malformed: "a run that is not an object" };
|
|
@@ -22163,40 +22185,44 @@ function readStages(run2) {
|
|
|
22163
22185
|
return null;
|
|
22164
22186
|
}
|
|
22165
22187
|
const stages = run2["stages"];
|
|
22166
|
-
if (!Array.isArray(stages) || stages.length
|
|
22167
|
-
return { malformed: "stages that are not
|
|
22188
|
+
if (!Array.isArray(stages) || stages.length === 0) {
|
|
22189
|
+
return { malformed: "stages that are not a list of stages" };
|
|
22168
22190
|
}
|
|
22169
22191
|
const out = [];
|
|
22170
22192
|
for (const [index, entry] of stages.entries()) {
|
|
22171
|
-
|
|
22172
|
-
|
|
22173
|
-
return { malformed: `stage ${index + 1} is not ${stage}` };
|
|
22193
|
+
if (!isRecord(entry) || typeof entry["stage"] !== "string" || entry["stage"] === "") {
|
|
22194
|
+
return { malformed: `stage ${index + 1} has no name` };
|
|
22174
22195
|
}
|
|
22196
|
+
const stage = entry["stage"];
|
|
22175
22197
|
const state = entry["state"];
|
|
22176
|
-
if (
|
|
22177
|
-
return { malformed: `stage ${stage} has
|
|
22198
|
+
if (typeof state !== "string" || state === "") {
|
|
22199
|
+
return { malformed: `stage ${stage} has no state` };
|
|
22178
22200
|
}
|
|
22179
22201
|
const at = entry["at"];
|
|
22180
22202
|
if (typeof at !== "string" && at !== null) {
|
|
22181
22203
|
return { malformed: `stage ${stage} has an unreadable time` };
|
|
22182
22204
|
}
|
|
22183
|
-
out.push({ stage, word:
|
|
22205
|
+
out.push({ stage, word: wordOf(stage), state, at });
|
|
22184
22206
|
}
|
|
22185
22207
|
return { stages: out };
|
|
22186
22208
|
}
|
|
22187
22209
|
function ending(stages) {
|
|
22188
|
-
if (stages.some((s) =>
|
|
22210
|
+
if (stages.some((s) => !FINISHED.has(s.state))) {
|
|
22189
22211
|
return null;
|
|
22190
22212
|
}
|
|
22191
22213
|
if (stages.some((s) => s.state === "failed")) {
|
|
22192
22214
|
return "failed";
|
|
22193
22215
|
}
|
|
22194
|
-
|
|
22216
|
+
const state = (stage) => stages.find((s) => s.stage === stage)?.state;
|
|
22217
|
+
if (state("live") === "done") {
|
|
22195
22218
|
return "live";
|
|
22196
22219
|
}
|
|
22197
|
-
if (
|
|
22220
|
+
if (state("running") === "done" && state("deploying") === "skipped") {
|
|
22198
22221
|
return "not-deployed";
|
|
22199
22222
|
}
|
|
22223
|
+
if (state("live") === void 0) {
|
|
22224
|
+
return null;
|
|
22225
|
+
}
|
|
22200
22226
|
return "stopped";
|
|
22201
22227
|
}
|
|
22202
22228
|
var POLL_INTERVAL_MS = 5e3;
|
|
@@ -22781,7 +22807,7 @@ async function publish(ctx, repoId, remote, opts, call2) {
|
|
|
22781
22807
|
return runPublication(ctx, repoId, remote, repoDir, store2, pending2, opts, call2, true);
|
|
22782
22808
|
}
|
|
22783
22809
|
const outcome2 = await resolvePending(ctx, repoDir, remote, pending2, call2, store2);
|
|
22784
|
-
if (outcome2.state
|
|
22810
|
+
if (outcome2.state !== "accepted" && outcome2.state !== "rejected" && outcome2.state !== "created") {
|
|
22785
22811
|
throw new PublisherError("OUTCOME_UNKNOWN", `publication ${pending2.publicationId} is still being processed; run status before publishing again`, {
|
|
22786
22812
|
isRetryable: true,
|
|
22787
22813
|
details: { publicationId: pending2.publicationId }
|
|
@@ -23142,8 +23168,8 @@ async function install(ctx, gd, artifacts, call2) {
|
|
|
23142
23168
|
let bytes = 0;
|
|
23143
23169
|
const total = artifacts.reduce((sum, a) => sum + a.size, 0);
|
|
23144
23170
|
try {
|
|
23145
|
-
for (const a of artifacts) {
|
|
23146
|
-
const file2 = (0, import_node_path5.join)(tmp, `${
|
|
23171
|
+
for (const [i, a] of artifacts.entries()) {
|
|
23172
|
+
const file2 = (0, import_node_path5.join)(tmp, `${i}.${a.kind}`);
|
|
23147
23173
|
bytes += await download(ctx.fetchImpl, a.url, file2, a.sha256, a.size, call2);
|
|
23148
23174
|
progress({ phase: "fetch", message: `installing ${a.kind}`, bytes, total });
|
|
23149
23175
|
if (a.kind === "bundle") {
|
|
@@ -23633,8 +23659,8 @@ async function pollDeviceLogin(started, opts) {
|
|
|
23633
23659
|
}
|
|
23634
23660
|
async function deviceLogin(opts) {
|
|
23635
23661
|
const started = await startDeviceLogin(opts);
|
|
23636
|
-
const { deviceCode: _secret, authEndpoint: _auth, expiresAt: _at, ...
|
|
23637
|
-
await opts.onPrompt(
|
|
23662
|
+
const { deviceCode: _secret, authEndpoint: _auth, expiresAt: _at, ...shown3 } = started;
|
|
23663
|
+
await opts.onPrompt(shown3);
|
|
23638
23664
|
const signIn = await pollDeviceLogin(started, { ...opts, lastPolledAt: (opts.now ?? Date.now)() });
|
|
23639
23665
|
return signIn;
|
|
23640
23666
|
}
|
|
@@ -23843,6 +23869,11 @@ async function portalFor(endpoint, route, opts = {}) {
|
|
|
23843
23869
|
return at.terminal.includes(route) ? { kind: "served", portal: at.portal } : { kind: "no-route", portal: at.portal };
|
|
23844
23870
|
}
|
|
23845
23871
|
|
|
23872
|
+
// src/terminal/shown.ts
|
|
23873
|
+
function shown(text) {
|
|
23874
|
+
return text.replace(new RegExp("[^\\P{Cc}\\n\\t]|\\p{Cf}", "gu"), "?");
|
|
23875
|
+
}
|
|
23876
|
+
|
|
23846
23877
|
// src/terminal/progress.ts
|
|
23847
23878
|
var SAYS = {
|
|
23848
23879
|
received: { doing: "The platform is picking up your changes", done: "The platform has your changes", still: "still picking up your changes" },
|
|
@@ -23850,6 +23881,9 @@ var SAYS = {
|
|
|
23850
23881
|
deploying: { doing: "putting the new version in place; the current version remains available", done: "the new version is in place", still: "still putting it in place" },
|
|
23851
23882
|
live: { doing: "going live", done: "everyone sees the new version", still: "still going live" }
|
|
23852
23883
|
};
|
|
23884
|
+
function saysOf(e) {
|
|
23885
|
+
return isKnownStage(e.stage) ? SAYS[e.stage] : { doing: "in progress", done: "done", still: `still at ${shown(e.word)}` };
|
|
23886
|
+
}
|
|
23853
23887
|
var HEARTBEAT_MS = 3e4;
|
|
23854
23888
|
var SPINNER = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
23855
23889
|
function took(ms) {
|
|
@@ -23866,10 +23900,10 @@ function interval(fn, ms) {
|
|
|
23866
23900
|
return { stop: () => clearInterval(timer) };
|
|
23867
23901
|
}
|
|
23868
23902
|
function settledLine(e, total) {
|
|
23869
|
-
const word = e.word.padEnd(10);
|
|
23903
|
+
const word = shown(e.word).padEnd(10);
|
|
23870
23904
|
switch (e.state) {
|
|
23871
23905
|
case "done":
|
|
23872
|
-
return ` \u2713 ${word} ${
|
|
23906
|
+
return ` \u2713 ${word} ${saysOf(e).done}${total}
|
|
23873
23907
|
`;
|
|
23874
23908
|
case "failed":
|
|
23875
23909
|
return ` \u2717 ${word} it stopped here
|
|
@@ -23877,8 +23911,11 @@ function settledLine(e, total) {
|
|
|
23877
23911
|
case "skipped":
|
|
23878
23912
|
return ` \u2013 ${word} skipped
|
|
23879
23913
|
`;
|
|
23880
|
-
|
|
23914
|
+
case "pending":
|
|
23881
23915
|
return null;
|
|
23916
|
+
default:
|
|
23917
|
+
return ` \xB7 ${word} ${shown(e.state)}
|
|
23918
|
+
`;
|
|
23882
23919
|
}
|
|
23883
23920
|
}
|
|
23884
23921
|
function stageReporter(io) {
|
|
@@ -23909,7 +23946,7 @@ function stageReporter(io) {
|
|
|
23909
23946
|
} else {
|
|
23910
23947
|
clear();
|
|
23911
23948
|
}
|
|
23912
|
-
const says =
|
|
23949
|
+
const says = saysOf(e);
|
|
23913
23950
|
if (e.stage === "received" && e.at !== null) {
|
|
23914
23951
|
receivedAt = since(e);
|
|
23915
23952
|
}
|
|
@@ -23921,7 +23958,7 @@ function stageReporter(io) {
|
|
|
23921
23958
|
}
|
|
23922
23959
|
return;
|
|
23923
23960
|
}
|
|
23924
|
-
io.write(` \u2026 ${e.word.padEnd(10)} ${says.doing}
|
|
23961
|
+
io.write(` \u2026 ${shown(e.word).padEnd(10)} ${says.doing}
|
|
23925
23962
|
`);
|
|
23926
23963
|
const from = since(e);
|
|
23927
23964
|
if (io.isTTY) {
|
|
@@ -23965,7 +24002,7 @@ async function followPublication(p, endpoint, o, opts) {
|
|
|
23965
24002
|
).finally(() => opts.stopStages?.());
|
|
23966
24003
|
const answerable = confirmed2.terminal.includes(PREPARATION);
|
|
23967
24004
|
const dir = shellWord(opts.dir);
|
|
23968
|
-
const next = outcome2.kind === "timed-out" || outcome2.kind === "moving" ? { action: "follow", command: `publisher follow ${dir} --publication ${o.publicationId}${opts.untilChange === true ? " --until-change" : ""} --json` } : outcome2.kind === "waiting" && answerable ? { action: "question", command: `publisher question ${dir} --json` } : void 0;
|
|
24005
|
+
const next = outcome2.kind === "timed-out" || outcome2.kind === "moving" ? { action: "follow", command: `publisher follow ${dir} --publication ${shellWord(o.publicationId)}${opts.untilChange === true ? " --until-change" : ""} --json` } : outcome2.kind === "waiting" && answerable ? { action: "question", command: `publisher question ${dir} --json` } : void 0;
|
|
23969
24006
|
const findings = await failedChecks(p, portal, o.repoId, outcome2, answerable);
|
|
23970
24007
|
if (findings !== null) {
|
|
23971
24008
|
return {
|
|
@@ -24012,9 +24049,6 @@ function followTimeoutMs(flag) {
|
|
|
24012
24049
|
}
|
|
24013
24050
|
return Math.min(Number(flag) * 1e3, FOLLOW_TIMEOUT_MS);
|
|
24014
24051
|
}
|
|
24015
|
-
function shellWord(path) {
|
|
24016
|
-
return /^[A-Za-z0-9_./-]+$/.test(path) ? path : `'${path.replace(/'/g, `'\\''`)}'`;
|
|
24017
|
-
}
|
|
24018
24052
|
function stageEmitter(json2, quiet) {
|
|
24019
24053
|
const nothing = () => {
|
|
24020
24054
|
};
|
|
@@ -24213,10 +24247,10 @@ function prompt({ verificationUri, userCode, expiresInSeconds }) {
|
|
|
24213
24247
|
process.stderr.write(
|
|
24214
24248
|
`
|
|
24215
24249
|
To sign in, open:
|
|
24216
|
-
${verificationUri}
|
|
24250
|
+
${shown(verificationUri)}
|
|
24217
24251
|
|
|
24218
24252
|
and confirm the code:
|
|
24219
|
-
${userCode}
|
|
24253
|
+
${shown(userCode)}
|
|
24220
24254
|
|
|
24221
24255
|
Waiting (it expires in ${Math.round(expiresInSeconds / 60)} minutes)...
|
|
24222
24256
|
`
|
|
@@ -24261,9 +24295,9 @@ async function login(ctx) {
|
|
|
24261
24295
|
}
|
|
24262
24296
|
const signIn = await deviceLogin({
|
|
24263
24297
|
endpoint,
|
|
24264
|
-
onPrompt: (
|
|
24298
|
+
onPrompt: (shown3) => {
|
|
24265
24299
|
clock.lap("start");
|
|
24266
|
-
prompt(
|
|
24300
|
+
prompt(shown3);
|
|
24267
24301
|
}
|
|
24268
24302
|
});
|
|
24269
24303
|
clock.lap("approval");
|
|
@@ -24559,8 +24593,8 @@ var migrate = {
|
|
|
24559
24593
|
async run(inv) {
|
|
24560
24594
|
const dir = inv.dirArg(1);
|
|
24561
24595
|
const result = await migrateAssociation({ repoDir: dir, ...inv.optStr("to") });
|
|
24562
|
-
const command = `publisher login --endpoint ${result.to} --json`;
|
|
24563
|
-
inv.log(`re-pointed ${dir}: ${result.from} -> ${result.to}; sign in there with: ${command}`);
|
|
24596
|
+
const command = `publisher login --endpoint ${shellWord(result.to)} --json`;
|
|
24597
|
+
inv.log(`re-pointed ${dir}: ${shown(result.from)} -> ${shown(result.to)}; sign in there with: ${shown(command)}`);
|
|
24564
24598
|
inv.out({ ...result, next: { action: "reauthenticate", ask: null, command } });
|
|
24565
24599
|
return 0;
|
|
24566
24600
|
}
|
|
@@ -24601,11 +24635,11 @@ function placementWords(placement) {
|
|
|
24601
24635
|
return null;
|
|
24602
24636
|
}
|
|
24603
24637
|
if ("cell" in placement) {
|
|
24604
|
-
return `this app runs in the ${placement.cell} cell`;
|
|
24638
|
+
return `this app runs in the ${shown(placement.cell)} cell`;
|
|
24605
24639
|
}
|
|
24606
24640
|
switch (placement.refused) {
|
|
24607
24641
|
case "must-pick":
|
|
24608
|
-
return `this app has no cell yet, so its first publication stops. You can pick: ${placement.offered.join(", ")}. Open the app in the portal and pick one on its Cell tab`;
|
|
24642
|
+
return `this app has no cell yet, so its first publication stops. You can pick: ${placement.offered.map(shown).join(", ")}. Open the app in the portal and pick one on its Cell tab`;
|
|
24609
24643
|
case "no-cell":
|
|
24610
24644
|
return "this app has no cell yet, because you cannot use that cell or any cell. The owner or an admin can give you one";
|
|
24611
24645
|
case "unavailable":
|
|
@@ -24669,7 +24703,7 @@ var Moved = class {
|
|
|
24669
24703
|
return null;
|
|
24670
24704
|
}
|
|
24671
24705
|
const movedTo = details?.["movedTo"];
|
|
24672
|
-
const next = typeof movedTo === "string" ? `then run publisher checkout <new folder> --repo ${movedTo}` : "then run publisher list to find it there";
|
|
24706
|
+
const next = typeof movedTo === "string" ? `then run publisher checkout <new folder> --repo ${shellWord(movedTo)}` : "then run publisher list to find it there";
|
|
24673
24707
|
return `This app moved to another workspace. Sign in again with publisher login, choose that workspace, ${next}.`;
|
|
24674
24708
|
}
|
|
24675
24709
|
};
|
|
@@ -24778,7 +24812,8 @@ async function listApps(p, opts = {}) {
|
|
|
24778
24812
|
createdAt: r.createdAt,
|
|
24779
24813
|
publishedAt: r.lastTransaction?.committedAt ?? null,
|
|
24780
24814
|
archived: r.archived,
|
|
24781
|
-
|
|
24815
|
+
// The id is the server's and opaque, so it is quoted: one word, whatever it holds.
|
|
24816
|
+
checkout: `publisher checkout ${shellWord(folderFor(r.name))} --repo ${shellWord(r.repoId)} --json`
|
|
24782
24817
|
})).sort((a, b) => (b.publishedAt ?? b.createdAt).localeCompare(a.publishedAt ?? a.createdAt));
|
|
24783
24818
|
const hint = apps.length === 0 ? "You have not published an app from this sign-in yet." : "To work on one in a new folder, run its checkout command.";
|
|
24784
24819
|
return { apps, next: page.next, hint };
|
|
@@ -24795,7 +24830,7 @@ async function questionAt(p, endpoint, repoId, opts = {}) {
|
|
|
24795
24830
|
if ("reason" in at) {
|
|
24796
24831
|
return at;
|
|
24797
24832
|
}
|
|
24798
|
-
return
|
|
24833
|
+
return shown2(at.portal, await p.readPreparation({ portal: at.portal, repoId }), REFUSED2.read);
|
|
24799
24834
|
}
|
|
24800
24835
|
async function answerAt(p, endpoint, repoId, specs, opts = {}) {
|
|
24801
24836
|
const answers = parseSpecs(specs);
|
|
@@ -24803,7 +24838,7 @@ async function answerAt(p, endpoint, repoId, specs, opts = {}) {
|
|
|
24803
24838
|
if ("reason" in at) {
|
|
24804
24839
|
return at;
|
|
24805
24840
|
}
|
|
24806
|
-
const read2 =
|
|
24841
|
+
const read2 = shown2(at.portal, await p.readPreparation({ portal: at.portal, repoId }), REFUSED2.read);
|
|
24807
24842
|
if (read2.kind === "nothing-prepared") {
|
|
24808
24843
|
throw new PublisherError("LOCAL_STATE", `nothing is waiting for an answer (${NOTHING_PREPARED})`);
|
|
24809
24844
|
}
|
|
@@ -24825,7 +24860,7 @@ async function answerAt(p, endpoint, repoId, specs, opts = {}) {
|
|
|
24825
24860
|
throw new PublisherError("INVALID_REQUEST", `"${value}" is not one of ${values.join(", ")} for "${id}"`, { details: { questions: read2.questions } });
|
|
24826
24861
|
}
|
|
24827
24862
|
}
|
|
24828
|
-
return
|
|
24863
|
+
return shown2(at.portal, await p.answerPreparation({ portal: at.portal, repoId, id: read2.preparation.id, revision: read2.preparation.revision, answers }), REFUSED2.answer);
|
|
24829
24864
|
}
|
|
24830
24865
|
async function retryAt(p, endpoint, repoId, opts = {}) {
|
|
24831
24866
|
const read2 = await questionAt(p, endpoint, repoId, opts);
|
|
@@ -24841,7 +24876,7 @@ async function retryAt(p, endpoint, repoId, opts = {}) {
|
|
|
24841
24876
|
if (!read2.preparation.canRetry) {
|
|
24842
24877
|
throw new PublisherError("LOCAL_STATE", "this version cannot be tried again: only one that stopped because of a fault on our side can, three times at most");
|
|
24843
24878
|
}
|
|
24844
|
-
const tried =
|
|
24879
|
+
const tried = shown2(read2.portal, await p.retryPreparation({ portal: read2.portal, repoId, id: read2.preparation.id, revision: read2.preparation.revision }), REFUSED2.retry);
|
|
24845
24880
|
return tried.kind === "view" ? { ...tried, hint: "This version is being tried again. Run: publisher follow, or watch it in the portal." } : tried;
|
|
24846
24881
|
}
|
|
24847
24882
|
function parseSpecs(specs) {
|
|
@@ -24879,7 +24914,7 @@ var REFUSED2 = {
|
|
|
24879
24914
|
answer: "the portal will not let this sign-in answer for this workspace (the owner or an admin can, or the app's creator for the first preparation after an adoption)",
|
|
24880
24915
|
retry: "the portal will not let this sign-in try it again in this workspace (the owner or an admin can, or the app's creator, except for the first preparation after an adoption)"
|
|
24881
24916
|
};
|
|
24882
|
-
function
|
|
24917
|
+
function shown2(portal, r, refused) {
|
|
24883
24918
|
switch (r.kind) {
|
|
24884
24919
|
case "view": {
|
|
24885
24920
|
const { questions, ...preparation } = r.view;
|
|
@@ -25573,12 +25608,12 @@ main(process.argv.slice(2)).then(
|
|
|
25573
25608
|
const payload = { error: { code: e.code, message: e.message, isRetryable: e.isRetryable, details: e.details ?? null }, ...moved === null ? {} : { hint: moved } };
|
|
25574
25609
|
const hint = e.code === "NETWORK" ? `
|
|
25575
25610
|
if this folder's service moved, "publisher doctor" says where to` : moved === null ? "" : `
|
|
25576
|
-
${moved}`;
|
|
25577
|
-
process.stdout.write((json2 ? JSON.stringify(payload) : `error [${e.code}]: ${e.message}${hint}`) + "\n");
|
|
25611
|
+
${shown(moved)}`;
|
|
25612
|
+
process.stdout.write((json2 ? JSON.stringify(payload) : `error [${e.code}]: ${shown(e.message)}${hint}`) + "\n");
|
|
25578
25613
|
process.exit(exitCodeFor(e.code));
|
|
25579
25614
|
}
|
|
25580
25615
|
process.stdout.write(
|
|
25581
|
-
(json2 ? JSON.stringify({ error: { code: "INTERNAL", message: String(e?.message ?? e) } }) : `error: ${String(e?.message ?? e)}`) + "\n"
|
|
25616
|
+
(json2 ? JSON.stringify({ error: { code: "INTERNAL", message: String(e?.message ?? e) } }) : `error: ${shown(String(e?.message ?? e))}`) + "\n"
|
|
25582
25617
|
);
|
|
25583
25618
|
process.exit(1);
|
|
25584
25619
|
}
|