@bisondesk/core-sdk 1.0.0 → 1.0.3

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.
@@ -0,0 +1,8 @@
1
+ export declare const APP_LANGUAGES_PICKLIST_ID = "appLanguages";
2
+ export declare const TIMEZONES_PICKLIST_ID = "timezones";
3
+ export declare const COUNTRIES_PICKLIST_ID = "countries";
4
+ export declare const MAX_SORT_PRIORITY = 10000;
5
+ export declare const MIN_SORT_PRIORITY = 1;
6
+ export declare const FILTER_RANGE_SEPARATOR = "__";
7
+ export declare const FILTER_MULTIPLE_SEPARATOR = "__";
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AACxD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AACjD,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAKjD,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AACvC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAKnC,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,yBAAyB,OAAO,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FILTER_MULTIPLE_SEPARATOR = exports.FILTER_RANGE_SEPARATOR = exports.MIN_SORT_PRIORITY = exports.MAX_SORT_PRIORITY = exports.COUNTRIES_PICKLIST_ID = exports.TIMEZONES_PICKLIST_ID = exports.APP_LANGUAGES_PICKLIST_ID = void 0;
4
+ //
5
+ // STATIC PICKLIST IDS
6
+ //
7
+ exports.APP_LANGUAGES_PICKLIST_ID = 'appLanguages';
8
+ exports.TIMEZONES_PICKLIST_ID = 'timezones';
9
+ exports.COUNTRIES_PICKLIST_ID = 'countries';
10
+ //
11
+ // PICKLIST CONSTANTS
12
+ //
13
+ exports.MAX_SORT_PRIORITY = 10000;
14
+ exports.MIN_SORT_PRIORITY = 1;
15
+ //
16
+ // SEARCH
17
+ //
18
+ exports.FILTER_RANGE_SEPARATOR = '__';
19
+ exports.FILTER_MULTIPLE_SEPARATOR = '__';
20
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,EAAE;AACF,sBAAsB;AACtB,EAAE;AACW,QAAA,yBAAyB,GAAG,cAAc,CAAC;AAC3C,QAAA,qBAAqB,GAAG,WAAW,CAAC;AACpC,QAAA,qBAAqB,GAAG,WAAW,CAAC;AAEjD,EAAE;AACF,qBAAqB;AACrB,EAAE;AACW,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAC1B,QAAA,iBAAiB,GAAG,CAAC,CAAC;AAEnC,EAAE;AACF,SAAS;AACT,EAAE;AACW,QAAA,sBAAsB,GAAG,IAAI,CAAC;AAC9B,QAAA,yBAAyB,GAAG,IAAI,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare enum RecordAction {
2
+ Create = "content.records.create",
3
+ Update = "content.records.update",
4
+ Delete = "content.records.delete"
5
+ }
6
+ export declare type ActionMessage = {
7
+ id: string;
8
+ action: RecordAction;
9
+ actionAt: string;
10
+ userId: string;
11
+ tenantId: string;
12
+ businessEntityId: string;
13
+ recordId: string;
14
+ fieldIds?: string[];
15
+ };
16
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IAEtB,MAAM,2BAA2B;IACjC,MAAM,2BAA2B;IACjC,MAAM,2BAA2B;CAClC;AAED,oBAAY,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecordAction = void 0;
4
+ var RecordAction;
5
+ (function (RecordAction) {
6
+ // if you rename this, you also need to adjust the SNS subscription filters
7
+ RecordAction["Create"] = "content.records.create";
8
+ RecordAction["Update"] = "content.records.update";
9
+ RecordAction["Delete"] = "content.records.delete";
10
+ })(RecordAction = exports.RecordAction || (exports.RecordAction = {}));
11
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,2EAA2E;IAC3E,iDAAiC,CAAA;IACjC,iDAAiC,CAAA;IACjC,iDAAiC,CAAA;AACnC,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB"}
@@ -0,0 +1,34 @@
1
+ import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
2
+ export declare enum FieldTypes {
3
+ checkbox = "checkbox",
4
+ date = "date",
5
+ email = "email",
6
+ image = "image",
7
+ multilang = "multilang",
8
+ multiline = "multiline",
9
+ number = "number",
10
+ phoneNumber = "phoneNumber",
11
+ rating = "rating",
12
+ text = "text"
13
+ }
14
+ export declare type PhoneNumberValue = {
15
+ country?: string;
16
+ e164: string;
17
+ international: string;
18
+ national: string;
19
+ };
20
+ export declare type PhoneNumberRawValue = {
21
+ defaultCountry?: string;
22
+ input: string;
23
+ };
24
+ export declare type AttachmentValue = {
25
+ contentType: string;
26
+ fileName: string;
27
+ id: string;
28
+ size: number;
29
+ uploadedAt: string;
30
+ uploadedBy: string;
31
+ url: string;
32
+ descriptions?: string | MultiLangValue;
33
+ };
34
+ //# sourceMappingURL=fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/types/fields.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,oBAAY,UAAU;IACpB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,oBAAY,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;CACxC,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldTypes = void 0;
4
+ var FieldTypes;
5
+ (function (FieldTypes) {
6
+ FieldTypes["checkbox"] = "checkbox";
7
+ FieldTypes["date"] = "date";
8
+ FieldTypes["email"] = "email";
9
+ FieldTypes["image"] = "image";
10
+ FieldTypes["multilang"] = "multilang";
11
+ FieldTypes["multiline"] = "multiline";
12
+ FieldTypes["number"] = "number";
13
+ FieldTypes["phoneNumber"] = "phoneNumber";
14
+ FieldTypes["rating"] = "rating";
15
+ FieldTypes["text"] = "text";
16
+ })(FieldTypes = exports.FieldTypes || (exports.FieldTypes = {}));
17
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../src/types/fields.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAWX;AAXD,WAAY,UAAU;IACpB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,yCAA2B,CAAA;IAC3B,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACf,CAAC,EAXW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAWrB"}
@@ -0,0 +1,64 @@
1
+ import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
2
+ export declare type PicklistValueUpdateRequest = {
3
+ picklistId: string;
4
+ value: PicklistValue | NewPicklistValue;
5
+ };
6
+ export declare type NewPicklistValue = {
7
+ color?: string;
8
+ customId?: string;
9
+ sortPriority?: number;
10
+ titles: MultiLangValue;
11
+ };
12
+ export declare type PicklistValue = NewPicklistValue & {
13
+ id: string;
14
+ system?: boolean;
15
+ };
16
+ export declare type PicklistValueListRequest = {
17
+ picklistId: string;
18
+ limit: number;
19
+ offset: number;
20
+ };
21
+ export declare type PicklistValueRequest = {
22
+ picklistId: string;
23
+ valueId: string;
24
+ };
25
+ export declare type AdHocPicklistValues = {
26
+ [picklistId: string]: {
27
+ [valueId: string]: PicklistValue;
28
+ };
29
+ };
30
+ export declare type AdHocPicklistValueDisplay = {
31
+ [picklistId: string]: {
32
+ [valueId: string]: {
33
+ color?: string;
34
+ title: string;
35
+ };
36
+ };
37
+ };
38
+ export declare type PicklistOptionsRequest = {
39
+ picklistId: string;
40
+ lang: string;
41
+ };
42
+ export declare type QuickAddPicklistValue = {
43
+ customId?: string;
44
+ sortPriority?: number;
45
+ titles: MultiLangValue;
46
+ };
47
+ export declare type NewPicklist = {
48
+ titles: MultiLangValue;
49
+ values: QuickAddPicklistValue[];
50
+ customSort?: boolean;
51
+ customId?: string;
52
+ };
53
+ export declare type BasePicklist = {
54
+ customSort?: boolean;
55
+ id: string;
56
+ system?: boolean;
57
+ titles: MultiLangValue;
58
+ customId?: string;
59
+ };
60
+ export declare type PicklistInfo = BasePicklist & {
61
+ count: number;
62
+ modifiedAt: string;
63
+ };
64
+ //# sourceMappingURL=picklists.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"picklists.d.ts","sourceRoot":"","sources":["../../src/types/picklists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAKlE,oBAAY,0BAA0B,GAAG;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,aAAa,GAAG,gBAAgB,CAAC;CACzC,CAAC;AACF,oBAAY,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AACF,oBAAY,aAAa,GAAG,gBAAgB,GAAG;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AACF,oBAAY,wBAAwB,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,oBAAY,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,oBAAY,mBAAmB,GAAG;IAChC,CAAC,UAAU,EAAE,MAAM,GAAG;QACpB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAAC;KAClC,CAAC;CACH,CAAC;AACF,oBAAY,yBAAyB,GAAG;IACtC,CAAC,UAAU,EAAE,MAAM,GAAG;QACpB,CAAC,OAAO,EAAE,MAAM,GAAG;YACjB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;CACH,CAAC;AACF,oBAAY,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AACF,oBAAY,qBAAqB,GAAG;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AACF,oBAAY,WAAW,GAAG;IACxB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,oBAAY,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AACF,oBAAY,YAAY,GAAG,YAAY,GAAG;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=picklists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"picklists.js","sourceRoot":"","sources":["../../src/types/picklists.ts"],"names":[],"mappings":""}
@@ -0,0 +1,134 @@
1
+ import { SortFilter } from '@bisondesk/commons-sdk/lib/types';
2
+ import { FieldTypes } from './fields';
3
+ export declare enum ConditionType {
4
+ and = "AND",
5
+ or = "OR"
6
+ }
7
+ export declare type Filter<OP extends string = string> = {
8
+ data: string;
9
+ fieldId: string;
10
+ fieldType: FieldTypes;
11
+ operator: OP;
12
+ };
13
+ export declare type ComplexFilter<OP extends string = string> = {
14
+ condition: ConditionType;
15
+ filters: Array<Filter<OP> | ComplexFilter<OP>>;
16
+ };
17
+ export declare type SearchRequest<OP extends string = string> = {
18
+ fullText?: string;
19
+ limit: number;
20
+ offset?: number;
21
+ query?: ComplexFilter<OP>;
22
+ sortBy?: SortFilter[];
23
+ lang: string;
24
+ };
25
+ export declare type RecordSearchRequest<OP extends string = string> = SearchRequest<OP> & {
26
+ businessEntityId: string;
27
+ };
28
+ export declare type TextSearchRequest = {
29
+ businessEntityIds?: string[];
30
+ fullText: string;
31
+ limit: number;
32
+ offset?: number;
33
+ lang: string;
34
+ };
35
+ export declare enum ElasticsearchOperator {
36
+ empty = "EMPTY",
37
+ notEmpty = "NOT_EMPTY",
38
+ is = "IS",
39
+ isNot = "IS_NOT",
40
+ greaterThanOrEqual = "GTE",
41
+ greaterThan = "GT",
42
+ lessThanEqual = "LTE",
43
+ lessThan = "LT",
44
+ between = "BETWEEN",
45
+ contains = "CONTAINS",
46
+ notContains = "NOT_CONTAINS",
47
+ startsWith = "STARTS_WITH",
48
+ endsWith = "ENDS_WITH"
49
+ }
50
+ export declare enum DateOperator {
51
+ after = "GTE",
52
+ before = "LTE",
53
+ empty = "EMPTY",
54
+ is = "IS",
55
+ lastMonth = "LAST_MONTH",
56
+ lastWeek = "LAST_WEEK",
57
+ notEmpty = "NOT_EMPTY",
58
+ thisMonth = "THIS_MONTH",
59
+ thisWeek = "THIS_WEEK",
60
+ today = "TODAY",
61
+ yesterday = "YESTERDAY"
62
+ }
63
+ export declare enum NumberOperator {
64
+ between = "BETWEEN",
65
+ empty = "EMPTY",
66
+ greaterThan = "GT",
67
+ greaterThanOrEqual = "GTE",
68
+ is = "IS",
69
+ isNot = "IS_NOT",
70
+ lessThan = "LT",
71
+ lessThanEqual = "LTE",
72
+ notEmpty = "NOT_EMPTY"
73
+ }
74
+ export declare enum CheckboxOperator {
75
+ empty = "EMPTY",
76
+ is = "IS",
77
+ notEmpty = "NOT_EMPTY"
78
+ }
79
+ export declare enum PicklistOperator {
80
+ empty = "EMPTY",
81
+ isMultiple = "IS_MULTIPLE",
82
+ isNotMultiple = "IS_NOT_MULTIPLE",
83
+ notEmpty = "NOT_EMPTY"
84
+ }
85
+ export declare enum RatingOperator {
86
+ empty = "EMPTY",
87
+ greaterThan = "GT",
88
+ greaterThanOrEqual = "GTE",
89
+ is = "IS",
90
+ isNot = "IS_NOT",
91
+ lessThan = "LT",
92
+ lessThanEqual = "LTE",
93
+ notEmpty = "NOT_EMPTY"
94
+ }
95
+ export declare enum TextOperator {
96
+ contains = "CONTAINS",
97
+ empty = "EMPTY",
98
+ endsWith = "ENDS_WITH",
99
+ is = "IS",
100
+ isNot = "IS_NOT",
101
+ notContains = "NOT_CONTAINS",
102
+ notEmpty = "NOT_EMPTY",
103
+ startsWith = "STARTS_WITH"
104
+ }
105
+ export declare type SearchResponse<T = any> = {
106
+ took: number;
107
+ timed_out: boolean;
108
+ _scroll_id?: string;
109
+ _shards: unknown;
110
+ hits: {
111
+ total: {
112
+ value: number;
113
+ relation: 'eq' | 'gte';
114
+ };
115
+ max_score: number;
116
+ hits: Array<{
117
+ _index: string;
118
+ _type: string;
119
+ _id: string;
120
+ _score: number;
121
+ _source?: T;
122
+ _version?: number;
123
+ _explanation?: unknown;
124
+ fields?: any;
125
+ highlight?: any;
126
+ inner_hits?: any;
127
+ matched_queries?: string[];
128
+ sort?: Array<string | number>;
129
+ }>;
130
+ };
131
+ aggregations?: unknown;
132
+ };
133
+ export declare type FilterTransformer = (filter: Filter<string>) => Filter<ElasticsearchOperator> | ComplexFilter<ElasticsearchOperator>;
134
+ //# sourceMappingURL=search.d.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B,WAAW,iBAAiB;IAC5B,QAAQ,cAAc;IACtB,UAAU,gBAAgB;CAC3B;AAED,oBAAY,cAAc,CAAC,CAAC,GAAG,GAAG,IAAI;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,KAAK,EAAE,MAAM,CAAC;YACd,QAAQ,EAAE,IAAI,GAAG,KAAK,CAAC;SACxB,CAAC;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,KAAK,CAAC;YACV,MAAM,EAAE,MAAM,CAAC;YACf,KAAK,EAAE,MAAM,CAAC;YACd,GAAG,EAAE,MAAM,CAAC;YACZ,MAAM,EAAE,MAAM,CAAC;YACf,OAAO,CAAC,EAAE,CAAC,CAAC;YACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,YAAY,CAAC,EAAE,OAAO,CAAC;YACvB,MAAM,CAAC,EAAE,GAAG,CAAC;YACb,SAAS,CAAC,EAAE,GAAG,CAAC;YAChB,UAAU,CAAC,EAAE,GAAG,CAAC;YACjB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;YAC3B,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;SAC/B,CAAC,CAAC;KACJ,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,oBAAY,iBAAiB,GAAG,CAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,KACnB,MAAM,CAAC,qBAAqB,CAAC,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TextOperator = exports.RatingOperator = exports.PicklistOperator = exports.CheckboxOperator = exports.NumberOperator = exports.DateOperator = exports.ElasticsearchOperator = exports.ConditionType = void 0;
4
+ var ConditionType;
5
+ (function (ConditionType) {
6
+ ConditionType["and"] = "AND";
7
+ ConditionType["or"] = "OR";
8
+ })(ConditionType = exports.ConditionType || (exports.ConditionType = {}));
9
+ var ElasticsearchOperator;
10
+ (function (ElasticsearchOperator) {
11
+ // all properties
12
+ ElasticsearchOperator["empty"] = "EMPTY";
13
+ ElasticsearchOperator["notEmpty"] = "NOT_EMPTY";
14
+ ElasticsearchOperator["is"] = "IS";
15
+ ElasticsearchOperator["isNot"] = "IS_NOT";
16
+ // number, date properties
17
+ ElasticsearchOperator["greaterThanOrEqual"] = "GTE";
18
+ ElasticsearchOperator["greaterThan"] = "GT";
19
+ ElasticsearchOperator["lessThanEqual"] = "LTE";
20
+ ElasticsearchOperator["lessThan"] = "LT";
21
+ ElasticsearchOperator["between"] = "BETWEEN";
22
+ // string properties
23
+ ElasticsearchOperator["contains"] = "CONTAINS";
24
+ ElasticsearchOperator["notContains"] = "NOT_CONTAINS";
25
+ ElasticsearchOperator["startsWith"] = "STARTS_WITH";
26
+ ElasticsearchOperator["endsWith"] = "ENDS_WITH";
27
+ })(ElasticsearchOperator = exports.ElasticsearchOperator || (exports.ElasticsearchOperator = {}));
28
+ var DateOperator;
29
+ (function (DateOperator) {
30
+ DateOperator["after"] = "GTE";
31
+ DateOperator["before"] = "LTE";
32
+ DateOperator["empty"] = "EMPTY";
33
+ DateOperator["is"] = "IS";
34
+ DateOperator["lastMonth"] = "LAST_MONTH";
35
+ DateOperator["lastWeek"] = "LAST_WEEK";
36
+ DateOperator["notEmpty"] = "NOT_EMPTY";
37
+ DateOperator["thisMonth"] = "THIS_MONTH";
38
+ DateOperator["thisWeek"] = "THIS_WEEK";
39
+ DateOperator["today"] = "TODAY";
40
+ DateOperator["yesterday"] = "YESTERDAY";
41
+ })(DateOperator = exports.DateOperator || (exports.DateOperator = {}));
42
+ var NumberOperator;
43
+ (function (NumberOperator) {
44
+ NumberOperator["between"] = "BETWEEN";
45
+ NumberOperator["empty"] = "EMPTY";
46
+ NumberOperator["greaterThan"] = "GT";
47
+ NumberOperator["greaterThanOrEqual"] = "GTE";
48
+ NumberOperator["is"] = "IS";
49
+ NumberOperator["isNot"] = "IS_NOT";
50
+ NumberOperator["lessThan"] = "LT";
51
+ NumberOperator["lessThanEqual"] = "LTE";
52
+ NumberOperator["notEmpty"] = "NOT_EMPTY";
53
+ })(NumberOperator = exports.NumberOperator || (exports.NumberOperator = {}));
54
+ var CheckboxOperator;
55
+ (function (CheckboxOperator) {
56
+ CheckboxOperator["empty"] = "EMPTY";
57
+ CheckboxOperator["is"] = "IS";
58
+ CheckboxOperator["notEmpty"] = "NOT_EMPTY";
59
+ })(CheckboxOperator = exports.CheckboxOperator || (exports.CheckboxOperator = {}));
60
+ var PicklistOperator;
61
+ (function (PicklistOperator) {
62
+ PicklistOperator["empty"] = "EMPTY";
63
+ PicklistOperator["isMultiple"] = "IS_MULTIPLE";
64
+ PicklistOperator["isNotMultiple"] = "IS_NOT_MULTIPLE";
65
+ PicklistOperator["notEmpty"] = "NOT_EMPTY";
66
+ })(PicklistOperator = exports.PicklistOperator || (exports.PicklistOperator = {}));
67
+ var RatingOperator;
68
+ (function (RatingOperator) {
69
+ RatingOperator["empty"] = "EMPTY";
70
+ RatingOperator["greaterThan"] = "GT";
71
+ RatingOperator["greaterThanOrEqual"] = "GTE";
72
+ RatingOperator["is"] = "IS";
73
+ RatingOperator["isNot"] = "IS_NOT";
74
+ RatingOperator["lessThan"] = "LT";
75
+ RatingOperator["lessThanEqual"] = "LTE";
76
+ RatingOperator["notEmpty"] = "NOT_EMPTY";
77
+ })(RatingOperator = exports.RatingOperator || (exports.RatingOperator = {}));
78
+ var TextOperator;
79
+ (function (TextOperator) {
80
+ TextOperator["contains"] = "CONTAINS";
81
+ TextOperator["empty"] = "EMPTY";
82
+ TextOperator["endsWith"] = "ENDS_WITH";
83
+ TextOperator["is"] = "IS";
84
+ TextOperator["isNot"] = "IS_NOT";
85
+ TextOperator["notContains"] = "NOT_CONTAINS";
86
+ TextOperator["notEmpty"] = "NOT_EMPTY";
87
+ TextOperator["startsWith"] = "STARTS_WITH";
88
+ })(TextOperator = exports.TextOperator || (exports.TextOperator = {}));
89
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/types/search.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,4BAAW,CAAA;IACX,0BAAS,CAAA;AACX,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAmCD,IAAY,qBAiBX;AAjBD,WAAY,qBAAqB;IAC/B,iBAAiB;IACjB,wCAAe,CAAA;IACf,+CAAsB,CAAA;IACtB,kCAAS,CAAA;IACT,yCAAgB,CAAA;IAChB,0BAA0B;IAC1B,mDAA0B,CAAA;IAC1B,2CAAkB,CAAA;IAClB,8CAAqB,CAAA;IACrB,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,oBAAoB;IACpB,8CAAqB,CAAA;IACrB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,+CAAsB,CAAA;AACxB,CAAC,EAjBW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAiBhC;AAED,IAAY,YAYX;AAZD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,8BAAc,CAAA;IACd,+BAAe,CAAA;IACf,yBAAS,CAAA;IACT,wCAAwB,CAAA;IACxB,sCAAsB,CAAA;IACtB,sCAAsB,CAAA;IACtB,wCAAwB,CAAA;IACxB,sCAAsB,CAAA;IACtB,+BAAe,CAAA;IACf,uCAAuB,CAAA;AACzB,CAAC,EAZW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAYvB;AAED,IAAY,cAUX;AAVD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;IAC1B,2BAAS,CAAA;IACT,kCAAgB,CAAA;IAChB,iCAAe,CAAA;IACf,uCAAqB,CAAA;IACrB,wCAAsB,CAAA;AACxB,CAAC,EAVW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAUzB;AAED,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,6BAAS,CAAA;IACT,0CAAsB,CAAA;AACxB,CAAC,EAJW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAI3B;AAED,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,mCAAe,CAAA;IACf,8CAA0B,CAAA;IAC1B,qDAAiC,CAAA;IACjC,0CAAsB,CAAA;AACxB,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AAED,IAAY,cASX;AATD,WAAY,cAAc;IACxB,iCAAe,CAAA;IACf,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;IAC1B,2BAAS,CAAA;IACT,kCAAgB,CAAA;IAChB,iCAAe,CAAA;IACf,uCAAqB,CAAA;IACrB,wCAAsB,CAAA;AACxB,CAAC,EATW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QASzB;AAED,IAAY,YASX;AATD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,sCAAsB,CAAA;IACtB,yBAAS,CAAA;IACT,gCAAgB,CAAA;IAChB,4CAA4B,CAAA;IAC5B,sCAAsB,CAAA;IACtB,0CAA0B,CAAA;AAC5B,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB"}
@@ -0,0 +1,12 @@
1
+ export declare type UploadInfo = {
2
+ id: string;
3
+ uploadUrl: string;
4
+ downloadUrl: string;
5
+ };
6
+ export declare type GetUploadUrlRequest = {
7
+ businessEntityId: string;
8
+ fieldId: string;
9
+ fileName: string;
10
+ contentType: string;
11
+ };
12
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/types/storage.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/types/storage.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { Region } from '@bisondesk/commons-sdk/lib/types';
2
+ export declare type NewTenant = {
3
+ country: string;
4
+ region: Region;
5
+ name: string;
6
+ languages: string[];
7
+ subdomain: string;
8
+ };
9
+ export declare type Tenant = NewTenant & {
10
+ id: string;
11
+ subdomain: string;
12
+ };
13
+ //# sourceMappingURL=tenants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../src/types/tenants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,oBAAY,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,MAAM,GAAG,SAAS,GAAG;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=tenants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tenants.js","sourceRoot":"","sources":["../../src/types/tenants.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { AttachmentValue, PhoneNumberValue } from './fields';
2
+ export declare type User = {
3
+ active: boolean;
4
+ createdAt: string;
5
+ email: string;
6
+ firstName: string;
7
+ id: string;
8
+ language: string;
9
+ lastName: string;
10
+ phone: PhoneNumberValue;
11
+ picture?: AttachmentValue;
12
+ roles: string[];
13
+ updatedAt: string;
14
+ };
15
+ //# sourceMappingURL=users.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/types/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE7D,oBAAY,IAAI,GAAG;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=users.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/types/users.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ export declare type CountryInfo = {
2
+ code: string;
3
+ name: string;
4
+ labels: {
5
+ city: string;
6
+ state: string;
7
+ postalCode?: string;
8
+ };
9
+ required: {
10
+ city: boolean;
11
+ state: boolean;
12
+ postalCode: boolean;
13
+ };
14
+ dialCode: number;
15
+ currencyCode: string;
16
+ states?: {
17
+ [code: string]: string;
18
+ };
19
+ postalCodeFormat?: string;
20
+ postalCodeEx?: string;
21
+ };
22
+ export declare type Country = {
23
+ code: string;
24
+ name: string;
25
+ dialCode: number;
26
+ };
27
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE;QACR,IAAI,EAAE,OAAO,CAAC;QACd,KAAK,EAAE,OAAO,CAAC;QACf,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE;QACP,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,CAAC;IACF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,oBAAY,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bisondesk/core-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "clean": "rm -rf build dist lib *.tsbuildinfo",
@@ -11,8 +11,8 @@
11
11
  },
12
12
  "author": "Ivo Anastácio",
13
13
  "dependencies": {
14
- "@hapi/joi": "17.1.1",
15
- "@bisondesk/commons-sdk": "1.0.0"
14
+ "@bisondesk/commons-sdk": "1.0.0",
15
+ "@hapi/joi": "17.1.1"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/hapi__joi": "17.1.6",
@@ -2,20 +2,15 @@ import { MultiLangValue } from '@bisondesk/commons-sdk/lib/types';
2
2
 
3
3
  export enum FieldTypes {
4
4
  checkbox = 'checkbox',
5
- collaborator = 'collaborator',
6
5
  date = 'date',
7
6
  email = 'email',
8
7
  image = 'image',
9
- picklist = 'picklist',
10
8
  multilang = 'multilang',
11
- multiRecord = 'multiRecord',
12
9
  multiline = 'multiline',
13
10
  number = 'number',
14
11
  phoneNumber = 'phoneNumber',
15
12
  rating = 'rating',
16
- record = 'record',
17
13
  text = 'text',
18
- location = 'location',
19
14
  }
20
15
 
21
16
  export type PhoneNumberValue = {