@vrplatform/api 1.2.33-stage.943 → 1.2.34

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 (40) hide show
  1. package/build/main/client.d.ts +1 -1
  2. package/build/main/client.js +1 -1
  3. package/build/main/client.js.map +1 -1
  4. package/build/main/error.js +1 -1
  5. package/build/main/error.js.map +1 -1
  6. package/build/main/generated/v1.d.ts +745 -657
  7. package/build/main/generated/v1.js.map +1 -1
  8. package/build/main/index.d.ts +4 -4
  9. package/build/main/index.js +0 -1
  10. package/build/main/index.js.map +1 -1
  11. package/build/main/ingest/index.d.ts +0 -1
  12. package/build/main/ingest/index.js.map +1 -1
  13. package/build/main/ingest/types.d.ts +1 -1
  14. package/build/main/ingest/types.js.map +1 -1
  15. package/build/main/tsconfig.main.tsbuildinfo +1 -1
  16. package/build/module/client.d.ts +1 -1
  17. package/build/module/client.js +1 -1
  18. package/build/module/client.js.map +1 -1
  19. package/build/module/error.js +1 -1
  20. package/build/module/error.js.map +1 -1
  21. package/build/module/generated/v1.d.ts +745 -657
  22. package/build/module/generated/v1.js.map +1 -1
  23. package/build/module/index.d.ts +4 -4
  24. package/build/module/index.js +0 -1
  25. package/build/module/index.js.map +1 -1
  26. package/build/module/ingest/index.d.ts +0 -1
  27. package/build/module/ingest/index.js.map +1 -1
  28. package/build/module/ingest/types.d.ts +1 -1
  29. package/build/module/ingest/types.js.map +1 -1
  30. package/build/module/tsconfig.esm.tsbuildinfo +1 -1
  31. package/package.json +8 -6
  32. package/src/client.ts +4 -1
  33. package/src/error.ts +1 -1
  34. package/src/generated/v1.ts +745 -657
  35. package/src/index.ts +5 -10
  36. package/src/ingest/index.ts +0 -2
  37. package/src/ingest/types.ts +1 -1
  38. package/src/ingest-compat/index.ts +0 -98
  39. package/src/ingest-compat/map.ts +0 -111
  40. package/src/ingest-compat/types.ts +0 -9
@@ -1,9 +1,9 @@
1
+ import type { useIngest } from './ingest';
2
+ import type { ApiClient } from './types';
1
3
  export * from './client';
2
4
  export * from './error';
3
5
  export * from './generated/v1';
4
6
  export * from './ingest';
5
- export * from './ingest-compat';
6
7
  export * from './types';
7
- export type ApiIngest = ReturnType<typeof import('./ingest').useIngest>;
8
- export type ApiIngestCompat = ReturnType<typeof import('./ingest-compat').useIngestCompat>;
9
- export type VRPlatformApi = import('./types').ApiClient;
8
+ export type ApiIngest = ReturnType<typeof useIngest>;
9
+ export type VRPlatformApi = ApiClient;
@@ -2,6 +2,5 @@ export * from './client';
2
2
  export * from './error';
3
3
  export * from './generated/v1';
4
4
  export * from './ingest';
5
- export * from './ingest-compat';
6
5
  export * from './types';
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC","sourcesContent":["export * from './client';\nexport * from './error';\nexport * from './generated/v1';\nexport * from './ingest';\nexport * from './ingest-compat';\nexport * from './types';\n\nexport type ApiIngest = ReturnType<typeof import('./ingest').useIngest>;\nexport type ApiIngestCompat = ReturnType<\n typeof import('./ingest-compat').useIngestCompat\n>;\nexport type VRPlatformApi = import('./types').ApiClient;\n\ntype _EnsureApiIngest = ApiIngest;\ntype _EnsureApiIngestCompat = ApiIngestCompat;\ntype _EnsureVRPlatformApi = VRPlatformApi;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAGA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC","sourcesContent":["import type { useIngest } from './ingest';\nimport type { ApiClient } from './types';\n\nexport * from './client';\nexport * from './error';\nexport * from './generated/v1';\nexport * from './ingest';\nexport * from './types';\n\nexport type ApiIngest = ReturnType<typeof useIngest>;\nexport type VRPlatformApi = ApiClient;\n"]}
@@ -1,6 +1,5 @@
1
1
  import type { ApiClient, RequestBody } from '../types';
