@gleanwork/api-client 0.14.12 → 0.14.14

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 (95) hide show
  1. package/README.md +9 -9
  2. package/dist/commonjs/__tests__/messages.test.js +1 -1
  3. package/dist/commonjs/__tests__/messages.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/summarize.test.js +3 -3
  5. package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
  6. package/dist/commonjs/funcs/clientChatDeleteFiles.d.ts +1 -1
  7. package/dist/commonjs/funcs/clientChatDeleteFiles.js +1 -1
  8. package/dist/commonjs/funcs/clientChatRetrieveFiles.d.ts +1 -1
  9. package/dist/commonjs/funcs/clientChatRetrieveFiles.js +1 -1
  10. package/dist/commonjs/funcs/clientChatUploadFiles.d.ts +1 -1
  11. package/dist/commonjs/funcs/clientChatUploadFiles.js +4 -2
  12. package/dist/commonjs/funcs/clientChatUploadFiles.js.map +1 -1
  13. package/dist/commonjs/funcs/indexingPeopleIndex.d.ts +1 -1
  14. package/dist/commonjs/funcs/indexingPeopleIndex.js +1 -1
  15. package/dist/commonjs/lib/config.d.ts +3 -3
  16. package/dist/commonjs/lib/config.js +3 -3
  17. package/dist/commonjs/lib/encodings.d.ts.map +1 -1
  18. package/dist/commonjs/lib/encodings.js +20 -5
  19. package/dist/commonjs/lib/encodings.js.map +1 -1
  20. package/dist/commonjs/models/components/chatfilestatus.d.ts +1 -0
  21. package/dist/commonjs/models/components/chatfilestatus.d.ts.map +1 -1
  22. package/dist/commonjs/models/components/chatfilestatus.js +1 -0
  23. package/dist/commonjs/models/components/chatfilestatus.js.map +1 -1
  24. package/dist/commonjs/models/components/documentdefinition.d.ts +5 -0
  25. package/dist/commonjs/models/components/documentdefinition.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/documentdefinition.js +1 -0
  27. package/dist/commonjs/models/components/documentdefinition.js.map +1 -1
  28. package/dist/commonjs/react-query/clientChatDeleteFiles.d.ts +1 -1
  29. package/dist/commonjs/react-query/clientChatDeleteFiles.js +1 -1
  30. package/dist/commonjs/react-query/clientChatRetrieveFiles.d.ts +1 -1
  31. package/dist/commonjs/react-query/clientChatRetrieveFiles.js +1 -1
  32. package/dist/commonjs/react-query/clientChatUploadFiles.d.ts +1 -1
  33. package/dist/commonjs/react-query/clientChatUploadFiles.js +1 -1
  34. package/dist/commonjs/react-query/indexingPeopleIndex.d.ts +1 -1
  35. package/dist/commonjs/react-query/indexingPeopleIndex.js +1 -1
  36. package/dist/commonjs/sdk/chat.d.ts +3 -3
  37. package/dist/commonjs/sdk/chat.js +3 -3
  38. package/dist/commonjs/sdk/people.d.ts +1 -1
  39. package/dist/commonjs/sdk/people.js +1 -1
  40. package/dist/esm/__tests__/messages.test.js +1 -1
  41. package/dist/esm/__tests__/messages.test.js.map +1 -1
  42. package/dist/esm/__tests__/summarize.test.js +3 -3
  43. package/dist/esm/__tests__/summarize.test.js.map +1 -1
  44. package/dist/esm/funcs/clientChatDeleteFiles.d.ts +1 -1
  45. package/dist/esm/funcs/clientChatDeleteFiles.js +1 -1
  46. package/dist/esm/funcs/clientChatRetrieveFiles.d.ts +1 -1
  47. package/dist/esm/funcs/clientChatRetrieveFiles.js +1 -1
  48. package/dist/esm/funcs/clientChatUploadFiles.d.ts +1 -1
  49. package/dist/esm/funcs/clientChatUploadFiles.js +4 -2
  50. package/dist/esm/funcs/clientChatUploadFiles.js.map +1 -1
  51. package/dist/esm/funcs/indexingPeopleIndex.d.ts +1 -1
  52. package/dist/esm/funcs/indexingPeopleIndex.js +1 -1
  53. package/dist/esm/lib/config.d.ts +3 -3
  54. package/dist/esm/lib/config.js +3 -3
  55. package/dist/esm/lib/encodings.d.ts.map +1 -1
  56. package/dist/esm/lib/encodings.js +20 -5
  57. package/dist/esm/lib/encodings.js.map +1 -1
  58. package/dist/esm/models/components/chatfilestatus.d.ts +1 -0
  59. package/dist/esm/models/components/chatfilestatus.d.ts.map +1 -1
  60. package/dist/esm/models/components/chatfilestatus.js +1 -0
  61. package/dist/esm/models/components/chatfilestatus.js.map +1 -1
  62. package/dist/esm/models/components/documentdefinition.d.ts +5 -0
  63. package/dist/esm/models/components/documentdefinition.d.ts.map +1 -1
  64. package/dist/esm/models/components/documentdefinition.js +1 -0
  65. package/dist/esm/models/components/documentdefinition.js.map +1 -1
  66. package/dist/esm/react-query/clientChatDeleteFiles.d.ts +1 -1
  67. package/dist/esm/react-query/clientChatDeleteFiles.js +1 -1
  68. package/dist/esm/react-query/clientChatRetrieveFiles.d.ts +1 -1
  69. package/dist/esm/react-query/clientChatRetrieveFiles.js +1 -1
  70. package/dist/esm/react-query/clientChatUploadFiles.d.ts +1 -1
  71. package/dist/esm/react-query/clientChatUploadFiles.js +1 -1
  72. package/dist/esm/react-query/indexingPeopleIndex.d.ts +1 -1
  73. package/dist/esm/react-query/indexingPeopleIndex.js +1 -1
  74. package/dist/esm/sdk/chat.d.ts +3 -3
  75. package/dist/esm/sdk/chat.js +3 -3
  76. package/dist/esm/sdk/people.d.ts +1 -1
  77. package/dist/esm/sdk/people.js +1 -1
  78. package/jsr.json +1 -1
  79. package/package.json +1 -1
  80. package/src/__tests__/messages.test.ts +1 -1
  81. package/src/__tests__/summarize.test.ts +3 -3
  82. package/src/funcs/clientChatDeleteFiles.ts +1 -1
  83. package/src/funcs/clientChatRetrieveFiles.ts +1 -1
  84. package/src/funcs/clientChatUploadFiles.ts +4 -2
  85. package/src/funcs/indexingPeopleIndex.ts +1 -1
  86. package/src/lib/config.ts +3 -3
  87. package/src/lib/encodings.ts +23 -4
  88. package/src/models/components/chatfilestatus.ts +1 -0
  89. package/src/models/components/documentdefinition.ts +6 -0
  90. package/src/react-query/clientChatDeleteFiles.ts +1 -1
  91. package/src/react-query/clientChatRetrieveFiles.ts +1 -1
  92. package/src/react-query/clientChatUploadFiles.ts +1 -1
  93. package/src/react-query/indexingPeopleIndex.ts +1 -1
  94. package/src/sdk/chat.ts +3 -3
  95. package/src/sdk/people.ts +1 -1
