@phpsandbox/sdk 0.1.17 → 0.1.19

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.
@@ -19071,6 +19071,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19071
19071
  });
19072
19072
 
19073
19073
  // src/publications.ts
19074
+ var PublicationDomains = class {
19075
+ constructor(client, publicationId) {
19076
+ this.client = client;
19077
+ this.publicationId = publicationId;
19078
+ }
19079
+ async list() {
19080
+ return (await this.client.get(this.path())).data;
19081
+ }
19082
+ async create(hostname3) {
19083
+ return (await this.client.post(this.path(), { hostname: hostname3 })).data;
19084
+ }
19085
+ async refresh(id) {
19086
+ return (await this.client.post(`${this.path()}/${encodeURIComponent(id)}/refresh`)).data;
19087
+ }
19088
+ async delete(id) {
19089
+ await this.client.delete(`${this.path()}/${encodeURIComponent(id)}`);
19090
+ }
19091
+ path() {
19092
+ return `/publications/${encodeURIComponent(this.publicationId)}/domains`;
19093
+ }
19094
+ };
19074
19095
  var PublicationApi = class {
19075
19096
  constructor(client) {
19076
19097
  this.client = client;
@@ -19084,6 +19105,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19084
19105
  constructor(initial, client) {
19085
19106
  this.initial = initial;
19086
19107
  this.client = client;
19108
+ this.streamAbort = new AbortController();
19087
19109
  this.started = false;
19088
19110
  this.completed = false;
19089
19111
  this.finalError = null;
@@ -19131,6 +19153,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19131
19153
  void this.consumeStream(eventStreamUrl);
19132
19154
  return this;
19133
19155
  }
19156
+ /** Stop observing this run; the server-side publication continues. */
19157
+ dispose() {
19158
+ if (this.completed) return;
19159
+ const error51 = new DOMException("Stopped observing publication; deployment continues.", "AbortError");
19160
+ if (!this.started) {
19161
+ this.started = true;
19162
+ this.resultPromise = Promise.reject(error51);
19163
+ this.resultPromise.catch(() => void 0);
19164
+ }
19165
+ this.streamAbort.abort(error51);
19166
+ this.fail(error51);
19167
+ }
19134
19168
  subscribe() {
19135
19169
  const queue = new AsyncPublishEventQueue();
19136
19170
  for (const event of this.bufferedEvents) {
@@ -19147,7 +19181,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19147
19181
  }
19148
19182
  async consumeStream(eventStreamUrl) {
19149
19183
  try {
19150
- const stream = await this.client.sse(eventStreamUrl);
19184
+ const stream = await this.client.sse(eventStreamUrl, this.streamAbort.signal);
19151
19185
  for await (const event of readPublishStreamEvents(stream)) {
19152
19186
  this.publish(event);
19153
19187
  if (event.type === "result") {
@@ -19192,6 +19226,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19192
19226
  this.data = data;
19193
19227
  this.client = client;
19194
19228
  this.notebookId = notebookId;
19229
+ this.domains = new PublicationDomains(client, data.id);
19195
19230
  }
19196
19231
  async refresh() {
19197
19232
  const response = await this.client.get(`/publications/${this.data.id}`);
@@ -19966,14 +20001,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19966
20001
  }
19967
20002
  return response.body;
19968
20003
  }
19969
- async sse(url2) {
20004
+ async sse(url2, signal) {
19970
20005
  const response = await this.fetchResponse(
19971
20006
  authenticatedRequest(url2, {
19972
20007
  method: "GET",
19973
20008
  headers: {
19974
20009
  ...this.headers,
19975
20010
  "Accept": "text/event-stream"
19976
- }
20011
+ },
20012
+ ...signal === void 0 ? {} : { signal }
19977
20013
  })
19978
20014
  );
19979
20015
  if (!response.ok) {