@vrplatform/api 1.3.1-stage.7 → 1.3.1-stage.74

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.
@@ -31,6 +31,8 @@ export type ResponseData<T extends ResponseCombinations> = T extends `${infer Me
31
31
  };
32
32
  };
33
33
  } ? Data : never : never : never : never;
34
+ export type ApiScope = NonNullable<ResponseData<'get:/me'>['membership']>['permissions'][number];
35
+ export type UiPermissionBundleName = NonNullable<ResponseData<'get:/me'>['membership']>['permissionBundles'][number];
34
36
  type RequestBodyCombinations = {
35
37
  [Path in keyof paths]: {
36
38
  [Method in keyof paths[Path]]: paths[Path][Method] extends never ? never : ExtractJsonRequestBody<paths[Path][Method]> extends never ? never : `${Method & string}:${Path}`;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"src/","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import type createClient from 'openapi-fetch';\nimport type { paths } from './generated/v1';\n\nexport type ApiClientAuth = {\n apiKey?: string;\n sec?: string;\n tenantId?: string;\n accessToken?: string;\n};\nexport type ApiClient = ReturnType<typeof createClient<paths>> & {\n sessionId: string;\n};\ntype ResponseCombinations = {\n [Path in keyof paths]: {\n [Method in keyof paths[Path]]: paths[Path][Method] extends never\n ? never\n : paths[Path][Method] extends {\n responses: {\n 200: { content: { 'application/json': unknown } };\n };\n }\n ? `${Method & string}:${Path}`\n : never;\n }[keyof paths[Path]];\n}[keyof paths];\n\nexport type ResponseData<T extends ResponseCombinations> =\n T extends `${infer Method}:${infer Path}`\n ? Path extends keyof paths\n ? Method extends keyof paths[Path]\n ? paths[Path][Method] extends {\n responses: {\n 200: { content: { 'application/json': infer Data } };\n };\n }\n ? Data\n : never\n : never\n : never\n : never;\n\ntype RequestBodyCombinations = {\n [Path in keyof paths]: {\n [Method in keyof paths[Path]]: paths[Path][Method] extends never\n ? never\n : ExtractJsonRequestBody<paths[Path][Method]> extends never\n ? never\n : `${Method & string}:${Path}`;\n }[keyof paths[Path]];\n}[keyof paths];\n\ntype ExtractJsonRequestBody<T> = T extends {\n requestBody?: infer RequestBody;\n}\n ? RequestBody extends {\n content: { 'application/json': infer Data };\n }\n ? Data\n : never\n : never;\n\nexport type RequestBody<T extends RequestBodyCombinations> =\n T extends `${infer Method}:${infer Path}`\n ? Path extends keyof paths\n ? Method extends keyof paths[Path]\n ? ExtractJsonRequestBody<paths[Path][Method]>\n : never\n : never\n : never;\n\ntype RequestParamCombinations = {\n [Path in keyof paths]: {\n [Method in keyof paths[Path]]: paths[Path][Method] extends never\n ? never\n : paths[Path][Method] extends {\n parameters: {\n query?: Record<string, unknown>;\n };\n }\n ? `${Method & string}:${Path}`\n : never;\n }[keyof paths[Path]];\n}[keyof paths];\n\nexport type RequestQuery<T extends RequestParamCombinations> =\n T extends `${infer Method}:${infer Path}`\n ? Path extends keyof paths\n ? Method extends keyof paths[Path]\n ? paths[Path][Method] extends {\n parameters: {\n query?: infer Data;\n };\n }\n ? Data\n : never\n : never\n : never\n : never;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"src/","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import type createClient from 'openapi-fetch';\nimport type { paths } from './generated/v1';\n\nexport type ApiClientAuth = {\n apiKey?: string;\n sec?: string;\n tenantId?: string;\n accessToken?: string;\n};\nexport type ApiClient = ReturnType<typeof createClient<paths>> & {\n sessionId: string;\n};\ntype ResponseCombinations = {\n [Path in keyof paths]: {\n [Method in keyof paths[Path]]: paths[Path][Method] extends never\n ? never\n : paths[Path][Method] extends {\n responses: {\n 200: { content: { 'application/json': unknown } };\n };\n }\n ? `${Method & string}:${Path}`\n : never;\n }[keyof paths[Path]];\n}[keyof paths];\n\nexport type ResponseData<T extends ResponseCombinations> =\n T extends `${infer Method}:${infer Path}`\n ? Path extends keyof paths\n ? Method extends keyof paths[Path]\n ? paths[Path][Method] extends {\n responses: {\n 200: { content: { 'application/json': infer Data } };\n };\n }\n ? Data\n : never\n : never\n : never\n : never;\n\nexport type ApiScope = NonNullable<\n ResponseData<'get:/me'>['membership']\n>['permissions'][number];\n\nexport type UiPermissionBundleName = NonNullable<\n ResponseData<'get:/me'>['membership']\n>['permissionBundles'][number];\n\ntype RequestBodyCombinations = {\n [Path in keyof paths]: {\n [Method in keyof paths[Path]]: paths[Path][Method] extends never\n ? never\n : ExtractJsonRequestBody<paths[Path][Method]> extends never\n ? never\n : `${Method & string}:${Path}`;\n }[keyof paths[Path]];\n}[keyof paths];\n\ntype ExtractJsonRequestBody<T> = T extends {\n requestBody?: infer RequestBody;\n}\n ? RequestBody extends {\n content: { 'application/json': infer Data };\n }\n ? Data\n : never\n : never;\n\nexport type RequestBody<T extends RequestBodyCombinations> =\n T extends `${infer Method}:${infer Path}`\n ? Path extends keyof paths\n ? Method extends keyof paths[Path]\n ? ExtractJsonRequestBody<paths[Path][Method]>\n : never\n : never\n : never;\n\ntype RequestParamCombinations = {\n [Path in keyof paths]: {\n [Method in keyof paths[Path]]: paths[Path][Method] extends never\n ? never\n : paths[Path][Method] extends {\n parameters: {\n query?: Record<string, unknown>;\n };\n }\n ? `${Method & string}:${Path}`\n : never;\n }[keyof paths[Path]];\n}[keyof paths];\n\nexport type RequestQuery<T extends RequestParamCombinations> =\n T extends `${infer Method}:${infer Path}`\n ? Path extends keyof paths\n ? Method extends keyof paths[Path]\n ? paths[Path][Method] extends {\n parameters: {\n query?: infer Data;\n };\n }\n ? Data\n : never\n : never\n : never\n : never;\n"]}