@bisondesk/core-sdk 1.0.319 → 1.0.321

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 (48) hide show
  1. package/lib/apis/crm.d.ts +5 -0
  2. package/lib/apis/crm.d.ts.map +1 -1
  3. package/lib/apis/crm.js +20 -0
  4. package/lib/apis/crm.js.map +1 -1
  5. package/lib/apis/opportunities.d.ts +1 -0
  6. package/lib/apis/opportunities.d.ts.map +1 -1
  7. package/lib/apis/opportunities.js +9 -0
  8. package/lib/apis/opportunities.js.map +1 -1
  9. package/lib/apis/picklists.d.ts +2 -1
  10. package/lib/apis/picklists.d.ts.map +1 -1
  11. package/lib/apis/picklists.js +16 -0
  12. package/lib/apis/picklists.js.map +1 -1
  13. package/lib/constants.d.ts +2 -0
  14. package/lib/constants.d.ts.map +1 -1
  15. package/lib/constants.js +2 -0
  16. package/lib/constants.js.map +1 -1
  17. package/lib/types/crm.d.ts +3 -2
  18. package/lib/types/crm.d.ts.map +1 -1
  19. package/lib/types/crm.js.map +1 -1
  20. package/lib/types/internet-opportunities.d.ts +2 -1
  21. package/lib/types/internet-opportunities.d.ts.map +1 -1
  22. package/lib/types/internet-opportunities.js.map +1 -1
  23. package/lib/types/leasing-administration.d.ts +1 -0
  24. package/lib/types/leasing-administration.d.ts.map +1 -1
  25. package/lib/types/leasing-administration.js.map +1 -1
  26. package/lib/types/picklists.d.ts +6 -0
  27. package/lib/types/picklists.d.ts.map +1 -1
  28. package/lib/types/picklists.js.map +1 -1
  29. package/lib/types/search.d.ts +16 -3
  30. package/lib/types/search.d.ts.map +1 -1
  31. package/lib/types/search.js.map +1 -1
  32. package/lib/utils/search.d.ts +33 -0
  33. package/lib/utils/search.d.ts.map +1 -0
  34. package/lib/utils/search.js +64 -0
  35. package/lib/utils/search.js.map +1 -0
  36. package/package.json +1 -1
  37. package/src/apis/crm.ts +30 -0
  38. package/src/apis/opportunities.ts +13 -0
  39. package/src/apis/picklists.ts +23 -0
  40. package/src/constants.ts +2 -0
  41. package/src/types/crm.ts +5 -2
  42. package/src/types/internet-opportunities.ts +2 -1
  43. package/src/types/leasing-administration.ts +2 -1
  44. package/src/types/picklists.ts +7 -0
  45. package/src/types/search.ts +17 -3
  46. package/src/utils/search.ts +130 -0
  47. package/tsconfig.deploy.tsbuildinfo +1 -1
  48. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"leasing-administration.d.ts","sourceRoot":"/","sources":["types/leasing-administration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,YAAY,GAAG,OAAO,CAAC;AAE1E,MAAM,MAAM,0BAA0B,GAAG;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,OAAO;CAAE,CAAC;AACvE,MAAM,MAAM,6BAA6B,GAAG;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,eAAe;CAAE,CAAC;AAElF,MAAM,MAAM,uBAAuB,CACjC,CAAC,SAAS,0BAA0B,GAAG,EAAE,EACzC,CAAC,SAAS,6BAA6B,GAAG,EAAE,IAC1C,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD,MAAM,MAAM,kBAAkB,CAC5B,CAAC,SAAS,0BAA0B,GAAG,EAAE,EACzC,CAAC,SAAS,6BAA6B,GAAG,EAAE,IAC1C;IACF,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,EAAE,wBAAwB,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC;IACf,QAAQ,EAAE,CAAC,CAAC;IACZ,SAA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KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;QACnB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;KACrB;CACF,CAAC;AAEF,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI;IACpB,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;CACxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"leasing-administration.js","sourceRoot":"/","sources":["types/leasing-administration.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from '@bisondesk/commons-sdk/types';\nimport { LeasingAdminUploadHandlers } from '../constants.js';\n\nexport type LeasingAdminUploadStatus = 'success' | 'processing' | 'error';\n\nexport type LeasingAdminUploadMetadata = { [key in string]?: unknown };\nexport type LeasingAdminUploadAttachments = { [key in string]?: AttachmentValue };\n\nexport type LeasingAdminUploadEvent<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = LeasingAdminUpload<M, A> & { tenantId: string };\n\nexport type LeasingAdminUpload<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = {\n id: string;\n updatedAt: string;\n createdAt: string;\n createdBy: string;\n\n status: LeasingAdminUploadStatus;\n attachments: A;\n metadata: M;\n handlerId: LeasingAdminUploadHandlers;\n};\n\nexport type NewLeasingAdminUploadRequest<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = {\n attachments: A;\n metadata: M;\n handlerId: LeasingAdminUploadHandlers;\n};\n\nexport type DhondtAttachments = {\n json: AttachmentValue;\n};\n\nexport type BelfiusAttachments = {\n xlsx: AttachmentValue;\n json?: AttachmentValue; // json version of the xlsx file\n};\n\nexport type BelfiusMetadata = {\n totalLines: number;\n totalIncludingVat: string;\n};\n\nexport type DhondtMetadata = {\n invoiceNumber: string;\n invoiceDate: string;\n};\n\nexport type DhondtInvoiceLine = {\n BrutoPremie: number;\n Chassisnummer: string;\n Datum: string;\n NettoPremie: number;\n Plaatnummer: string;\n Taksen: number;\n VoertuigVlootNummer: string | undefined;\n};\n\nexport type INGMetadata = {\n capital: string;\n emailId?: string;\n interest: string;\n invoiceDate: string;\n invoiceNumber: string;\n pdfUrl: string;\n stockNumber: string;\n yearlyFee?: string;\n};\n\nexport type INGAttachments = {\n email?: AttachmentValue; // like the emailId, can be missing if the invoices are uploaded manually\n};\n\nexport type DiffableDhondtInvoiceLine = DhondtInvoiceLine;\n\nexport type BelfiusRawInvoiceLine = {\n 'Additional info': string;\n Amortization: number;\n 'Amount including tax': number;\n Avenant: number;\n Contract: number;\n Currency: string;\n Customer: string;\n Description: string;\n 'Due date': Date;\n 'Interest Amount': number;\n 'Invoice Date': Date;\n 'Invoice Number': number;\n 'Rent amount': number;\n 'VAT amount': number;\n 'VAT number': string;\n 'VAT rate': number;\n};\n\nexport type BelfiusInvoiceLine = {\n capital: string;\n contractNr: string;\n interest: string;\n invoiceNr: string;\n invoiceDate: string;\n rentExcl: string;\n rentIncl: string;\n vatAmount: string;\n vehicleId: string;\n stockNumber: string;\n};\n\nexport type DiffableBelfiusInvoiceLine = Omit<\n BelfiusInvoiceLine,\n 'invoiceNr' | 'invoiceDate' | 'capital' | 'interest'\n>;\n\nexport type LineDiff<T> = {\n [Property in keyof T]: {\n value: T[Property];\n before: T[Property];\n };\n};\n\nexport type Diff<T> = {\n added: T[];\n removed: T[];\n changed: LineDiff<T>[];\n};\n"]}
1
+ {"version":3,"file":"leasing-administration.js","sourceRoot":"/","sources":["types/leasing-administration.ts"],"names":[],"mappings":"","sourcesContent":["import { AttachmentValue } from '@bisondesk/commons-sdk/types';\nimport { LeasingAdminUploadHandlers } from '../constants.js';\n\nexport type LeasingAdminUploadStatus = 'success' | 'processing' | 'error';\n\nexport type LeasingAdminUploadMetadata = { [key in string]?: unknown };\nexport type LeasingAdminUploadAttachments = { [key in string]?: AttachmentValue };\n\nexport type LeasingAdminUploadEvent<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = LeasingAdminUpload<M, A> & { tenantId: string };\n\nexport type LeasingAdminUpload<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = {\n id: string;\n updatedAt: string;\n createdAt: string;\n createdBy: string;\n\n status: LeasingAdminUploadStatus;\n attachments: A;\n metadata: M;\n handlerId: LeasingAdminUploadHandlers;\n};\n\nexport type NewLeasingAdminUploadRequest<\n M extends LeasingAdminUploadMetadata = {},\n A extends LeasingAdminUploadAttachments = {}\n> = {\n attachments: A;\n metadata: M;\n handlerId: LeasingAdminUploadHandlers;\n};\n\nexport type DhondtAttachments = {\n json: AttachmentValue;\n};\n\nexport type BelfiusAttachments = {\n xlsx: AttachmentValue;\n json?: AttachmentValue; // json version of the xlsx file\n};\n\nexport type BelfiusMetadata = {\n totalLines: number;\n totalIncludingVat: string;\n};\n\nexport type DhondtMetadata = {\n invoiceNumber: string;\n invoiceDate: string;\n};\n\nexport type DhondtInvoiceLine = {\n BrutoPremie: number;\n Chassisnummer: string;\n Datum: string;\n NettoPremie: number;\n Plaatnummer: string;\n Taksen: number;\n VoertuigVlootNummer: string | undefined;\n};\n\nexport type INGMetadata = {\n capital: string;\n emailId?: string;\n interest: string;\n invoiceDate: string;\n invoiceNumber: string;\n pdfUrl: string; // data url\n pdfFilename?: string;\n stockNumber: string;\n yearlyFee?: string;\n};\n\nexport type INGAttachments = {\n email?: AttachmentValue; // like the emailId, can be missing if the invoices are uploaded manually\n};\n\nexport type DiffableDhondtInvoiceLine = DhondtInvoiceLine;\n\nexport type BelfiusRawInvoiceLine = {\n 'Additional info': string;\n Amortization: number;\n 'Amount including tax': number;\n Avenant: number;\n Contract: number;\n Currency: string;\n Customer: string;\n Description: string;\n 'Due date': Date;\n 'Interest Amount': number;\n 'Invoice Date': Date;\n 'Invoice Number': number;\n 'Rent amount': number;\n 'VAT amount': number;\n 'VAT number': string;\n 'VAT rate': number;\n};\n\nexport type BelfiusInvoiceLine = {\n capital: string;\n contractNr: string;\n interest: string;\n invoiceNr: string;\n invoiceDate: string;\n rentExcl: string;\n rentIncl: string;\n vatAmount: string;\n vehicleId: string;\n stockNumber: string;\n};\n\nexport type DiffableBelfiusInvoiceLine = Omit<\n BelfiusInvoiceLine,\n 'invoiceNr' | 'invoiceDate' | 'capital' | 'interest'\n>;\n\nexport type LineDiff<T> = {\n [Property in keyof T]: {\n value: T[Property];\n before: T[Property];\n };\n};\n\nexport type Diff<T> = {\n added: T[];\n removed: T[];\n changed: LineDiff<T>[];\n};\n"]}
@@ -2,6 +2,7 @@ import { MultiLangValue } from '@bisondesk/commons-sdk/types';
2
2
  export type PicklistValueUpdateRequest = {
3
3
  picklistId: string;
4
4
  value: PicklistValue | NewPicklistValue;
5
+ tenantId?: string;
5
6
  };
6
7
  export type NewPicklistValue<T = Record<string, string>> = {
7
8
  color?: string;
@@ -47,6 +48,11 @@ export type PicklistOptionsRequest = {
47
48
  dependencies?: PicklistValueDependency[];
48
49
  lang: string;
49
50
  };
51
+ export type PicklistUpsertValueRequest = {
52
+ tenantId?: string;
53
+ picklistId: string;
54
+ value: PicklistValue | NewPicklistValue;
55
+ };
50
56
  export type QuickAddPicklistValue = {
51
57
  sortPriority?: number;
52
58
  titles: MultiLangValue;
@@ -1 +1 @@
1
- {"version":3,"file":"picklists.d.ts","sourceRoot":"/","sources":["types/picklists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,aAAa,GAAG,gBAAgB,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;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AAE,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,aAAa,GAAG,gBAAgB,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,YAAY,GAAG;IAAE,IAAI,EAAE,aAAa,EAAE,CAAA;CAAE,CAAC,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"picklists.js","sourceRoot":"/","sources":["types/picklists.ts"],"names":[],"mappings":"","sourcesContent":["import { MultiLangValue } from '@bisondesk/commons-sdk/types';\n\nexport type PicklistValueUpdateRequest = {\n picklistId: string;\n value: PicklistValue | NewPicklistValue;\n};\n\nexport type NewPicklistValue<T = Record<string, string>> = {\n color?: string;\n sortPriority?: number;\n titles: MultiLangValue;\n dependency?: PicklistValueDependency;\n meta?: T;\n};\n\nexport type PicklistValue<T = any> = NewPicklistValue<T> & {\n id: string;\n system?: boolean;\n};\n\nexport type PicklistValueListRequest = {\n picklistId: string;\n limit: number;\n offset: number;\n dependencies?: PicklistValueDependency[];\n};\n\nexport type PicklistValueRequest = {\n picklistId: string;\n valueId: string;\n};\n\nexport type AdHocPicklistValues<T = any> = {\n [picklistId: string]: {\n [valueId: string]: PicklistValue<T>;\n };\n};\n\nexport type AdHocPicklistRequest = {\n requests: PicklistValueRequest[];\n preferredLang: string;\n tenantLang: string;\n};\n\nexport type AdHocPicklistValueDisplay = {\n [picklistId: string]: {\n [valueId: string]: {\n color?: string;\n title: string;\n };\n };\n};\n\nexport type PicklistOptionsRequest = {\n picklistId: string;\n dependencies?: PicklistValueDependency[];\n lang: string;\n};\n\nexport type QuickAddPicklistValue = {\n sortPriority?: number;\n titles: MultiLangValue;\n};\n\nexport type NewPicklist = {\n id?: undefined;\n titles: MultiLangValue;\n values: QuickAddPicklistValue[];\n customSort?: boolean;\n};\n\nexport type BasePicklist = {\n customSort?: boolean;\n id: string;\n system?: boolean;\n titles: MultiLangValue;\n};\n\nexport type PicklistInfo = BasePicklist & {\n count: number;\n modifiedAt: string;\n};\nexport type PicklistValueDependency = {\n picklistId: string;\n values: string[];\n};\n\nexport type PicklistCollection = (BasePicklist & { data: PicklistValue[] })[];\n"]}
1
+ {"version":3,"file":"picklists.js","sourceRoot":"/","sources":["types/picklists.ts"],"names":[],"mappings":"","sourcesContent":["import { MultiLangValue } from '@bisondesk/commons-sdk/types';\n\nexport type PicklistValueUpdateRequest = {\n picklistId: string;\n value: PicklistValue | NewPicklistValue;\n tenantId?: string;\n};\n\nexport type NewPicklistValue<T = Record<string, string>> = {\n color?: string;\n sortPriority?: number;\n titles: MultiLangValue;\n dependency?: PicklistValueDependency;\n meta?: T;\n};\n\nexport type PicklistValue<T = any> = NewPicklistValue<T> & {\n id: string;\n system?: boolean;\n};\n\nexport type PicklistValueListRequest = {\n picklistId: string;\n limit: number;\n offset: number;\n dependencies?: PicklistValueDependency[];\n};\n\nexport type PicklistValueRequest = {\n picklistId: string;\n valueId: string;\n};\n\nexport type AdHocPicklistValues<T = any> = {\n [picklistId: string]: {\n [valueId: string]: PicklistValue<T>;\n };\n};\n\nexport type AdHocPicklistRequest = {\n requests: PicklistValueRequest[];\n preferredLang: string;\n tenantLang: string;\n};\n\nexport type AdHocPicklistValueDisplay = {\n [picklistId: string]: {\n [valueId: string]: {\n color?: string;\n title: string;\n };\n };\n};\n\nexport type PicklistOptionsRequest = {\n picklistId: string;\n dependencies?: PicklistValueDependency[];\n lang: string;\n};\n\nexport type PicklistUpsertValueRequest = {\n tenantId?: string;\n picklistId: string;\n value: PicklistValue | NewPicklistValue;\n};\n\nexport type QuickAddPicklistValue = {\n sortPriority?: number;\n titles: MultiLangValue;\n};\n\nexport type NewPicklist = {\n id?: undefined;\n titles: MultiLangValue;\n values: QuickAddPicklistValue[];\n customSort?: boolean;\n};\n\nexport type BasePicklist = {\n customSort?: boolean;\n id: string;\n system?: boolean;\n titles: MultiLangValue;\n};\n\nexport type PicklistInfo = BasePicklist & {\n count: number;\n modifiedAt: string;\n};\nexport type PicklistValueDependency = {\n picklistId: string;\n values: string[];\n};\n\nexport type PicklistCollection = (BasePicklist & { data: PicklistValue[] })[];\n"]}
@@ -88,12 +88,25 @@ export type SearchRequest = {
88
88
  query?: ComplexFilter<ElasticsearchOperator>;
89
89
  sortBy?: SortFilter[];
90
90
  } & (InfiniteSearchRequest | PaginatedSearchRequest);
91
- export type MultiEntitySearchRequest = SearchRequest & {
91
+ export type GlobalSearchRequest = {
92
+ fullText: string;
93
+ limit: number;
94
+ } & {
92
95
  entityIds: BusinessEntityIds[];
93
96
  } & (InfiniteSearchRequest | PaginatedSearchRequest);
94
- export type MultiEntitySearchItem<T = unknown> = {
97
+ export type GlobalSearchResult = {
95
98
  businessEntityId: BusinessEntityIds;
96
- } & T;
99
+ recordId: string;
100
+ title: string;
101
+ description: string;
102
+ tags?: string[];
103
+ };
104
+ export type GlobalSearchByIdRequest = {
105
+ ids: {
106
+ businessEntityId: BusinessEntityIds;
107
+ recordId: string;
108
+ }[];
109
+ };
97
110
  export type PublicSearchRequest = {
98
111
  limit: number;
99
112
  offset?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"/","sources":["types/search.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,EAAE,OAAO;CACV;AAED,oBAAY,qBAAqB;IAE/B,KAAK,UAAU;IACf,QAAQ,cAAc;IACtB,EAAE,OAAO;IACT,KAAK,WAAW;IAEhB,kBAAkB,QAAQ;IAC1B,WAAW,OAAO;IAClB,aAAa,QAAQ;IACrB,QAAQ,OAAO;IACf,OAAO,YAAY;IAEnB,QAAQ,aAAa;IACrB,WAAW,iBAAiB;IAC5B,UAAU,gBAAgB;IAC1B,QAAQ,cAAc;CACvB;AAED,MAAM,MAAM,MAAM,CAAC,EAAE,GAAG,qBAAqB,IAAI;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,EAAE,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,EAAE,GAAG,qBAAqB,IAAI;IACtD,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,GAAG,IAAI;IACpC,IA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AAED,MAAM,CAAN,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAE/B,wCAAe,CAAA;IACf,+CAAsB,CAAA;IACtB,kCAAS,CAAA;IACT,yCAAgB,CAAA;IAEhB,mDAA0B,CAAA;IAC1B,2CAAkB,CAAA;IAClB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,4CAAmB,CAAA;IAEnB,8CAAqB,CAAA;IACrB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,+CAAsB,CAAA;AACxB,CAAC,EAjBW,qBAAqB,KAArB,qBAAqB,QAiBhC;AA8CD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAyDD,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["///////////////////////////////////////////////////////\n// Generic stuff\n///////////////////////////////////////////////////////\n\nimport { BusinessEntityIds, SUPPORTED_LANGUAGES } from '@bisondesk/commons-sdk/constants';\nimport { MultiLangValue } from '@bisondesk/commons-sdk/types';\nimport { FieldTypes, NumberMeta } from './fields.js';\n\nexport enum ConditionType {\n and = 'AND',\n or = 'OR',\n}\n\nexport enum ElasticsearchOperator {\n // all properties\n empty = 'EMPTY',\n notEmpty = 'NOT_EMPTY',\n is = 'IS',\n isNot = 'IS_NOT',\n // number, date properties\n greaterThanOrEqual = 'GTE',\n greaterThan = 'GT',\n lessThanEqual = 'LTE',\n lessThan = 'LT',\n between = 'BETWEEN',\n // string properties\n contains = 'CONTAINS',\n notContains = 'NOT_CONTAINS',\n startsWith = 'STARTS_WITH',\n endsWith = 'ENDS_WITH',\n}\n\nexport type Filter<OP = ElasticsearchOperator> = {\n data: string;\n fieldId: string;\n operator: OP;\n};\n\nexport type ComplexFilter<OP = ElasticsearchOperator> = {\n condition: ConditionType;\n filters: Array<Filter<OP> | ComplexFilter<OP>>;\n};\n\nexport type SearchResponse<T = any> = {\n took: number;\n timed_out: boolean;\n _scroll_id?: string;\n _shards: unknown;\n hits: {\n total: {\n value: number;\n relation: 'eq' | 'gte';\n };\n max_score: number;\n hits: Array<{\n _index: string;\n _type: string;\n _id: string;\n _score: number;\n _source?: T;\n _version?: number;\n _explanation?: unknown;\n fields?: any;\n highlight?: any;\n inner_hits?: any;\n matched_queries?: string[];\n sort?: Array<string | number>;\n }>;\n };\n aggregations?: { [aggName: string]: object };\n};\n\n///////////////////////////////////////////////////////\n// Search\n///////////////////////////////////////////////////////\n\nexport const FILTER_RANGE_SEPARATOR = '__';\n\nexport enum SortOrder {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport type SortFilter = {\n fieldId: string;\n order: SortOrder;\n};\n\nexport type BaseSearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n sortBy?: SortFilter[];\n};\n\ntype InfiniteSearchRequest = {\n infinite: true;\n nextToken?: string;\n};\n\ntype PaginatedSearchRequest = {\n infinite?: false;\n offset?: number;\n};\n\nexport type SearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n sortBy?: SortFilter[];\n} & (InfiniteSearchRequest | PaginatedSearchRequest);\n\nexport type MultiEntitySearchRequest = SearchRequest & {\n entityIds: BusinessEntityIds[];\n} & (InfiniteSearchRequest | PaginatedSearchRequest);\n\nexport type MultiEntitySearchItem<T = unknown> = {\n businessEntityId: BusinessEntityIds;\n} & T;\n\nexport type PublicSearchRequest = {\n limit: number;\n offset?: number;\n query?: ComplexFilter;\n sortBy?: SortFilter[];\n};\n\n///////////////////////////////////////////////////////\n// Aggregations\n///////////////////////////////////////////////////////\n\nexport type AggFilterOperator =\n | ElasticsearchOperator.is\n | ElasticsearchOperator.greaterThan\n | ElasticsearchOperator.lessThan\n | ElasticsearchOperator.greaterThanOrEqual\n | ElasticsearchOperator.lessThanEqual;\n\nexport enum AggregationType {\n term = 'TERM',\n range = 'RANGE',\n}\n\nexport type TermAggregation = {\n titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };\n fieldId: string;\n type: AggregationType.term;\n\n orderBy?: 'count' | 'field';\n} & (\n | {\n fieldType: FieldTypes.picklist;\n picklistId: string;\n }\n | {\n fieldType: FieldTypes.number;\n meta?: NumberMeta;\n }\n | {\n fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;\n }\n);\n\nexport type Range =\n | {\n start: number;\n end?: number;\n }\n | {\n start?: number;\n end: number;\n }\n | {\n start: number;\n end: number;\n };\n\nexport type RangeAggregation = {\n titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };\n fieldId: string;\n type: AggregationType.range;\n step: number;\n ranges: Range[];\n format?: NumberMeta;\n};\n\nexport type Aggregation = TermAggregation | RangeAggregation;\n\nexport type AggregationRequest = {\n fullText?: string;\n filters: ComplexFilter<AggFilterOperator>[];\n};\n\nexport type AggregationResult = {\n value: string;\n count: number;\n from?: number;\n to?: number;\n};\n\nexport type AggregationResultSet = {\n [field: string]: AggregationResult[];\n};\n\nexport type AggregationResponse<M = {}> = {\n results: AggregationResultSet;\n meta: M;\n};\n"]}
1
+ {"version":3,"file":"search.js","sourceRoot":"/","sources":["types/search.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,0BAAS,CAAA;AACX,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAE/B,wCAAe,CAAA;IACf,+CAAsB,CAAA;IACtB,kCAAS,CAAA;IACT,yCAAgB,CAAA;IAEhB,mDAA0B,CAAA;IAC1B,2CAAkB,CAAA;IAClB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,4CAAmB,CAAA;IAEnB,8CAAqB,CAAA;IACrB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,+CAAsB,CAAA;AACxB,CAAC,EAjBW,qBAAqB,KAArB,qBAAqB,QAiBhC;AA8CD,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAE3C,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAuED,MAAM,CAAN,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,kCAAe,CAAA;AACjB,CAAC,EAHW,eAAe,KAAf,eAAe,QAG1B","sourcesContent":["///////////////////////////////////////////////////////\n// Generic stuff\n///////////////////////////////////////////////////////\n\nimport { BusinessEntityIds, SUPPORTED_LANGUAGES } from '@bisondesk/commons-sdk/constants';\nimport { MultiLangValue } from '@bisondesk/commons-sdk/types';\nimport { FieldTypes, NumberMeta } from './fields.js';\n\nexport enum ConditionType {\n and = 'AND',\n or = 'OR',\n}\n\nexport enum ElasticsearchOperator {\n // all properties\n empty = 'EMPTY',\n notEmpty = 'NOT_EMPTY',\n is = 'IS',\n isNot = 'IS_NOT',\n // number, date properties\n greaterThanOrEqual = 'GTE',\n greaterThan = 'GT',\n lessThanEqual = 'LTE',\n lessThan = 'LT',\n between = 'BETWEEN',\n // string properties\n contains = 'CONTAINS',\n notContains = 'NOT_CONTAINS',\n startsWith = 'STARTS_WITH',\n endsWith = 'ENDS_WITH',\n}\n\nexport type Filter<OP = ElasticsearchOperator> = {\n data: string;\n fieldId: string;\n operator: OP;\n};\n\nexport type ComplexFilter<OP = ElasticsearchOperator> = {\n condition: ConditionType;\n filters: Array<Filter<OP> | ComplexFilter<OP>>;\n};\n\nexport type SearchResponse<T = any> = {\n took: number;\n timed_out: boolean;\n _scroll_id?: string;\n _shards: unknown;\n hits: {\n total: {\n value: number;\n relation: 'eq' | 'gte';\n };\n max_score: number;\n hits: Array<{\n _index: string;\n _type: string;\n _id: string;\n _score: number;\n _source?: T;\n _version?: number;\n _explanation?: unknown;\n fields?: any;\n highlight?: any;\n inner_hits?: any;\n matched_queries?: string[];\n sort?: Array<string | number>;\n }>;\n };\n aggregations?: { [aggName: string]: object };\n};\n\n///////////////////////////////////////////////////////\n// Search\n///////////////////////////////////////////////////////\n\nexport const FILTER_RANGE_SEPARATOR = '__';\n\nexport enum SortOrder {\n asc = 'asc',\n desc = 'desc',\n}\n\nexport type SortFilter = {\n fieldId: string;\n order: SortOrder;\n};\n\nexport type BaseSearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n sortBy?: SortFilter[];\n};\n\ntype InfiniteSearchRequest = {\n infinite: true;\n nextToken?: string;\n};\n\ntype PaginatedSearchRequest = {\n infinite?: false;\n offset?: number;\n};\n\nexport type SearchRequest = {\n fullText?: string;\n limit: number;\n query?: ComplexFilter<ElasticsearchOperator>;\n sortBy?: SortFilter[];\n} & (InfiniteSearchRequest | PaginatedSearchRequest);\n\nexport type GlobalSearchRequest = {\n fullText: string;\n limit: number;\n} & {\n entityIds: BusinessEntityIds[];\n} & (InfiniteSearchRequest | PaginatedSearchRequest);\n\nexport type GlobalSearchResult = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n title: string;\n description: string;\n tags?: string[];\n};\n\nexport type GlobalSearchByIdRequest = {\n ids: {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n }[];\n};\n\nexport type PublicSearchRequest = {\n limit: number;\n offset?: number;\n query?: ComplexFilter;\n sortBy?: SortFilter[];\n};\n\n///////////////////////////////////////////////////////\n// Aggregations\n///////////////////////////////////////////////////////\n\nexport type AggFilterOperator =\n | ElasticsearchOperator.is\n | ElasticsearchOperator.greaterThan\n | ElasticsearchOperator.lessThan\n | ElasticsearchOperator.greaterThanOrEqual\n | ElasticsearchOperator.lessThanEqual;\n\nexport enum AggregationType {\n term = 'TERM',\n range = 'RANGE',\n}\n\nexport type TermAggregation = {\n titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };\n fieldId: string;\n type: AggregationType.term;\n\n orderBy?: 'count' | 'field';\n} & (\n | {\n fieldType: FieldTypes.picklist;\n picklistId: string;\n }\n | {\n fieldType: FieldTypes.number;\n meta?: NumberMeta;\n }\n | {\n fieldType: Exclude<FieldTypes, FieldTypes.picklist | FieldTypes.number>;\n }\n);\n\nexport type Range =\n | {\n start: number;\n end?: number;\n }\n | {\n start?: number;\n end: number;\n }\n | {\n start: number;\n end: number;\n };\n\nexport type RangeAggregation = {\n titles: MultiLangValue & { [local in (typeof SUPPORTED_LANGUAGES)[number]]: string };\n fieldId: string;\n type: AggregationType.range;\n step: number;\n ranges: Range[];\n format?: NumberMeta;\n};\n\nexport type Aggregation = TermAggregation | RangeAggregation;\n\nexport type AggregationRequest = {\n fullText?: string;\n filters: ComplexFilter<AggFilterOperator>[];\n};\n\nexport type AggregationResult = {\n value: string;\n count: number;\n from?: number;\n to?: number;\n};\n\nexport type AggregationResultSet = {\n [field: string]: AggregationResult[];\n};\n\nexport type AggregationResponse<M = {}> = {\n results: AggregationResultSet;\n meta: M;\n};\n"]}
@@ -0,0 +1,33 @@
1
+ import { BusinessEntityIds } from '../constants.js';
2
+ import { Contact, Organization, SearchOrganization } from '../types/crm.js';
3
+ import { SearchLeasingContract } from '../types/leasing-search.js';
4
+ import { LeasingContract } from '../types/leasing.js';
5
+ import { Opportunity, SearchOpportunity } from '../types/opportunities.js';
6
+ import { SearchVehicle, Vehicle } from '../types/vehicles.js';
7
+ export type GlobalBusinessEntity = Opportunity | Vehicle | Organization | LeasingContract;
8
+ export type GlobalSearchEntity = SearchOpportunity | SearchVehicle | SearchOrganization | SearchLeasingContract;
9
+ export declare const getCustomerInformation: (org?: Organization, contact?: Contact) => {
10
+ countryCode: string;
11
+ title: string;
12
+ code: number;
13
+ } | {
14
+ countryCode: string | undefined;
15
+ title: string;
16
+ code?: undefined;
17
+ } | undefined;
18
+ export declare const mappings: {
19
+ [key in BusinessEntityIds]?: {
20
+ getMainEntity: (entity: any) => GlobalBusinessEntity;
21
+ getTitle: (entity: any) => string;
22
+ getTags: (entity: any) => (string | undefined)[];
23
+ getDescription?: (entity: any) => string;
24
+ };
25
+ };
26
+ export declare const getTagsForBusinessEntity: (businessEntityId: BusinessEntityIds, entity: GlobalBusinessEntity) => string[];
27
+ export declare const getTagsForSearchBusinessEntity: (businessEntityId: BusinessEntityIds, entity: GlobalSearchEntity) => string[];
28
+ export declare const getDescriptionForBusinessEntity: (businessEntityId: BusinessEntityIds, entity: GlobalBusinessEntity) => string;
29
+ export declare const getDescriptionForSearchBusinessEntity: (businessEntityId: BusinessEntityIds, entity: GlobalSearchEntity) => string;
30
+ export declare const getMainEntityFromSearchEntity: (businessEntityId: BusinessEntityIds, entity: GlobalSearchEntity) => GlobalBusinessEntity;
31
+ export declare const getTitleForBusinessEntity: (businessEntityId: BusinessEntityIds, entity: GlobalBusinessEntity) => string;
32
+ export declare const getTitleForSearchBusinessEntity: (businessEntityId: BusinessEntityIds, searchEntity: GlobalSearchEntity) => string;
33
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"/","sources":["utils/search.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB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constants.js';
3
+ export const getCustomerInformation = (org, contact) => {
4
+ if (org != null) {
5
+ return {
6
+ countryCode: org.countryCode,
7
+ title: org.name,
8
+ code: org.externalId,
9
+ };
10
+ }
11
+ if (contact != null) {
12
+ return {
13
+ countryCode: contact.countryCode,
14
+ title: [contact?.firstName, contact?.lastName].filter(Boolean).join(' '),
15
+ };
16
+ }
17
+ };
18
+ export const mappings = {
19
+ [BusinessEntityIds.Opportunities]: {
20
+ getMainEntity: (entity) => entity.opportunity,
21
+ getTitle: (opp) => opp.id,
22
+ getDescription: (opp) => joinWithSeparator([
23
+ getCustomerInformation(opp.org, opp.contact)?.code,
24
+ opp.vehicle?.external.identification.stockNumber,
25
+ ].filter(Boolean)),
26
+ getTags: (opp) => [opp.id],
27
+ },
28
+ [BusinessEntityIds.Vehicles]: {
29
+ getMainEntity: (entity) => entity.vehicle,
30
+ getTitle: (vehicle) => vehicle.internal.description.title,
31
+ getTags: (vehicle) => [
32
+ vehicle.external.identification?.stockNumber,
33
+ vehicle.internal.identification?.administrativeNumber,
34
+ ],
35
+ },
36
+ [BusinessEntityIds.Organizations]: {
37
+ getMainEntity: (entity) => entity.org,
38
+ getTitle: (org) => org.name,
39
+ getTags: (org) => [`${org.externalId}`, org.vatNumber],
40
+ },
41
+ [BusinessEntityIds.LeasingContracts]: {
42
+ getMainEntity: (entity) => entity.contract,
43
+ getTitle: (contract) => contract.contractNumber ?? contract.id,
44
+ getTags: (contract) => [contract.contractNumber, contract.slbPartner],
45
+ },
46
+ };
47
+ const getMapping = (businessEntityId) => {
48
+ const mapping = mappings[businessEntityId];
49
+ if (!mapping) {
50
+ throw new Error(`Invalid business entity id ${businessEntityId}`);
51
+ }
52
+ return mapping;
53
+ };
54
+ export const getTagsForBusinessEntity = (businessEntityId, entity) => getMapping(businessEntityId).getTags(entity).filter(Boolean);
55
+ export const getTagsForSearchBusinessEntity = (businessEntityId, entity) => getTagsForBusinessEntity(businessEntityId, getMainEntityFromSearchEntity(businessEntityId, entity));
56
+ export const getDescriptionForBusinessEntity = (businessEntityId, entity) => joinWithSeparator(getTagsForBusinessEntity(businessEntityId, entity));
57
+ export const getDescriptionForSearchBusinessEntity = (businessEntityId, entity) => {
58
+ return (getMapping(businessEntityId).getDescription?.(entity) ??
59
+ getDescriptionForBusinessEntity(businessEntityId, getMainEntityFromSearchEntity(businessEntityId, entity)));
60
+ };
61
+ export const getMainEntityFromSearchEntity = (businessEntityId, entity) => getMapping(businessEntityId).getMainEntity(entity);
62
+ export const getTitleForBusinessEntity = (businessEntityId, entity) => getMapping(businessEntityId).getTitle(entity);
63
+ export const getTitleForSearchBusinessEntity = (businessEntityId, searchEntity) => getTitleForBusinessEntity(businessEntityId, getMainEntityFromSearchEntity(businessEntityId, searchEntity));
64
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"/","sources":["utils/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAcpD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAkB,EAAE,OAAiB,EAAE,EAAE;IAC9E,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,OAAO;YACL,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,KAAK,EAAE,GAAG,CAAC,IAAI;YACf,IAAI,EAAE,GAAG,CAAC,UAAU;SACrB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;SACzE,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAA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B,gBAAgB,EAChB,6BAA6B,CAAC,gBAAgB,EAAE,MAAM,CAAC,CACxD,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,gBAAmC,EACnC,MAA0B,EAC1B,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,gBAAmC,EACnC,MAA4B,EAC5B,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAEnD,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,gBAAmC,EACnC,YAAgC,EAChC,EAAE,CACF,yBAAyB,CACvB,gBAAgB,EAChB,6BAA6B,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAC9D,CAAC","sourcesContent":["import { joinWithSeparator } from '@bisondesk/commons-sdk/formatting';\nimport { BusinessEntityIds } from '../constants.js';\nimport { Contact, Organization, SearchOrganization } from '../types/crm.js';\nimport { SearchLeasingContract } from '../types/leasing-search.js';\nimport { LeasingContract } from '../types/leasing.js';\nimport { Opportunity, SearchOpportunity } from '../types/opportunities.js';\nimport { SearchVehicle, Vehicle } from '../types/vehicles.js';\n\nexport type GlobalBusinessEntity = Opportunity | Vehicle | Organization | LeasingContract;\nexport type GlobalSearchEntity =\n | SearchOpportunity\n | SearchVehicle\n | SearchOrganization\n | SearchLeasingContract;\n\nexport const getCustomerInformation = (org?: Organization, contact?: Contact) => {\n if (org != null) {\n return {\n countryCode: org.countryCode,\n title: org.name,\n code: org.externalId,\n };\n }\n\n if (contact != null) {\n return {\n countryCode: contact.countryCode,\n title: [contact?.firstName, contact?.lastName].filter(Boolean).join(' '),\n };\n }\n};\n\nexport const mappings: {\n [key in BusinessEntityIds]?: {\n getMainEntity: (entity: any) => GlobalBusinessEntity;\n getTitle: (entity: any) => string;\n getTags: (entity: any) => (string | undefined)[];\n getDescription?: (entity: any) => string;\n };\n} = {\n [BusinessEntityIds.Opportunities]: {\n getMainEntity: (entity: SearchOpportunity) => entity.opportunity,\n getTitle: (opp: Opportunity) => opp.id,\n getDescription: (opp: SearchOpportunity) =>\n joinWithSeparator(\n [\n getCustomerInformation(opp.org, opp.contact)?.code,\n opp.vehicle?.external.identification.stockNumber,\n ].filter(Boolean)\n ),\n getTags: (opp: Opportunity) => [opp.id],\n },\n [BusinessEntityIds.Vehicles]: {\n getMainEntity: (entity: SearchVehicle) => entity.vehicle,\n getTitle: (vehicle: Vehicle) => vehicle.internal.description.title,\n getTags: (vehicle: Vehicle) => [\n vehicle.external.identification?.stockNumber,\n vehicle.internal.identification?.administrativeNumber,\n ],\n },\n [BusinessEntityIds.Organizations]: {\n getMainEntity: (entity: SearchOrganization) => entity.org,\n getTitle: (org: Organization) => org.name,\n getTags: (org: Organization) => [`${org.externalId}`, org.vatNumber],\n },\n [BusinessEntityIds.LeasingContracts]: {\n getMainEntity: (entity: SearchLeasingContract) => entity.contract,\n getTitle: (contract: LeasingContract) => contract.contractNumber ?? contract.id,\n getTags: (contract: LeasingContract) => [contract.contractNumber, contract.slbPartner],\n },\n};\n\nconst getMapping = (businessEntityId: BusinessEntityIds) => {\n const mapping = mappings[businessEntityId];\n if (!mapping) {\n throw new Error(`Invalid business entity id ${businessEntityId}`);\n }\n return mapping;\n};\n\nexport const getTagsForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n): string[] => getMapping(businessEntityId).getTags(entity).filter(Boolean) as string[];\n\nexport const getTagsForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) =>\n getTagsForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, entity)\n );\n\nexport const getDescriptionForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n) => joinWithSeparator(getTagsForBusinessEntity(businessEntityId, entity));\n\nexport const getDescriptionForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) => {\n return (\n getMapping(businessEntityId).getDescription?.(entity) ??\n getDescriptionForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, entity)\n )\n );\n};\n\nexport const getMainEntityFromSearchEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalSearchEntity\n) => getMapping(businessEntityId).getMainEntity(entity);\n\nexport const getTitleForBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n entity: GlobalBusinessEntity\n) => getMapping(businessEntityId).getTitle(entity);\n\nexport const getTitleForSearchBusinessEntity = (\n businessEntityId: BusinessEntityIds,\n searchEntity: GlobalSearchEntity\n) =>\n getTitleForBusinessEntity(\n businessEntityId,\n getMainEntityFromSearchEntity(businessEntityId, searchEntity)\n );\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.319",
3
+ "version": "1.0.321",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/apis/crm.ts CHANGED
@@ -228,6 +228,36 @@ export const listCrmContacts = async (
228
228
  throw new XError(response.statusText, { body, tenantId, organizationId, opts });
229
229
  };
230
230
 
231
+ export const listPotentialDuplicateOrgs = async (
232
+ tenantId: string,
233
+ org: Partial<Organization>,
234
+ opts?: { serviceId?: string; limit?: number; offset?: number }
235
+ ): Promise<PaginatedList<SearchOrganization, ReferenceData>> => {
236
+ const auth = await getAdminAuth();
237
+ const limit = opts?.limit ?? '';
238
+ const offset = opts?.offset ?? '';
239
+ const response: Response = await fetch(
240
+ `${process.env.CORE_API_ORIGIN}/api/crm/organizations/duplicate-check?limit=${limit}&offset=${offset}`,
241
+ {
242
+ method: 'POST',
243
+ headers: cleanHeaders({
244
+ 'Content-Type': 'application/json',
245
+ Authorization: auth,
246
+ [TENANT_ID_ADMIN_HEADER]: tenantId,
247
+ [SERVICE_ID_ADMIN_HEADER]: opts?.serviceId,
248
+ }),
249
+ body: JSON.stringify(org),
250
+ }
251
+ );
252
+
253
+ if (response.ok) {
254
+ return response.status === 200 ? (response.json() as any) : undefined;
255
+ }
256
+
257
+ const body = await response.text();
258
+ throw new XError(response.statusText, { body, tenantId, org, opts });
259
+ };
260
+
231
261
  export const getCrmContact = async (
232
262
  tenantId: string,
233
263
  contactId: string,
@@ -9,6 +9,19 @@ import {
9
9
  import { LeasingQuoteParams } from '../types/quote-settings.js';
10
10
  import { Quote } from '../types/quotes.js';
11
11
 
12
+ export const getOpportunityById = async (
13
+ tenantId: string,
14
+ opportunityId: string
15
+ ): Promise<Opportunity | undefined> => {
16
+ const auth = await getAdminAuth();
17
+ return fetchJson(`${process.env.CORE_API_ORIGIN}/api/opportunities/${opportunityId}`, {
18
+ headers: cleanHeaders({
19
+ Authorization: auth,
20
+ [TENANT_ID_ADMIN_HEADER]: tenantId,
21
+ }),
22
+ });
23
+ };
24
+
12
25
  export const getOpportunityBff = async (
13
26
  tenantId: string,
14
27
  opportunityId: string
@@ -6,6 +6,8 @@ import {
6
6
  AdHocPicklistRequest,
7
7
  AdHocPicklistValueDisplay,
8
8
  PicklistOptionsRequest,
9
+ PicklistValue,
10
+ PicklistValueUpdateRequest,
9
11
  } from '../types/picklists.js';
10
12
 
11
13
  export const getMultiplePicklistValues = async (
@@ -48,3 +50,24 @@ export const getPicklistOptions = async (req: PicklistOptionsRequest): Promise<O
48
50
  const body = await response.text();
49
51
  throw new XError(response.statusText, { body, req });
50
52
  };
53
+
54
+ export const upsertPicklistValue = async (
55
+ request: PicklistValueUpdateRequest
56
+ ): Promise<PicklistValue> => {
57
+ const auth = await getAdminAuth();
58
+ const response: Response = await fetch(`${process.env.CORE_API_ORIGIN}/api/picklists/value`, {
59
+ method: 'POST',
60
+ headers: {
61
+ Authorization: auth,
62
+ 'Content-Type': 'application/json',
63
+ },
64
+ body: JSON.stringify(request),
65
+ });
66
+
67
+ if (response.ok) {
68
+ return response.json() as any;
69
+ }
70
+
71
+ const body = await response.text();
72
+ throw new XError(response.statusText, { body });
73
+ };
package/src/constants.ts CHANGED
@@ -34,6 +34,8 @@ export const SHIPPING_COMPANIES_PICKLIST_ID = 'shippingCompanies';
34
34
  export const SLB_PARTNERS_PICKLIST_ID = 'slb_partners';
35
35
  export const PURCHASE_LOGISTICS_STATUS_PICKLIST_ID = 'purchaseLogisticsStatus';
36
36
  export const QUOTE_STATUS_PICKLIST_ID = 'quoteStatus';
37
+ export const DOCUMENT_CATEGORIES_PICKLIST_ID = 'documentCategories';
38
+ export const DOCUMENT_LINE_CATEGORIES_PICKLIST_ID = 'documentLineCategories';
37
39
 
38
40
  export const PICKLIST_FALLBACK_LOCALE = 'en';
39
41
 
package/src/types/crm.ts CHANGED
@@ -41,11 +41,14 @@ type BaseOrganization = {
41
41
  transport?: LocationValue;
42
42
  };
43
43
  accountManagers: string[];
44
+ conglomerate?: boolean;
45
+ riskTags?: string[];
46
+
47
+ // billing
44
48
  billingEmails?: string[];
49
+ billingPhone?: string;
45
50
  skipPaymentReminders?: boolean;
46
51
  trustworthy?: boolean;
47
- conglomerate?: boolean;
48
- riskTags?: string[];
49
52
  };
50
53
 
51
54
  export type NewOrganization = BaseOrganization & {
@@ -20,10 +20,10 @@ type BaseInternetOpportunity = {
20
20
  lastName?: string;
21
21
  message?: string;
22
22
  name: string;
23
- platformEmail?: string;
24
23
  source: string;
25
24
  stockNumber?: string;
26
25
  type?: OpportunityType;
26
+ vehicleBid?: string;
27
27
  };
28
28
 
29
29
  export type InternetOpportunityEvent = BaseInternetOpportunity & {
@@ -33,5 +33,6 @@ export type InternetOpportunityEvent = BaseInternetOpportunity & {
33
33
  };
34
34
 
35
35
  export type InternetOpportunity = BaseInternetOpportunity & {
36
+ platformEmail?: string;
36
37
  phoneNumber?: PhoneNumberValue;
37
38
  };
@@ -70,7 +70,8 @@ export type INGMetadata = {
70
70
  interest: string;
71
71
  invoiceDate: string;
72
72
  invoiceNumber: string;
73
- pdfUrl: string;
73
+ pdfUrl: string; // data url
74
+ pdfFilename?: string;
74
75
  stockNumber: string;
75
76
  yearlyFee?: string;
76
77
  };
@@ -3,6 +3,7 @@ import { MultiLangValue } from '@bisondesk/commons-sdk/types';
3
3
  export type PicklistValueUpdateRequest = {
4
4
  picklistId: string;
5
5
  value: PicklistValue | NewPicklistValue;
6
+ tenantId?: string;
6
7
  };
7
8
 
8
9
  export type NewPicklistValue<T = Record<string, string>> = {
@@ -57,6 +58,12 @@ export type PicklistOptionsRequest = {
57
58
  lang: string;
58
59
  };
59
60
 
61
+ export type PicklistUpsertValueRequest = {
62
+ tenantId?: string;
63
+ picklistId: string;
64
+ value: PicklistValue | NewPicklistValue;
65
+ };
66
+
60
67
  export type QuickAddPicklistValue = {
61
68
  sortPriority?: number;
62
69
  titles: MultiLangValue;
@@ -110,13 +110,27 @@ export type SearchRequest = {
110
110
  sortBy?: SortFilter[];
111
111
  } & (InfiniteSearchRequest | PaginatedSearchRequest);
112
112
 
113
- export type MultiEntitySearchRequest = SearchRequest & {
113
+ export type GlobalSearchRequest = {
114
+ fullText: string;
115
+ limit: number;
116
+ } & {
114
117
  entityIds: BusinessEntityIds[];
115
118
  } & (InfiniteSearchRequest | PaginatedSearchRequest);
116
119
 
117
- export type MultiEntitySearchItem<T = unknown> = {
120
+ export type GlobalSearchResult = {
118
121
  businessEntityId: BusinessEntityIds;
119
- } & T;
122
+ recordId: string;
123
+ title: string;
124
+ description: string;
125
+ tags?: string[];
126
+ };
127
+
128
+ export type GlobalSearchByIdRequest = {
129
+ ids: {
130
+ businessEntityId: BusinessEntityIds;
131
+ recordId: string;
132
+ }[];
133
+ };
120
134
 
121
135
  export type PublicSearchRequest = {
122
136
  limit: number;