@vrplatform/api 1.3.1-stage.4248 → 1.3.1-stage.42494128957

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 (108) hide show
  1. package/build/main/cache.js +10 -7
  2. package/build/main/cache.js.map +1 -1
  3. package/build/main/client.d.ts +6 -2
  4. package/build/main/client.js +18 -15
  5. package/build/main/client.js.map +1 -1
  6. package/build/main/control-plane-routing.d.ts +6 -0
  7. package/build/main/control-plane-routing.js +34 -0
  8. package/build/main/control-plane-routing.js.map +1 -0
  9. package/build/main/embed-lifecycle.d.ts +140 -0
  10. package/build/main/embed-lifecycle.js +126 -0
  11. package/build/main/embed-lifecycle.js.map +1 -0
  12. package/build/main/error.d.ts +32 -17
  13. package/build/main/error.js +56 -32
  14. package/build/main/error.js.map +1 -1
  15. package/build/main/generated/routing.d.ts +11 -0
  16. package/build/main/generated/routing.js +292 -0
  17. package/build/main/generated/routing.js.map +1 -0
  18. package/build/main/generated/v1.d.ts +4 -74851
  19. package/build/main/generated/v1.js.map +4 -1
  20. package/build/main/index.d.ts +7 -0
  21. package/build/main/index.js +7 -0
  22. package/build/main/index.js.map +1 -1
  23. package/build/main/is-test-team.d.ts +18 -0
  24. package/build/main/is-test-team.js +27 -0
  25. package/build/main/is-test-team.js.map +1 -0
  26. package/build/main/is-test-user.d.ts +4 -0
  27. package/build/main/is-test-user.js +31 -0
  28. package/build/main/is-test-user.js.map +1 -0
  29. package/build/main/is-vrp-member.d.ts +4 -0
  30. package/build/main/is-vrp-member.js +33 -0
  31. package/build/main/is-vrp-member.js.map +1 -0
  32. package/build/main/retarget-request.d.ts +7 -0
  33. package/build/main/retarget-request.js +21 -0
  34. package/build/main/retarget-request.js.map +1 -0
  35. package/build/main/routing.d.ts +7 -0
  36. package/build/main/routing.js +22 -0
  37. package/build/main/routing.js.map +1 -1
  38. package/build/main/sec.js.map +1 -1
  39. package/build/main/types.d.ts +2 -0
  40. package/build/main/types.js.map +1 -1
  41. package/build/main/vrt-mcp.d.ts +216 -0
  42. package/build/main/vrt-mcp.js +201 -0
  43. package/build/main/vrt-mcp.js.map +1 -0
  44. package/build/module/cache.js +10 -7
  45. package/build/module/cache.js.map +1 -1
  46. package/build/module/client.d.ts +6 -2
  47. package/build/module/client.js +18 -15
  48. package/build/module/client.js.map +1 -1
  49. package/build/module/control-plane-routing.d.ts +6 -0
  50. package/build/module/control-plane-routing.js +30 -0
  51. package/build/module/control-plane-routing.js.map +1 -0
  52. package/build/module/embed-lifecycle.d.ts +140 -0
  53. package/build/module/embed-lifecycle.js +90 -0
  54. package/build/module/embed-lifecycle.js.map +1 -0
  55. package/build/module/error.d.ts +32 -17
  56. package/build/module/error.js +59 -31
  57. package/build/module/error.js.map +1 -1
  58. package/build/module/generated/routing.d.ts +11 -0
  59. package/build/module/generated/routing.js +289 -0
  60. package/build/module/generated/routing.js.map +1 -0
  61. package/build/module/generated/v1.d.ts +4 -74851
  62. package/build/module/generated/v1.js.map +4 -1
  63. package/build/module/index.d.ts +7 -0
  64. package/build/module/index.js +7 -0
  65. package/build/module/index.js.map +1 -1
  66. package/build/module/is-test-team.d.ts +18 -0
  67. package/build/module/is-test-team.js +22 -0
  68. package/build/module/is-test-team.js.map +1 -0
  69. package/build/module/is-test-user.d.ts +4 -0
  70. package/build/module/is-test-user.js +27 -0
  71. package/build/module/is-test-user.js.map +1 -0
  72. package/build/module/is-vrp-member.d.ts +4 -0
  73. package/build/module/is-vrp-member.js +29 -0
  74. package/build/module/is-vrp-member.js.map +1 -0
  75. package/build/module/retarget-request.d.ts +7 -0
  76. package/build/module/retarget-request.js +18 -0
  77. package/build/module/retarget-request.js.map +1 -0
  78. package/build/module/routing.d.ts +7 -0
  79. package/build/module/routing.js +21 -0
  80. package/build/module/routing.js.map +1 -1
  81. package/build/module/types.d.ts +2 -0
  82. package/build/module/types.js.map +1 -1
  83. package/build/module/vrt-mcp.d.ts +216 -0
  84. package/build/module/vrt-mcp.js +165 -0
  85. package/build/module/vrt-mcp.js.map +1 -0
  86. package/package.json +10 -9
  87. package/src/cache.ts +11 -8
  88. package/src/client.ts +20 -17
  89. package/src/control-plane-routing.ts +46 -0
  90. package/src/embed-lifecycle.ts +96 -0
  91. package/src/error.ts +105 -56
  92. package/src/generated/routing.ts +292 -0
  93. package/src/generated/v1.ts +4 -74852
  94. package/src/index.ts +7 -0
  95. package/src/is-test-team.ts +50 -0
  96. package/src/is-test-user.ts +39 -0
  97. package/src/is-vrp-member.ts +38 -0
  98. package/src/retarget-request.ts +17 -0
  99. package/src/routing.ts +30 -0
  100. package/src/types.ts +8 -0
  101. package/src/vrt-mcp.ts +192 -0
  102. package/build/main/generated/openapi-fetch.d.ts +0 -224
  103. package/build/main/generated/openapi-fetch.js +0 -14
  104. package/build/main/generated/openapi-fetch.js.map +0 -1
  105. package/build/module/generated/openapi-fetch.d.ts +0 -224
  106. package/build/module/generated/openapi-fetch.js +0 -2
  107. package/build/module/generated/openapi-fetch.js.map +0 -1
  108. package/src/generated/openapi-fetch.ts +0 -433