2
2
  import type * as t from './types';
3
- export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
4
3
  export * from './types';
5
4
  export declare function usePostSources(api: ApiClient, config: t.IngestArg): <T = undefined>(data: RequestBody<"post:/sources/batch">["data"], configOverwrites?: t.IngestFnArg) => Promise<t.TypedResponseData<T>[]>;
6
5
  export declare function useIngest(api: ApiClient, config: t.IngestArg): {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"src/","sources":["ingest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAMxC,cAAc,SAAS,CAAC;AAExB,SAAS,WAAW,CAClB,IAAS,EACT,MAAmB,EACnB,gBAAgC;IAEhC,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,IAAI,gBAAgB,EAAE,CAAC;QACrB,MAAM,EAAE,aAAa,EAAE,GAAG,cAAc,EAAE,GAAG,gBAAgB,CAAC;QAC9D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;YACvD,IAAI,KAAK;gBAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC/B,IAAI,aAAa;YAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,aAAa,CAAC;IACjE,CAAC;IACD,IAAI,MAAM,CAAC,SAAS;QAAE,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;IAEjE,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAc,EAAE,MAAmB;IAChE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,M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,IAAI,QAAQ;oBACjC,SAAS,EAAE;wBACT,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE,aAAa;qBACpB;iBACF,CAAC;YACJ,CAAC,CAAC,EACF,gBAAgB,CACjB,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,QAAQ,CACZ,OAA+B,EAC/B,gBAAgC;YAEhC,IAAI,CAAC,OAAO,CAAC,MAAM;gBAAE,OAAO,SAAS,CAAC;YACtC,OAAO,MAAM,IAAI,CACf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE;gBACvC,OAAO;oBACL,GAAG,MAAM;oBACT,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,SAAS;oBAC9B,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI;oBACjD,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,KAAM;oBAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,QAAQ;oBACjC,SAAS,EAAE;wBACT,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE,SAAS;qBAChB;iBACF,CAAC;YACJ,CAAC,CAAC,EACF,gBAAgB,CACjB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { throwIfError } from '../error';\nimport type { ApiClient, RequestBody } from '../types';\nimport type * as t from './types';\n\nexport type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport * from './types';\n\nfunction mergeConfig(\n body: any,\n config: t.IngestArg,\n configOverwrites?: t.IngestFnArg\n) {\n const headers: Record<string, string> = {};\n if (configOverwrites) {\n const { correlationId, ...restOverwrites } = configOverwrites;\n for (const [key, value] of Object.entries(restOverwrites))\n if (value) body[key] = value;\n if (correlationId) headers['X-Correlation-Id'] = correlationId;\n }\n if (config.sessionId) headers['X-Session-Id'] = config.sessionId;\n\n return headers;\n}\n\nexport function usePostSources(api: ApiClient, config: t.IngestArg) {\n const { sessionId: _, ...restConfig } = config;\n async function post<T = undefined>(\n data: RequestBody<'post:/sources/batch'>['data'],\n configOverwrites?: t.IngestFnArg\n ): Promise<t.TypedResponseData<T>[]> {\n const body: RequestBody<'post:/sources/batch'> = {\n ...restConfig,\n data,\n };\n const headers = mergeConfig(body, config, configOverwrites);\n const response = throwIfError(\n await api.POST('/sources/batch', { body, headers })\n );\n return response.data as any;\n }\n return post;\n}\n\nexport function useIngest(api: ApiClient, config: t.IngestArg) {\n const post = usePostSources(api, config);\n return {\n api,\n get sessionId() {\n return api.sessionId;\n },\n async sources(\n changes: t.IngestSourceInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post(changes, configOverwrites);\n },\n async updateSources(\n data: RequestBody<'put:/sources/batch'>['data'],\n configOverwrites?: t.IngestFnArg\n ) {\n const { sessionId: _, ...restConfig } = config;\n const body: RequestBody<'put:/sources/batch'> = {\n ...restConfig,\n data,\n };\n const headers = mergeConfig(body, config, configOverwrites);\n const response = throwIfError(\n await api.PUT('/sources/batch', { body, headers })\n );\n return response.data;\n },\n async reservations(\n changes: t.IngestReservationInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return [];\n return await post<t.ReservationParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'reservation',\n description: source.description || transform.confirmationCode,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n date: source.date || transform.bookedAt,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'reservation',\n },\n };\n }),\n configOverwrites\n );\n },\n async payments(\n changes: t.IngestPaymentInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.PaymentParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'payment',\n description: source.description || transform.description,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n date: source.date || transform.paidAt,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'payment',\n },\n };\n }),\n configOverwrites\n );\n },\n async listings(\n changes: t.IngestListingInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.ListingParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'listing',\n description: source.description || transform.name,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'listing',\n },\n };\n }),\n configOverwrites\n );\n },\n async cleanup(\n type: string | 'listing',\n configOverwrites?: t.IngestFnArg & {\n whereRange?: RequestBody<'put:/sources/cleanup'>['whereRange'];\n }\n ) {\n const body: RequestBody<'put:/sources/cleanup'> = {\n syncId: configOverwrites?.syncId || config.syncId,\n connectionId: configOverwrites?.connectionId || config.connectionId,\n type,\n };\n if (configOverwrites?.whereRange) {\n body.whereRange = configOverwrites.whereRange;\n }\n const headers = mergeConfig(body, config, configOverwrites);\n const response = throwIfError(\n await api.PUT('/sources/cleanup', { body, headers })\n );\n return response.ok as any;\n },\n async bankRecords(\n changes: t.IngestBankRecordInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.BankRecordParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'bankRecord',\n description: source.description || transform.description,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'bankRecord',\n },\n };\n }),\n configOverwrites\n );\n },\n async transactions(\n changes: t.IngestTransactionInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.TransactionParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'transaction',\n description: source.description || transform.description,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'transaction',\n },\n };\n }),\n configOverwrites\n );\n },\n async contacts(\n changes: t.IngestContactInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.ContactParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'contact',\n description: source.description || transform.name,\n uniqueRef: source.uniqueRef || transform.email!,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'contact',\n },\n };\n }),\n configOverwrites\n );\n },\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"src/","sources":["ingest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,cAAc,SAAS,CAAC;AAExB,SAAS,WAAW,CAClB,IAAS,EACT,MAAmB,EACnB,gBAAgC;IAEhC,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,IAAI,gBAAgB,EAAE,CAAC;QACrB,MAAM,EAAE,aAAa,EAAE,GAAG,cAAc,EAAE,GAAG,gBAAgB,CAAC;QAC9D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;YACvD,IAAI,KAAK;gBAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC/B,IAAI,aAAa;YAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,aAAa,CAAC;IACjE,CAAC;IACD,IAAI,MAAM,CAAC,SAAS;QAAE,OAAO,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;IAEjE,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,GAAc,EAAE,MAAmB;IAChE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,MAAM,CAAC;IAC/C,KAAK,UAAU,IAAI,CACjB,IAAgD,EAChD,gBAAgC;QAEhC,MAAM,IAAI,GAAuC;YAC/C,GAAG,UAAU;YACb,IAAI;SACL,CAAC;QACF,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE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A+B,EAC/B,gBAAgC;YAEhC,IAAI,CAAC,OAAO,CAAC,MAAM;gBAAE,OAAO,SAAS,CAAC;YACtC,OAAO,MAAM,IAAI,CACf,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,EAAE,EAAE;gBACvC,OAAO;oBACL,GAAG,MAAM;oBACT,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,SAAS;oBAC9B,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI;oBACjD,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,KAAM;oBAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,QAAQ;oBACjC,SAAS,EAAE;wBACT,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE,SAAS;qBAChB;iBACF,CAAC;YACJ,CAAC,CAAC,EACF,gBAAgB,CACjB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { throwIfError } from '../error';\nimport type { ApiClient, RequestBody } from '../types';\nimport type * as t from './types';\n\nexport * from './types';\n\nfunction mergeConfig(\n body: any,\n config: t.IngestArg,\n configOverwrites?: t.IngestFnArg\n) {\n const headers: Record<string, string> = {};\n if (configOverwrites) {\n const { correlationId, ...restOverwrites } = configOverwrites;\n for (const [key, value] of Object.entries(restOverwrites))\n if (value) body[key] = value;\n if (correlationId) headers['X-Correlation-Id'] = correlationId;\n }\n if (config.sessionId) headers['X-Session-Id'] = config.sessionId;\n\n return headers;\n}\n\nexport function usePostSources(api: ApiClient, config: t.IngestArg) {\n const { sessionId: _, ...restConfig } = config;\n async function post<T = undefined>(\n data: RequestBody<'post:/sources/batch'>['data'],\n configOverwrites?: t.IngestFnArg\n ): Promise<t.TypedResponseData<T>[]> {\n const body: RequestBody<'post:/sources/batch'> = {\n ...restConfig,\n data,\n };\n const headers = mergeConfig(body, config, configOverwrites);\n const response = throwIfError(\n await api.POST('/sources/batch', { body, headers })\n );\n return response.data as any;\n }\n return post;\n}\n\nexport function useIngest(api: ApiClient, config: t.IngestArg) {\n const post = usePostSources(api, config);\n return {\n api,\n get sessionId() {\n return api.sessionId;\n },\n async sources(\n changes: t.IngestSourceInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post(changes, configOverwrites);\n },\n async updateSources(\n data: RequestBody<'put:/sources/batch'>['data'],\n configOverwrites?: t.IngestFnArg\n ) {\n const { sessionId: _, ...restConfig } = config;\n const body: RequestBody<'put:/sources/batch'> = {\n ...restConfig,\n data,\n };\n const headers = mergeConfig(body, config, configOverwrites);\n const response = throwIfError(\n await api.PUT('/sources/batch', { body, headers })\n );\n return response.data;\n },\n async reservations(\n changes: t.IngestReservationInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return [];\n return await post<t.ReservationParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'reservation',\n description: source.description || transform.confirmationCode,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n date: source.date || transform.bookedAt,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'reservation',\n },\n };\n }),\n configOverwrites\n );\n },\n async payments(\n changes: t.IngestPaymentInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.PaymentParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'payment',\n description: source.description || transform.description,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n date: source.date || transform.paidAt,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'payment',\n },\n };\n }),\n configOverwrites\n );\n },\n async listings(\n changes: t.IngestListingInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.ListingParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'listing',\n description: source.description || transform.name,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'listing',\n },\n };\n }),\n configOverwrites\n );\n },\n async cleanup(\n type: string | 'listing',\n configOverwrites?: t.IngestFnArg & {\n whereRange?: RequestBody<'put:/sources/cleanup'>['whereRange'];\n }\n ) {\n const body: RequestBody<'put:/sources/cleanup'> = {\n syncId: configOverwrites?.syncId || config.syncId,\n connectionId: configOverwrites?.connectionId || config.connectionId,\n type,\n };\n if (configOverwrites?.whereRange) {\n body.whereRange = configOverwrites.whereRange;\n }\n const headers = mergeConfig(body, config, configOverwrites);\n const response = throwIfError(\n await api.PUT('/sources/cleanup', { body, headers })\n );\n return response.ok as any;\n },\n async bankRecords(\n changes: t.IngestBankRecordInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.BankRecordParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'bankRecord',\n description: source.description || transform.description,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'bankRecord',\n },\n };\n }),\n configOverwrites\n );\n },\n async transactions(\n changes: t.IngestTransactionInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.TransactionParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'transaction',\n description: source.description || transform.description,\n uniqueRef: source.uniqueRef || transform.uniqueRef!,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'transaction',\n },\n };\n }),\n configOverwrites\n );\n },\n async contacts(\n changes: t.IngestContactInput[],\n configOverwrites?: t.IngestFnArg\n ) {\n if (!changes.length) return undefined;\n return await post<t.ContactParam>(\n changes.map(({ source, ...transform }) => {\n return {\n ...source,\n type: source.type || 'contact',\n description: source.description || transform.name,\n uniqueRef: source.uniqueRef || transform.email!,\n status: source.status || 'active',\n transform: {\n data: transform,\n type: 'contact',\n },\n };\n }),\n configOverwrites\n );\n },\n };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { PartialBy } from '@finalytic/utils';
