@fencyai/js 0.1.121 → 0.1.123

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.
Files changed (132) hide show
  1. package/lib/AgentTaskEventData.d.ts +5 -0
  2. package/lib/AgentTaskEventData.d.ts.map +1 -0
  3. package/lib/AgentTaskModel.d.ts +4 -0
  4. package/lib/AgentTaskModel.d.ts.map +1 -0
  5. package/lib/AgentTaskModel.js +2 -0
  6. package/lib/api/agent-task-params/toStreamingChatCompletionTaskParams.d.ts +1 -0
  7. package/lib/api/agent-task-params/toStreamingChatCompletionTaskParams.d.ts.map +1 -0
  8. package/lib/api/agent-task-params/toStreamingChatCompletionTaskParams.js +1 -1
  9. package/lib/api/agent-task-params/toStreamingMemoryTypeChatCompletionTaskParams.d.ts +1 -0
  10. package/lib/api/agent-task-params/toStreamingMemoryTypeChatCompletionTaskParams.d.ts.map +1 -0
  11. package/lib/api/agent-task-params/toStreamingMemoryTypeChatCompletionTaskParams.js +1 -1
  12. package/lib/api/agent-task-params/toStructuredChatCompletionTaskParams.d.ts +1 -0
  13. package/lib/api/agent-task-params/toStructuredChatCompletionTaskParams.d.ts.map +1 -0
  14. package/lib/api/agent-task-params/toStructuredChatCompletionTaskParams.js +1 -1
  15. package/lib/api/createAgentTask.d.ts +5 -0
  16. package/lib/api/createAgentTask.d.ts.map +1 -0
  17. package/lib/api/createAgentTask.js +4 -0
  18. package/lib/api/createStream.d.ts +5 -0
  19. package/lib/api/createStream.d.ts.map +1 -0
  20. package/lib/api/createStream.js +4 -0
  21. package/lib/index.d.ts +5 -3
  22. package/lib/index.d.ts.map +1 -0
  23. package/lib/index.js +4 -0
  24. package/lib/loadFency.d.ts +2 -0
  25. package/lib/loadFency.d.ts.map +1 -0
  26. package/lib/loadFency.js +1 -0
  27. package/lib/openapi/ct/core/ApiError.d.ts +1 -0
  28. package/lib/openapi/ct/core/ApiError.d.ts.map +1 -0
  29. package/lib/openapi/ct/core/ApiRequestOptions.d.ts +1 -0
  30. package/lib/openapi/ct/core/ApiRequestOptions.d.ts.map +1 -0
  31. package/lib/openapi/ct/core/ApiResult.d.ts +1 -0
  32. package/lib/openapi/ct/core/ApiResult.d.ts.map +1 -0
  33. package/lib/openapi/ct/core/CancelablePromise.d.ts +1 -0
  34. package/lib/openapi/ct/core/CancelablePromise.d.ts.map +1 -0
  35. package/lib/openapi/ct/core/OpenAPI.d.ts +1 -0
  36. package/lib/openapi/ct/core/OpenAPI.d.ts.map +1 -0
  37. package/lib/openapi/ct/core/request.d.ts +1 -0
  38. package/lib/openapi/ct/core/request.d.ts.map +1 -0
  39. package/lib/openapi/ct/index.d.ts +1 -0
  40. package/lib/openapi/ct/index.d.ts.map +1 -0
  41. package/lib/openapi/ct/models/AgentTaskProgressItemUpdatedEventDto.d.ts +1 -0
  42. package/lib/openapi/ct/models/AgentTaskProgressItemUpdatedEventDto.d.ts.map +1 -0
  43. package/lib/openapi/ct/models/ApiDtoType.d.ts +1 -0
  44. package/lib/openapi/ct/models/ApiDtoType.d.ts.map +1 -0
  45. package/lib/openapi/ct/models/StreamDto.d.ts +1 -0
  46. package/lib/openapi/ct/models/StreamDto.d.ts.map +1 -0
  47. package/lib/openapi/ct/models/StreamEventType.d.ts +1 -0
  48. package/lib/openapi/ct/models/StreamEventType.d.ts.map +1 -0
  49. package/lib/openapi/ct/models/StreamNotFoundEventDto.d.ts +1 -0
  50. package/lib/openapi/ct/models/StreamNotFoundEventDto.d.ts.map +1 -0
  51. package/lib/openapi/ct/models/StreamTimeoutEventDto.d.ts +1 -0
  52. package/lib/openapi/ct/models/StreamTimeoutEventDto.d.ts.map +1 -0
  53. package/lib/openapi/ct/services/PubService.d.ts +1 -0
  54. package/lib/openapi/ct/services/PubService.d.ts.map +1 -0
  55. package/lib/openapi/ct-st/core/ApiError.d.ts +1 -0
  56. package/lib/openapi/ct-st/core/ApiError.d.ts.map +1 -0
  57. package/lib/openapi/ct-st/core/ApiRequestOptions.d.ts +1 -0
  58. package/lib/openapi/ct-st/core/ApiRequestOptions.d.ts.map +1 -0
  59. package/lib/openapi/ct-st/core/ApiResult.d.ts +1 -0
  60. package/lib/openapi/ct-st/core/ApiResult.d.ts.map +1 -0
  61. package/lib/openapi/ct-st/core/CancelablePromise.d.ts +1 -0
  62. package/lib/openapi/ct-st/core/CancelablePromise.d.ts.map +1 -0
  63. package/lib/openapi/ct-st/core/OpenAPI.d.ts +1 -0
  64. package/lib/openapi/ct-st/core/OpenAPI.d.ts.map +1 -0
  65. package/lib/openapi/ct-st/core/request.d.ts +1 -0
  66. package/lib/openapi/ct-st/core/request.d.ts.map +1 -0
  67. package/lib/openapi/ct-st/index.d.ts +1 -0
  68. package/lib/openapi/ct-st/index.d.ts.map +1 -0
  69. package/lib/openapi/ct-st/models/AgentTaskTypeName.d.ts +1 -0
  70. package/lib/openapi/ct-st/models/AgentTaskTypeName.d.ts.map +1 -0
  71. package/lib/openapi/ct-st/models/ModelMessage.d.ts +1 -0
  72. package/lib/openapi/ct-st/models/ModelMessage.d.ts.map +1 -0
  73. package/lib/openapi/ct-st/models/ModelMessageRole.d.ts +1 -0
  74. package/lib/openapi/ct-st/models/ModelMessageRole.d.ts.map +1 -0
  75. package/lib/openapi/ct-st/models/PubAgentTaskDto.d.ts +1 -0
  76. package/lib/openapi/ct-st/models/PubAgentTaskDto.d.ts.map +1 -0
  77. package/lib/openapi/ct-st/models/PubCreateAgentTaskRequest.d.ts +1 -0
  78. package/lib/openapi/ct-st/models/PubCreateAgentTaskRequest.d.ts.map +1 -0
  79. package/lib/openapi/ct-st/models/StreamingChatCompletionTaskTypeRequestDto.d.ts +1 -0
  80. package/lib/openapi/ct-st/models/StreamingChatCompletionTaskTypeRequestDto.d.ts.map +1 -0
  81. package/lib/openapi/ct-st/models/StreamingMemoryTypeChatCompletionTaskTypeRequestDto.d.ts +1 -0
  82. package/lib/openapi/ct-st/models/StreamingMemoryTypeChatCompletionTaskTypeRequestDto.d.ts.map +1 -0
  83. package/lib/openapi/ct-st/models/StructuredChatCompletionTaskTypeRequestDto.d.ts +1 -0
  84. package/lib/openapi/ct-st/models/StructuredChatCompletionTaskTypeRequestDto.d.ts.map +1 -0
  85. package/lib/openapi/ct-st/services/PubService.d.ts +1 -0
  86. package/lib/openapi/ct-st/services/PubService.d.ts.map +1 -0
  87. package/lib/types/AgentTask.d.ts +3 -0
  88. package/lib/types/AgentTask.d.ts.map +1 -0
  89. package/lib/types/AgentTask.js +1 -0
  90. package/lib/types/ApiError.d.ts +2 -0
  91. package/lib/types/ApiError.d.ts.map +1 -0
  92. package/lib/types/CreateAgentTaskRequest.d.ts +2 -0
  93. package/lib/types/CreateAgentTaskRequest.d.ts.map +1 -0
  94. package/lib/types/CreateAgentTaskResponse.d.ts +2 -0
  95. package/lib/types/CreateAgentTaskResponse.d.ts.map +1 -0
  96. package/lib/types/CreateStreamResponse.d.ts +2 -0
  97. package/lib/types/CreateStreamResponse.d.ts.map +1 -0
  98. package/lib/types/FencyInstance.d.ts +2 -0
  99. package/lib/types/FencyInstance.d.ts.map +1 -0
  100. package/lib/types/FencyOptions.d.ts +2 -0
  101. package/lib/types/FencyOptions.d.ts.map +1 -0
  102. package/lib/types/Stream.d.ts +3 -0
  103. package/lib/types/Stream.d.ts.map +1 -0
  104. package/lib/types/Stream.js +1 -0
  105. package/lib/types/StreamEventTypes.d.ts +25 -0
  106. package/lib/types/StreamEventTypes.d.ts.map +1 -0
  107. package/lib/types/index.d.ts +10 -7
  108. package/lib/types/index.d.ts.map +1 -0
  109. package/lib/types/index.js +9 -1
  110. package/lib/utils/streamEventTypes.d.ts +17 -0
  111. package/lib/utils/streamEventTypes.d.ts.map +1 -0
  112. package/lib/utils/streamEventTypes.js +75 -0
  113. package/lib/utils/toModelMessageRole.d.ts +3 -0
  114. package/lib/utils/toModelMessageRole.d.ts.map +1 -0
  115. package/lib/{toModelMessageRole.js → utils/toModelMessageRole.js} +1 -1
  116. package/lib/utils/version.d.ts +1 -0
  117. package/lib/utils/version.d.ts.map +1 -0
  118. package/lib/utils/version.js +1 -1
  119. package/package.json +5 -3
  120. package/lib/toModelMessageRole.d.ts +0 -2
  121. package/lib/types/CreateFileDownloadLinkRequest.d.ts +0 -3
  122. package/lib/types/CreateFileDownloadLinkResponse.d.ts +0 -4
  123. package/lib/types/CreateFileDownloadLinkResponse.js +0 -1
  124. package/lib/types/S3PostRequest.d.ts +0 -10
  125. package/lib/types/S3PostRequest.js +0 -1
  126. package/lib/utils/parseApiError.d.ts +0 -2
  127. package/lib/utils/parseApiError.js +0 -14
  128. package/lib/utils/parseErrorBody.d.ts +0 -1
  129. package/lib/utils/parseErrorBody.js +0 -8
  130. package/lib/utils/parseNonOkResponse.d.ts +0 -2
  131. package/lib/utils/parseNonOkResponse.js +0 -35
  132. /package/lib/types/{CreateFileDownloadLinkRequest.js → StreamEventTypes.js} +0 -0