@@ -1,8 +1,15 @@
1
1
  import type { ApiClient } from './types';
2
2
  export * from './client';
3
+ export * from './control-plane-routing';
4
+ export * from './embed-lifecycle';
3
5
  export * from './error';
4
6
  export type * from './generated/v1';
7
+ export * from './is-test-team';
8
+ export * from './is-test-user';
9
+ export * from './is-vrp-member';
10
+ export * from './retarget-request';
5
11
  export * from './routing';
6
12
  export * from './sec';
7
13
  export * from './types';
14
+ export * from './vrt-mcp';
8
15
  export type VRPlatformApi = ApiClient;
@@ -1,6 +1,13 @@
1
1
  export * from './client';
2
+ export * from './control-plane-routing';
3
+ export * from './embed-lifecycle';
2
4
  export * from './error';
5
+ export * from './is-test-team';
6
+ export * from './is-test-user';
7
+ export * from './is-vrp-member';
8
+ export * from './retarget-request';
3
9
  export * from './routing';
4
10
  export * from './sec';
5
11
  export * from './types';
12
+ export * from './vrt-mcp';
6
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC","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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC","sourcesContent":["import type { ApiClient } from './types';\n\nexport * from './client';\nexport * from './control-plane-routing';\nexport * from './embed-lifecycle';\nexport * from './error';\nexport type * from './generated/v1';\nexport * from './is-test-team';\nexport * from './is-test-user';\nexport * from './is-vrp-member';\nexport * from './retarget-request';\nexport * from './routing';\nexport * from './sec';\nexport * from './types';\nexport * from './vrt-mcp';\n\nexport type VRPlatformApi = ApiClient;\n"]}
@@ -0,0 +1,18 @@
1
+ export declare const TEST_TEAM_IDS: readonly ["0b6a7bd6-56cc-46b5-b2ab-1bd7d1e994fa", 'fa4d1a20-2f47-4021-9c72-c5a809be9c48', 'c4fd21b4-8447-43a2-bdcb-f06a85a935ad', '8f21060e-afe6-410a-b2f4-00a3caa20786'];
2
+ export declare function isTestTeam(team: {
3
+ id: string;
4
+ partnerId?: string | null;
5
+ billingPartnerId?: string | null;
6
+ } | undefined): boolean;
7
+ type TestTeamReference = {
8
+ id: string;
9
+ partnerId?: string | null;
10
+ billingPartnerId?: string | null;
11
+ } | null | undefined;
12
+ /**
13
+ * A team is a test team when it, its accounting partner or its billing
14
+ * partner is one by `isTestTeam`. Partners are checked without recursion.
15
+ * Hyperline bills these teams in Sandbox.
16
+ */
17
+ export declare function isTestTeamWithPartners(team: TestTeamReference, partner: TestTeamReference, billingPartner: TestTeamReference): boolean;
18
+ export {};
@@ -0,0 +1,22 @@
1
+ const DEMO_TEST_PARTNER_TENANT_ID = '0b6a7bd6-56cc-46b5-b2ab-1bd7d1e994fa';
2
+ export const TEST_TEAM_IDS = [
3
+ DEMO_TEST_PARTNER_TENANT_ID,
4
+ 'fa4d1a20-2f47-4021-9c72-c5a809be9c48', // Testing tenant
5
+ 'c4fd21b4-8447-43a2-bdcb-f06a85a935ad', // VRP Automated Testing
6
+ '8f21060e-afe6-410a-b2f4-00a3caa20786', // test_company_xxxx
7
+ ];
8
+ export function isTestTeam(team) {
9
+ if (!team)
10
+ return false;
11
+ return (new Set(TEST_TEAM_IDS).has(team.id) ||
12
+ [team.partnerId, team.billingPartnerId].includes(DEMO_TEST_PARTNER_TENANT_ID));
13
+ }
14
+ /**
15
+ * A team is a test team when it, its accounting partner or its billing
16
+ * partner is one by `isTestTeam`. Partners are checked without recursion.
17
+ * Hyperline bills these teams in Sandbox.
18
+ */
19
+ export function isTestTeamWithPartners(team, partner, billingPartner) {
20
+ return [team, partner, billingPartner].some((reference) => isTestTeam(reference ?? undefined));
21
+ }
22
+ //# sourceMappingURL=is-test-team.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-test-team.js","sourceRoot":"src/","sources":["is-test-team.ts"],"names":[],"mappings":"AAAA,MAAM,2BAA2B,GAAG,sCAAsC,CAAC;AAE3E,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,2BAA2B;IAC3B,sCAAsC,EAAE,iBAAiB;IACzD,sCAAsC,EAAE,wBAAwB;IAChE,sCAAsC,EAAE,oBAAoB;CACpD,CAAC;AAEX,MAAM,UAAU,UAAU,CACxB,IAMa;IAEb,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACxB,OAAO,CACL,IAAI,GAAG,CAAS,aAAa,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAC9C,2BAA2B,CAC5B,CACF,CAAC;AACJ,CAAC;AAWD;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAuB,EACvB,OAA0B,EAC1B,cAAiC;IAEjC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CACxD,UAAU,CAAC,SAAS,IAAI,SAAS,CAAC,CACnC,CAAC;AACJ,CAAC","sourcesContent":["const DEMO_TEST_PARTNER_TENANT_ID = '0b6a7bd6-56cc-46b5-b2ab-1bd7d1e994fa';\n\nexport const TEST_TEAM_IDS = [\n DEMO_TEST_PARTNER_TENANT_ID,\n 'fa4d1a20-2f47-4021-9c72-c5a809be9c48', // Testing tenant\n 'c4fd21b4-8447-43a2-bdcb-f06a85a935ad', // VRP Automated Testing\n '8f21060e-afe6-410a-b2f4-00a3caa20786', // test_company_xxxx\n] as const;\n\nexport function isTestTeam(\n team:\n | {\n id: string;\n partnerId?: string | null;\n billingPartnerId?: string | null;\n }\n | undefined\n): boolean {\n if (!team) return false;\n return (\n new Set<string>(TEST_TEAM_IDS).has(team.id) ||\n [team.partnerId, team.billingPartnerId].includes(\n DEMO_TEST_PARTNER_TENANT_ID\n )\n );\n}\n\ntype TestTeamReference =\n | {\n id: string;\n partnerId?: string | null;\n billingPartnerId?: string | null;\n }\n | null\n | undefined;\n\n/**\n * A team is a test team when it, its accounting partner or its billing\n * partner is one by `isTestTeam`. Partners are checked without recursion.\n * Hyperline bills these teams in Sandbox.\n */\nexport function isTestTeamWithPartners(\n team: TestTeamReference,\n partner: TestTeamReference,\n billingPartner: TestTeamReference\n): boolean {\n return [team, partner, billingPartner].some((reference) =>\n isTestTeam(reference ?? undefined)\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const isTestUser: ({ userEmail, userId, }: {
2
+ userEmail?: string | null;
3
+ userId?: string | null;
4
+ }) => boolean;
@@ -0,0 +1,27 @@
1
+ const E2E_TEST_USER_EMAILS = [
2
+ 'e2e-invite-owner@finalytic.io',
3
+ 'e2e-invite-owner@vrp.rocks',
4
+ 'e2e-invite-member@finalytic.io',
5
+ 'e2e-invite-member@vrp.rocks',
6
+ 'e2e-sign-up-legacy@vrp.rocks',
7
+ 'e2e-sign-up-partner@vrp.rocks',
8
+ 'e2e-sign-up@finalytic.io',
9
+ 'e2e-sign-up@vrp.rocks',
10
+ 'lars+e2e@vrplatform.app',
11
+ 'lars+e2e-gl@vrplatform.app',
12
+ 'lars+checkly@finalytic.co',
13
+ ];
14
+ const E2E_TEST_USERS = {
15
+ 'e2e-invite-member@finalytic.io': '113d73d8-ee21-46b7-a12a-a74f632401ca',
16
+ 'e2e-invite-member@vrp.rocks': '113d73d8-ee21-46b7-a12a-a74f632401ca',
17
+ 'e2e-invite-owner@finalytic.io': '917b7c4e-cb03-491c-9e94-d33a5bdeca05',
18
+ 'e2e-invite-owner@vrp.rocks': '917b7c4e-cb03-491c-9e94-d33a5bdeca05',
19
+ 'e2e-sign-up-partner@vrp.rocks': '5c8e5572-74d0-4ae6-af73-bca8db9a27e9',
20
+ 'e2e-sign-up@vrp.rocks': '3c8e5572-74d0-4ae6-af73-bca8db9a27e9',
21
+ 'e2e-sign-up@finalytic.io': 'ec8e5572-74d0-4ae6-af73-bca8db9a27e9',
22
+ 'e2e-sign-up-legacy@vrp.rocks': 'ec8e5572-74d0-4ae6-af73-bca8db9a27e9',
23
+ 'lars+checkly@finalytic.co': '9e7dfc88-503c-4222-9905-9116169d2203',
24
+ };
25
+ export const isTestUser = ({ userEmail, userId, }) => Boolean((userId && Object.values(E2E_TEST_USERS).includes(userId)) ||
26
+ (userEmail && Object.keys(E2E_TEST_USERS).includes(userEmail)));
27
+ //# sourceMappingURL=is-test-user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-test-user.js","sourceRoot":"src/","sources":["is-test-user.ts"],"names":[],"mappings":"AAAA,MAAM,oBAAoB,GAAG;IAC3B,+BAA+B;IAC/B,4BAA4B;IAC5B,gCAAgC;IAChC,6BAA6B;IAC7B,8BAA8B;IAC9B,+BAA+B;IAC/B,0BAA0B;IAC1B,uBAAuB;IACvB,yBAAyB;IACzB,4BAA4B;IAC5B,2BAA2B;CACnB,CAAC;AAEX,MAAM,cAAc,GAEhB;IACF,gCAAgC,EAAE,sCAAsC;IACxE,6BAA6B,EAAE,sCAAsC;IACrE,+BAA+B,EAAE,sCAAsC;IACvE,4BAA4B,EAAE,sCAAsC;IACpE,+BAA+B,EAAE,sCAAsC;IACvE,uBAAuB,EAAE,sCAAsC;IAC/D,0BAA0B,EAAE,sCAAsC;IAClE,8BAA8B,EAAE,sCAAsC;IACtE,2BAA2B,EAAE,sCAAsC;CACpE,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,SAAS,EACT,MAAM,GAIP,EAAE,EAAE,CACH,OAAO,CACL,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1D,CAAC,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAC/D,CAAC","sourcesContent":["const E2E_TEST_USER_EMAILS = [\n 'e2e-invite-owner@finalytic.io',\n 'e2e-invite-owner@vrp.rocks',\n 'e2e-invite-member@finalytic.io',\n 'e2e-invite-member@vrp.rocks',\n 'e2e-sign-up-legacy@vrp.rocks',\n 'e2e-sign-up-partner@vrp.rocks',\n 'e2e-sign-up@finalytic.io',\n 'e2e-sign-up@vrp.rocks',\n 'lars+e2e@vrplatform.app',\n 'lars+e2e-gl@vrplatform.app',\n 'lars+checkly@finalytic.co',\n] as const;\n\nconst E2E_TEST_USERS: Partial<\n Record<(typeof E2E_TEST_USER_EMAILS)[number], string>\n> = {\n 'e2e-invite-member@finalytic.io': '113d73d8-ee21-46b7-a12a-a74f632401ca',\n 'e2e-invite-member@vrp.rocks': '113d73d8-ee21-46b7-a12a-a74f632401ca',\n 'e2e-invite-owner@finalytic.io': '917b7c4e-cb03-491c-9e94-d33a5bdeca05',\n 'e2e-invite-owner@vrp.rocks': '917b7c4e-cb03-491c-9e94-d33a5bdeca05',\n 'e2e-sign-up-partner@vrp.rocks': '5c8e5572-74d0-4ae6-af73-bca8db9a27e9',\n 'e2e-sign-up@vrp.rocks': '3c8e5572-74d0-4ae6-af73-bca8db9a27e9',\n 'e2e-sign-up@finalytic.io': 'ec8e5572-74d0-4ae6-af73-bca8db9a27e9',\n 'e2e-sign-up-legacy@vrp.rocks': 'ec8e5572-74d0-4ae6-af73-bca8db9a27e9',\n 'lars+checkly@finalytic.co': '9e7dfc88-503c-4222-9905-9116169d2203',\n};\n\nexport const isTestUser = ({\n userEmail,\n userId,\n}: {\n userEmail?: string | null;\n userId?: string | null;\n}) =>\n Boolean(\n (userId && Object.values(E2E_TEST_USERS).includes(userId)) ||\n (userEmail && Object.keys(E2E_TEST_USERS).includes(userEmail))\n );\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const isVrpMember: ({ email, userId, }: {
2
+ email?: string | null;
3
+ userId?: string | null;
4
+ }) => boolean;
@@ -0,0 +1,29 @@
1
+ const VRP_EMAIL_DOMAINS = ['@finalytic.co', '@vrplatform.app'];
2
+ const VRP_EMAILS = [
3
+ 'radek+vrp@setup.inc',
4
+ 'philipp@philipp-achenbach.de',
5
+ 'l.behrenberg@gmail.com',
6
+ 'l.behrenberg+secondary@gmail.com',
7
+ 'adam@ximplifi.com',
8
+ ];
9
+ const VRP_USER_IDS = [
10
+ '3267f329-26d9-471d-86c1-d4c2efab2951',
11
+ '735e1803-13f5-4a90-a02f-2498b3eefa03',
12
+ '1a2bd1ea-88b1-4217-935f-2a8d97c422f9',
13
+ '4b221539-d6cf-4d18-a015-1f3a99fc3c2d',
14
+ '5e9bdcc1-71ae-4e59-87a1-affbfc3ce603',
15
+ '2a40c6c5-c9a2-4d98-a70f-3c6f75bff3e2',
16
+ '31a87570-3917-4e4c-b237-af605ab0094b',
17
+ 'ec78e603-705c-4f1c-9b85-4dc5733c5b85',
18
+ '16b5bd68-8261-4192-a28a-13817b31fede',
19
+ '2e22dcba-73f0-4699-bc48-088209804fe2',
20
+ '840da880-9a3d-43e5-9e2e-d4c74429ed17',
21
+ '9ecc0316-e7dc-4c73-960d-01c2763fb8da',
22
+ '9f6008c7-4df5-4aec-997f-07ecd44a2f79',
23
+ '27dc0d2a-d11a-4fe1-a500-6e0e6350ad04',
24
+ ];
25
+ export const isVrpMember = ({ email, userId, }) => Boolean((email &&
26
+ (VRP_EMAILS.includes(email) ||
27
+ VRP_EMAIL_DOMAINS.some((domain) => email.endsWith(domain)))) ||
28
+ (userId && VRP_USER_IDS.includes(userId)));
29
+ //# sourceMappingURL=is-vrp-member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-vrp-member.js","sourceRoot":"src/","sources":["is-vrp-member.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AAC/D,MAAM,UAAU,GAAG;IACjB,qBAAqB;IACrB,8BAA8B;IAC9B,wBAAwB;IACxB,kCAAkC;IAClC,mBAAmB;CACpB,CAAC;AACF,MAAM,YAAY,GAAG;IACnB,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;IACtC,sCAAsC;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,MAAM,GAIP,EAAE,EAAE,CACH,OAAO,CACL,CAAC,KAAK;IACJ,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;QACzB,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC,MAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAC1C,CAAC","sourcesContent":["const VRP_EMAIL_DOMAINS = ['@finalytic.co', '@vrplatform.app'];\nconst VRP_EMAILS = [\n 'radek+vrp@setup.inc',\n 'philipp@philipp-achenbach.de',\n 'l.behrenberg@gmail.com',\n 'l.behrenberg+secondary@gmail.com',\n 'adam@ximplifi.com',\n];\nconst VRP_USER_IDS = [\n '3267f329-26d9-471d-86c1-d4c2efab2951',\n '735e1803-13f5-4a90-a02f-2498b3eefa03',\n '1a2bd1ea-88b1-4217-935f-2a8d97c422f9',\n '4b221539-d6cf-4d18-a015-1f3a99fc3c2d',\n '5e9bdcc1-71ae-4e59-87a1-affbfc3ce603',\n '2a40c6c5-c9a2-4d98-a70f-3c6f75bff3e2',\n '31a87570-3917-4e4c-b237-af605ab0094b',\n 'ec78e603-705c-4f1c-9b85-4dc5733c5b85',\n '16b5bd68-8261-4192-a28a-13817b31fede',\n '2e22dcba-73f0-4699-bc48-088209804fe2',\n '840da880-9a3d-43e5-9e2e-d4c74429ed17',\n '9ecc0316-e7dc-4c73-960d-01c2763fb8da',\n '9f6008c7-4df5-4aec-997f-07ecd44a2f79',\n '27dc0d2a-d11a-4fe1-a500-6e0e6350ad04',\n];\n\nexport const isVrpMember = ({\n email,\n userId,\n}: {\n email?: string | null;\n userId?: string | null;\n}) =>\n Boolean(\n (email &&\n (VRP_EMAILS.includes(email) ||\n VRP_EMAIL_DOMAINS.some((domain) => email.endsWith(domain)))) ||\n (userId && VRP_USER_IDS.includes(userId))\n );\n"]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copy of `request` for another URL with its body buffered. `new Request(url,
3
+ * request)` hands the source body over as a ReadableStream, which WebKit
4
+ * (every iOS browser) rejects with "ReadableStream uploading is not supported".
5
+ * The source body is consumed, so pass a clone when the original is still needed.
6
+ */
7
+ export declare function retargetRequest(request: Request, url: string | URL): Promise<Request<unknown, CfProperties<unknown>>>;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copy of `request` for another URL with its body buffered. `new Request(url,
3
+ * request)` hands the source body over as a ReadableStream, which WebKit
4
+ * (every iOS browser) rejects with "ReadableStream uploading is not supported".
5
+ * The source body is consumed, so pass a clone when the original is still needed.
6
+ */
7
+ export async function retargetRequest(request, url) {
8
+ return new Request(url.toString(), {
9
+ method: request.method,
10
+ headers: request.headers,
11
+ body: request.body ? await request.arrayBuffer() : null,
12
+ signal: request.signal,
13
+ credentials: request.credentials,
14
+ cache: request.cache,
15
+ redirect: request.redirect,
16
+ });
17
+ }
18
+ //# sourceMappingURL=retarget-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retarget-request.js","sourceRoot":"src/","sources":["retarget-request.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAgB,EAAE,GAAiB;IACvE,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;QACjC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI;QACvD,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * Copy of `request` for another URL with its body buffered. `new Request(url,\n * request)` hands the source body over as a ReadableStream, which WebKit\n * (every iOS browser) rejects with \"ReadableStream uploading is not supported\".\n * The source body is consumed, so pass a clone when the original is still needed.\n */\nexport async function retargetRequest(request: Request, url: string | URL) {\n return new Request(url.toString(), {\n method: request.method,\n headers: request.headers,\n body: request.body ? await request.arrayBuffer() : null,\n signal: request.signal,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n });\n}\n"]}
@@ -14,4 +14,11 @@ export declare function resolveTenantRouting({ connectionId, slug, tenantId, aut
14
14
  slug?: string;
15
15
  tenantId?: string;
16
16
  }): Promise<TenantRouting>;
17
+ /**
18
+ * Resolve a tenant's home region and return an API client configured for that
19
+ * regional API. The resolved tenant id is applied to every regional request.
20
+ */
21
+ export declare function useResolvedApiClient({ connectionId, slug, tenantId, auth, ...apiClientOptions }: Parameters<typeof resolveTenantRouting>[0]): Promise<import("openapi-fetch").Client<import(".").paths, `${string}/${string}`> & {
22
+ sessionId: string;
23
+ }>;
17
24
  export {};
@@ -34,4 +34,25 @@ export async function resolveTenantRouting({ connectionId, slug, tenantId, auth,
34
34
  apiBaseUrl: new URL(response.apiBaseUrl).toString().replace(/\/$/, ''),
35
35
  };
36
36
  }
37
+ /**
38
+ * Resolve a tenant's home region and return an API client configured for that
39
+ * regional API. The resolved tenant id is applied to every regional request.
40
+ */
41
+ export async function useResolvedApiClient({ connectionId, slug, tenantId, auth, ...apiClientOptions }) {
42
+ const routing = await resolveTenantRouting({
43
+ ...apiClientOptions,
44
+ connectionId,
45
+ slug,
46
+ tenantId,
47
+ auth,
48
+ });
49
+ return useApiClient({
50
+ ...apiClientOptions,
51
+ baseUrl: routing.apiBaseUrl,
52
+ auth: () => ({
53
+ ...(typeof auth === 'function' ? auth() : (auth ?? {})),
54
+ tenantId: routing.id,
55
+ }),
56
+ });
57
+ }
37
58
  //# sourceMappingURL=routing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routing.js","sourceRoot":"src/","sources":["routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUvC;;;;;;GAMG;AACH,MAAM,CAAC,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,YAAY,CAC3B,MAAM,YAAY,CAAC;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\n/**\n * Resolve a tenant's region and regional `apiBaseUrl` from a connection id,\n * slug, or tenant id — the client entry point for non-API runtimes that need\n * to reach a tenant's home region. Each call is a `/teams/resolve` round trip;\n * hot-loop callers should cache the result (placement changes only on an\n * explicit tenant migration).\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"]}
1
+ {"version":3,"file":"routing.js","sourceRoot":"src/","sources":["routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAUvC;;;;;;GAMG;AACH,MAAM,CAAC,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,YAAY,CAC3B,MAAM,YAAY,CAAC;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;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,GAAG,gBAAgB,EACwB;IAC3C,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC;QACzC,GAAG,gBAAgB;QACnB,YAAY;QACZ,IAAI;QACJ,QAAQ;QACR,IAAI;KACL,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;QAClB,GAAG,gBAAgB;QACnB,OAAO,EAAE,OAAO,CAAC,UAAU;QAC3B,IAAI,EAAE,GAAG,EAAE,CACT,CAAC;YACC,GAAG,CAAC,OAAO,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;YACvD,QAAQ,EAAE,OAAO,CAAC,EAAE;SACrB,CAAyB;KAC7B,CAAC,CAAC;AACL,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\n/**\n * Resolve a tenant's region and regional `apiBaseUrl` from a connection id,\n * slug, or tenant id — the client entry point for non-API runtimes that need\n * to reach a tenant's home region. Each call is a `/teams/resolve` round trip;\n * hot-loop callers should cache the result (placement changes only on an\n * explicit tenant migration).\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\n/**\n * Resolve a tenant's home region and return an API client configured for that\n * regional API. The resolved tenant id is applied to every regional request.\n */\nexport async function useResolvedApiClient({\n connectionId,\n slug,\n tenantId,\n auth,\n ...apiClientOptions\n}: Parameters<typeof resolveTenantRouting>[0]) {\n const routing = await resolveTenantRouting({\n ...apiClientOptions,\n connectionId,\n slug,\n tenantId,\n auth,\n });\n\n return useApiClient({\n ...apiClientOptions,\n baseUrl: routing.apiBaseUrl,\n auth: () =>\n ({\n ...(typeof auth === 'function' ? auth() : (auth ?? {})),\n tenantId: routing.id,\n }) satisfies ApiClientAuth,\n });\n}\n"]}
@@ -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"]}
@@ -0,0 +1,216 @@
1
+ import * as z from 'zod';
2
+ export declare const vrtPaginatedLookupPayloadSchema: z.ZodObject<{
3
+ data: z.ZodArray<z.ZodUnknown>;
4
+ pagination: z.ZodObject<{
5
+ limit: z.ZodNumber;
6
+ nextPage: z.ZodOptional<z.ZodNumber>;
7
+ page: z.ZodNumber;
8
+ total: z.ZodNumber;
9
+ totalPage: z.ZodNumber;
10
+ }, z.core.$strip>;
11
+ }, z.core.$strip>;
12
+ export declare const vrtPaginatedLookupOutputSchema: z.ZodObject<{
13
+ data: z.ZodArray<z.ZodUnknown>;
14
+ pagination: z.ZodObject<{
15
+ limit: z.ZodNumber;
16
+ nextPage: z.ZodOptional<z.ZodNumber>;
17
+ page: z.ZodNumber;
18
+ total: z.ZodNumber;
19
+ totalPage: z.ZodNumber;
20
+ }, z.core.$strip>;
21
+ schemaVersion: z.ZodLiteral<1>;
22
+ }, z.core.$strip>;
23
+ export declare const vrtListingsLookupSchema: z.ZodObject<{
24
+ activeOwnership: z.ZodOptional<z.ZodBoolean>;
25
+ includeChildren: z.ZodOptional<z.ZodBoolean>;
26
+ issue: z.ZodOptional<z.ZodEnum<{
27
+ all: "all";
28
+ any: "any";
29
+ missingFeesAndCommission: "missingFeesAndCommission";
30
+ missingOpeningBalance: "missingOpeningBalance";
31
+ missingOwnershipOrDeactivation: "missingOwnershipOrDeactivation";
32
+ }>>;
33
+ limit: z.ZodDefault<z.ZodNumber>;
34
+ page: z.ZodDefault<z.ZodNumber>;
35
+ parent: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"null">]>>;
36
+ search: z.ZodOptional<z.ZodString>;
37
+ status: z.ZodOptional<z.ZodEnum<{
38
+ active: "active";
39
+ inactive: "inactive";
40
+ }>>;
41
+ teamId: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>;
43
+ export declare const vrtReservationsLookupSchema: z.ZodObject<{
44
+ bookingChannel: z.ZodOptional<z.ZodString>;
45
+ date: z.ZodOptional<z.ZodString>;
46
+ dateField: z.ZodOptional<z.ZodEnum<{
47
+ bookedAt: "bookedAt";
48
+ cancelledAt: "cancelledAt";
49
+ checkIn: "checkIn";
50
+ checkOut: "checkOut";
51
+ intersection: "intersection";
52
+ payment: "payment";
53
+ }>>;
54
+ generalLedgerStatus: z.ZodOptional<z.ZodEnum<{
55
+ active: "active";
56
+ inactive: "inactive";
57
+ }>>;
58
+ ids: z.ZodOptional<z.ZodString>;
59
+ includeLines: z.ZodOptional<z.ZodBoolean>;
60
+ limit: z.ZodDefault<z.ZodNumber>;
61
+ listingId: z.ZodOptional<z.ZodString>;
62
+ page: z.ZodDefault<z.ZodNumber>;
63
+ paidStatus: z.ZodOptional<z.ZodEnum<{
64
+ "!overpaid": "!overpaid";
65
+ "!paid": "!paid";
66
+ "!underpaid": "!underpaid";
67
+ "!unpaid": "!unpaid";
68
+ overpaid: "overpaid";
69
+ paid: "paid";
70
+ underpaid: "underpaid";
71
+ unpaid: "unpaid";
72
+ }>>;
73
+ search: z.ZodOptional<z.ZodString>;
74
+ shortRefs: z.ZodOptional<z.ZodString>;
75
+ status: z.ZodOptional<z.ZodEnum<{
76
+ booked: "booked";
77
+ canceled: "canceled";
78
+ inactive: "inactive";
79
+ }>>;
80
+ teamId: z.ZodOptional<z.ZodString>;
81
+ }, z.core.$strip>;
82
+ export declare const vrtTransactionsLookupSchema: z.ZodObject<{
83
+ accountId: z.ZodOptional<z.ZodString>;
84
+ amount: z.ZodOptional<z.ZodString>;
85
+ contactId: z.ZodOptional<z.ZodString>;
86
+ dateRange: z.ZodOptional<z.ZodString>;
87
+ ids: z.ZodOptional<z.ZodString>;
88
+ includeLines: z.ZodOptional<z.ZodBoolean>;
89
+ limit: z.ZodDefault<z.ZodNumber>;
90
+ listingIds: z.ZodOptional<z.ZodString>;
91
+ page: z.ZodDefault<z.ZodNumber>;
92
+ paidAtRange: z.ZodOptional<z.ZodString>;
93
+ paidStatus: z.ZodOptional<z.ZodEnum<{
94
+ overpaid: "overpaid";
95
+ paid: "paid";
96
+ underpaid: "underpaid";
97
+ unpaid: "unpaid";
98
+ }>>;
99
+ reconciled: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"candidate">]>>;
100
+ search: z.ZodOptional<z.ZodString>;
101
+ shortRefs: z.ZodOptional<z.ZodString>;
102
+ status: z.ZodOptional<z.ZodEnum<{
103
+ active: "active";
104
+ inactive: "inactive";
105
+ }>>;
106
+ teamId: z.ZodOptional<z.ZodString>;
107
+ type: z.ZodOptional<z.ZodEnum<{
108
+ deposit: "deposit";
109
+ expense: "expense";
110
+ payout: "payout";
111
+ transfer: "transfer";
112
+ }>>;
113
+ uniqueRefs: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strip>;
115
+ export declare const vrtAccountsLookupSchema: z.ZodObject<{
116
+ bankingCategory: z.ZodOptional<z.ZodEnum<{
117
+ external: "external";
118
+ operating: "operating";
119
+ trust: "trust";
120
+ }>>;
121
+ classification: z.ZodOptional<z.ZodEnum<{
122
+ asset: "asset";
123
+ costOfRevenue: "costOfRevenue";
124
+ equity: "equity";
125
+ expense: "expense";
126
+ liability: "liability";
127
+ revenue: "revenue";
128
+ }>>;
129
+ limit: z.ZodDefault<z.ZodNumber>;
130
+ page: z.ZodDefault<z.ZodNumber>;
131
+ reconciled: z.ZodOptional<z.ZodBoolean>;
132
+ search: z.ZodOptional<z.ZodString>;
133
+ status: z.ZodOptional<z.ZodEnum<{
134
+ active: "active";
135
+ inactive: "inactive";
136
+ }>>;
137
+ teamId: z.ZodOptional<z.ZodString>;
138
+ type: z.ZodOptional<z.ZodEnum<{
139
+ bank: "bank";
140
+ ledger: "ledger";
141
+ nonPosting: "nonPosting";
142
+ recurringFee: "recurringFee";
143
+ }>>;
144
+ }, z.core.$strip>;
145
+ export declare const vrtStatementsLookupSchema: z.ZodObject<{
146
+ dateRange: z.ZodOptional<z.ZodString>;
147
+ isDateRangeEndInclusive: z.ZodOptional<z.ZodBoolean>;
148
+ limit: z.ZodDefault<z.ZodNumber>;
149
+ listingIds: z.ZodOptional<z.ZodString>;
150
+ month: z.ZodOptional<z.ZodString>;
151
+ ownerIds: z.ZodOptional<z.ZodString>;
152
+ page: z.ZodDefault<z.ZodNumber>;
153
+ periodIds: z.ZodOptional<z.ZodString>;
154
+ recurringFeeIds: z.ZodOptional<z.ZodString>;
155
+ search: z.ZodOptional<z.ZodString>;
156
+ statementIds: z.ZodOptional<z.ZodString>;
157
+ status: z.ZodOptional<z.ZodEnum<{
158
+ all: "all";
159
+ draft: "draft";
160
+ inReview: "inReview";
161
+ published: "published";
162
+ }>>;
163
+ teamId: z.ZodOptional<z.ZodString>;
164
+ year: z.ZodOptional<z.ZodNumber>;
165
+ }, z.core.$strip>;
166
+ export declare const vrtJournalEntriesLookupSchema: z.ZodObject<{
167
+ accountAssignmentTypes: z.ZodOptional<z.ZodString>;
168
+ accountIds: z.ZodOptional<z.ZodString>;
169
+ accountType: z.ZodOptional<z.ZodEnum<{
170
+ bank: "bank";
171
+ ledger: "ledger";
172
+ nonPosting: "nonPosting";
173
+ recurringFee: "recurringFee";
174
+ }>>;
175
+ amount: z.ZodOptional<z.ZodString>;
176
+ classifications: z.ZodOptional<z.ZodString>;
177
+ date: z.ZodOptional<z.ZodString>;
178
+ endAt: z.ZodOptional<z.ZodString>;
179
+ entityTypes: z.ZodOptional<z.ZodString>;
180
+ excludeTriggerTypes: z.ZodOptional<z.ZodString>;
181
+ excludeTypes: z.ZodOptional<z.ZodString>;
182
+ ids: z.ZodOptional<z.ZodString>;
183
+ includeDetails: z.ZodOptional<z.ZodBoolean>;
184
+ ledger: z.ZodOptional<z.ZodEnum<{
185
+ historical: "historical";
186
+ operating: "operating";
187
+ trust: "trust";
188
+ }>>;
189
+ limit: z.ZodDefault<z.ZodNumber>;
190
+ listingIds: z.ZodOptional<z.ZodString>;
191
+ ownerStatementIds: z.ZodOptional<z.ZodString>;
192
+ page: z.ZodDefault<z.ZodNumber>;
193
+ party: z.ZodOptional<z.ZodEnum<{
194
+ manager: "manager";
195
+ owners: "owners";
196
+ }>>;
197
+ published: z.ZodOptional<z.ZodBoolean>;
198
+ reservationIds: z.ZodOptional<z.ZodString>;
199
+ search: z.ZodOptional<z.ZodString>;
200
+ startAt: z.ZodOptional<z.ZodString>;
201
+ status: z.ZodOptional<z.ZodEnum<{
202
+ active: "active";
203
+ inactive: "inactive";
204
+ }>>;
205
+ teamId: z.ZodOptional<z.ZodString>;
206
+ transactionIds: z.ZodOptional<z.ZodString>;
207
+ triggerTypes: z.ZodOptional<z.ZodString>;
208
+ types: z.ZodOptional<z.ZodString>;
209
+ }, z.core.$strip>;
210
+ export type VrtListingsLookupInput = z.infer<typeof vrtListingsLookupSchema>;
211
+ export type VrtReservationsLookupInput = z.infer<typeof vrtReservationsLookupSchema>;
212
+ export type VrtTransactionsLookupInput = z.infer<typeof vrtTransactionsLookupSchema>;
213
+ export type VrtAccountsLookupInput = z.infer<typeof vrtAccountsLookupSchema>;
214
+ export type VrtStatementsLookupInput = z.infer<typeof vrtStatementsLookupSchema>;
215
+ export type VrtJournalEntriesLookupInput = z.infer<typeof vrtJournalEntriesLookupSchema>;
216
+ export type VrtPaginatedLookupOutput = z.infer<typeof vrtPaginatedLookupOutputSchema>;