@01.software/sdk 0.31.0 → 0.32.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.
- package/README.md +87 -29
- package/dist/analytics/react.cjs.map +1 -1
- package/dist/analytics/react.js.map +1 -1
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/client.cjs +10 -46
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +10 -46
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-DFXXz0vk.d.cts → collection-client-CORhppPb.d.cts} +3 -3
- package/dist/{collection-client-ByzY3hWK.d.ts → collection-client-DPGXnhoF.d.ts} +3 -3
- package/dist/{const-AytzliEu.d.cts → const-Brk2Ff0q.d.cts} +1 -1
- package/dist/{const-BGCP-OJL.d.ts → const-DcY2_z9O.d.ts} +1 -1
- package/dist/index.cjs +58 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +58 -47
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-Wa4-eC6x.d.cts → payload-types-DVK1QCeU.d.cts} +8 -2
- package/dist/{payload-types-Wa4-eC6x.d.ts → payload-types-DVK1QCeU.d.ts} +8 -2
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +16 -16
- package/dist/query.d.ts +16 -16
- package/dist/query.js.map +1 -1
- package/dist/realtime.cjs.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/realtime.js.map +1 -1
- package/dist/server.cjs +34 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +99 -7
- package/dist/server.d.ts +99 -7
- package/dist/server.js +34 -1
- package/dist/server.js.map +1 -1
- package/dist/{types-CmLG-7RL.d.cts → types-ByMrR_Z_.d.cts} +1 -1
- package/dist/{types-DChFjQGz.d.cts → types-CAkWqIr6.d.cts} +41 -8
- package/dist/{types-BX2mqDf6.d.ts → types-CYMSBkJC.d.ts} +41 -8
- package/dist/{types-CVA10VC-.d.ts → types-DUPC7Xn6.d.ts} +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.cjs +48 -1
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +73 -4
- package/dist/webhook.d.ts +73 -4
- package/dist/webhook.js +48 -1
- package/dist/webhook.js.map +1 -1
- package/package.json +3 -3
package/dist/client.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { R as ReadOnlyCollectionClient } from './collection-client-
|
|
2
|
-
import { C as CommerceClient, a as CommunityClient, b as CustomerNamespace, c as ClientState, d as ClientConfig } from './types-
|
|
3
|
-
export { A as ApiQueryOptions, e as ClientMetadata, D as DebugConfig, f as DeepPartial, E as ExtractArrayType, P as PayloadFindResponse, g as PayloadMutationResponse, R as RetryConfig, h as RootClient, h as RootClientType, i as RootCollectionClient, j as RootReadOnlyQueryBuilder, S as Sort, W as Where } from './types-
|
|
4
|
-
export { C as Collection, P as PublicCollection } from './const-
|
|
1
|
+
import { R as ReadOnlyCollectionClient } from './collection-client-CORhppPb.cjs';
|
|
2
|
+
import { C as CommerceClient, a as CommunityClient, b as CustomerNamespace, c as ClientState, d as ClientConfig } from './types-CAkWqIr6.cjs';
|
|
3
|
+
export { A as ApiQueryOptions, e as ClientMetadata, D as DebugConfig, f as DeepPartial, E as ExtractArrayType, P as PayloadFindResponse, g as PayloadMutationResponse, R as RetryConfig, h as RootClient, h as RootClientType, i as RootCollectionClient, j as RootReadOnlyQueryBuilder, S as Sort, W as Where } from './types-CAkWqIr6.cjs';
|
|
4
|
+
export { C as Collection, P as PublicCollection } from './const-Brk2Ff0q.cjs';
|
|
5
5
|
import './metadata.cjs';
|
|
6
|
-
import './types-
|
|
7
|
-
import './payload-types-
|
|
6
|
+
import './types-ByMrR_Z_.cjs';
|
|
7
|
+
import './payload-types-DVK1QCeU.cjs';
|
|
8
8
|
|
|
9
9
|
declare class Client {
|
|
10
10
|
commerce: CommerceClient;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { R as ReadOnlyCollectionClient } from './collection-client-
|
|
2
|
-
import { C as CommerceClient, a as CommunityClient, b as CustomerNamespace, c as ClientState, d as ClientConfig } from './types-
|
|
3
|
-
export { A as ApiQueryOptions, e as ClientMetadata, D as DebugConfig, f as DeepPartial, E as ExtractArrayType, P as PayloadFindResponse, g as PayloadMutationResponse, R as RetryConfig, h as RootClient, h as RootClientType, i as RootCollectionClient, j as RootReadOnlyQueryBuilder, S as Sort, W as Where } from './types-
|
|
4
|
-
export { C as Collection, P as PublicCollection } from './const-
|
|
1
|
+
import { R as ReadOnlyCollectionClient } from './collection-client-DPGXnhoF.js';
|
|
2
|
+
import { C as CommerceClient, a as CommunityClient, b as CustomerNamespace, c as ClientState, d as ClientConfig } from './types-CYMSBkJC.js';
|
|
3
|
+
export { A as ApiQueryOptions, e as ClientMetadata, D as DebugConfig, f as DeepPartial, E as ExtractArrayType, P as PayloadFindResponse, g as PayloadMutationResponse, R as RetryConfig, h as RootClient, h as RootClientType, i as RootCollectionClient, j as RootReadOnlyQueryBuilder, S as Sort, W as Where } from './types-CYMSBkJC.js';
|
|
4
|
+
export { C as Collection, P as PublicCollection } from './const-DcY2_z9O.js';
|
|
5
5
|
import './metadata.js';
|
|
6
|
-
import './types-
|
|
7
|
-
import './payload-types-
|
|
6
|
+
import './types-DUPC7Xn6.js';
|
|
7
|
+
import './payload-types-DVK1QCeU.js';
|
|
8
8
|
|
|
9
9
|
declare class Client {
|
|
10
10
|
commerce: CommerceClient;
|
package/dist/client.js
CHANGED
|
@@ -1164,7 +1164,7 @@ var CustomerAuth = class {
|
|
|
1164
1164
|
);
|
|
1165
1165
|
return data.customer ?? null;
|
|
1166
1166
|
} catch (error) {
|
|
1167
|
-
if (error instanceof
|
|
1167
|
+
if (error instanceof SDKError && error.status === 401) {
|
|
1168
1168
|
this.setToken(null);
|
|
1169
1169
|
return null;
|
|
1170
1170
|
}
|
|
@@ -1259,51 +1259,15 @@ var CustomerAuth = class {
|
|
|
1259
1259
|
if (!headers.has("Content-Type") && init.body) {
|
|
1260
1260
|
headers.set("Content-Type", "application/json");
|
|
1261
1261
|
}
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
} catch (error) {
|
|
1272
|
-
clearTimeout(timeoutId);
|
|
1273
|
-
if (error instanceof Error && error.name === "AbortError") {
|
|
1274
|
-
throw new TimeoutError(`Request timed out after ${DEFAULT_TIMEOUT2}ms`, {
|
|
1275
|
-
url: path,
|
|
1276
|
-
timeout: DEFAULT_TIMEOUT2
|
|
1277
|
-
});
|
|
1278
|
-
}
|
|
1279
|
-
throw new NetworkError(
|
|
1280
|
-
error instanceof Error ? error.message : "Network request failed",
|
|
1281
|
-
void 0,
|
|
1282
|
-
{ url: path },
|
|
1283
|
-
"Network connection failed.",
|
|
1284
|
-
"Please check your internet connection and try again."
|
|
1285
|
-
);
|
|
1286
|
-
}
|
|
1287
|
-
clearTimeout(timeoutId);
|
|
1288
|
-
if (!res.ok) {
|
|
1289
|
-
const body = await res.json().catch(() => ({}));
|
|
1290
|
-
throw new ApiError(
|
|
1291
|
-
body.error || `HTTP ${res.status}`,
|
|
1292
|
-
res.status,
|
|
1293
|
-
body.details,
|
|
1294
|
-
body.error
|
|
1295
|
-
);
|
|
1296
|
-
}
|
|
1297
|
-
try {
|
|
1298
|
-
return await res.json();
|
|
1299
|
-
} catch {
|
|
1300
|
-
throw new ApiError(
|
|
1301
|
-
"Invalid JSON response from server",
|
|
1302
|
-
res.status,
|
|
1303
|
-
void 0,
|
|
1304
|
-
"INVALID_RESPONSE"
|
|
1305
|
-
);
|
|
1306
|
-
}
|
|
1262
|
+
const response = await httpFetch(path, {
|
|
1263
|
+
...init,
|
|
1264
|
+
apiUrl: this.baseUrl,
|
|
1265
|
+
publishableKey: this.publishableKey,
|
|
1266
|
+
headers,
|
|
1267
|
+
timeout: DEFAULT_TIMEOUT2,
|
|
1268
|
+
retry: { maxRetries: 0 }
|
|
1269
|
+
});
|
|
1270
|
+
return parseApiResponse(response, path);
|
|
1307
1271
|
}
|
|
1308
1272
|
};
|
|
1309
1273
|
|