@factify/sdk 1.0.1 → 1.1.0-rc.1

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 (119) hide show
  1. package/README.md +7 -0
  2. package/dist/commonjs/funcs/documentsCreate.js +3 -1
  3. package/dist/commonjs/funcs/documentsCreate.js.map +1 -1
  4. package/dist/commonjs/funcs/organizationsGetPublicProfile.d.ts +18 -0
  5. package/dist/commonjs/funcs/organizationsGetPublicProfile.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/organizationsGetPublicProfile.js +126 -0
  7. package/dist/commonjs/funcs/organizationsGetPublicProfile.js.map +1 -0
  8. package/dist/commonjs/funcs/organizationsLogoUpload.d.ts +18 -0
  9. package/dist/commonjs/funcs/organizationsLogoUpload.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/organizationsLogoUpload.js +127 -0
  11. package/dist/commonjs/funcs/organizationsLogoUpload.js.map +1 -0
  12. package/dist/commonjs/funcs/versionsCreate.js +3 -1
  13. package/dist/commonjs/funcs/versionsCreate.js.map +1 -1
  14. package/dist/commonjs/lib/config.d.ts +4 -4
  15. package/dist/commonjs/lib/config.d.ts.map +1 -1
  16. package/dist/commonjs/lib/config.js +4 -4
  17. package/dist/commonjs/lib/config.js.map +1 -1
  18. package/dist/commonjs/lib/encodings.d.ts.map +1 -1
  19. package/dist/commonjs/lib/encodings.js +20 -5
  20. package/dist/commonjs/lib/encodings.js.map +1 -1
  21. package/dist/commonjs/models/components/getorganizationpublicprofileresponse.d.ts +20 -0
  22. package/dist/commonjs/models/components/getorganizationpublicprofileresponse.d.ts.map +1 -0
  23. package/dist/commonjs/models/components/getorganizationpublicprofileresponse.js +58 -0
  24. package/dist/commonjs/models/components/getorganizationpublicprofileresponse.js.map +1 -0
  25. package/dist/commonjs/models/components/index.d.ts +2 -0
  26. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  27. package/dist/commonjs/models/components/index.js +2 -0
  28. package/dist/commonjs/models/components/index.js.map +1 -1
  29. package/dist/commonjs/models/components/uploadorganizationlogoresponse.d.ts +16 -0
  30. package/dist/commonjs/models/components/uploadorganizationlogoresponse.d.ts.map +1 -0
  31. package/dist/commonjs/models/components/uploadorganizationlogoresponse.js +56 -0
  32. package/dist/commonjs/models/components/uploadorganizationlogoresponse.js.map +1 -0
  33. package/dist/commonjs/models/operations/getorganizationpublicprofile.d.ts +30 -0
  34. package/dist/commonjs/models/operations/getorganizationpublicprofile.d.ts.map +1 -0
  35. package/dist/commonjs/models/operations/getorganizationpublicprofile.js +70 -0
  36. package/dist/commonjs/models/operations/getorganizationpublicprofile.js.map +1 -0
  37. package/dist/commonjs/models/operations/index.d.ts +2 -0
  38. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  39. package/dist/commonjs/models/operations/index.js +2 -0
  40. package/dist/commonjs/models/operations/index.js.map +1 -1
  41. package/dist/commonjs/models/operations/uploadorganizationlogo.d.ts +50 -0
  42. package/dist/commonjs/models/operations/uploadorganizationlogo.d.ts.map +1 -0
  43. package/dist/commonjs/models/operations/uploadorganizationlogo.js +85 -0
  44. package/dist/commonjs/models/operations/uploadorganizationlogo.js.map +1 -0
  45. package/dist/commonjs/sdk/logo.d.ts +12 -0
  46. package/dist/commonjs/sdk/logo.d.ts.map +1 -0
  47. package/dist/commonjs/sdk/logo.js +22 -0
  48. package/dist/commonjs/sdk/logo.js.map +1 -0
  49. package/dist/commonjs/sdk/organizations.d.ts +10 -0
  50. package/dist/commonjs/sdk/organizations.d.ts.map +1 -1
  51. package/dist/commonjs/sdk/organizations.js +14 -0
  52. package/dist/commonjs/sdk/organizations.js.map +1 -1
  53. package/dist/esm/funcs/documentsCreate.js +3 -1
  54. package/dist/esm/funcs/documentsCreate.js.map +1 -1
  55. package/dist/esm/funcs/organizationsGetPublicProfile.d.ts +18 -0
  56. package/dist/esm/funcs/organizationsGetPublicProfile.d.ts.map +1 -0
  57. package/dist/esm/funcs/organizationsGetPublicProfile.js +90 -0
  58. package/dist/esm/funcs/organizationsGetPublicProfile.js.map +1 -0
  59. package/dist/esm/funcs/organizationsLogoUpload.d.ts +18 -0
  60. package/dist/esm/funcs/organizationsLogoUpload.d.ts.map +1 -0
  61. package/dist/esm/funcs/organizationsLogoUpload.js +91 -0
  62. package/dist/esm/funcs/organizationsLogoUpload.js.map +1 -0
  63. package/dist/esm/funcs/versionsCreate.js +3 -1
  64. package/dist/esm/funcs/versionsCreate.js.map +1 -1
  65. package/dist/esm/lib/config.d.ts +4 -4
  66. package/dist/esm/lib/config.d.ts.map +1 -1
  67. package/dist/esm/lib/config.js +4 -4
  68. package/dist/esm/lib/config.js.map +1 -1
  69. package/dist/esm/lib/encodings.d.ts.map +1 -1
  70. package/dist/esm/lib/encodings.js +20 -5
  71. package/dist/esm/lib/encodings.js.map +1 -1
  72. package/dist/esm/models/components/getorganizationpublicprofileresponse.d.ts +20 -0
  73. package/dist/esm/models/components/getorganizationpublicprofileresponse.d.ts.map +1 -0
  74. package/dist/esm/models/components/getorganizationpublicprofileresponse.js +21 -0
  75. package/dist/esm/models/components/getorganizationpublicprofileresponse.js.map +1 -0
  76. package/dist/esm/models/components/index.d.ts +2 -0
  77. package/dist/esm/models/components/index.d.ts.map +1 -1
  78. package/dist/esm/models/components/index.js +2 -0
  79. package/dist/esm/models/components/index.js.map +1 -1
  80. package/dist/esm/models/components/uploadorganizationlogoresponse.d.ts +16 -0
  81. package/dist/esm/models/components/uploadorganizationlogoresponse.d.ts.map +1 -0
  82. package/dist/esm/models/components/uploadorganizationlogoresponse.js +19 -0
  83. package/dist/esm/models/components/uploadorganizationlogoresponse.js.map +1 -0
  84. package/dist/esm/models/operations/getorganizationpublicprofile.d.ts +30 -0
  85. package/dist/esm/models/operations/getorganizationpublicprofile.d.ts.map +1 -0
  86. package/dist/esm/models/operations/getorganizationpublicprofile.js +32 -0
  87. package/dist/esm/models/operations/getorganizationpublicprofile.js.map +1 -0
  88. package/dist/esm/models/operations/index.d.ts +2 -0
  89. package/dist/esm/models/operations/index.d.ts.map +1 -1
  90. package/dist/esm/models/operations/index.js +2 -0
  91. package/dist/esm/models/operations/index.js.map +1 -1
  92. package/dist/esm/models/operations/uploadorganizationlogo.d.ts +50 -0
  93. package/dist/esm/models/operations/uploadorganizationlogo.d.ts.map +1 -0
  94. package/dist/esm/models/operations/uploadorganizationlogo.js +46 -0
  95. package/dist/esm/models/operations/uploadorganizationlogo.js.map +1 -0
  96. package/dist/esm/sdk/logo.d.ts +12 -0
  97. package/dist/esm/sdk/logo.d.ts.map +1 -0
  98. package/dist/esm/sdk/logo.js +18 -0
  99. package/dist/esm/sdk/logo.js.map +1 -0
  100. package/dist/esm/sdk/organizations.d.ts +10 -0
  101. package/dist/esm/sdk/organizations.d.ts.map +1 -1
  102. package/dist/esm/sdk/organizations.js +14 -0
  103. package/dist/esm/sdk/organizations.js.map +1 -1
  104. package/jsr.json +1 -1
  105. package/package.json +1 -1
  106. package/src/funcs/documentsCreate.ts +3 -1
  107. package/src/funcs/organizationsGetPublicProfile.ts +185 -0
  108. package/src/funcs/organizationsLogoUpload.ts +183 -0
  109. package/src/funcs/versionsCreate.ts +3 -1
  110. package/src/lib/config.ts +5 -4
  111. package/src/lib/encodings.ts +23 -4
  112. package/src/models/components/getorganizationpublicprofileresponse.ts +52 -0
  113. package/src/models/components/index.ts +2 -0
  114. package/src/models/components/uploadorganizationlogoresponse.ts +45 -0
  115. package/src/models/operations/getorganizationpublicprofile.ts +83 -0
  116. package/src/models/operations/index.ts +2 -0
  117. package/src/models/operations/uploadorganizationlogo.ts +133 -0
  118. package/src/sdk/logo.ts +27 -0
  119. package/src/sdk/organizations.ts +24 -0
