@iota-uz/sdk 0.14.0 → 0.15.0
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,9 +1,9 @@
|
|
|
1
|
-
export declare const SDK_RELEASE_VERSION = "0.
|
|
2
|
-
export declare const SDK_SOURCE_COMMIT = "
|
|
1
|
+
export declare const SDK_RELEASE_VERSION = "0.15.0";
|
|
2
|
+
export declare const SDK_SOURCE_COMMIT = "9ceb321bfda838bf3c3333f6f465db1b9c81cf72";
|
|
3
3
|
export declare const SDK_PROTOCOL_VERSION = "1.0.0";
|
|
4
4
|
export declare const SDK_IDENTITY: Readonly<{
|
|
5
|
-
releaseVersion: "0.
|
|
6
|
-
sourceCommit: "
|
|
5
|
+
releaseVersion: "0.15.0";
|
|
6
|
+
sourceCommit: "9ceb321bfda838bf3c3333f6f465db1b9c81cf72";
|
|
7
7
|
protocolVersion: "1.0.0";
|
|
8
8
|
}>;
|
|
9
9
|
export interface SDKRuntimeIdentity {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CLIENT_HOST_PROTOCOL_VERSION } from './protocol';
|
|
2
|
-
export const SDK_RELEASE_VERSION = '0.
|
|
3
|
-
export const SDK_SOURCE_COMMIT = '
|
|
2
|
+
export const SDK_RELEASE_VERSION = '0.15.0';
|
|
3
|
+
export const SDK_SOURCE_COMMIT = '9ceb321bfda838bf3c3333f6f465db1b9c81cf72';
|
|
4
4
|
export const SDK_PROTOCOL_VERSION = CLIENT_HOST_PROTOCOL_VERSION;
|
|
5
5
|
export const SDK_IDENTITY = Object.freeze({
|
|
6
6
|
releaseVersion: SDK_RELEASE_VERSION,
|
package/dist/sdk-identity.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
|
-
const SDK_RELEASE_VERSION = "0.
|
|
3
|
-
const SDK_SOURCE_COMMIT = "
|
|
2
|
+
const SDK_RELEASE_VERSION = "0.15.0"
|
|
3
|
+
const SDK_SOURCE_COMMIT = "9ceb321bfda838bf3c3333f6f465db1b9c81cf72"
|
|
4
4
|
const SDK_PROTOCOL_VERSION = "1.0.0"
|
|
5
|
-
const SDK_IDENTITY = Object.freeze({"releaseVersion":"0.
|
|
5
|
+
const SDK_IDENTITY = Object.freeze({"releaseVersion":"0.15.0","sourceCommit":"9ceb321bfda838bf3c3333f6f465db1b9c81cf72","protocolVersion":"1.0.0"})
|
|
6
6
|
module.exports = { SDK_RELEASE_VERSION, SDK_SOURCE_COMMIT, SDK_PROTOCOL_VERSION, SDK_IDENTITY }
|
package/dist/sdk-identity.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const SDK_RELEASE_VERSION = "0.
|
|
2
|
-
export const SDK_SOURCE_COMMIT = "
|
|
1
|
+
export const SDK_RELEASE_VERSION = "0.15.0"
|
|
2
|
+
export const SDK_SOURCE_COMMIT = "9ceb321bfda838bf3c3333f6f465db1b9c81cf72"
|
|
3
3
|
export const SDK_PROTOCOL_VERSION = "1.0.0"
|
|
4
|
-
export const SDK_IDENTITY = Object.freeze({"releaseVersion":"0.
|
|
4
|
+
export const SDK_IDENTITY = Object.freeze({"releaseVersion":"0.15.0","sourceCommit":"9ceb321bfda838bf3c3333f6f465db1b9c81cf72","protocolVersion":"1.0.0"})
|
package/dist/sdk-identity.json
CHANGED
package/dist/testing/index.js
CHANGED
|
@@ -121,7 +121,7 @@ export async function actionAndHtmxResponse(page, match, action, options = {}) {
|
|
|
121
121
|
const d = event.detail;
|
|
122
122
|
if (!d?.xhr)
|
|
123
123
|
return;
|
|
124
|
-
const record = { url: new URL(d.requestConfig.path, location.href).href, method: String(d.requestConfig.verb).toUpperCase(), status: 0, settled: false, failed: false };
|
|
124
|
+
const record = { url: new URL(d.requestConfig.path, location.href).href, method: String(d.requestConfig.verb).toUpperCase(), status: 0, settled: false, failed: false, aborted: false };
|
|
125
125
|
records.push(record);
|
|
126
126
|
requests.set(d.xhr, record);
|
|
127
127
|
// A removed swap target no longer bubbles its lifecycle events to document.
|
|
@@ -131,6 +131,8 @@ export async function actionAndHtmxResponse(page, match, action, options = {}) {
|
|
|
131
131
|
observed.add(element);
|
|
132
132
|
element.addEventListener('htmx:afterSettle', update);
|
|
133
133
|
element.addEventListener('htmx:responseError', update);
|
|
134
|
+
element.addEventListener('htmx:sendAbort', update);
|
|
135
|
+
element.addEventListener('htmx:sendError', update);
|
|
134
136
|
}
|
|
135
137
|
};
|
|
136
138
|
const update = (event) => {
|
|
@@ -140,19 +142,26 @@ export async function actionAndHtmxResponse(page, match, action, options = {}) {
|
|
|
140
142
|
return;
|
|
141
143
|
record.url = d.xhr.responseURL || record.url;
|
|
142
144
|
record.status = d.xhr.status;
|
|
143
|
-
record.failed = event.type === 'htmx:responseError';
|
|
145
|
+
record.failed = event.type === 'htmx:responseError' || event.type === 'htmx:sendError';
|
|
146
|
+
record.aborted = event.type === 'htmx:sendAbort';
|
|
144
147
|
record.settled = event.type === 'htmx:afterSettle';
|
|
145
148
|
};
|
|
146
149
|
document.addEventListener('htmx:beforeRequest', before);
|
|
147
150
|
document.addEventListener('htmx:afterSettle', update);
|
|
148
151
|
document.addEventListener('htmx:responseError', update);
|
|
152
|
+
document.addEventListener('htmx:sendAbort', update);
|
|
153
|
+
document.addEventListener('htmx:sendError', update);
|
|
149
154
|
window[key] = { records, dispose: () => {
|
|
150
155
|
document.removeEventListener('htmx:beforeRequest', before);
|
|
151
156
|
document.removeEventListener('htmx:afterSettle', update);
|
|
152
157
|
document.removeEventListener('htmx:responseError', update);
|
|
158
|
+
document.removeEventListener('htmx:sendAbort', update);
|
|
159
|
+
document.removeEventListener('htmx:sendError', update);
|
|
153
160
|
for (const element of observed) {
|
|
154
161
|
element.removeEventListener('htmx:afterSettle', update);
|
|
155
162
|
element.removeEventListener('htmx:responseError', update);
|
|
163
|
+
element.removeEventListener('htmx:sendAbort', update);
|
|
164
|
+
element.removeEventListener('htmx:sendError', update);
|
|
156
165
|
}
|
|
157
166
|
} };
|
|
158
167
|
}, key);
|
|
@@ -161,8 +170,15 @@ export async function actionAndHtmxResponse(page, match, action, options = {}) {
|
|
|
161
170
|
const identity = { url: response.url(), method: response.request().method(), status: response.status() };
|
|
162
171
|
await page.waitForFunction(({ key, identity }) => {
|
|
163
172
|
const records = window[key].records.filter((r) => r.url === identity.url && r.method === identity.method);
|
|
164
|
-
return records.
|
|
173
|
+
return records.some((r) => !r.aborted && (r.settled || r.failed)) && records.every((r) => r.settled || r.failed || r.aborted);
|
|
165
174
|
}, { key, identity }, { timeout: timeout(options) });
|
|
175
|
+
const failure = await page.evaluate(({ key, identity }) => {
|
|
176
|
+
const records = window[key].records.filter((r) => r.url === identity.url && r.method === identity.method && !r.aborted);
|
|
177
|
+
const latest = records.at(-1);
|
|
178
|
+
return latest?.failed ? latest.status : null;
|
|
179
|
+
}, { key, identity });
|
|
180
|
+
if (failure !== null)
|
|
181
|
+
throw new Error(`HTMX request failed: ${failure} ${response.url()}`);
|
|
166
182
|
if (!response.ok())
|
|
167
183
|
throw new Error(`HTMX request failed: ${response.status()} ${response.url()}`);
|
|
168
184
|
return response;
|