@vrplatform/api 1.3.1-stage.2596 → 1.3.1-stage.2599
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/build/main/cache.js.map +1 -1
- package/build/main/client.js.map +1 -1
- package/build/main/error.js +0 -4
- package/build/main/error.js.map +1 -1
- package/build/main/generated/openapi-fetch.js.map +1 -1
- package/build/main/generated/v1.d.ts +509 -0
- package/build/main/generated/v1.js.map +1 -1
- package/build/main/sec.js.map +1 -1
- package/build/module/cache.js.map +1 -1
- package/build/module/client.js.map +1 -1
- package/build/module/error.js.map +1 -1
- package/build/module/generated/v1.d.ts +509 -0
- package/build/module/generated/v1.js.map +1 -1
- package/build/module/sec.js.map +1 -1
- package/package.json +4 -4
- package/src/generated/v1.ts +509 -0
- package/build/main/tsconfig.main.tsbuildinfo +0 -1
- package/build/module/tsconfig.esm.tsbuildinfo +0 -1
package/build/main/sec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sec.js","sourceRoot":"src/","sources":["sec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sec.js","sourceRoot":"src/","sources":["sec.ts"],"names":[],"mappings":";;AAAA,8CAqBC;AArBM,KAAK,UAAU,iBAAiB,CACrC,MAAc,EACd,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;IAEzC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,CAC7C,KAAK,EACL,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EACtB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EACjC,KAAK,EACL,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACvE,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAC1E,IAAI,EACJ,EAAE,CACH,CAAC;IAEF,OAAO,GAAG,SAAS,IAAI,IAAI,EAAE,CAAC;AAChC,CAAC","sourcesContent":["export async function generateApiKeySec(\n secret: string,\n timestamp = Math.floor(Date.now() / 1000)\n): Promise<string> {\n const encoder = new TextEncoder();\n const secretKey = await crypto.subtle.importKey(\n 'raw',\n encoder.encode(secret),\n { name: 'HMAC', hash: 'SHA-256' },\n false,\n ['sign']\n );\n\n const message = encoder.encode(`${timestamp}`);\n const signature = await crypto.subtle.sign('HMAC', secretKey, message);\n const hash = btoa(String.fromCharCode(...new Uint8Array(signature))).replace(\n /=/g,\n ''\n );\n\n return `${timestamp}.${hash}`;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"src/","sources":["cache.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,QAAQ,CACtB,OAA+B,EAC/B,YAAoB
|
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"src/","sources":["cache.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,QAAQ,CACtB,OAA+B,EAC/B,YAAoB;IAEpB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAyB,CAAC;IAClD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAsB,CAAC;IAEpD,MAAM,cAAc,GAAG,KAAK,EAAE,GAAM,EAAc,EAAE;QAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAEvB,yCAAyC;QACzC,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,WAAW,IAAI,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC;YAChD,OAAO,WAAW,CAAC,KAAK,CAAC;QAC3B,CAAC;QAED,0EAA0E;QAC1E,MAAM,eAAe,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACpD,IAAI,eAAe;YAAE,OAAO,eAAe,CAAC;QAE5C,kBAAkB;QAClB,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;YAC7B,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAErC,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC;YACjC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACrB,KAAK,EAAE,UAAU;gBACjB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY;aACrC,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,UAAU,EAAE,GAAG,EAAE;YACf,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjB,aAAa,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,OAAO,EAAE,cAAc;KACxB,CAAC;AACJ,CAAC","sourcesContent":["type CacheEntry<T> = {\n value: T;\n expiresAt: number;\n};\n\ntype CacheResult<T, A> = {\n current: (arg: A) => Promise<T>;\n invalidate: () => void;\n};\n\nexport function useCache<T, A>(\n fetchFn: (arg: A) => Promise<T>,\n expiryTimeMs: number\n): CacheResult<T, A> {\n const cacheMap = new Map<string, CacheEntry<T>>();\n const fetchPromises = new Map<string, Promise<T>>();\n\n const getCachedValue = async (arg: A): Promise<T> => {\n const cacheKey = JSON.stringify(arg);\n const now = Date.now();\n\n // If cache is valid, return cached value\n const cachedEntry = cacheMap.get(cacheKey);\n if (cachedEntry && now <= cachedEntry.expiresAt) {\n return cachedEntry.value;\n }\n\n // If there's already a fetch in progress for this key, return its promise\n const existingPromise = fetchPromises.get(cacheKey);\n if (existingPromise) return existingPromise;\n\n // Start new fetch\n try {\n const promise = fetchFn(arg);\n fetchPromises.set(cacheKey, promise);\n\n const freshValue = await promise;\n cacheMap.set(cacheKey, {\n value: freshValue,\n expiresAt: Date.now() + expiryTimeMs,\n });\n\n return freshValue;\n } finally {\n fetchPromises.delete(cacheKey);\n }\n };\n\n return {\n invalidate: () => {\n cacheMap.clear();\n fetchPromises.clear();\n },\n current: getCachedValue,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"src/","sources":["client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAEL,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG1C,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAEtC,MAAM,UAAU,YAAY,CAAC,EAC3B,OAAO,EAAE,IAAI,EACb,KAAK,EACL,IAAI,EACJ,SAAS,EAAE,GAAG;AACd,cAAc;AACd,OAAO,EACP,OAAO,EAAE,CAAC,EACV,GAAG,oBAAoB,EAYD
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"src/","sources":["client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,EAEL,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAA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C;gBACvE,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;oBACpC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;gBACjD,CAAC;gBAED,IAAI,KAAK,CAAC,cAAc,CAAC;oBACvB,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;gBAC3D,IAAI,KAAK,CAAC,OAAO;oBAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;gBAE/D,OAAO,KAAK,CAAC;YACf,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;IAEH,MAAM,aAAa,GAAc,MAAa,CAAC;IAC/C,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC;IACpC,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["import * as Sentry from '@sentry/core';\nimport {\n type RetryableFetchParams,\n useRetryableFetch,\n} from '@vrplatform/utils';\nimport createClient from 'openapi-fetch';\nimport { useCache } from './cache';\nimport type { paths } from './generated/v1';\nimport { generateApiKeySec } from './sec';\nimport type { ApiClient, ApiClientAuth } from './types';\n\nconst DEFAULT_API_CLIENT_ATTEMPTS = 5;\n\nexport function useApiClient({\n baseUrl: base,\n local,\n auth,\n sessionId: sid,\n // headers: h,\n testing,\n headers: h,\n ...retryableFetchParams\n}: {\n attempts?: number;\n auth?: ApiClientAuth | (() => ApiClientAuth);\n baseUrl?: string;\n sessionId?: string;\n local?: boolean | number;\n headers?: Record<string, string> | (() => Record<string, string>);\n testing?: {\n overwriteUri?: string;\n getOverwriteTimestamp?: () => number | undefined;\n };\n} & RetryableFetchParams) {\n const baseUrl =\n (local\n ? `http://localhost:${typeof local === 'number' ? local : 8877}`\n : base) || 'https://api.vrplatform.app';\n\n const sessionId = sid || crypto.randomUUID();\n // cache the sec key for 1 minute (its valid for 5 minutes on the API)\n const cache = useCache(\n async (v: string) =>\n generateApiKeySec(v, testing?.getOverwriteTimestamp?.()),\n 60_000\n );\n\n const retryableFetch = useRetryableFetch({\n ...retryableFetchParams,\n attempts: retryableFetchParams.attempts ?? DEFAULT_API_CLIENT_ATTEMPTS,\n onRetry(arg) {\n cache.invalidate();\n if (retryableFetchParams.onRetry) retryableFetchParams.onRetry(arg);\n },\n });\n\n const trace = Sentry.getTraceData();\n const client = createClient<paths>({\n baseUrl,\n querySerializer: {\n array: {\n explode: false,\n style: 'form',\n },\n },\n fetch(req) {\n return retryableFetch(async () => {\n let clone: any = req.clone() as any;\n if (testing?.overwriteUri)\n clone = new Request(testing.overwriteUri, clone);\n\n const a = (typeof auth === 'function' ? auth() : auth) || {};\n if (sessionId) clone.headers.set('X-Session-Id', sessionId);\n if (a.sec)\n clone.headers.set('X-Api-Key', `Sec ${await cache.current(a.sec)}`);\n if (a.apiKey) clone.headers.set('X-Api-Key', a.apiKey);\n if (a.tenantId) clone.headers.set('X-Team-Id', a.tenantId);\n if (a.accessToken)\n clone.headers.set(\n 'Authorization',\n a.accessToken.startsWith('Bearer ')\n ? a.accessToken\n : `Bearer ${a.accessToken}`\n );\n const additionalHeaders = h ? (typeof h === 'function' ? h() : h) : {};\n for (const key in additionalHeaders) {\n clone.headers.set(key, additionalHeaders[key]);\n }\n\n if (trace['sentry-trace'])\n clone.headers.set('sentry-trace', trace['sentry-trace']);\n if (trace.baggage) clone.headers.set('baggage', trace.baggage);\n\n return clone;\n });\n },\n });\n\n const sessionClient: ApiClient = client as any;\n sessionClient.sessionId = sessionId;\n return sessionClient;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"src/","sources":["error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAY7C,MAAM,OAAO,cAAe,SAAQ,KAAK;IAMpB
|
|
1
|
+
{"version":3,"file":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,EAAE,qBAAqB;oBAC3B,OAAO,EAAE,4BAA4B;iBACtC,CAAC,CAAC;YACL,CAAC;YAED,MAAM,KAAK,GAAM,QAAQ,CAAC,KAAK,CAAC;YAEhC,IAAI,KAAK;gBAAE,MAAM,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC;YAC3C,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,GAAM,QAAQ,CAAC,KAAK,CAAC;IAEhC,IAAI,KAAK;QAAE,MAAM,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC","sourcesContent":["import { hasValue } from '@vrplatform/utils';\nimport type { FetchResponse } from './generated/openapi-fetch';\n\ntype E = {\n code: string;\n message: string;\n issues?: {\n message: string;\n }[];\n context?: any;\n stack?: any;\n};\nexport class ApiClientError extends Error {\n code: string;\n issues: {\n message: string;\n }[];\n context: any;\n constructor(public error: E) {\n const message =\n error.message ||\n [\n error.code,\n error.issues\n ?.map((x) =>\n [x.message, (x as any).path?.join('->')]\n .filter(hasValue)\n .join(' on ')\n )\n .join(', '),\n ]\n .filter(hasValue)\n .join(': ');\n super(message);\n\n this.code = error.code;\n this.issues = error.issues || [];\n this.context = error.context || {};\n if (error.stack) this.stack = error.stack;\n }\n}\nexport function throwIfError<T extends FetchResponse<any, any, any>>(\n response: T\n): NonNullable<T['data']>;\nexport function throwIfError<T extends FetchResponse<any, any, any>>(\n response: Promise<T>\n): Promise<NonNullable<T['data']>>;\nexport function throwIfError<T extends FetchResponse<any, any, any>>(\n response: Promise<T> | T\n): Promise<NonNullable<T['data']>> | NonNullable<T['data']> {\n if (response instanceof Promise) {\n return response.then((response) => {\n if (response.response.status === 503) {\n throw new ApiClientError({\n code: 'SERVICE_UNAVAILABLE',\n message: 'Worker resources exceeded.',\n });\n }\n\n const error: E = response.error;\n\n if (error) throw new ApiClientError(error);\n return response.data;\n });\n }\n\n const error: E = response.error;\n\n if (error) throw new ApiClientError(error);\n return response.data;\n}\n"]}
|
|
@@ -2061,6 +2061,40 @@ export interface paths {
|
|
|
2061
2061
|
patch?: never;
|
|
2062
2062
|
trace?: never;
|
|
2063
2063
|
};
|
|
2064
|
+
"/reports/manager-statements/detail/pdf": {
|
|
2065
|
+
parameters: {
|
|
2066
|
+
query?: never;
|
|
2067
|
+
header?: never;
|
|
2068
|
+
path?: never;
|
|
2069
|
+
cookie?: never;
|
|
2070
|
+
};
|
|
2071
|
+
/** @description Manager statement detail PDF export */
|
|
2072
|
+
get: operations["getManagerStatementReportDetailPdf"];
|
|
2073
|
+
put?: never;
|
|
2074
|
+
post?: never;
|
|
2075
|
+
delete?: never;
|
|
2076
|
+
options?: never;
|
|
2077
|
+
head?: never;
|
|
2078
|
+
patch?: never;
|
|
2079
|
+
trace?: never;
|
|
2080
|
+
};
|
|
2081
|
+
"/reports/manager-statements/pdf": {
|
|
2082
|
+
parameters: {
|
|
2083
|
+
query?: never;
|
|
2084
|
+
header?: never;
|
|
2085
|
+
path?: never;
|
|
2086
|
+
cookie?: never;
|
|
2087
|
+
};
|
|
2088
|
+
/** @description Manager statements PDF export */
|
|
2089
|
+
get: operations["getManagerStatementsReportPdf"];
|
|
2090
|
+
put?: never;
|
|
2091
|
+
post?: never;
|
|
2092
|
+
delete?: never;
|
|
2093
|
+
options?: never;
|
|
2094
|
+
head?: never;
|
|
2095
|
+
patch?: never;
|
|
2096
|
+
trace?: never;
|
|
2097
|
+
};
|
|
2064
2098
|
"/reports/owner-statement-summaries-per-layout": {
|
|
2065
2099
|
parameters: {
|
|
2066
2100
|
query?: never;
|
|
@@ -2146,6 +2180,40 @@ export interface paths {
|
|
|
2146
2180
|
patch?: never;
|
|
2147
2181
|
trace?: never;
|
|
2148
2182
|
};
|
|
2183
|
+
"/reports/owner-statement-summaries-per-layout/details/{contactId}/pdf": {
|
|
2184
|
+
parameters: {
|
|
2185
|
+
query?: never;
|
|
2186
|
+
header?: never;
|
|
2187
|
+
path?: never;
|
|
2188
|
+
cookie?: never;
|
|
2189
|
+
};
|
|
2190
|
+
/** @description Owner statement summary detail PDF */
|
|
2191
|
+
get: operations["getOwnerStatementSummaryPerLayoutDetailsReportPdf"];
|
|
2192
|
+
put?: never;
|
|
2193
|
+
post?: never;
|
|
2194
|
+
delete?: never;
|
|
2195
|
+
options?: never;
|
|
2196
|
+
head?: never;
|
|
2197
|
+
patch?: never;
|
|
2198
|
+
trace?: never;
|
|
2199
|
+
};
|
|
2200
|
+
"/reports/owner-statement-summaries-per-layout/pdf": {
|
|
2201
|
+
parameters: {
|
|
2202
|
+
query?: never;
|
|
2203
|
+
header?: never;
|
|
2204
|
+
path?: never;
|
|
2205
|
+
cookie?: never;
|
|
2206
|
+
};
|
|
2207
|
+
/** @description Owner statement summary PDF ZIP export */
|
|
2208
|
+
get: operations["getOwnerStatementSummariesPerLayoutReportPdfBatch"];
|
|
2209
|
+
put?: never;
|
|
2210
|
+
post?: never;
|
|
2211
|
+
delete?: never;
|
|
2212
|
+
options?: never;
|
|
2213
|
+
head?: never;
|
|
2214
|
+
patch?: never;
|
|
2215
|
+
trace?: never;
|
|
2216
|
+
};
|
|
2149
2217
|
"/reports/profit-and-loss": {
|
|
2150
2218
|
parameters: {
|
|
2151
2219
|
query?: never;
|
|
@@ -28155,6 +28223,218 @@ export interface operations {
|
|
|
28155
28223
|
};
|
|
28156
28224
|
};
|
|
28157
28225
|
};
|
|
28226
|
+
getManagerStatementReportDetailPdf: {
|
|
28227
|
+
parameters: {
|
|
28228
|
+
query: {
|
|
28229
|
+
startAt: string;
|
|
28230
|
+
endAt: string;
|
|
28231
|
+
};
|
|
28232
|
+
header?: never;
|
|
28233
|
+
path?: never;
|
|
28234
|
+
cookie?: never;
|
|
28235
|
+
};
|
|
28236
|
+
requestBody?: never;
|
|
28237
|
+
responses: {
|
|
28238
|
+
/** @description Successful response */
|
|
28239
|
+
200: {
|
|
28240
|
+
headers: {
|
|
28241
|
+
[name: string]: unknown;
|
|
28242
|
+
};
|
|
28243
|
+
content: {
|
|
28244
|
+
"application/json": {
|
|
28245
|
+
url: string;
|
|
28246
|
+
expIn: number;
|
|
28247
|
+
};
|
|
28248
|
+
};
|
|
28249
|
+
};
|
|
28250
|
+
/** @description Bad request */
|
|
28251
|
+
400: {
|
|
28252
|
+
headers: {
|
|
28253
|
+
[name: string]: unknown;
|
|
28254
|
+
};
|
|
28255
|
+
content: {
|
|
28256
|
+
"application/json": {
|
|
28257
|
+
code: string;
|
|
28258
|
+
message: string;
|
|
28259
|
+
issues?: {
|
|
28260
|
+
message: string;
|
|
28261
|
+
}[];
|
|
28262
|
+
context?: unknown;
|
|
28263
|
+
};
|
|
28264
|
+
};
|
|
28265
|
+
};
|
|
28266
|
+
/** @description Unauthorized */
|
|
28267
|
+
401: {
|
|
28268
|
+
headers: {
|
|
28269
|
+
[name: string]: unknown;
|
|
28270
|
+
};
|
|
28271
|
+
content: {
|
|
28272
|
+
"application/json": {
|
|
28273
|
+
code: string;
|
|
28274
|
+
message: string;
|
|
28275
|
+
issues?: {
|
|
28276
|
+
message: string;
|
|
28277
|
+
}[];
|
|
28278
|
+
context?: unknown;
|
|
28279
|
+
};
|
|
28280
|
+
};
|
|
28281
|
+
};
|
|
28282
|
+
/** @description Forbidden */
|
|
28283
|
+
403: {
|
|
28284
|
+
headers: {
|
|
28285
|
+
[name: string]: unknown;
|
|
28286
|
+
};
|
|
28287
|
+
content: {
|
|
28288
|
+
"application/json": {
|
|
28289
|
+
code: string;
|
|
28290
|
+
message: string;
|
|
28291
|
+
issues?: {
|
|
28292
|
+
message: string;
|
|
28293
|
+
}[];
|
|
28294
|
+
context?: unknown;
|
|
28295
|
+
};
|
|
28296
|
+
};
|
|
28297
|
+
};
|
|
28298
|
+
/** @description Not found */
|
|
28299
|
+
404: {
|
|
28300
|
+
headers: {
|
|
28301
|
+
[name: string]: unknown;
|
|
28302
|
+
};
|
|
28303
|
+
content: {
|
|
28304
|
+
"application/json": {
|
|
28305
|
+
code: string;
|
|
28306
|
+
message: string;
|
|
28307
|
+
issues?: {
|
|
28308
|
+
message: string;
|
|
28309
|
+
}[];
|
|
28310
|
+
context?: unknown;
|
|
28311
|
+
};
|
|
28312
|
+
};
|
|
28313
|
+
};
|
|
28314
|
+
/** @description Internal server error */
|
|
28315
|
+
500: {
|
|
28316
|
+
headers: {
|
|
28317
|
+
[name: string]: unknown;
|
|
28318
|
+
};
|
|
28319
|
+
content: {
|
|
28320
|
+
"application/json": {
|
|
28321
|
+
code: string;
|
|
28322
|
+
message: string;
|
|
28323
|
+
issues?: {
|
|
28324
|
+
message: string;
|
|
28325
|
+
}[];
|
|
28326
|
+
context?: unknown;
|
|
28327
|
+
};
|
|
28328
|
+
};
|
|
28329
|
+
};
|
|
28330
|
+
};
|
|
28331
|
+
};
|
|
28332
|
+
getManagerStatementsReportPdf: {
|
|
28333
|
+
parameters: {
|
|
28334
|
+
query: {
|
|
28335
|
+
/** @description comma separated month start dates */
|
|
28336
|
+
startAts: string;
|
|
28337
|
+
};
|
|
28338
|
+
header?: never;
|
|
28339
|
+
path?: never;
|
|
28340
|
+
cookie?: never;
|
|
28341
|
+
};
|
|
28342
|
+
requestBody?: never;
|
|
28343
|
+
responses: {
|
|
28344
|
+
/** @description Successful response */
|
|
28345
|
+
200: {
|
|
28346
|
+
headers: {
|
|
28347
|
+
[name: string]: unknown;
|
|
28348
|
+
};
|
|
28349
|
+
content: {
|
|
28350
|
+
"application/json": {
|
|
28351
|
+
url: string;
|
|
28352
|
+
expIn: number;
|
|
28353
|
+
};
|
|
28354
|
+
};
|
|
28355
|
+
};
|
|
28356
|
+
/** @description Bad request */
|
|
28357
|
+
400: {
|
|
28358
|
+
headers: {
|
|
28359
|
+
[name: string]: unknown;
|
|
28360
|
+
};
|
|
28361
|
+
content: {
|
|
28362
|
+
"application/json": {
|
|
28363
|
+
code: string;
|
|
28364
|
+
message: string;
|
|
28365
|
+
issues?: {
|
|
28366
|
+
message: string;
|
|
28367
|
+
}[];
|
|
28368
|
+
context?: unknown;
|
|
28369
|
+
};
|
|
28370
|
+
};
|
|
28371
|
+
};
|
|
28372
|
+
/** @description Unauthorized */
|
|
28373
|
+
401: {
|
|
28374
|
+
headers: {
|
|
28375
|
+
[name: string]: unknown;
|
|
28376
|
+
};
|
|
28377
|
+
content: {
|
|
28378
|
+
"application/json": {
|
|
28379
|
+
code: string;
|
|
28380
|
+
message: string;
|
|
28381
|
+
issues?: {
|
|
28382
|
+
message: string;
|
|
28383
|
+
}[];
|
|
28384
|
+
context?: unknown;
|
|
28385
|
+
};
|
|
28386
|
+
};
|
|
28387
|
+
};
|
|
28388
|
+
/** @description Forbidden */
|
|
28389
|
+
403: {
|
|
28390
|
+
headers: {
|
|
28391
|
+
[name: string]: unknown;
|
|
28392
|
+
};
|
|
28393
|
+
content: {
|
|
28394
|
+
"application/json": {
|
|
28395
|
+
code: string;
|
|
28396
|
+
message: string;
|
|
28397
|
+
issues?: {
|
|
28398
|
+
message: string;
|
|
28399
|
+
}[];
|
|
28400
|
+
context?: unknown;
|
|
28401
|
+
};
|
|
28402
|
+
};
|
|
28403
|
+
};
|
|
28404
|
+
/** @description Not found */
|
|
28405
|
+
404: {
|
|
28406
|
+
headers: {
|
|
28407
|
+
[name: string]: unknown;
|
|
28408
|
+
};
|
|
28409
|
+
content: {
|
|
28410
|
+
"application/json": {
|
|
28411
|
+
code: string;
|
|
28412
|
+
message: string;
|
|
28413
|
+
issues?: {
|
|
28414
|
+
message: string;
|
|
28415
|
+
}[];
|
|
28416
|
+
context?: unknown;
|
|
28417
|
+
};
|
|
28418
|
+
};
|
|
28419
|
+
};
|
|
28420
|
+
/** @description Internal server error */
|
|
28421
|
+
500: {
|
|
28422
|
+
headers: {
|
|
28423
|
+
[name: string]: unknown;
|
|
28424
|
+
};
|
|
28425
|
+
content: {
|
|
28426
|
+
"application/json": {
|
|
28427
|
+
code: string;
|
|
28428
|
+
message: string;
|
|
28429
|
+
issues?: {
|
|
28430
|
+
message: string;
|
|
28431
|
+
}[];
|
|
28432
|
+
context?: unknown;
|
|
28433
|
+
};
|
|
28434
|
+
};
|
|
28435
|
+
};
|
|
28436
|
+
};
|
|
28437
|
+
};
|
|
28158
28438
|
getOwnerStatementSummariesPerLayoutReport: {
|
|
28159
28439
|
parameters: {
|
|
28160
28440
|
query: {
|
|
@@ -28875,6 +29155,235 @@ export interface operations {
|
|
|
28875
29155
|
};
|
|
28876
29156
|
};
|
|
28877
29157
|
};
|
|
29158
|
+
getOwnerStatementSummaryPerLayoutDetailsReportPdf: {
|
|
29159
|
+
parameters: {
|
|
29160
|
+
query: {
|
|
29161
|
+
view: "listing" | "month" | "reservation" | "bookingChannel";
|
|
29162
|
+
startAt: string;
|
|
29163
|
+
endAt: string;
|
|
29164
|
+
/** @description comma separated listings */
|
|
29165
|
+
listingIds?: string;
|
|
29166
|
+
currency?: string;
|
|
29167
|
+
viewAs?: "owner" | "manager";
|
|
29168
|
+
layoutId?: string;
|
|
29169
|
+
};
|
|
29170
|
+
header?: never;
|
|
29171
|
+
path: {
|
|
29172
|
+
contactId: string;
|
|
29173
|
+
};
|
|
29174
|
+
cookie?: never;
|
|
29175
|
+
};
|
|
29176
|
+
requestBody?: never;
|
|
29177
|
+
responses: {
|
|
29178
|
+
/** @description Successful response */
|
|
29179
|
+
200: {
|
|
29180
|
+
headers: {
|
|
29181
|
+
[name: string]: unknown;
|
|
29182
|
+
};
|
|
29183
|
+
content: {
|
|
29184
|
+
"application/json": {
|
|
29185
|
+
contactId?: string;
|
|
29186
|
+
url: string;
|
|
29187
|
+
expIn: number;
|
|
29188
|
+
};
|
|
29189
|
+
};
|
|
29190
|
+
};
|
|
29191
|
+
/** @description Bad request */
|
|
29192
|
+
400: {
|
|
29193
|
+
headers: {
|
|
29194
|
+
[name: string]: unknown;
|
|
29195
|
+
};
|
|
29196
|
+
content: {
|
|
29197
|
+
"application/json": {
|
|
29198
|
+
code: string;
|
|
29199
|
+
message: string;
|
|
29200
|
+
issues?: {
|
|
29201
|
+
message: string;
|
|
29202
|
+
}[];
|
|
29203
|
+
context?: unknown;
|
|
29204
|
+
};
|
|
29205
|
+
};
|
|
29206
|
+
};
|
|
29207
|
+
/** @description Unauthorized */
|
|
29208
|
+
401: {
|
|
29209
|
+
headers: {
|
|
29210
|
+
[name: string]: unknown;
|
|
29211
|
+
};
|
|
29212
|
+
content: {
|
|
29213
|
+
"application/json": {
|
|
29214
|
+
code: string;
|
|
29215
|
+
message: string;
|
|
29216
|
+
issues?: {
|
|
29217
|
+
message: string;
|
|
29218
|
+
}[];
|
|
29219
|
+
context?: unknown;
|
|
29220
|
+
};
|
|
29221
|
+
};
|
|
29222
|
+
};
|
|
29223
|
+
/** @description Forbidden */
|
|
29224
|
+
403: {
|
|
29225
|
+
headers: {
|
|
29226
|
+
[name: string]: unknown;
|
|
29227
|
+
};
|
|
29228
|
+
content: {
|
|
29229
|
+
"application/json": {
|
|
29230
|
+
code: string;
|
|
29231
|
+
message: string;
|
|
29232
|
+
issues?: {
|
|
29233
|
+
message: string;
|
|
29234
|
+
}[];
|
|
29235
|
+
context?: unknown;
|
|
29236
|
+
};
|
|
29237
|
+
};
|
|
29238
|
+
};
|
|
29239
|
+
/** @description Not found */
|
|
29240
|
+
404: {
|
|
29241
|
+
headers: {
|
|
29242
|
+
[name: string]: unknown;
|
|
29243
|
+
};
|
|
29244
|
+
content: {
|
|
29245
|
+
"application/json": {
|
|
29246
|
+
code: string;
|
|
29247
|
+
message: string;
|
|
29248
|
+
issues?: {
|
|
29249
|
+
message: string;
|
|
29250
|
+
}[];
|
|
29251
|
+
context?: unknown;
|
|
29252
|
+
};
|
|
29253
|
+
};
|
|
29254
|
+
};
|
|
29255
|
+
/** @description Internal server error */
|
|
29256
|
+
500: {
|
|
29257
|
+
headers: {
|
|
29258
|
+
[name: string]: unknown;
|
|
29259
|
+
};
|
|
29260
|
+
content: {
|
|
29261
|
+
"application/json": {
|
|
29262
|
+
code: string;
|
|
29263
|
+
message: string;
|
|
29264
|
+
issues?: {
|
|
29265
|
+
message: string;
|
|
29266
|
+
}[];
|
|
29267
|
+
context?: unknown;
|
|
29268
|
+
};
|
|
29269
|
+
};
|
|
29270
|
+
};
|
|
29271
|
+
};
|
|
29272
|
+
};
|
|
29273
|
+
getOwnerStatementSummariesPerLayoutReportPdfBatch: {
|
|
29274
|
+
parameters: {
|
|
29275
|
+
query: {
|
|
29276
|
+
startAt: string;
|
|
29277
|
+
endAt: string;
|
|
29278
|
+
/** @description comma separated listings */
|
|
29279
|
+
listingIds?: string;
|
|
29280
|
+
currency?: string;
|
|
29281
|
+
viewAs?: "owner" | "manager";
|
|
29282
|
+
view: "listing" | "month" | "reservation" | "bookingChannel";
|
|
29283
|
+
/** @description comma separated contacts */
|
|
29284
|
+
contactIds?: string;
|
|
29285
|
+
layoutId?: string;
|
|
29286
|
+
};
|
|
29287
|
+
header?: never;
|
|
29288
|
+
path?: never;
|
|
29289
|
+
cookie?: never;
|
|
29290
|
+
};
|
|
29291
|
+
requestBody?: never;
|
|
29292
|
+
responses: {
|
|
29293
|
+
/** @description Successful response */
|
|
29294
|
+
200: {
|
|
29295
|
+
headers: {
|
|
29296
|
+
[name: string]: unknown;
|
|
29297
|
+
};
|
|
29298
|
+
content: {
|
|
29299
|
+
"application/json": {
|
|
29300
|
+
url: string;
|
|
29301
|
+
expIn: number;
|
|
29302
|
+
};
|
|
29303
|
+
};
|
|
29304
|
+
};
|
|
29305
|
+
/** @description Bad request */
|
|
29306
|
+
400: {
|
|
29307
|
+
headers: {
|
|
29308
|
+
[name: string]: unknown;
|
|
29309
|
+
};
|
|
29310
|
+
content: {
|
|
29311
|
+
"application/json": {
|
|
29312
|
+
code: string;
|
|
29313
|
+
message: string;
|
|
29314
|
+
issues?: {
|
|
29315
|
+
message: string;
|
|
29316
|
+
}[];
|
|
29317
|
+
context?: unknown;
|
|
29318
|
+
};
|
|
29319
|
+
};
|
|
29320
|
+
};
|
|
29321
|
+
/** @description Unauthorized */
|
|
29322
|
+
401: {
|
|
29323
|
+
headers: {
|
|
29324
|
+
[name: string]: unknown;
|
|
29325
|
+
};
|
|
29326
|
+
content: {
|
|
29327
|
+
"application/json": {
|
|
29328
|
+
code: string;
|
|
29329
|
+
message: string;
|
|
29330
|
+
issues?: {
|
|
29331
|
+
message: string;
|
|
29332
|
+
}[];
|
|
29333
|
+
context?: unknown;
|
|
29334
|
+
};
|
|
29335
|
+
};
|
|
29336
|
+
};
|
|
29337
|
+
/** @description Forbidden */
|
|
29338
|
+
403: {
|
|
29339
|
+
headers: {
|
|
29340
|
+
[name: string]: unknown;
|
|
29341
|
+
};
|
|
29342
|
+
content: {
|
|
29343
|
+
"application/json": {
|
|
29344
|
+
code: string;
|
|
29345
|
+
message: string;
|
|
29346
|
+
issues?: {
|
|
29347
|
+
message: string;
|
|
29348
|
+
}[];
|
|
29349
|
+
context?: unknown;
|
|
29350
|
+
};
|
|
29351
|
+
};
|
|
29352
|
+
};
|
|
29353
|
+
/** @description Not found */
|
|
29354
|
+
404: {
|
|
29355
|
+
headers: {
|
|
29356
|
+
[name: string]: unknown;
|
|
29357
|
+
};
|
|
29358
|
+
content: {
|
|
29359
|
+
"application/json": {
|
|
29360
|
+
code: string;
|
|
29361
|
+
message: string;
|
|
29362
|
+
issues?: {
|
|
29363
|
+
message: string;
|
|
29364
|
+
}[];
|
|
29365
|
+
context?: unknown;
|
|
29366
|
+
};
|
|
29367
|
+
};
|
|
29368
|
+
};
|
|
29369
|
+
/** @description Internal server error */
|
|
29370
|
+
500: {
|
|
29371
|
+
headers: {
|
|
29372
|
+
[name: string]: unknown;
|
|
29373
|
+
};
|
|
29374
|
+
content: {
|
|
29375
|
+
"application/json": {
|
|
29376
|
+
code: string;
|
|
29377
|
+
message: string;
|
|
29378
|
+
issues?: {
|
|
29379
|
+
message: string;
|
|
29380
|
+
}[];
|
|
29381
|
+
context?: unknown;
|
|
29382
|
+
};
|
|
29383
|
+
};
|
|
29384
|
+
};
|
|
29385
|
+
};
|
|
29386
|
+
};
|
|
28878
29387
|
getProfitAndLossReport: {
|
|
28879
29388
|
parameters: {
|
|
28880
29389
|
query?: {
|