@@ -1,4 +1,6 @@
1
+ /** @public */
1
2
  export type ApiError = {
2
3
  code: string;
3
4
  message: string;
4
5
  };
6
+ //# sourceMappingURL=ApiError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiError.d.ts","sourceRoot":"","sources":["../../src/types/ApiError.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,MAAM,QAAQ,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB,CAAA"}
@@ -1,3 +1,4 @@
1
+ /** @public */
1
2
  export interface CreateAgentTaskRequest {
2
3
  streamingChatCompletionTask?: {
3
4
  messages: {
@@ -22,3 +23,4 @@ export interface CreateAgentTaskRequest {
22
23
  model: string;
23
24
  };
24
25
  }
26
+ //# sourceMappingURL=CreateAgentTaskRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateAgentTaskRequest.d.ts","sourceRoot":"","sources":["../../src/types/CreateAgentTaskRequest.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,WAAW,sBAAsB;IACnC,2BAA2B,CAAC,EAAE;QAC1B,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;YACrC,OAAO,EAAE,MAAM,CAAA;SAClB,EAAE,CAAA;QACH,KAAK,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,4BAA4B,CAAC,EAAE;QAC3B,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;YACrC,OAAO,EAAE,MAAM,CAAA;SAClB,EAAE,CAAA;QACH,UAAU,EAAE,MAAM,CAAA;QAClB,KAAK,EAAE,MAAM,CAAA;KAChB,CAAA;IACD,qCAAqC,CAAC,EAAE;QACpC,QAAQ,EAAE;YACN,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;YACrC,OAAO,EAAE,MAAM,CAAA;SAClB,EAAE,CAAA;QACH,KAAK,EAAE,MAAM,CAAA;KAChB,CAAA;CACJ"}
@@ -1,5 +1,6 @@
1
1
  import { ApiError } from './ApiError';
2
2
  import { AgentTask } from './AgentTask';
3
+ /** @public */
3
4
  export type CreateAgentTaskResponse = {
4
5
  type: 'success';
5
6
  agentTask: AgentTask;
@@ -7,3 +8,4 @@ export type CreateAgentTaskResponse = {
7
8
  type: 'error';
8
9
  error: ApiError;
9
10
  };
11
+ //# sourceMappingURL=CreateAgentTaskResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateAgentTaskResponse.d.ts","sourceRoot":"","sources":["../../src/types/CreateAgentTaskResponse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,cAAc;AACd,MAAM,MAAM,uBAAuB,GAC7B;IACI,IAAI,EAAE,SAAS,CAAA;IACf,SAAS,EAAE,SAAS,CAAA;CACvB,GACD;IACI,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,QAAQ,CAAA;CAClB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { ApiError } from './ApiError';
2
2
  import { Stream } from './Stream';
3
+ /** @public */
3
4
  export type CreateStreamResponse = {
4
5
  type: 'success';
5
6
  stream: Stream;
@@ -7,3 +8,4 @@ export type CreateStreamResponse = {
7
8
  type: 'error';
8
9
  error: ApiError;
9
10
  };
11
+ //# sourceMappingURL=CreateStreamResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateStreamResponse.d.ts","sourceRoot":"","sources":["../../src/types/CreateStreamResponse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,cAAc;AACd,MAAM,MAAM,oBAAoB,GAC1B;IACI,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACjB,GACD;IACI,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,QAAQ,CAAA;CAClB,CAAA"}
@@ -1,4 +1,6 @@
1
+ /** @public */
1
2
  export interface FencyInstance {
2
3
  publishableKey: string;
3
4
  baseUrl: string;
4
5
  }
6
+ //# sourceMappingURL=FencyInstance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FencyInstance.d.ts","sourceRoot":"","sources":["../../src/types/FencyInstance.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,WAAW,aAAa;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;CAClB"}
@@ -1,6 +1,8 @@
1
+ /** @public */
1
2
  export interface FencyOptions {
2
3
  /** Your Fency publishable key */
3
4
  publishableKey: string;
4
5
  /** Optional configuration for the Fency instance */
5
6
  baseUrl?: string;
6
7
  }
8
+ //# sourceMappingURL=FencyOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FencyOptions.d.ts","sourceRoot":"","sources":["../../src/types/FencyOptions.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,WAAW,YAAY;IACzB,iCAAiC;IACjC,cAAc,EAAE,MAAM,CAAA;IACtB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB"}
@@ -1,6 +1,9 @@
1
+ /** @public */
1
2
  export interface Stream {
2
3
  id: string;
3
4
  createdAt: string;
4
5
  token: string;
5
6
  }
7
+ /** @public */
6
8
  export declare const isStream: (data: any) => data is Stream;
9
+ //# sourceMappingURL=Stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stream.d.ts","sourceRoot":"","sources":["../../src/types/Stream.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,cAAc;AACd,eAAO,MAAM,QAAQ,GAAI,MAAM,GAAG,KAAG,IAAI,IAAI,MAQ5C,CAAA"}
@@ -1,3 +1,4 @@
1
+ /** @public */
1
2
  export const isStream = (data) => {
2
3
  return (typeof data === 'object' &&
3
4
  data !== null &&
@@ -0,0 +1,25 @@
1
+ /** @public */
2
+ export type StreamEventType = 'StreamTimeout' | 'StreamNotFound' | 'StreamUnauthorized' | 'AgentTaskProgressItemUpdated';
3
+ /** @public */
4
+ export type AgentTaskProgressItemUpdatedEventDto = {
5
+ type: StreamEventType;
6
+ streamId: string;
7
+ timestamp: string;
8
+ createdAt: string;
9
+ agentTaskId: string;
10
+ progressItemId: string;
11
+ data: string;
12
+ };
13
+ /** @public */
14
+ export type StreamNotFoundEventDto = {
15
+ type: StreamEventType;
16
+ streamId: string;
17
+ timestamp: string;
18
+ };
19
+ /** @public */
20
+ export type StreamTimeoutEventDto = {
21
+ type: StreamEventType;
22
+ streamId: string;
23
+ timestamp: string;
24
+ };
25
+ //# sourceMappingURL=StreamEventTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StreamEventTypes.d.ts","sourceRoot":"","sources":["../../src/types/StreamEventTypes.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,MAAM,MAAM,eAAe,GACrB,eAAe,GACf,gBAAgB,GAChB,oBAAoB,GACpB,8BAA8B,CAAA;AAEpC,cAAc;AACd,MAAM,MAAM,oCAAoC,GAAG;IAC/C,IAAI,EAAE,eAAe,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;CACf,CAAA;AAED,cAAc;AACd,MAAM,MAAM,sBAAsB,GAAG;IACjC,IAAI,EAAE,eAAe,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,cAAc;AACd,MAAM,MAAM,qBAAqB,GAAG;IAChC,IAAI,EAAE,eAAe,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAA"}
@@ -1,7 +1,10 @@
1
- export type { ApiError } from './ApiError';
2
- export type { AgentTask } from './AgentTask';
3
- export type { CreateAgentTaskRequest } from './CreateAgentTaskRequest';
4
- export type { CreateAgentTaskResponse } from './CreateAgentTaskResponse';
5
- export type { CreateStreamResponse } from './CreateStreamResponse';
6
- export type { CreateFileDownloadLinkResponse } from './CreateFileDownloadLinkResponse';
7
- export type { Stream } from './Stream';
1
+ export * from './AgentTask';
2
+ export * from './ApiError';
3
+ export * from './CreateAgentTaskRequest';
4
+ export * from './CreateAgentTaskResponse';
5
+ export * from './CreateStreamResponse';
6
+ export * from './FencyInstance';
7
+ export * from './FencyOptions';
8
+ export * from './Stream';
9
+ export * from './StreamEventTypes';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA"}
@@ -1 +1,9 @@
1
- export {};
1
+ export * from './AgentTask';
2
+ export * from './ApiError';
3
+ export * from './CreateAgentTaskRequest';
4
+ export * from './CreateAgentTaskResponse';
5
+ export * from './CreateStreamResponse';
6
+ export * from './FencyInstance';
7
+ export * from './FencyOptions';
8
+ export * from './Stream';
9
+ export * from './StreamEventTypes';
@@ -0,0 +1,17 @@
1
+ import type { AgentTaskProgressItemUpdatedEventDto, StreamNotFoundEventDto, StreamTimeoutEventDto } from '../types/StreamEventTypes';
2
+ import type { AgentTaskProgressItemUpdatedEventDto as GeneratedAgentTaskDto } from '../openapi/ct/models/AgentTaskProgressItemUpdatedEventDto';
3
+ import type { StreamNotFoundEventDto as GeneratedStreamNotFoundDto } from '../openapi/ct/models/StreamNotFoundEventDto';
4
+ import type { StreamTimeoutEventDto as GeneratedStreamTimeoutDto } from '../openapi/ct/models/StreamTimeoutEventDto';
5
+ /** @public */
6
+ export declare function isStreamTimeoutEventDto(value: unknown): value is StreamTimeoutEventDto;
7
+ /** @public */
8
+ export declare function isStreamNotFoundEventDto(value: unknown): value is StreamNotFoundEventDto;
9
+ /** @public */
10
+ export declare function isAgentTaskProgressItemUpdatedEventDto(value: unknown): value is AgentTaskProgressItemUpdatedEventDto;
11
+ /** @public */
12
+ export declare function toStreamTimeoutEventDto(value: GeneratedStreamTimeoutDto): StreamTimeoutEventDto;
13
+ /** @public */
14
+ export declare function toStreamNotFoundEventDto(value: GeneratedStreamNotFoundDto): StreamNotFoundEventDto;
15
+ /** @public */
16
+ export declare function toAgentTaskProgressItemUpdatedEventDto(value: GeneratedAgentTaskDto): AgentTaskProgressItemUpdatedEventDto;
17
+ //# sourceMappingURL=streamEventTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamEventTypes.d.ts","sourceRoot":"","sources":["../../src/utils/streamEventTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,oCAAoC,EAEpC,sBAAsB,EACtB,qBAAqB,EACxB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,oCAAoC,IAAI,qBAAqB,EAAE,MAAM,2DAA2D,CAAA;AAC9I,OAAO,KAAK,EAAE,sBAAsB,IAAI,0BAA0B,EAAE,MAAM,6CAA6C,CAAA;AACvH,OAAO,KAAK,EAAE,qBAAqB,IAAI,yBAAyB,EAAE,MAAM,4CAA4C,CAAA;AAUpH,cAAc;AACd,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,qBAAqB,CAOhC;AAED,cAAc;AACd,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,sBAAsB,CAOjC;AAED,cAAc;AACd,wBAAgB,sCAAsC,CAClD,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,oCAAoC,CAW/C;AAWD,cAAc;AACd,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,yBAAyB,GACjC,qBAAqB,CAMvB;AAED,cAAc;AACd,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,0BAA0B,GAClC,sBAAsB,CAMxB;AAED,cAAc;AACd,wBAAgB,sCAAsC,CAClD,KAAK,EAAE,qBAAqB,GAC7B,oCAAoC,CAUtC"}
@@ -0,0 +1,75 @@
1
+ function isObject(value) {
2
+ return typeof value === 'object' && value !== null;
3
+ }
4
+ function hasString(obj, key) {
5
+ return key in obj && typeof obj[key] === 'string';
6
+ }
7
+ /** @public */
8
+ export function isStreamTimeoutEventDto(value) {
9
+ if (!isObject(value))
10
+ return false;
11
+ return (value.type === 'StreamTimeout' &&
12
+ hasString(value, 'streamId') &&
13
+ hasString(value, 'timestamp'));
14
+ }
15
+ /** @public */
16
+ export function isStreamNotFoundEventDto(value) {
17
+ if (!isObject(value))
18
+ return false;
19
+ return (value.type === 'StreamNotFound' &&
20
+ hasString(value, 'streamId') &&
21
+ hasString(value, 'timestamp'));
22
+ }
23
+ /** @public */
24
+ export function isAgentTaskProgressItemUpdatedEventDto(value) {
25
+ if (!isObject(value))
26
+ return false;
27
+ return (value.type === 'AgentTaskProgressItemUpdated' &&
28
+ hasString(value, 'streamId') &&
29
+ hasString(value, 'timestamp') &&
30
+ hasString(value, 'createdAt') &&
31
+ hasString(value, 'agentTaskId') &&
32
+ hasString(value, 'progressItemId') &&
33
+ hasString(value, 'data'));
34
+ }
35
+ function parseStreamEventType(value) {
36
+ if (typeof value !== 'string')
37
+ return 'StreamTimeout';
38
+ if (value === 'StreamTimeout')
39
+ return 'StreamTimeout';
40
+ if (value === 'StreamNotFound')
41
+ return 'StreamNotFound';
42
+ if (value === 'StreamUnauthorized')
43
+ return 'StreamUnauthorized';
44
+ if (value === 'AgentTaskProgressItemUpdated')
45
+ return 'AgentTaskProgressItemUpdated';
46
+ return 'StreamTimeout';
47
+ }
48
+ /** @public */
49
+ export function toStreamTimeoutEventDto(value) {
50
+ return {
51
+ type: parseStreamEventType(value.type),
52
+ streamId: value.streamId,
53
+ timestamp: value.timestamp,
54
+ };
55
+ }
56
+ /** @public */
57
+ export function toStreamNotFoundEventDto(value) {
58
+ return {
59
+ type: parseStreamEventType(value.type),
60
+ streamId: value.streamId,
61
+ timestamp: value.timestamp,
62
+ };
63
+ }
64
+ /** @public */
65
+ export function toAgentTaskProgressItemUpdatedEventDto(value) {
66
+ return {
67
+ type: parseStreamEventType(value.type),
68
+ streamId: value.streamId,
69
+ timestamp: value.timestamp,
70
+ createdAt: value.createdAt,
71
+ agentTaskId: value.agentTaskId,
72
+ progressItemId: value.progressItemId,
73
+ data: value.data,
74
+ };
75
+ }
@@ -0,0 +1,3 @@
1
+ import { ModelMessageRole } from '../openapi/ct-st/models/ModelMessageRole';
2
+ export declare const toModelMessageRole: (role: "user" | "assistant" | "system") => ModelMessageRole;
3
+ //# sourceMappingURL=toModelMessageRole.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toModelMessageRole.d.ts","sourceRoot":"","sources":["../../src/utils/toModelMessageRole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAE3E,eAAO,MAAM,kBAAkB,GAC3B,MAAM,MAAM,GAAG,WAAW,GAAG,QAAQ,KACtC,gBASF,CAAA"}
@@ -1,4 +1,4 @@
1
- import { ModelMessageRole } from './openapi/ct-st/models/ModelMessageRole';
1
+ import { ModelMessageRole } from '../openapi/ct-st/models/ModelMessageRole';
2
2
  export const toModelMessageRole = (role) => {
3
3
  switch (role) {
4
4
  case 'user':
@@ -12,3 +12,4 @@ export declare function setPackageVersion(version: string): void;
12
12
  * Reset the version to the default build-time version
13
13
  */
14
14
  export declare function resetPackageVersion(): void;
15
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
@@ -1,7 +1,7 @@
1
1
  // Browser-compatible version utility
2
2
  // The version is set at build time and can be overridden if needed
3
3
  // Build-time version constant - this should be updated during the build process
4
- const SDK_VERSION = '0.1.119';
4
+ const SDK_VERSION = '0.1.121';
5
5
  // Allow runtime override if needed
6
6
  let versionOverride = null;
7
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fencyai/js",
3
- "version": "0.1.121",
3
+ "version": "0.1.123",
4
4
  "description": "> TODO: description",
5
5
  "author": "staklau <steinaageklaussen@gmail.com>",
6
6
  "homepage": "",
@@ -32,7 +32,9 @@
32
32
  "test:watch": "jest --watch",
33
33
  "dev": "tsc --watch",
34
34
  "prepublishOnly": "npm run build",
35
- "codegen": "openapi --input http://localhost:8080/pub/ct-st/swagger.json --output ./src/openapi/ct-st && openapi --input http://localhost:8080/pub/ct/swagger.json --output ./src/openapi/ct"
35
+ "codegen": "openapi --input http://localhost:8080/pub/ct-st/swagger.json --output ./src/openapi/ct-st && openapi --input http://localhost:8080/pub/ct/swagger.json --output ./src/openapi/ct",
36
+ "extract-api": "api-extractor run",
37
+ "extract-api:local": "api-extractor run --local"
36
38
  },
37
39
  "devDependencies": {
38
40
  "@types/jest": "^29.5.11",
@@ -42,5 +44,5 @@
42
44
  "ts-jest": "^29.1.1",
43
45
  "typescript": "^5.3.3"
44
46
  },
45
- "gitHead": "3fd3c83b21343f758b4a1cc08c567d90e82b78c5"
47
+ "gitHead": "69837e7a8a835804f22365e8970216e4c1ab047b"
46
48
  }
@@ -1,2 +0,0 @@
1
- import { ModelMessageRole } from './openapi/ct-st/models/ModelMessageRole';
2
- export declare const toModelMessageRole: (role: "user" | "assistant" | "system") => ModelMessageRole;
@@ -1,3 +0,0 @@
1
- export interface CreateFileDownloadLinkRequest {
2
- fileId: string;
3
- }
@@ -1,4 +0,0 @@
1
- export interface CreateFileDownloadLinkResponse {
2
- type: 'success';
3
- downloadLink: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- export interface S3PostRequest {
2
- xAmzDate: string;
3
- xAmzSignature: string;
4
- xAmzAlgorithm: string;
5
- xAmzCredential: string;
6
- policy: string;
7
- key: string;
8
- uploadUrl: string;
9
- sessionToken: string;
10
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { ApiError } from '../types/ApiError';
2
- export declare const parseApiError: (error: unknown) => ApiError | null;
@@ -1,14 +0,0 @@
1
- export const parseApiError = (error) => {
2
- if (typeof error === 'object' &&
3
- error !== null &&
4
- 'code' in error &&
5
- 'message' in error &&
6
- typeof error.code === 'string' &&
7
- typeof error.message === 'string') {
8
- return {
9
- code: error.code,
10
- message: error.message,
11
- };
12
- }
13
- return null;
14
- };
@@ -1 +0,0 @@
1
- export declare const parseErrorBody: (response: Response) => Promise<unknown>;
@@ -1,8 +0,0 @@
1
- export const parseErrorBody = async (response) => {
2
- try {
3
- return await response.json();
4
- }
5
- catch (error) {
6
- return null;
7
- }
8
- };
@@ -1,2 +0,0 @@
1
- import { ApiError } from '../types/ApiError';
2
- export declare const parseNonOkResponse: (response: Response) => Promise<ApiError>;
@@ -1,35 +0,0 @@
1
- import { parseApiError } from './parseApiError';
2
- import { parseErrorBody } from './parseErrorBody';
3
- export const parseNonOkResponse = async (response) => {
4
- const error = await parseErrorBody(response);
5
- const apiError = parseApiError(error);
6
- if (apiError) {
7
- return apiError;
8
- }
9
- if (apiError) {
10
- return apiError;
11
- }
12
- if (response.status === 401) {
13
- return {
14
- code: 'InvalidCredentials',
15
- message: `Invalid credentials provided.
16
- Please make sure a valid publishable key is set.
17
- You can find your publishable key in the Fency dashboard.
18
- Take a look at https://docs.fency.ai/docs for more information.`,
19
- };
20
- }
21
- if (response.status === 403) {
22
- return {
23
- code: 'ForbiddenOperation',
24
- message: `Forbidden operation!
25
- If your publishable key is correctly set, you might need to whitelist the domain you're using in the Fency dashboard.
26
- If you're using localhost you also need to whitelist that.
27
- Take a look at https://docs.fency.ai/docs for more information.
28
- `,
29
- };
30
- }
31
- return {
32
- code: 'UnknownError',
33
- message: `Unknown error!\n${response.status ? `Status code: ${response.status}\n` : ''}Response Body:${JSON.stringify(error, null, 2)}`.trim(),
34
- };
35
- };