@factify/sdk 0.3.15-rc.1 → 0.3.15-rc.3
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 +7 -0
- package/dist/commonjs/funcs/documentsGetDocumentQuota.d.ts +18 -0
- package/dist/commonjs/funcs/documentsGetDocumentQuota.d.ts.map +1 -0
- package/dist/commonjs/funcs/documentsGetDocumentQuota.js +110 -0
- package/dist/commonjs/funcs/documentsGetDocumentQuota.js.map +1 -0
- package/dist/commonjs/funcs/userPreferencesGetUserPreferences.d.ts +18 -0
- package/dist/commonjs/funcs/userPreferencesGetUserPreferences.d.ts.map +1 -0
- package/dist/commonjs/funcs/userPreferencesGetUserPreferences.js +110 -0
- package/dist/commonjs/funcs/userPreferencesGetUserPreferences.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/components/getdocumentquotaresponse.d.ts +30 -0
- package/dist/commonjs/models/components/getdocumentquotaresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/getdocumentquotaresponse.js +53 -0
- package/dist/commonjs/models/components/getdocumentquotaresponse.js.map +1 -0
- package/dist/commonjs/models/components/getuserpreferencesresponse.d.ts +20 -0
- package/dist/commonjs/models/components/getuserpreferencesresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/getuserpreferencesresponse.js +58 -0
- package/dist/commonjs/models/components/getuserpreferencesresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/operations/getdocumentquota.d.ts +14 -0
- package/dist/commonjs/models/operations/getdocumentquota.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getdocumentquota.js +58 -0
- package/dist/commonjs/models/operations/getdocumentquota.js.map +1 -0
- package/dist/commonjs/models/operations/getuserpreferences.d.ts +14 -0
- package/dist/commonjs/models/operations/getuserpreferences.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getuserpreferences.js +58 -0
- package/dist/commonjs/models/operations/getuserpreferences.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/sdk/documents.d.ts +7 -0
- package/dist/commonjs/sdk/documents.d.ts.map +1 -1
- package/dist/commonjs/sdk/documents.js +10 -0
- package/dist/commonjs/sdk/documents.js.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/userpreferences.d.ts +12 -0
- package/dist/commonjs/sdk/userpreferences.d.ts.map +1 -0
- package/dist/commonjs/sdk/userpreferences.js +22 -0
- package/dist/commonjs/sdk/userpreferences.js.map +1 -0
- package/dist/esm/funcs/documentsGetDocumentQuota.d.ts +18 -0
- package/dist/esm/funcs/documentsGetDocumentQuota.d.ts.map +1 -0
- package/dist/esm/funcs/documentsGetDocumentQuota.js +74 -0
- package/dist/esm/funcs/documentsGetDocumentQuota.js.map +1 -0
- package/dist/esm/funcs/userPreferencesGetUserPreferences.d.ts +18 -0
- package/dist/esm/funcs/userPreferencesGetUserPreferences.d.ts.map +1 -0
- package/dist/esm/funcs/userPreferencesGetUserPreferences.js +74 -0
- package/dist/esm/funcs/userPreferencesGetUserPreferences.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/components/getdocumentquotaresponse.d.ts +30 -0
- package/dist/esm/models/components/getdocumentquotaresponse.d.ts.map +1 -0
- package/dist/esm/models/components/getdocumentquotaresponse.js +16 -0
- package/dist/esm/models/components/getdocumentquotaresponse.js.map +1 -0
- package/dist/esm/models/components/getuserpreferencesresponse.d.ts +20 -0
- package/dist/esm/models/components/getuserpreferencesresponse.d.ts.map +1 -0
- package/dist/esm/models/components/getuserpreferencesresponse.js +21 -0
- package/dist/esm/models/components/getuserpreferencesresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/operations/getdocumentquota.d.ts +14 -0
- package/dist/esm/models/operations/getdocumentquota.d.ts.map +1 -0
- package/dist/esm/models/operations/getdocumentquota.js +21 -0
- package/dist/esm/models/operations/getdocumentquota.js.map +1 -0
- package/dist/esm/models/operations/getuserpreferences.d.ts +14 -0
- package/dist/esm/models/operations/getuserpreferences.d.ts.map +1 -0
- package/dist/esm/models/operations/getuserpreferences.js +21 -0
- package/dist/esm/models/operations/getuserpreferences.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/sdk/documents.d.ts +7 -0
- package/dist/esm/sdk/documents.d.ts.map +1 -1
- package/dist/esm/sdk/documents.js +10 -0
- package/dist/esm/sdk/documents.js.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/userpreferences.d.ts +12 -0
- package/dist/esm/sdk/userpreferences.d.ts.map +1 -0
- package/dist/esm/sdk/userpreferences.js +18 -0
- package/dist/esm/sdk/userpreferences.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/documentsGetDocumentQuota.ts +155 -0
- package/src/funcs/userPreferencesGetUserPreferences.ts +155 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/getdocumentquotaresponse.ts +53 -0
- package/src/models/components/getuserpreferencesresponse.ts +51 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/operations/getdocumentquota.ts +42 -0
- package/src/models/operations/getuserpreferences.ts +42 -0
- package/src/models/operations/index.ts +2 -0
- package/src/sdk/documents.ts +16 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/userpreferences.ts +25 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { FactifyCore } from "../core.js";
|
|
6
|
+
import * as M from "../lib/matchers.js";
|
|
7
|
+
import { compactMap } from "../lib/primitives.js";
|
|
8
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
9
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
10
|
+
import { pathToFunc } from "../lib/url.js";
|
|
11
|
+
import { FactifyError } from "../models/errors/factifyerror.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/errors/httpclienterrors.js";
|
|
19
|
+
import * as errors from "../models/errors/index.js";
|
|
20
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get user preferences
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Returns the authenticated user's onboarding preferences. Only available for user accounts, not API keys.
|
|
31
|
+
*/
|
|
32
|
+
export function userPreferencesGetUserPreferences(
|
|
33
|
+
client: FactifyCore,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
operations.GetUserPreferencesResponse,
|
|
38
|
+
| errors.ErrorResponse
|
|
39
|
+
| FactifyError
|
|
40
|
+
| ResponseValidationError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| UnexpectedClientError
|
|
46
|
+
| SDKValidationError
|
|
47
|
+
>
|
|
48
|
+
> {
|
|
49
|
+
return new APIPromise($do(
|
|
50
|
+
client,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: FactifyCore,
|
|
57
|
+
options?: RequestOptions,
|
|
58
|
+
): Promise<
|
|
59
|
+
[
|
|
60
|
+
Result<
|
|
61
|
+
operations.GetUserPreferencesResponse,
|
|
62
|
+
| errors.ErrorResponse
|
|
63
|
+
| FactifyError
|
|
64
|
+
| ResponseValidationError
|
|
65
|
+
| ConnectionError
|
|
66
|
+
| RequestAbortedError
|
|
67
|
+
| RequestTimeoutError
|
|
68
|
+
| InvalidRequestError
|
|
69
|
+
| UnexpectedClientError
|
|
70
|
+
| SDKValidationError
|
|
71
|
+
>,
|
|
72
|
+
APICall,
|
|
73
|
+
]
|
|
74
|
+
> {
|
|
75
|
+
const path = pathToFunc("/v1beta/user-preferences")();
|
|
76
|
+
|
|
77
|
+
const headers = new Headers(compactMap({
|
|
78
|
+
Accept: "application/json",
|
|
79
|
+
}));
|
|
80
|
+
|
|
81
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
82
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
83
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
84
|
+
|
|
85
|
+
const context = {
|
|
86
|
+
options: client._options,
|
|
87
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
88
|
+
operationID: "getUserPreferences",
|
|
89
|
+
oAuth2Scopes: null,
|
|
90
|
+
|
|
91
|
+
resolvedSecurity: requestSecurity,
|
|
92
|
+
|
|
93
|
+
securitySource: client._options.bearerAuth,
|
|
94
|
+
retryConfig: options?.retries
|
|
95
|
+
|| client._options.retryConfig
|
|
96
|
+
|| { strategy: "none" },
|
|
97
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const requestRes = client._createRequest(context, {
|
|
101
|
+
security: requestSecurity,
|
|
102
|
+
method: "GET",
|
|
103
|
+
baseURL: options?.serverURL,
|
|
104
|
+
path: path,
|
|
105
|
+
headers: headers,
|
|
106
|
+
userAgent: client._options.userAgent,
|
|
107
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
108
|
+
}, options);
|
|
109
|
+
if (!requestRes.ok) {
|
|
110
|
+
return [requestRes, { status: "invalid" }];
|
|
111
|
+
}
|
|
112
|
+
const req = requestRes.value;
|
|
113
|
+
|
|
114
|
+
const doResult = await client._do(req, {
|
|
115
|
+
context,
|
|
116
|
+
errorCodes: ["400", "401", "403", "404", "429", "4XX", "500", "5XX"],
|
|
117
|
+
retryConfig: context.retryConfig,
|
|
118
|
+
retryCodes: context.retryCodes,
|
|
119
|
+
});
|
|
120
|
+
if (!doResult.ok) {
|
|
121
|
+
return [doResult, { status: "request-error", request: req }];
|
|
122
|
+
}
|
|
123
|
+
const response = doResult.value;
|
|
124
|
+
|
|
125
|
+
const responseFields = {
|
|
126
|
+
HttpMeta: { Response: response, Request: req },
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const [result] = await M.match<
|
|
130
|
+
operations.GetUserPreferencesResponse,
|
|
131
|
+
| errors.ErrorResponse
|
|
132
|
+
| FactifyError
|
|
133
|
+
| ResponseValidationError
|
|
134
|
+
| ConnectionError
|
|
135
|
+
| RequestAbortedError
|
|
136
|
+
| RequestTimeoutError
|
|
137
|
+
| InvalidRequestError
|
|
138
|
+
| UnexpectedClientError
|
|
139
|
+
| SDKValidationError
|
|
140
|
+
>(
|
|
141
|
+
M.json(200, operations.GetUserPreferencesResponse$inboundSchema, {
|
|
142
|
+
key: "Result",
|
|
143
|
+
}),
|
|
144
|
+
M.jsonErr([400, 401, 403, 404], errors.ErrorResponse$inboundSchema),
|
|
145
|
+
M.jsonErr(429, errors.ErrorResponse$inboundSchema, { hdrs: true }),
|
|
146
|
+
M.jsonErr(500, errors.ErrorResponse$inboundSchema),
|
|
147
|
+
M.fail("4XX"),
|
|
148
|
+
M.fail("5XX"),
|
|
149
|
+
)(response, req, { extraFields: responseFields });
|
|
150
|
+
if (!result.ok) {
|
|
151
|
+
return [result, { status: "complete", request: req, response }];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return [result, { status: "complete", request: req, response }];
|
|
155
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "1.0.0",
|
|
68
|
-
sdkVersion: "0.3.15-rc.
|
|
69
|
-
genVersion: "2.
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.3.15-rc.
|
|
68
|
+
sdkVersion: "0.3.15-rc.3",
|
|
69
|
+
genVersion: "2.859.2",
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.3.15-rc.3 2.859.2 1.0.0 @factify/sdk",
|
|
71
71
|
} as const;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* GetDocumentQuotaResponse contains the document quota for the organization.
|
|
13
|
+
*/
|
|
14
|
+
export type GetDocumentQuotaResponse = {
|
|
15
|
+
/**
|
|
16
|
+
* Remaining documents that can be created (limit minus used, floored at 0).
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* When limit is 0 (unlimited), this field is 0 and should be ignored by clients.
|
|
20
|
+
*/
|
|
21
|
+
available?: number | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum documents allowed for this organization.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* 0 means unlimited (no quota enforced).
|
|
27
|
+
*/
|
|
28
|
+
limit?: number | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Number of documents counting against quota (excludes demo, includes trashed).
|
|
31
|
+
*/
|
|
32
|
+
used?: number | undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const GetDocumentQuotaResponse$inboundSchema: z.ZodMiniType<
|
|
37
|
+
GetDocumentQuotaResponse,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
available: types.optional(types.number()),
|
|
41
|
+
limit: types.optional(types.number()),
|
|
42
|
+
used: types.optional(types.number()),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export function getDocumentQuotaResponseFromJSON(
|
|
46
|
+
jsonString: string,
|
|
47
|
+
): SafeParseResult<GetDocumentQuotaResponse, SDKValidationError> {
|
|
48
|
+
return safeParse(
|
|
49
|
+
jsonString,
|
|
50
|
+
(x) => GetDocumentQuotaResponse$inboundSchema.parse(JSON.parse(x)),
|
|
51
|
+
`Failed to parse 'GetDocumentQuotaResponse' from JSON`,
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
* GetUserPreferencesResponse contains the user's onboarding preferences.
|
|
14
|
+
*/
|
|
15
|
+
export type GetUserPreferencesResponse = {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the user has completed the document tour.
|
|
18
|
+
*/
|
|
19
|
+
hasCompletedDocumentTour?: boolean | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the user has completed the hub onboarding flow.
|
|
22
|
+
*/
|
|
23
|
+
hasCompletedHubOnboarding?: boolean | undefined;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const GetUserPreferencesResponse$inboundSchema: z.ZodMiniType<
|
|
28
|
+
GetUserPreferencesResponse,
|
|
29
|
+
unknown
|
|
30
|
+
> = z.pipe(
|
|
31
|
+
z.object({
|
|
32
|
+
has_completed_document_tour: types.optional(types.boolean()),
|
|
33
|
+
has_completed_hub_onboarding: types.optional(types.boolean()),
|
|
34
|
+
}),
|
|
35
|
+
z.transform((v) => {
|
|
36
|
+
return remap$(v, {
|
|
37
|
+
"has_completed_document_tour": "hasCompletedDocumentTour",
|
|
38
|
+
"has_completed_hub_onboarding": "hasCompletedHubOnboarding",
|
|
39
|
+
});
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export function getUserPreferencesResponseFromJSON(
|
|
44
|
+
jsonString: string,
|
|
45
|
+
): SafeParseResult<GetUserPreferencesResponse, SDKValidationError> {
|
|
46
|
+
return safeParse(
|
|
47
|
+
jsonString,
|
|
48
|
+
(x) => GetUserPreferencesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
49
|
+
`Failed to parse 'GetUserPreferencesResponse' from JSON`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -30,10 +30,12 @@ export * from "./empty.js";
|
|
|
30
30
|
export * from "./errordetail.js";
|
|
31
31
|
export * from "./errorresponse.js";
|
|
32
32
|
export * from "./generateentrypageresponse.js";
|
|
33
|
+
export * from "./getdocumentquotaresponse.js";
|
|
33
34
|
export * from "./getdocumentresponse.js";
|
|
34
35
|
export * from "./getorganizationquotaresponse.js";
|
|
35
36
|
export * from "./getorganizationresponse.js";
|
|
36
37
|
export * from "./getusagehistoryresponse.js";
|
|
38
|
+
export * from "./getuserpreferencesresponse.js";
|
|
37
39
|
export * from "./listapikeyquotasresponse.js";
|
|
38
40
|
export * from "./listapikeysresponse.js";
|
|
39
41
|
export * from "./listdocumentpoliciesresponse.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
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 GetDocumentQuotaResponse = {
|
|
13
|
+
headers: { [k: string]: Array<string> };
|
|
14
|
+
result: components.GetDocumentQuotaResponse;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const GetDocumentQuotaResponse$inboundSchema: z.ZodMiniType<
|
|
19
|
+
GetDocumentQuotaResponse,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.pipe(
|
|
22
|
+
z.object({
|
|
23
|
+
Headers: z._default(z.record(z.string(), z.array(z.string())), {}),
|
|
24
|
+
Result: components.GetDocumentQuotaResponse$inboundSchema,
|
|
25
|
+
}),
|
|
26
|
+
z.transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"Headers": "headers",
|
|
29
|
+
"Result": "result",
|
|
30
|
+
});
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export function getDocumentQuotaResponseFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<GetDocumentQuotaResponse, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => GetDocumentQuotaResponse$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'GetDocumentQuotaResponse' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 GetUserPreferencesResponse = {
|
|
13
|
+
headers: { [k: string]: Array<string> };
|
|
14
|
+
result: components.GetUserPreferencesResponse;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const GetUserPreferencesResponse$inboundSchema: z.ZodMiniType<
|
|
19
|
+
GetUserPreferencesResponse,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.pipe(
|
|
22
|
+
z.object({
|
|
23
|
+
Headers: z._default(z.record(z.string(), z.array(z.string())), {}),
|
|
24
|
+
Result: components.GetUserPreferencesResponse$inboundSchema,
|
|
25
|
+
}),
|
|
26
|
+
z.transform((v) => {
|
|
27
|
+
return remap$(v, {
|
|
28
|
+
"Headers": "headers",
|
|
29
|
+
"Result": "result",
|
|
30
|
+
});
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export function getUserPreferencesResponseFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<GetUserPreferencesResponse, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => GetUserPreferencesResponse$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'GetUserPreferencesResponse' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -14,9 +14,11 @@ export * from "./deleteapikeyquota.js";
|
|
|
14
14
|
export * from "./detachdocumentpolicy.js";
|
|
15
15
|
export * from "./generatedocumententrypage.js";
|
|
16
16
|
export * from "./getdocument.js";
|
|
17
|
+
export * from "./getdocumentquota.js";
|
|
17
18
|
export * from "./getorganization.js";
|
|
18
19
|
export * from "./getorganizationquota.js";
|
|
19
20
|
export * from "./getusagehistory.js";
|
|
21
|
+
export * from "./getuserpreferences.js";
|
|
20
22
|
export * from "./getversion.js";
|
|
21
23
|
export * from "./listapikeyquotas.js";
|
|
22
24
|
export * from "./listapikeys.js";
|
package/src/sdk/documents.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { documentsCreate } from "../funcs/documentsCreate.js";
|
|
6
6
|
import { documentsGet } from "../funcs/documentsGet.js";
|
|
7
|
+
import { documentsGetDocumentQuota } from "../funcs/documentsGetDocumentQuota.js";
|
|
7
8
|
import { documentsList } from "../funcs/documentsList.js";
|
|
8
9
|
import { documentsUpdate } from "../funcs/documentsUpdate.js";
|
|
9
10
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
@@ -49,6 +50,21 @@ export class Documents extends ClientSDK {
|
|
|
49
50
|
));
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Get document quota
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Returns the document quota status for the authenticated user's organization, including the number of documents used, the configured limit, and remaining capacity.
|
|
58
|
+
*/
|
|
59
|
+
async getDocumentQuota(
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<operations.GetDocumentQuotaResponse> {
|
|
62
|
+
return unwrapAsync(documentsGetDocumentQuota(
|
|
63
|
+
this,
|
|
64
|
+
options,
|
|
65
|
+
));
|
|
66
|
+
}
|
|
67
|
+
|
|
52
68
|
/**
|
|
53
69
|
* Retrieve a document
|
|
54
70
|
*
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Organizations } from "./organizations.js";
|
|
|
10
10
|
import { Policies } from "./policies.js";
|
|
11
11
|
import { Quotas } from "./quotas.js";
|
|
12
12
|
import { Usage } from "./usage.js";
|
|
13
|
+
import { UserPreferences } from "./userpreferences.js";
|
|
13
14
|
import { Versions } from "./versions.js";
|
|
14
15
|
|
|
15
16
|
export class Factify extends ClientSDK {
|
|
@@ -52,4 +53,9 @@ export class Factify extends ClientSDK {
|
|
|
52
53
|
get usage(): Usage {
|
|
53
54
|
return (this._usage ??= new Usage(this._options));
|
|
54
55
|
}
|
|
56
|
+
|
|
57
|
+
private _userPreferences?: UserPreferences;
|
|
58
|
+
get userPreferences(): UserPreferences {
|
|
59
|
+
return (this._userPreferences ??= new UserPreferences(this._options));
|
|
60
|
+
}
|
|
55
61
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { userPreferencesGetUserPreferences } from "../funcs/userPreferencesGetUserPreferences.js";
|
|
6
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
|
+
import * as operations from "../models/operations/index.js";
|
|
8
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
9
|
+
|
|
10
|
+
export class UserPreferences extends ClientSDK {
|
|
11
|
+
/**
|
|
12
|
+
* Get user preferences
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Returns the authenticated user's onboarding preferences. Only available for user accounts, not API keys.
|
|
16
|
+
*/
|
|
17
|
+
async getUserPreferences(
|
|
18
|
+
options?: RequestOptions,
|
|
19
|
+
): Promise<operations.GetUserPreferencesResponse> {
|
|
20
|
+
return unwrapAsync(userPreferencesGetUserPreferences(
|
|
21
|
+
this,
|
|
22
|
+
options,
|
|
23
|
+
));
|
|
24
|
+
}
|
|
25
|
+
}
|