1
+ import type { PartialBy } from '@vrplatform/utils';
2
2
  import type { RequestBody, ResponseData } from '../types';
3
3
  export type ReservationParam = Omit<RequestBody<'post:/reservations/batch'>['data'][0], 'sourceId'>;
4
4
  export type PaymentParam = Omit<RequestBody<'post:/payments/batch'>['data'][0], 'sourceId'>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"src/","sources":["ingest/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PartialBy } from '@finalytic/utils';\nimport type { RequestBody, ResponseData } from '../types';\n\nexport type ReservationParam = Omit<\n RequestBody<'post:/reservations/batch'>['data'][0],\n 'sourceId'\n>;\nexport type PaymentParam = Omit<\n RequestBody<'post:/payments/batch'>['data'][0],\n 'sourceId'\n>;\nexport type ListingParam = Omit<\n RequestBody<'post:/listings/batch'>['data'][0],\n 'sourceId'\n>;\nexport type BankRecordParam = Omit<\n RequestBody<'post:/bank-records/batch'>['data'][0],\n 'sourceId'\n>;\nexport type TransactionParam = Omit<\n RequestBody<'post:/transactions/batch'>['data'][0],\n 'sourceId'\n>;\nexport type ContactParam = Omit<\n RequestBody<'post:/contacts/batch'>['data'][0],\n 'sourceId'\n>;\ntype _SourceWithoutTransform = Omit<\n RequestBody<'post:/sources/batch'>['data'][number],\n 'transform'\n> & {\n // this is ONLY for ecosystem ingestion, can be removed once ecosystem does not rely on ingest, but calls batch endpoints\n fileStorageId?: string;\n};\ntype _SourceWithTransform<T> = _SourceWithoutTransform & {\n transform: { type: string; data: T };\n};\nexport type Source<T = undefined> = T extends undefined\n ? _SourceWithoutTransform\n : _SourceWithTransform<T>;\n\nexport type IngestArg = Omit<RequestBody<'post:/sources/batch'>, 'data'> & {\n sessionId?: string;\n tenantId: string;\n};\nexport type IngestFnArg = Omit<Partial<IngestArg>, 'sessionId'> & {\n correlationId?: string;\n};\n\nexport type BatchResponseData = ResponseData<'post:/sources/batch'>['data'][0];\nexport type TypedResponseData<T = undefined> = Omit<\n BatchResponseData,\n 'transform'\n> &\n (T extends undefined\n ? { transform?: never }\n : {\n transform: Omit<BatchResponseData['transform'], 'data'> & {\n data: T;\n };\n });\n\nexport type Impossible<K extends keyof any> = {\n [P in K]: never;\n};\nexport type NoExtraProperties<T, U extends T = T> = U &\n Impossible<Exclude<keyof U, keyof T>>;\n\nexport type ObjectWithSource<T = undefined> = T & {\n source: PartialBy<_SourceWithoutTransform, 'type'>;\n};\n\nexport type IngestReservationInput = NoExtraProperties<\n ObjectWithSource<ReservationParam>\n>;\nexport type IngestPaymentInput = NoExtraProperties<\n ObjectWithSource<PaymentParam>\n>;\nexport type IngestListingInput = NoExtraProperties<\n ObjectWithSource<ListingParam>\n>;\nexport type IngestBankRecordInput = NoExtraProperties<\n ObjectWithSource<BankRecordParam>\n>;\nexport type IngestTransactionInput = NoExtraProperties<\n ObjectWithSource<TransactionParam>\n>;\nexport type IngestContactInput = NoExtraProperties<\n ObjectWithSource<ContactParam>\n>;\nexport type IngestSourceInput = NoExtraProperties<Source>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"src/","sources":["ingest/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { PartialBy } from '@vrplatform/utils';\nimport type { RequestBody, ResponseData } from '../types';\n\nexport type ReservationParam = Omit<\n RequestBody<'post:/reservations/batch'>['data'][0],\n 'sourceId'\n>;\nexport type PaymentParam = Omit<\n RequestBody<'post:/payments/batch'>['data'][0],\n 'sourceId'\n>;\nexport type ListingParam = Omit<\n RequestBody<'post:/listings/batch'>['data'][0],\n 'sourceId'\n>;\nexport type BankRecordParam = Omit<\n RequestBody<'post:/bank-records/batch'>['data'][0],\n 'sourceId'\n>;\nexport type TransactionParam = Omit<\n RequestBody<'post:/transactions/batch'>['data'][0],\n 'sourceId'\n>;\nexport type ContactParam = Omit<\n RequestBody<'post:/contacts/batch'>['data'][0],\n 'sourceId'\n>;\ntype _SourceWithoutTransform = Omit<\n RequestBody<'post:/sources/batch'>['data'][number],\n 'transform'\n> & {\n // this is ONLY for ecosystem ingestion, can be removed once ecosystem does not rely on ingest, but calls batch endpoints\n fileStorageId?: string;\n};\ntype _SourceWithTransform<T> = _SourceWithoutTransform & {\n transform: { type: string; data: T };\n};\nexport type Source<T = undefined> = T extends undefined\n ? _SourceWithoutTransform\n : _SourceWithTransform<T>;\n\nexport type IngestArg = Omit<RequestBody<'post:/sources/batch'>, 'data'> & {\n sessionId?: string;\n tenantId: string;\n};\nexport type IngestFnArg = Omit<Partial<IngestArg>, 'sessionId'> & {\n correlationId?: string;\n};\n\nexport type BatchResponseData = ResponseData<'post:/sources/batch'>['data'][0];\nexport type TypedResponseData<T = undefined> = Omit<\n BatchResponseData,\n 'transform'\n> &\n (T extends undefined\n ? { transform?: never }\n : {\n transform: Omit<BatchResponseData['transform'], 'data'> & {\n data: T;\n };\n });\n\nexport type Impossible<K extends keyof any> = {\n [P in K]: never;\n};\nexport type NoExtraProperties<T, U extends T = T> = U &\n Impossible<Exclude<keyof U, keyof T>>;\n\nexport type ObjectWithSource<T = undefined> = T & {\n source: PartialBy<_SourceWithoutTransform, 'type'>;\n};\n\nexport type IngestReservationInput = NoExtraProperties<\n ObjectWithSource<ReservationParam>\n>;\nexport type IngestPaymentInput = NoExtraProperties<\n ObjectWithSource<PaymentParam>\n>;\nexport type IngestListingInput = NoExtraProperties<\n ObjectWithSource<ListingParam>\n>;\nexport type IngestBankRecordInput = NoExtraProperties<\n ObjectWithSource<BankRecordParam>\n>;\nexport type IngestTransactionInput = NoExtraProperties<\n ObjectWithSource<TransactionParam>\n>;\nexport type IngestContactInput = NoExtraProperties<\n ObjectWithSource<ContactParam>\n>;\nexport type IngestSourceInput = NoExtraProperties<Source>;\n"]}
@@ -1 +1 @@
1
- {"root":["../../src/cache.ts","../../src/client.ts","../../src/error.ts","../../src/index.ts","../../src/sec.ts","../../src/types.ts","../../src/generated/openapi-fetch.ts","../../src/generated/v1.ts","../../src/ingest/index.ts","../../src/ingest/types.ts","../../src/ingest-compat/index.ts","../../src/ingest-compat/map.ts","../../src/ingest-compat/types.ts"],"version":"5.9.3"}
1
+ {"root":["../../src/cache.ts","../../src/client.ts","../../src/error.ts","../../src/index.ts","../../src/sec.ts","../../src/types.ts","../../src/generated/openapi-fetch.ts","../../src/generated/v1.ts","../../src/ingest/index.ts","../../src/ingest/types.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.2.33-stage.943",
6
+ "version": "1.2.34",
7
7
  "description": "",
8
8
  "main": "build/main/index.js",
9
9
  "module": "build/module/index.js",
@@ -15,11 +15,13 @@
15
15
  "openapi-typescript-helpers": "^0.0.15"
16
16
  },
17
17
  "peerDependencies": {
18
- "@finalytic/utils": "^4.9.45",
18
+ "@vrplatform/utils": "^4.9.45",
19
19
  "@sentry/core": "*"
20
20
  },
21
21
  "devDependencies": {
22
- "@vrplatform/kysely": "*"
22
+ "@vrplatform/kysely": "*",
23
+ "@vrplatform/repository": "*",
24
+ "@vrplatform/common": "*"
23
25
  },
24
26
  "files": [
25
27
  "build/main",
@@ -31,14 +33,14 @@
31
33
  "scripts": {
32
34
  "pub": "bunx bumpp --no-commit --no-git-check --no-verify --ignore-scripts --no-tag -p=false",
33
35
  "npmpub": "bun run build && bunx vrp-deploy --prefix npmpub",
34
- "npmpub:main": "pnpm publish --no-git-checks --tag staging",
35
- "npmpub:release": "pnpm publish --no-git-checks",
36
+ "npmpub:staging": "pnpm publish --no-git-checks --tag staging",
37
+ "npmpub:main": "pnpm publish --no-git-checks",
36
38
  "build": "bun run generate && bun build:main && bun build:module",
37
39
  "build:main": "tsc -b tsconfig.main.json",
38
40
  "build:module": "tsc -b tsconfig.esm.json",
39
41
  "dev": "NODE_ENV=generator bun --watch ./generate.ts",
40
42
  "generate": "bun generate:schema && bun generate:client",
41
- "generate:schema": "bun run --cwd ../../api build",
43
+ "generate:schema": "bun run --cwd ../../api generate",
42
44
  "generate:client": "bunx --bun openapi-typescript ../../api/openapi.json -o ./src/generated/v1.ts",
43
45
  "typecheck": "tsc --noEmit",
44
46
  "tsgo": "tsgo --noEmit"
package/src/client.ts CHANGED
@@ -1,5 +1,8 @@
1
- import { type RetryableFetchParams, useRetryableFetch } from '@finalytic/utils';
2
1
  import * as Sentry from '@sentry/core';
2
+ import {
3
+ type RetryableFetchParams,
4
+ useRetryableFetch,
5
+ } from '@vrplatform/utils';
3
6
  import createClient from 'openapi-fetch';
4
7
  import { useCache } from './cache';
5
8
  import type { paths } from './generated/v1';
package/src/error.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { hasValue } from '@finalytic/utils';
1
+ import { hasValue } from '@vrplatform/utils';
2
2
  import type { FetchResponse } from './generated/openapi-fetch';
3
3
 
4
4
  type E = {