@asgard-js/core 0.0.43-canary.8 → 0.0.43

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 +1 @@
1
- {"version":3,"file":"create-sse-observable.d.ts","sourceRoot":"","sources":["../../src/lib/create-sse-observable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKlC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,UAAU,0BAA0B;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CA8EpC"}
1
+ {"version":3,"file":"create-sse-observable.d.ts","sourceRoot":"","sources":["../../src/lib/create-sse-observable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAKlC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,UAAU,0BAA0B;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CA2DpC"}
@@ -0,0 +1,2 @@
1
+ export type AuthState = 'loading' | 'needApiKey' | 'authenticated' | 'error' | 'invalidApiKey';
2
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/types/auth.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,OAAO,GAAG,eAAe,CAAC"}
@@ -1,3 +1,4 @@
1
+ export type * from './auth';
1
2
  export type * from './client';
2
3
  export type * from './channel';
3
4
  export type * from './sse-response';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,QAAQ,CAAC;AAC5B,mBAAmB,UAAU,CAAC;AAC9B,mBAAmB,WAAW,CAAC;AAC/B,mBAAmB,gBAAgB,CAAC;AACpC,mBAAmB,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgard-js/core",
3
- "version": "0.0.43-canary.8",
3
+ "version": "0.0.43",
4
4
  "dependencies": {
5
5
  "@microsoft/fetch-event-source": "^2.0.1",
6
6
  "rxjs": "^7.8.1"
@@ -53,26 +53,7 @@ export function createSseObservable(
53
53
  openWhenHidden: true,
54
54
  onopen: async (response) => {
55
55
  if (!response.ok) {
56
- // Enhanced error handling for authentication and bot provider issues
57
- let errorDetail;
58
- try {
59
- const errorText = await response.text();
60
- errorDetail = JSON.parse(errorText);
61
- } catch {
62
- errorDetail = { message: `HTTP ${response.status}: ${response.statusText}` };
63
- }
64
-
65
- const enhancedError = {
66
- response,
67
- status: response.status,
68
- statusText: response.statusText,
69
- errorDetail,
70
- isAuthError: response.status === 401,
71
- isBotProviderError: response.status === 400 &&
72
- (errorDetail?.code === 'BOT_PROVIDER_DISABLED' || errorDetail?.code === 'BOT_PROVIDER_NOT_FOUND'),
73
- };
74
-
75
- subscriber.error(enhancedError);
56
+ subscriber.error(response);
76
57
  controller.abort();
77
58
  }
78
59
  },
@@ -0,0 +1 @@
1
+ export type AuthState = 'loading' | 'needApiKey' | 'authenticated' | 'error' | 'invalidApiKey';
@@ -1,3 +1,4 @@
1
+ export type * from './auth';
1
2
  export type * from './client';
2
3
  export type * from './channel';
3
4
  export type * from './sse-response';