@@ -34,7 +34,7 @@ import { Result } from "../types/fp.js";
34
34
  import { isReadableStream } from "../types/streams.js";
35
35
 
36
36
  /**
37
- * Upload files for Chat.
37
+ * Upload files for Chat
38
38
  *
39
39
  * @remarks
40
40
  * Upload files for Chat.
@@ -108,7 +108,9 @@ async function $do(
108
108
 
109
109
  for (const fileItem of payload.UploadChatFilesRequest.files ?? []) {
110
110
  if (isBlobLike(fileItem)) {
111
- appendForm(body, "files", fileItem);
111
+ const blob = fileItem;
112
+ const name = "name" in blob ? (blob.name as string) : undefined;
113
+ appendForm(body, "files", blob, name);
112
114
  } else if (isReadableStream(fileItem.content)) {
113
115
  const buffer = await readableStreamToArrayBuffer(fileItem.content);
114
116
  const contentType = getContentTypeFromFileName(fileItem.fileName)
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * Index employee
31
31
  *
32
32
  * @remarks
33
- * Adds an employee or updates information about an employee
33
+ * Adds an employee or replaces the existing information about an employee.
34
34
  */
35
35
  export function indexingPeopleIndex(
36
36
  client: GleanCore,
package/src/lib/config.ts CHANGED
@@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
73
73
  export const SDK_METADATA = {
74
74
  language: "typescript",
75
75
  openapiDocVersion: "0.9.0",
76
- sdkVersion: "0.14.12",
77
- genVersion: "2.869.10",
76
+ sdkVersion: "0.14.14",
77
+ genVersion: "2.869.25",
78
78
  userAgent:
79
- "speakeasy-sdk/typescript 0.14.12 2.869.10 0.9.0 @gleanwork/api-client",
79
+ "speakeasy-sdk/typescript 0.14.14 2.869.25 0.9.0 @gleanwork/api-client",
80
80
  } as const;
@@ -480,6 +480,23 @@ export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
480
480
  export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
481
481
  export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
482
482
 
483
+ function isBlobLike(val: unknown): val is Blob {
484
+ if (val instanceof Blob) {
485
+ return true;
486
+ }
487
+
488
+ if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
489
+ return false;
490
+ }
491
+
492
+ const tag = val[Symbol.toStringTag];
493
+ if (tag !== "Blob" && tag !== "File") {
494
+ return false;
495
+ }
496
+
497
+ return "stream" in val && typeof val.stream === "function";
498
+ }
499
+
483
500
  export function appendForm(
484
501
  fd: FormData,
485
502
  key: string,
@@ -488,10 +505,12 @@ export function appendForm(
488
505
  ): void {
489
506
  if (value == null) {
490
507
  return;
491
- } else if (value instanceof Blob && fileName) {
492
- fd.append(key, value, fileName);
493
- } else if (value instanceof Blob) {
494
- fd.append(key, value);
508
+ } else if (isBlobLike(value)) {
509
+ if (fileName) {
510
+ fd.append(key, value as Blob, fileName);
511
+ } else {
512
+ fd.append(key, value as Blob);
513
+ }
495
514
  } else {
496
515
  fd.append(key, String(value));
497
516
  }
@@ -13,6 +13,7 @@ import { OpenEnum } from "../../types/enums.js";
13
13
  export const ChatFileStatus = {
14
14
  Processing: "PROCESSING",
15
15
  Processed: "PROCESSED",
16
+ PartiallyProcessed: "PARTIALLY_PROCESSED",
16
17
  Failed: "FAILED",
17
18
  Deleted: "DELETED",
18
19
  } as const;
@@ -121,6 +121,10 @@ export type DocumentDefinition = {
121
121
  * Additional variations of the URL that this document points to.
122
122
  */
123
123
  additionalUrls?: Array<string> | undefined;
124
+ /**
125
+ * A deep link, if available, into the datasource's native application for the user's platform (e.g. slack://channel/message).
126
+ */
127
+ nativeAppUrl?: string | undefined;
124
128
  /**
125
129
  * Comments associated with the document.
126
130
  */
@@ -154,6 +158,7 @@ export type DocumentDefinition$Outbound = {
154
158
  interactions?: DocumentInteractionsDefinition$Outbound | undefined;
155
159
  status?: string | undefined;
156
160
  additionalUrls?: Array<string> | undefined;
161
+ nativeAppUrl?: string | undefined;
157
162
  comments?: Array<CommentDefinition$Outbound> | undefined;
158
163
  customProperties?: Array<CustomProperty$Outbound> | undefined;
159
164
  };
@@ -185,6 +190,7 @@ export const DocumentDefinition$outboundSchema: z.ZodType<
185
190
  interactions: DocumentInteractionsDefinition$outboundSchema.optional(),
186
191
  status: z.string().optional(),
187
192
  additionalUrls: z.array(z.string()).optional(),
193
+ nativeAppUrl: z.string().optional(),
188
194
  comments: z.array(CommentDefinition$outboundSchema).optional(),
189
195
  customProperties: z.array(CustomProperty$outboundSchema).optional(),
190
196
  });
@@ -47,7 +47,7 @@ export type ClientChatDeleteFilesMutationError =
47
47
  | SDKValidationError;
48
48
 
49
49
  /**
50
- * Delete files uploaded by a user for chat.
50
+ * Delete files uploaded by a user for chat
51
51
  *
52
52
  * @remarks
53
53
  * Delete files uploaded by a user for Chat.
@@ -48,7 +48,7 @@ export type ClientChatRetrieveFilesMutationError =
48
48
  | SDKValidationError;
49
49
 
50
50
  /**
51
- * Get files uploaded by a user for Chat.
51
+ * Get files uploaded by a user for Chat
52
52
  *
53
53
  * @remarks
54
54
  * Get files uploaded by a user for Chat.
@@ -48,7 +48,7 @@ export type ClientChatUploadFilesMutationError =
48
48
  | SDKValidationError;
49
49
 
50
50
  /**
51
- * Upload files for Chat.
51
+ * Upload files for Chat
52
52
  *
53
53
  * @remarks
54
54
  * Upload files for Chat.
@@ -48,7 +48,7 @@ export type IndexingPeopleIndexMutationError =
48
48
  * Index employee
49
49
  *
50
50
  * @remarks
51
- * Adds an employee or updates information about an employee
51
+ * Adds an employee or replaces the existing information about an employee.
52
52
  */
53
53
  export function useIndexingPeopleIndexMutation(
54
54
  options?: MutationHookOptions<
package/src/sdk/chat.ts CHANGED
@@ -141,7 +141,7 @@ export class Chat extends ClientSDK {
141
141
  }
142
142
 
143
143
  /**
144
- * Upload files for Chat.
144
+ * Upload files for Chat
145
145
  *
146
146
  * @remarks
147
147
  * Upload files for Chat.
@@ -162,7 +162,7 @@ export class Chat extends ClientSDK {
162
162
  }
163
163
 
164
164
  /**
165
- * Get files uploaded by a user for Chat.
165
+ * Get files uploaded by a user for Chat
166
166
  *
167
167
  * @remarks
168
168
  * Get files uploaded by a user for Chat.
@@ -183,7 +183,7 @@ export class Chat extends ClientSDK {
183
183
  }
184
184
 
185
185
  /**
186
- * Delete files uploaded by a user for chat.
186
+ * Delete files uploaded by a user for chat
187
187
  *
188
188
  * @remarks
189
189
  * Delete files uploaded by a user for Chat.
package/src/sdk/people.ts CHANGED
@@ -63,7 +63,7 @@ export class People extends ClientSDK {
63
63
  * Index employee
64
64
  *
65
65
  * @remarks
66
- * Adds an employee or updates information about an employee
66
+ * Adds an employee or replaces the existing information about an employee.
67
67
  */
68
68
  async index(
69
69
  request: components.IndexEmployeeRequest,