@octostar/platform-api 0.5.31 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apis.d.ts +23 -2
- package/dist/apis.d.ts.map +1 -1
- package/dist/apis.js +19 -4
- package/dist/apis.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/factory.d.ts +127 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +445 -137
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/AIClientImpl.d.ts.map +1 -1
- package/dist/lib/AIClientImpl.js +6 -29
- package/dist/lib/AIClientImpl.js.map +1 -1
- package/dist/lib/ApiConfig.d.ts +56 -2
- package/dist/lib/ApiConfig.d.ts.map +1 -1
- package/dist/lib/ApiConfig.js +103 -6
- package/dist/lib/ApiConfig.js.map +1 -1
- package/dist/lib/AsyncServiceLocator.d.ts +0 -3
- package/dist/lib/AsyncServiceLocator.d.ts.map +1 -1
- package/dist/lib/AsyncServiceLocator.js.map +1 -1
- package/dist/lib/FilesAPIImpl.d.ts +8 -2
- package/dist/lib/FilesAPIImpl.d.ts.map +1 -1
- package/dist/lib/FilesAPIImpl.js +81 -2
- package/dist/lib/FilesAPIImpl.js.map +1 -1
- package/dist/lib/FusionApi.d.ts +15 -6
- package/dist/lib/FusionApi.d.ts.map +1 -1
- package/dist/lib/FusionApi.js +24 -10
- package/dist/lib/FusionApi.js.map +1 -1
- package/dist/lib/LiveContextAPI.d.ts +1 -0
- package/dist/lib/LiveContextAPI.d.ts.map +1 -1
- package/dist/lib/LiveContextAPI.js +4 -1
- package/dist/lib/LiveContextAPI.js.map +1 -1
- package/dist/lib/RemoteDevManager.d.ts +79 -0
- package/dist/lib/RemoteDevManager.d.ts.map +1 -0
- package/dist/lib/RemoteDevManager.js +218 -0
- package/dist/lib/RemoteDevManager.js.map +1 -0
- package/dist/lib/SearchQueryBuilder.d.ts +61 -4
- package/dist/lib/SearchQueryBuilder.d.ts.map +1 -1
- package/dist/lib/SearchQueryBuilder.js +86 -56
- package/dist/lib/SearchQueryBuilder.js.map +1 -1
- package/dist/permissions.d.ts +5 -0
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +5 -0
- package/dist/permissions.js.map +1 -1
- package/dist/type/FusionTypes.d.ts +13 -1
- package/dist/type/FusionTypes.d.ts.map +1 -1
- package/dist/utils.js +3 -3
- package/dist/utils.js.map +1 -1
- package/package.json +9 -31
- package/dist/octostar-platform-api.js +0 -26572
|
@@ -1,18 +1,17 @@
|
|
|
1
|
+
const ENTITY_TYPE_KEYWORD = 'document_fields.entity_type.keyword';
|
|
2
|
+
const LABEL_FIELD = 'document_fields.entity_label';
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* @param options - Search options
|
|
4
|
+
* The indexer's concatenation of the whole record: label, `os_*` metadata,
|
|
5
|
+
* extracted text, summary, NER entities, image tags. One field to search
|
|
6
|
+
* "anywhere"; `fields: ['*']` can trip the circuit breaker.
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// FIXME: lowercasing as the mappings lowercase keywords...
|
|
8
|
+
const RAG_FULLTEXT = 'annotations.rag:fulltext';
|
|
9
|
+
const escapeWildcard = (value) => value.replace(/[\\*?]/g, '\\$&');
|
|
10
|
+
/** Below this `*term*` matches nearly every label and walks the whole term dictionary; the token tiers still run. Enforced here, not at call sites. */
|
|
11
|
+
export const MIN_SUBSTRING_LENGTH = 3;
|
|
12
|
+
function buildLabelClauses(trimmedQuery, options) {
|
|
13
|
+
// The `.keyword` sub-field is lowercase-normalized, so the query is too.
|
|
14
14
|
const lowercaseQuery = trimmedQuery.toLowerCase().replace(/\s+/g, ' ');
|
|
15
|
-
// Create matches for quoted parts
|
|
16
15
|
const quotedPhrases = [];
|
|
17
16
|
const quoteRegex = /"(?<phrase>[^"]+)"/g;
|
|
18
17
|
let match;
|
|
@@ -23,63 +22,94 @@ export function buildTextSearchClauses(query, options) {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
const clauses = [];
|
|
26
|
-
//
|
|
27
|
-
const
|
|
28
|
-
term: {
|
|
29
|
-
'document_fields.entity_label.keyword': {
|
|
30
|
-
value: phrase,
|
|
31
|
-
boost: 100,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
}));
|
|
35
|
-
// Add quoted term queries as or clauses. This is by design.
|
|
36
|
-
if (quotedTermQueries.length > 0) {
|
|
37
|
-
clauses.push(...quotedTermQueries);
|
|
25
|
+
// Quoted phrases are OR-ed against each other, by design.
|
|
26
|
+
for (const phrase of quotedPhrases) {
|
|
27
|
+
clauses.push({ term: { [`${LABEL_FIELD}.keyword`]: { value: phrase, boost: 100 } } });
|
|
38
28
|
}
|
|
39
|
-
// If nothing quoted, try exact match on label
|
|
40
29
|
if (!quotedPhrases.length) {
|
|
30
|
+
clauses.push({ term: { [`${LABEL_FIELD}.keyword`]: { value: lowercaseQuery, boost: 100 } } });
|
|
31
|
+
}
|
|
32
|
+
if (options?.labelSubstring && lowercaseQuery.length >= MIN_SUBSTRING_LENGTH) {
|
|
41
33
|
clauses.push({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
boost: 100,
|
|
46
|
-
},
|
|
34
|
+
constant_score: {
|
|
35
|
+
filter: { wildcard: { [`${LABEL_FIELD}.keyword`]: { value: `*${escapeWildcard(lowercaseQuery)}*` } } },
|
|
36
|
+
boost: 30,
|
|
47
37
|
},
|
|
48
38
|
});
|
|
49
39
|
}
|
|
50
|
-
|
|
40
|
+
clauses.push({ match_phrase: { [LABEL_FIELD]: { query: trimmedQuery, analyzer: 'standard', boost: 50 } } });
|
|
51
41
|
clauses.push({
|
|
52
|
-
|
|
53
|
-
'document_fields.entity_label': {
|
|
54
|
-
query: trimmedQuery,
|
|
55
|
-
analyzer: 'standard',
|
|
56
|
-
boost: 50,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
42
|
+
match: { [LABEL_FIELD]: { query: trimmedQuery, analyzer: 'standard', operator: 'and', boost: 20 } },
|
|
59
43
|
});
|
|
60
|
-
//
|
|
44
|
+
// Catches tokens the standard analyzer splits or strips (codes, ids, dotted names).
|
|
61
45
|
clauses.push({
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
multi_match: {
|
|
47
|
+
query: trimmedQuery,
|
|
48
|
+
fields: [`${LABEL_FIELD}^4`],
|
|
49
|
+
analyzer: 'whitespace',
|
|
50
|
+
operator: 'and',
|
|
51
|
+
boost: 10,
|
|
52
|
+
lenient: true,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
if (!options?.fragmentsContentOnly)
|
|
56
|
+
return clauses;
|
|
57
|
+
return [
|
|
58
|
+
{
|
|
59
|
+
bool: {
|
|
60
|
+
must_not: [{ term: { [ENTITY_TYPE_KEYWORD]: 'os_fragment' } }],
|
|
61
|
+
should: clauses,
|
|
62
|
+
minimum_should_match: 1,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
function buildContentClauses(trimmedQuery, operator) {
|
|
68
|
+
return [
|
|
69
|
+
{
|
|
70
|
+
multi_match: {
|
|
64
71
|
query: trimmedQuery,
|
|
65
|
-
|
|
72
|
+
fields: [`${RAG_FULLTEXT}^2`],
|
|
73
|
+
analyzer: 'whitespace',
|
|
66
74
|
operator: 'and',
|
|
67
|
-
boost:
|
|
75
|
+
boost: 10,
|
|
76
|
+
lenient: true,
|
|
68
77
|
},
|
|
69
78
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
lenient: true,
|
|
79
|
+
{
|
|
80
|
+
simple_query_string: {
|
|
81
|
+
query: trimmedQuery,
|
|
82
|
+
fields: [RAG_FULLTEXT],
|
|
83
|
+
flags: 'PHRASE',
|
|
84
|
+
analyzer: 'standard',
|
|
85
|
+
default_operator: operator,
|
|
86
|
+
boost: 1,
|
|
87
|
+
lenient: true,
|
|
88
|
+
},
|
|
81
89
|
},
|
|
82
|
-
|
|
83
|
-
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* OpenSearch `should` clauses for full-text search, strongest evidence first
|
|
94
|
+
* (same ladder as `content-browser/src/search/textQuery.ts`):
|
|
95
|
+
*
|
|
96
|
+
* 1. exact keyword on `entity_label.keyword` (quoted phrases too) boost 100
|
|
97
|
+
* 2. phrase on `entity_label` boost 50
|
|
98
|
+
* 3. `*term*` on `entity_label.keyword` (`labelSubstring`) boost 30
|
|
99
|
+
* 4. all-terms match on `entity_label` boost 20
|
|
100
|
+
* 5. whitespace match on `entity_label^4` boost 10
|
|
101
|
+
* 6. whitespace match on `rag:fulltext^2` boost 10
|
|
102
|
+
* 7. `simple_query_string` over `rag:fulltext` boost 1
|
|
103
|
+
*
|
|
104
|
+
* `labelOnly` keeps tiers 1–5; `fragmentsContentOnly` leaves fragments tiers 6–7 only.
|
|
105
|
+
*/
|
|
106
|
+
export function buildTextSearchClauses(query, options) {
|
|
107
|
+
const trimmedQuery = query.trim();
|
|
108
|
+
if (!trimmedQuery)
|
|
109
|
+
return [];
|
|
110
|
+
const labelClauses = buildLabelClauses(trimmedQuery, options);
|
|
111
|
+
if (options?.labelOnly)
|
|
112
|
+
return labelClauses;
|
|
113
|
+
return [...labelClauses, ...buildContentClauses(trimmedQuery, options?.defaultQueryOperator ?? 'or')];
|
|
84
114
|
}
|
|
85
115
|
//# sourceMappingURL=SearchQueryBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchQueryBuilder.js","sourceRoot":"","sources":["../../src/lib/SearchQueryBuilder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SearchQueryBuilder.js","sourceRoot":"","sources":["../../src/lib/SearchQueryBuilder.ts"],"names":[],"mappings":"AAkFA,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AAClE,MAAM,WAAW,GAAG,8BAA8B,CAAC;AACnD;;;;GAIG;AACH,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAEhD,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAEnF,uJAAuJ;AACvJ,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,SAAS,iBAAiB,CAAC,YAAoB,EAAE,OAA2B;IAC1E,yEAAyE;IACzE,MAAM,cAAc,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEvE,MAAM,aAAa,GAAa,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,qBAAqB,CAAC;IACzC,IAAI,KAA6B,CAAC;IAClC,OAAO,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACxD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC5C,IAAI,MAAM,EAAE,CAAC;YACX,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAmB,EAAE,CAAC;IAEnC,0DAA0D;IAC1D,KAAK,MAAM,MAAM,IAAI,aAAa,EAAE,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,E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AAO,CAAC,GAAG,YAAY,EAAE,GAAG,mBAAmB,CAAC,YAAY,EAAE,OAAO,EAAE,oBAAoB,IAAI,IAAI,CAAC,CAAC,CAAC;AACxG,CAAC"}
|
package/dist/permissions.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ export declare const DESKTOP_PERMISSION_GROUP = "octostar:desktop:";
|
|
|
8
8
|
* Ontology permission group.
|
|
9
9
|
*/
|
|
10
10
|
export declare const ONTOLOGY_PERMISSION_GROUP = "octostar:ontology:";
|
|
11
|
+
/**
|
|
12
|
+
* @beta
|
|
13
|
+
* Report API permission group (Composer / .odoc).
|
|
14
|
+
*/
|
|
15
|
+
export declare const REPORT_PERMISSION_GROUP = "octostar:report:";
|
|
11
16
|
/**
|
|
12
17
|
* @beta
|
|
13
18
|
* All permissions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC,eAAO,MAAM,qBAAqB,UAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC,eAAO,MAAM,qBAAqB,UAAoB,CAAC"}
|
package/dist/permissions.js
CHANGED
|
@@ -9,6 +9,11 @@ export const DESKTOP_PERMISSION_GROUP = 'octostar:desktop:';
|
|
|
9
9
|
* Ontology permission group.
|
|
10
10
|
*/
|
|
11
11
|
export const ONTOLOGY_PERMISSION_GROUP = 'octostar:ontology:';
|
|
12
|
+
/**
|
|
13
|
+
* @beta
|
|
14
|
+
* Report API permission group (Composer / .odoc).
|
|
15
|
+
*/
|
|
16
|
+
export const REPORT_PERMISSION_GROUP = 'octostar:report:';
|
|
12
17
|
/**
|
|
13
18
|
* @beta
|
|
14
19
|
* All permissions.
|
package/dist/permissions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,eAAe,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AAE1D;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -21,8 +21,20 @@ export interface FusionValue<Value = unknown, WithFocus extends boolean = false>
|
|
|
21
21
|
sources: FusionSource<WithFocus>[];
|
|
22
22
|
}
|
|
23
23
|
export type FusionConnectionValue = FusionValue<EConnection>;
|
|
24
|
+
/**
|
|
25
|
+
* Pairs a `FusionConnectionValue[]` with a `truncated` flag indicating that
|
|
26
|
+
* the underlying `getConnectionsByType` SQL hit `CONNECTIONS_QUERY_CAP`.
|
|
27
|
+
* The object shape is deliberate: a previous design hung `truncated` off the
|
|
28
|
+
* array as a non-enumerable property, but `.filter()` / `.slice()` / spread
|
|
29
|
+
* silently dropped it. Consumers must access `.values` to iterate and
|
|
30
|
+
* `.truncated` to surface a "showing first N" notice.
|
|
31
|
+
*/
|
|
32
|
+
export interface FusionConnectionValues {
|
|
33
|
+
values: FusionConnectionValue[];
|
|
34
|
+
truncated: boolean;
|
|
35
|
+
}
|
|
24
36
|
export type FusionConnectedDataKey = 'byConcept' | 'byRelationship';
|
|
25
|
-
type FusionConnectedDataValue = Record<string,
|
|
37
|
+
type FusionConnectedDataValue = Record<string, FusionConnectionValues>;
|
|
26
38
|
export type FusionConnectedData = Record<FusionConnectedDataKey, FusionConnectedDataValue>;
|
|
27
39
|
export interface FusionDocumentContent<MultiEntity extends boolean = false> {
|
|
28
40
|
description?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FusionTypes.d.ts","sourceRoot":"","sources":["../../src/type/FusionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AAElE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAChD,WAAW,EAAE,0BAA0B,CAAC,QAAQ,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,C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,WAAW,SAAS,OAAO,GAAG,KAAK;IACrE,UAAU,CAAC,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/utils.js
CHANGED
|
@@ -16,10 +16,10 @@ export const retry = async (fn, options) => {
|
|
|
16
16
|
return await fn();
|
|
17
17
|
}
|
|
18
18
|
catch (e) {
|
|
19
|
-
if (attempts
|
|
20
|
-
|
|
19
|
+
if (attempts >= maxAttempts) {
|
|
20
|
+
throw e;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
await new Promise(resolve => setTimeout(resolve, retryInterval));
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
};
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,EAAK,EAAoC,EAAE,OAAsB,EAAc,EAAE;IACzG,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,IAAI,CAAC;IAErD,OAAO,IAAI,EAAE,CAAC;QACZ,QAAQ,IAAI,CAAC,CAAC;QAEd,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,EAAK,EAAoC,EAAE,OAAsB,EAAc,EAAE;IACzG,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,IAAI,IAAI,CAAC;IAErD,OAAO,IAAI,EAAE,CAAC;QACZ,QAAQ,IAAI,CAAC,CAAC;QAEd,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,QAAQ,IAAI,WAAW,EAAE,CAAC;gBAC5B,MAAM,CAAC,CAAC;YACV,CAAC;YAED,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octostar/platform-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Provides access to the API exposed by Octostar platform to an application run in an iframe",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"octostar",
|
|
@@ -28,54 +28,32 @@
|
|
|
28
28
|
"module": "dist/index.js",
|
|
29
29
|
"types": "dist/index.d.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@babel/preset-env": "^7.28.3",
|
|
32
31
|
"@types/post-robot": "^10.0.6",
|
|
33
|
-
"
|
|
34
|
-
"lodash": "^4.17.21",
|
|
32
|
+
"lodash": "^4.18.1",
|
|
35
33
|
"post-robot": "^10.0.46",
|
|
36
|
-
"uuid": "^
|
|
34
|
+
"uuid": "^11.1.1"
|
|
37
35
|
},
|
|
38
36
|
"devDependencies": {
|
|
39
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
40
|
-
"@testing-library/react": "^16.3.0",
|
|
41
|
-
"@testing-library/user-event": "^14.6.1",
|
|
42
37
|
"@types/lodash": "^4.17.13",
|
|
43
|
-
"
|
|
44
|
-
"browserify": "^17.0.0",
|
|
45
|
-
"eslint": "^8.57.0",
|
|
46
|
-
"identity-obj-proxy": "^3.0.0",
|
|
38
|
+
"jsdom": "^26.0.0",
|
|
47
39
|
"rimraf": "^5.0.5",
|
|
48
|
-
"ts-node": "^10.9.2",
|
|
49
|
-
"tsup": "^8.4.0",
|
|
50
40
|
"typescript": "^5.8.2",
|
|
51
|
-
"vitest": "^
|
|
52
|
-
"@octostar/platform-types": "0.
|
|
53
|
-
"@repo/eslint-config": "0.0.0",
|
|
54
|
-
"@repo/typescript-config": "0.0.0"
|
|
41
|
+
"vitest": "^4.1.7",
|
|
42
|
+
"@octostar/platform-types": "1.0.0"
|
|
55
43
|
},
|
|
56
44
|
"peerDependencies": {
|
|
57
|
-
"@octostar/platform-types": "^0.
|
|
45
|
+
"@octostar/platform-types": "^1.0.0"
|
|
58
46
|
},
|
|
59
47
|
"publishConfig": {
|
|
60
48
|
"access": "public"
|
|
61
49
|
},
|
|
62
|
-
"lint-staged": {
|
|
63
|
-
"*.{js,jsx,ts,tsx}": [
|
|
64
|
-
"eslint --fix",
|
|
65
|
-
"prettier --write"
|
|
66
|
-
],
|
|
67
|
-
"*.{json,md}": [
|
|
68
|
-
"prettier --write"
|
|
69
|
-
]
|
|
70
|
-
},
|
|
71
50
|
"scripts": {
|
|
72
51
|
"typecheck": "tsc -b",
|
|
73
|
-
"
|
|
74
|
-
"build": "pnpm run clean && pnpm run compile && pnpm run browserify",
|
|
52
|
+
"build": "pnpm run clean && pnpm run compile",
|
|
75
53
|
"clean": "rimraf ./dist ./temp ./.turbo tsconfig.tsbuildinfo",
|
|
76
54
|
"compile": "tsc",
|
|
77
55
|
"dev": "tsc -b -w",
|
|
78
|
-
"lint": "eslint . --max-warnings
|
|
56
|
+
"lint": "eslint . --max-warnings 100",
|
|
79
57
|
"test": "vitest run"
|
|
80
58
|
}
|
|
81
59
|
}
|