@@ -0,0 +1,185 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { FactifyCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { FactifyError } from "../models/errors/factifyerror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Get an organization's public profile
31
+ *
32
+ * @remarks
33
+ * Returns the public-facing profile of an organization. This endpoint does not require authentication.
34
+ */
35
+ export function organizationsGetPublicProfile(
36
+ client: FactifyCore,
37
+ request: operations.GetOrganizationPublicProfileRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.GetOrganizationPublicProfileResponse,
42
+ | errors.ErrorResponse
43
+ | FactifyError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: FactifyCore,
62
+ request: operations.GetOrganizationPublicProfileRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ operations.GetOrganizationPublicProfileResponse,
68
+ | errors.ErrorResponse
69
+ | FactifyError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const parsed = safeParse(
82
+ request,
83
+ (value) =>
84
+ z.parse(
85
+ operations.GetOrganizationPublicProfileRequest$outboundSchema,
86
+ value,
87
+ ),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const pathParams = {
97
+ organization_id: encodeSimple("organization_id", payload.organization_id, {
98
+ explode: false,
99
+ charEncoding: "percent",
100
+ }),
101
+ };
102
+ const path = pathToFunc(
103
+ "/v1beta/organizations/{organization_id}/public-profile",
104
+ )(pathParams);
105
+
106
+ const headers = new Headers(compactMap({
107
+ Accept: "application/json",
108
+ }));
109
+
110
+ const secConfig = await extractSecurity(client._options.bearerAuth);
111
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
112
+ const requestSecurity = resolveGlobalSecurity(securityInput);
113
+
114
+ const context = {
115
+ options: client._options,
116
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
117
+ operationID: "getOrganizationPublicProfile",
118
+ oAuth2Scopes: null,
119
+
120
+ resolvedSecurity: requestSecurity,
121
+
122
+ securitySource: client._options.bearerAuth,
123
+ retryConfig: options?.retries
124
+ || client._options.retryConfig
125
+ || { strategy: "none" },
126
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
127
+ };
128
+
129
+ const requestRes = client._createRequest(context, {
130
+ security: requestSecurity,
131
+ method: "GET",
132
+ baseURL: options?.serverURL,
133
+ path: path,
134
+ headers: headers,
135
+ body: body,
136
+ userAgent: client._options.userAgent,
137
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
138
+ }, options);
139
+ if (!requestRes.ok) {
140
+ return [requestRes, { status: "invalid" }];
141
+ }
142
+ const req = requestRes.value;
143
+
144
+ const doResult = await client._do(req, {
145
+ context,
146
+ errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "5XX"],
147
+ retryConfig: context.retryConfig,
148
+ retryCodes: context.retryCodes,
149
+ });
150
+ if (!doResult.ok) {
151
+ return [doResult, { status: "request-error", request: req }];
152
+ }
153
+ const response = doResult.value;
154
+
155
+ const responseFields = {
156
+ HttpMeta: { Response: response, Request: req },
157
+ };
158
+
159
+ const [result] = await M.match<
160
+ operations.GetOrganizationPublicProfileResponse,
161
+ | errors.ErrorResponse
162
+ | FactifyError
163
+ | ResponseValidationError
164
+ | ConnectionError
165
+ | RequestAbortedError
166
+ | RequestTimeoutError
167
+ | InvalidRequestError
168
+ | UnexpectedClientError
169
+ | SDKValidationError
170
+ >(
171
+ M.json(200, operations.GetOrganizationPublicProfileResponse$inboundSchema, {
172
+ key: "Result",
173
+ }),
174
+ M.jsonErr([400, 401, 403, 404], errors.ErrorResponse$inboundSchema),
175
+ M.jsonErr(429, errors.ErrorResponse$inboundSchema, { hdrs: true }),
176
+ M.jsonErr(500, errors.ErrorResponse$inboundSchema),
177
+ M.fail("4XX"),
178
+ M.fail("5XX"),
179
+ )(response, req, { extraFields: responseFields });
180
+ if (!result.ok) {
181
+ return [result, { status: "complete", request: req, response }];
182
+ }
183
+
184
+ return [result, { status: "complete", request: req, response }];
185
+ }
@@ -0,0 +1,183 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { FactifyCore } from "../core.js";
7
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import { FactifyError } from "../models/errors/factifyerror.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Upload organization logo
31
+ *
32
+ * @remarks
33
+ * Uploads a logo image for an organization. Accepts JPEG, PNG, WebP, or SVG formats up to 2 MB.
34
+ */
35
+ export function organizationsLogoUpload(
36
+ client: FactifyCore,
37
+ request: operations.UploadOrganizationLogoRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.UploadOrganizationLogoResponse,
42
+ | errors.ErrorResponse
43
+ | FactifyError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: FactifyCore,
62
+ request: operations.UploadOrganizationLogoRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ operations.UploadOrganizationLogoResponse,
68
+ | errors.ErrorResponse
69
+ | FactifyError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const parsed = safeParse(
82
+ request,
83
+ (value) =>
84
+ z.parse(operations.UploadOrganizationLogoRequest$outboundSchema, value),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = encodeJSON("body", payload.body, { explode: true });
92
+
93
+ const pathParams = {
94
+ organization_id: encodeSimple("organization_id", payload.organization_id, {
95
+ explode: false,
96
+ charEncoding: "percent",
97
+ }),
98
+ };
99
+ const path = pathToFunc("/v1beta/organizations/{organization_id}/logo")(
100
+ pathParams,
101
+ );
102
+
103
+ const headers = new Headers(compactMap({
104
+ "Content-Type": "application/json",
105
+ Accept: "application/json",
106
+ }));
107
+
108
+ const secConfig = await extractSecurity(client._options.bearerAuth);
109
+ const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
110
+ const requestSecurity = resolveGlobalSecurity(securityInput);
111
+
112
+ const context = {
113
+ options: client._options,
114
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
115
+ operationID: "uploadOrganizationLogo",
116
+ oAuth2Scopes: null,
117
+
118
+ resolvedSecurity: requestSecurity,
119
+
120
+ securitySource: client._options.bearerAuth,
121
+ retryConfig: options?.retries
122
+ || client._options.retryConfig
123
+ || { strategy: "none" },
124
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
125
+ };
126
+
127
+ const requestRes = client._createRequest(context, {
128
+ security: requestSecurity,
129
+ method: "POST",
130
+ baseURL: options?.serverURL,
131
+ path: path,
132
+ headers: headers,
133
+ body: body,
134
+ userAgent: client._options.userAgent,
135
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
136
+ }, options);
137
+ if (!requestRes.ok) {
138
+ return [requestRes, { status: "invalid" }];
139
+ }
140
+ const req = requestRes.value;
141
+
142
+ const doResult = await client._do(req, {
143
+ context,
144
+ errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "5XX"],
145
+ retryConfig: context.retryConfig,
146
+ retryCodes: context.retryCodes,
147
+ });
148
+ if (!doResult.ok) {
149
+ return [doResult, { status: "request-error", request: req }];
150
+ }
151
+ const response = doResult.value;
152
+
153
+ const responseFields = {
154
+ HttpMeta: { Response: response, Request: req },
155
+ };
156
+
157
+ const [result] = await M.match<
158
+ operations.UploadOrganizationLogoResponse,
159
+ | errors.ErrorResponse
160
+ | FactifyError
161
+ | ResponseValidationError
162
+ | ConnectionError
163
+ | RequestAbortedError
164
+ | RequestTimeoutError
165
+ | InvalidRequestError
166
+ | UnexpectedClientError
167
+ | SDKValidationError
168
+ >(
169
+ M.json(200, operations.UploadOrganizationLogoResponse$inboundSchema, {
170
+ key: "Result",
171
+ }),
172
+ M.jsonErr([400, 401, 403, 404], errors.ErrorResponse$inboundSchema),
173
+ M.jsonErr(429, errors.ErrorResponse$inboundSchema, { hdrs: true }),
174
+ M.jsonErr(500, errors.ErrorResponse$inboundSchema),
175
+ M.fail("4XX"),
176
+ M.fail("5XX"),
177
+ )(response, req, { extraFields: responseFields });
178
+ if (!result.ok) {
179
+ return [result, { status: "complete", request: req, response }];
180
+ }
181
+
182
+ return [result, { status: "complete", request: req, response }];
183
+ }
@@ -98,7 +98,9 @@ async function $do(
98
98
  const body = new FormData();
99
99
 
100
100
  if (isBlobLike(payload.body.payload)) {
101
- appendForm(body, "payload", payload.body.payload);
101
+ const blob = payload.body.payload;
102
+ const name = "name" in blob ? (blob.name as string) : undefined;
103
+ appendForm(body, "payload", blob, name);
102
104
  } else if (isReadableStream(payload.body.payload.content)) {
103
105
  const buffer = await readableStreamToArrayBuffer(
104
106
  payload.body.payload.content,
package/src/lib/config.ts CHANGED
@@ -64,8 +64,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
64
64
 
65
65
  export const SDK_METADATA = {
66
66
  language: "typescript",
67
- openapiDocVersion: "1.0.0-rc.1",
68
- sdkVersion: "1.0.1",
69
- genVersion: "2.869.10",
70
- userAgent: "speakeasy-sdk/typescript 1.0.1 2.869.10 1.0.0-rc.1 @factify/sdk",
67
+ openapiDocVersion: "1.1.0-rc.1",
68
+ sdkVersion: "1.1.0-rc.1",
69
+ genVersion: "2.869.25",
70
+ userAgent:
71
+ "speakeasy-sdk/typescript 1.1.0-rc.1 2.869.25 1.1.0-rc.1 @factify/sdk",
71
72
  } as const;
@@ -479,6 +479,23 @@ export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited);
479
479
  export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited);
480
480
  export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject);
481
481
 
482
+ function isBlobLike(val: unknown): val is Blob {
483
+ if (val instanceof Blob) {
484
+ return true;
485
+ }
486
+
487
+ if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) {
488
+ return false;
489
+ }
490
+
491
+ const tag = val[Symbol.toStringTag];
492
+ if (tag !== "Blob" && tag !== "File") {
493
+ return false;
494
+ }
495
+
496
+ return "stream" in val && typeof val.stream === "function";
497
+ }
498
+
482
499
  export function appendForm(
483
500
  fd: FormData,
484
501
  key: string,
@@ -487,10 +504,12 @@ export function appendForm(
487
504
  ): void {
488
505
  if (value == null) {
489
506
  return;
490
- } else if (value instanceof Blob && fileName) {
491
- fd.append(key, value, fileName);
492
- } else if (value instanceof Blob) {
493
- fd.append(key, value);
507
+ } else if (isBlobLike(value)) {
508
+ if (fileName) {
509
+ fd.append(key, value as Blob, fileName);
510
+ } else {
511
+ fd.append(key, value as Blob);
512
+ }
494
513
  } else if (Array.isArray(value)) {
495
514
  value.forEach((v) => {
496
515
  appendForm(fd, key, v);
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * GetOrganizationPublicProfileResponse contains the public-facing profile of an organization.
14
+ */
15
+ export type GetOrganizationPublicProfileResponse = {
16
+ /**
17
+ * Human-readable organization name.
18
+ */
19
+ displayName?: string | undefined;
20
+ /**
21
+ * URL of the organization's logo image, if set.
22
+ */
23
+ logoImageUrl?: string | null | undefined;
24
+ };
25
+
26
+ /** @internal */
27
+ export const GetOrganizationPublicProfileResponse$inboundSchema: z.ZodMiniType<
28
+ GetOrganizationPublicProfileResponse,
29
+ unknown
30
+ > = z.pipe(
31
+ z.object({
32
+ display_name: types.optional(types.string()),
33
+ logo_image_url: z.optional(z.nullable(types.string())),
34
+ }),
35
+ z.transform((v) => {
36
+ return remap$(v, {
37
+ "display_name": "displayName",
38
+ "logo_image_url": "logoImageUrl",
39
+ });
40
+ }),
41
+ );
42
+
43
+ export function getOrganizationPublicProfileResponseFromJSON(
44
+ jsonString: string,
45
+ ): SafeParseResult<GetOrganizationPublicProfileResponse, SDKValidationError> {
46
+ return safeParse(
47
+ jsonString,
48
+ (x) =>
49
+ GetOrganizationPublicProfileResponse$inboundSchema.parse(JSON.parse(x)),
50
+ `Failed to parse 'GetOrganizationPublicProfileResponse' from JSON`,
51
+ );
52
+ }
@@ -41,6 +41,7 @@ export * from "./getdocumentquotaresponse.js";
41
41
  export * from "./getdocumentresponse.js";
42
42
  export * from "./getgeneralaccessresponse.js";
43
43
  export * from "./getmeresponse.js";
44
+ export * from "./getorganizationpublicprofileresponse.js";
44
45
  export * from "./getorganizationquotaresponse.js";
45
46
  export * from "./getorganizationresponse.js";
46
47
  export * from "./gettimelineresponse.js";
@@ -94,6 +95,7 @@ export * from "./updatedocumentaccessresponse.js";
94
95
  export * from "./updatedocumentresponse.js";
95
96
  export * from "./updateorganizationmemberresponse.js";
96
97
  export * from "./updateorganizationresponse.js";
98
+ export * from "./uploadorganizationlogoresponse.js";
97
99
  export * from "./user.js";
98
100
  export * from "./value.js";
99
101
  export * from "./version.js";
@@ -0,0 +1,45 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as types from "../../types/primitives.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ /**
13
+ * UploadOrganizationLogoResponse contains the URL of the uploaded logo.
14
+ */
15
+ export type UploadOrganizationLogoResponse = {
16
+ /**
17
+ * Public URL of the uploaded logo image.
18
+ */
19
+ logoUrl?: string | undefined;
20
+ };
21
+
22
+ /** @internal */
23
+ export const UploadOrganizationLogoResponse$inboundSchema: z.ZodMiniType<
24
+ UploadOrganizationLogoResponse,
25
+ unknown
26
+ > = z.pipe(
27
+ z.object({
28
+ logo_url: types.optional(types.string()),
29
+ }),
30
+ z.transform((v) => {
31
+ return remap$(v, {
32
+ "logo_url": "logoUrl",
33
+ });
34
+ }),
35
+ );
36
+
37
+ export function uploadOrganizationLogoResponseFromJSON(
38
+ jsonString: string,
39
+ ): SafeParseResult<UploadOrganizationLogoResponse, SDKValidationError> {
40
+ return safeParse(
41
+ jsonString,
42
+ (x) => UploadOrganizationLogoResponse$inboundSchema.parse(JSON.parse(x)),
43
+ `Failed to parse 'UploadOrganizationLogoResponse' from JSON`,
44
+ );
45
+ }
@@ -0,0 +1,83 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type GetOrganizationPublicProfileRequest = {
13
+ /**
14
+ * Organization ID.
15
+ *
16
+ * @remarks
17
+ * Pattern: org_[0-9a-hjkmnp-tv-z]{26}
18
+ */
19
+ organizationId: string;
20
+ };
21
+
22
+ export type GetOrganizationPublicProfileResponse = {
23
+ headers: { [k: string]: Array<string> };
24
+ result: components.GetOrganizationPublicProfileResponse;
25
+ };
26
+
27
+ /** @internal */
28
+ export type GetOrganizationPublicProfileRequest$Outbound = {
29
+ organization_id: string;
30
+ };
31
+
32
+ /** @internal */
33
+ export const GetOrganizationPublicProfileRequest$outboundSchema: z.ZodMiniType<
34
+ GetOrganizationPublicProfileRequest$Outbound,
35
+ GetOrganizationPublicProfileRequest
36
+ > = z.pipe(
37
+ z.object({
38
+ organizationId: z.string(),
39
+ }),
40
+ z.transform((v) => {
41
+ return remap$(v, {
42
+ organizationId: "organization_id",
43
+ });
44
+ }),
45
+ );
46
+
47
+ export function getOrganizationPublicProfileRequestToJSON(
48
+ getOrganizationPublicProfileRequest: GetOrganizationPublicProfileRequest,
49
+ ): string {
50
+ return JSON.stringify(
51
+ GetOrganizationPublicProfileRequest$outboundSchema.parse(
52
+ getOrganizationPublicProfileRequest,
53
+ ),
54
+ );
55
+ }
56
+
57
+ /** @internal */
58
+ export const GetOrganizationPublicProfileResponse$inboundSchema: z.ZodMiniType<
59
+ GetOrganizationPublicProfileResponse,
60
+ unknown
61
+ > = z.pipe(
62
+ z.object({
63
+ Headers: z._default(z.record(z.string(), z.array(z.string())), {}),
64
+ Result: components.GetOrganizationPublicProfileResponse$inboundSchema,
65
+ }),
66
+ z.transform((v) => {
67
+ return remap$(v, {
68
+ "Headers": "headers",
69
+ "Result": "result",
70
+ });
71
+ }),
72
+ );
73
+
74
+ export function getOrganizationPublicProfileResponseFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<GetOrganizationPublicProfileResponse, SDKValidationError> {
77
+ return safeParse(
78
+ jsonString,
79
+ (x) =>
80
+ GetOrganizationPublicProfileResponse$inboundSchema.parse(JSON.parse(x)),
81
+ `Failed to parse 'GetOrganizationPublicProfileResponse' from JSON`,
82
+ );
83
+ }
@@ -24,6 +24,7 @@ export * from "./getdocumenttimeline.js";
24
24
  export * from "./getgeneralaccess.js";
25
25
  export * from "./getme.js";
26
26
  export * from "./getorganization.js";
27
+ export * from "./getorganizationpublicprofile.js";
27
28
  export * from "./getorganizationquota.js";
28
29
  export * from "./getusagehistory.js";
29
30
  export * from "./getuserpreferences.js";
@@ -57,3 +58,4 @@ export * from "./updatedocumentaccess.js";
57
58
  export * from "./updateorganization.js";
58
59
  export * from "./updateorganizationmember.js";
59
60
  export * from "./updateversion.js";
61
+ export * from "./uploadorganizationlogo.js";