@vrplatform/api 1.3.1-stage.4084 → 1.3.1-stage.4089
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/generated/v1.d.ts +4 -3
- package/build/main/generated/v1.js.map +1 -1
- package/build/main/index.d.ts +1 -0
- package/build/main/index.js +1 -0
- package/build/main/index.js.map +1 -1
- package/build/main/routing.d.ts +10 -0
- package/build/main/routing.js +33 -0
- package/build/main/routing.js.map +1 -0
- package/build/module/generated/v1.d.ts +4 -3
- package/build/module/generated/v1.js.map +1 -1
- package/build/module/index.d.ts +1 -0
- package/build/module/index.js +1 -0
- package/build/module/index.js.map +1 -1
- package/build/module/routing.d.ts +10 -0
- package/build/module/routing.js +30 -0
- package/build/module/routing.js.map +1 -0
- package/package.json +1 -1
- package/src/generated/v1.ts +4 -3
- package/src/index.ts +1 -0
- package/src/routing.ts +52 -0
package/build/main/index.d.ts
CHANGED
package/build/main/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./client"), exports);
|
|
18
18
|
__exportStar(require("./error"), exports);
|
|
19
|
+
__exportStar(require("./routing"), exports);
|
|
19
20
|
__exportStar(require("./sec"), exports);
|
|
20
21
|
__exportStar(require("./types"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/build/main/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,2CAAyB;AACzB,0CAAwB;AAExB,wCAAsB;AACtB,0CAAwB","sourcesContent":["import type { ApiClient } from './types';\n\nexport * from './client';\nexport * from './error';\nexport type * from './generated/v1';\nexport * from './sec';\nexport * from './types';\n\nexport type VRPlatformApi = ApiClient;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,2CAAyB;AACzB,0CAAwB;AAExB,4CAA0B;AAC1B,wCAAsB;AACtB,0CAAwB","sourcesContent":["import type { ApiClient } from './types';\n\nexport * from './client';\nexport * from './error';\nexport type * from './generated/v1';\nexport * from './routing';\nexport * from './sec';\nexport * from './types';\n\nexport type VRPlatformApi = ApiClient;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useApiClient } from './client';
|
|
2
|
+
import type { ResponseData } from './types';
|
|
3
|
+
export type TenantRouting = Pick<ResponseData<'get:/teams/resolve'>, 'id' | 'slug' | 'dataRegion' | 'apiBaseUrl'>;
|
|
4
|
+
type ApiClientOptions = Parameters<typeof useApiClient>[0];
|
|
5
|
+
export declare function resolveTenantRouting({ connectionId, slug, tenantId, auth, ...apiClientOptions }: ApiClientOptions & {
|
|
6
|
+
connectionId?: string;
|
|
7
|
+
slug?: string;
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
}): Promise<TenantRouting>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveTenantRouting = resolveTenantRouting;
|
|
4
|
+
const client_1 = require("./client");
|
|
5
|
+
const error_1 = require("./error");
|
|
6
|
+
async function resolveTenantRouting({ connectionId, slug, tenantId, auth, ...apiClientOptions }) {
|
|
7
|
+
if (!connectionId && !slug && !tenantId) {
|
|
8
|
+
throw new Error('connectionId, slug, or tenantId is required');
|
|
9
|
+
}
|
|
10
|
+
const response = (0, error_1.throwIfError)(await (0, client_1.useApiClient)({
|
|
11
|
+
...apiClientOptions,
|
|
12
|
+
auth: tenantId
|
|
13
|
+
? () => {
|
|
14
|
+
const current = typeof auth === 'function' ? auth() : (auth ?? {});
|
|
15
|
+
return {
|
|
16
|
+
...current,
|
|
17
|
+
tenantId,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
: auth,
|
|
21
|
+
}).GET('/teams/resolve', {
|
|
22
|
+
params: {
|
|
23
|
+
query: slug ? { slug } : connectionId ? { connectionId } : {},
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
return {
|
|
27
|
+
id: response.id,
|
|
28
|
+
slug: response.slug,
|
|
29
|
+
dataRegion: response.dataRegion,
|
|
30
|
+
apiBaseUrl: new URL(response.apiBaseUrl).toString().replace(/\/$/, ''),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=routing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routing.js","sourceRoot":"src/","sources":["routing.ts"],"names":[],"mappings":";;AAWA,oDAwCC;AAnDD,qCAAwC;AACxC,mCAAuC;AAUhC,KAAK,UAAU,oBAAoB,CAAC,EACzC,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,GAAG,gBAAgB,EAKpB;IACC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAC3B,MAAM,IAAA,qBAAY,EAAC;QACjB,GAAG,gBAAgB;QACnB,IAAI,EAAE,QAAQ;YACZ,CAAC,CAAC,GAAG,EAAE;gBACH,MAAM,OAAO,GAAG,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;gBACnE,OAAO;oBACL,GAAG,OAAO;oBACV,QAAQ;iBACe,CAAC;YAC5B,CAAC;YACH,CAAC,CAAC,IAAI;KACT,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE;QACvB,MAAM,EAAE;YACN,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE;SAC9D;KACF,CAAC,CACH,CAAC;IAEF,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,EAAE;QACf,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,UAAU,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;KACvE,CAAC;AACJ,CAAC","sourcesContent":["import { useApiClient } from './client';\nimport { throwIfError } from './error';\nimport type { ApiClientAuth, ResponseData } from './types';\n\nexport type TenantRouting = Pick<\n ResponseData<'get:/teams/resolve'>,\n 'id' | 'slug' | 'dataRegion' | 'apiBaseUrl'\n>;\n\ntype ApiClientOptions = Parameters<typeof useApiClient>[0];\n\nexport async function resolveTenantRouting({\n connectionId,\n slug,\n tenantId,\n auth,\n ...apiClientOptions\n}: ApiClientOptions & {\n connectionId?: string;\n slug?: string;\n tenantId?: string;\n}): Promise<TenantRouting> {\n if (!connectionId && !slug && !tenantId) {\n throw new Error('connectionId, slug, or tenantId is required');\n }\n\n const response = throwIfError(\n await useApiClient({\n ...apiClientOptions,\n auth: tenantId\n ? () => {\n const current = typeof auth === 'function' ? auth() : (auth ?? {});\n return {\n ...current,\n tenantId,\n } satisfies ApiClientAuth;\n }\n : auth,\n }).GET('/teams/resolve', {\n params: {\n query: slug ? { slug } : connectionId ? { connectionId } : {},\n },\n })\n );\n\n return {\n id: response.id,\n slug: response.slug,\n dataRegion: response.dataRegion,\n apiBaseUrl: new URL(response.apiBaseUrl).toString().replace(/\\/$/, ''),\n };\n}\n"]}
|
|
@@ -3422,7 +3422,7 @@ export interface paths {
|
|
|
3422
3422
|
path?: never;
|
|
3423
3423
|
cookie?: never;
|
|
3424
3424
|
};
|
|
3425
|
-
/** @description Resolve a team by slug */
|
|
3425
|
+
/** @description Resolve a team by slug, connection, or tenant-scoped auth */
|
|
3426
3426
|
get: operations["getTeamsResolve"];
|
|
3427
3427
|
put?: never;
|
|
3428
3428
|
post?: never;
|
|
@@ -63181,8 +63181,9 @@ export interface operations {
|
|
|
63181
63181
|
};
|
|
63182
63182
|
getTeamsResolve: {
|
|
63183
63183
|
parameters: {
|
|
63184
|
-
query
|
|
63185
|
-
|
|
63184
|
+
query?: {
|
|
63185
|
+
connectionId?: string;
|
|
63186
|
+
slug?: string;
|
|
63186
63187
|
};
|
|
63187
63188
|
header?: never;
|
|
63188
63189
|
path?: never;
|