@palantir/pack.document-schema.model-types 0.1.0-beta.2 → 0.1.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/.turbo/turbo-lint.log +2 -8
- package/.turbo/turbo-transpileBrowser.log +1 -1
- package/.turbo/turbo-transpileCjs.log +1 -1
- package/.turbo/turbo-transpileEsm.log +1 -1
- package/.turbo/turbo-transpileTypes.log +1 -1
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +28 -0
- package/build/browser/index.js +42 -2
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +50 -1
- package/build/cjs/index.cjs.map +1 -1
- package/build/cjs/index.d.cts +180 -3
- package/build/esm/index.js +42 -2
- package/build/esm/index.js.map +1 -1
- package/build/types/index.d.ts +20 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/types/ActivityEvent.d.ts +27 -0
- package/build/types/types/ActivityEvent.d.ts.map +1 -0
- package/build/types/types/DocumentMetadata.d.ts +29 -0
- package/build/types/types/DocumentMetadata.d.ts.map +1 -0
- package/build/types/types/DocumentRef.d.ts +26 -0
- package/build/types/types/DocumentRef.d.ts.map +1 -0
- package/build/types/types/MediaRef.d.ts +11 -0
- package/build/types/types/MediaRef.d.ts.map +1 -0
- package/build/types/types/Model.d.ts +14 -2
- package/build/types/types/Model.d.ts.map +1 -1
- package/build/types/types/ObjectRef.d.ts +11 -0
- package/build/types/types/ObjectRef.d.ts.map +1 -0
- package/build/types/types/PresenceEvent.d.ts +30 -0
- package/build/types/types/PresenceEvent.d.ts.map +1 -0
- package/build/types/types/RecordCollectionRef.d.ts +18 -0
- package/build/types/types/RecordCollectionRef.d.ts.map +1 -0
- package/build/types/types/RecordRef.d.ts +16 -0
- package/build/types/types/RecordRef.d.ts.map +1 -0
- package/build/types/types/Unsubscribe.d.ts +1 -0
- package/build/types/types/Unsubscribe.d.ts.map +1 -0
- package/build/types/types/UserRef.d.ts +8 -0
- package/build/types/types/UserRef.d.ts.map +1 -0
- package/package.json +7 -4
- package/src/index.ts +39 -1
- package/src/types/ActivityEvent.ts +51 -0
- package/src/types/DocumentMetadata.ts +50 -0
- package/src/types/DocumentRef.ts +59 -0
- package/src/types/MediaRef.ts +32 -0
- package/src/types/Metadata.ts +1 -1
- package/src/types/Model.ts +17 -2
- package/src/types/ObjectRef.ts +32 -0
- package/src/types/PresenceEvent.ts +59 -0
- package/src/types/RecordCollectionRef.ts +49 -0
- package/src/types/RecordRef.ts +36 -0
- package/src/types/Unsubscribe.ts +17 -0
- package/src/types/UserRef.ts +27 -0
package/.turbo/turbo-lint.log
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @palantir/pack.document-schema.model-types@0.1.0
|
|
3
|
-
> eslint ./src
|
|
2
|
+
> @palantir/pack.document-schema.model-types@0.1.0 lint /home/runner/work/pack/pack/packages/document-schema/model-types
|
|
3
|
+
> eslint ./src && dprint check --config $(find-up dprint.json) --allow-no-files
|
|
4
4
|
|
|
5
|
-
Compiling https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm
|
|
6
|
-
Compiling https://plugins.dprint.dev/json-0.20.0.wasm
|
|
7
|
-
Compiling https://plugins.dprint.dev/markdown-0.19.0.wasm
|
|
8
|
-
Compiling https://plugins.dprint.dev/g-plane/markup_fmt-v0.23.1.wasm
|
|
9
|
-
Compiling https://plugins.dprint.dev/g-plane/malva-v0.14.2.wasm
|
|
10
|
-
Compiling https://plugins.dprint.dev/typescript-0.95.10.wasm
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @palantir/pack.document-schema.model-types@0.1.0
|
|
2
|
+
> @palantir/pack.document-schema.model-types@0.1.0 transpileBrowser /home/runner/work/pack/pack/packages/document-schema/model-types
|
|
3
3
|
> monorepo-transpile -f esm -m bundle -t browser
|
|
4
4
|
|
|
5
5
|
👍
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @palantir/pack.document-schema.model-types@0.1.0
|
|
2
|
+
> @palantir/pack.document-schema.model-types@0.1.0 transpileCjs /home/runner/work/pack/pack/packages/document-schema/model-types
|
|
3
3
|
> monorepo-transpile -f cjs -m bundle -t node
|
|
4
4
|
|
|
5
5
|
👍
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @palantir/pack.document-schema.model-types@0.1.0
|
|
2
|
+
> @palantir/pack.document-schema.model-types@0.1.0 transpileEsm /home/runner/work/pack/pack/packages/document-schema/model-types
|
|
3
3
|
> monorepo-transpile -f esm -m bundle -t node
|
|
4
4
|
|
|
5
5
|
👍
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @palantir/pack.document-schema.model-types@0.1.0
|
|
2
|
+
> @palantir/pack.document-schema.model-types@0.1.0 transpileTypes /home/runner/work/pack/pack/packages/document-schema/model-types
|
|
3
3
|
> monorepo-transpile -f esm -m types -t node
|
|
4
4
|
|
|
5
5
|
👍
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @palantir/pack.document-schema.model-types@0.1.0
|
|
2
|
+
> @palantir/pack.document-schema.model-types@0.1.0 typecheck /home/runner/work/pack/pack/packages/document-schema/model-types
|
|
3
3
|
> tsc --noEmit --emitDeclarationOnly false
|
|
4
4
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @palantir/pack.document-schema.model-types
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 77c07c4: Add Core and State Core packages, add Refs to core model types
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 09f7acd: Add activity & presence custom event subscriptions
|
|
12
|
+
- 99d9186: Add doc transactions for grouping multiple edits, and include an optional edit description for activity/history
|
|
13
|
+
- 27a3b33: Initial release
|
|
14
|
+
- 511ee0c: Resetting to beta version of package
|
|
15
|
+
- Updated dependencies [8698373]
|
|
16
|
+
- Updated dependencies [77c07c4]
|
|
17
|
+
- Updated dependencies [3ebc927]
|
|
18
|
+
- @palantir/pack.core@0.1.0
|
|
19
|
+
|
|
20
|
+
## 0.1.0-beta.3
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 77c07c4: Add Core and State Core packages, add Refs to core model types
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [77c07c4]
|
|
29
|
+
- @palantir/pack.core@0.1.0-beta.2
|
|
30
|
+
|
|
3
31
|
## 0.1.0-beta.2
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/build/browser/index.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
// src/types/ActivityEvent.ts
|
|
2
|
+
var ActivityEventDataType = {
|
|
3
|
+
CUSTOM_EVENT: "customEvent",
|
|
4
|
+
UNKNOWN: "unknown"
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/types/DocumentRef.ts
|
|
8
|
+
var DocumentRefBrand = Symbol("pack:DocumentRef");
|
|
9
|
+
|
|
10
|
+
// src/types/MediaRef.ts
|
|
11
|
+
var MediaRefBrand = Symbol("pack:MediaRef");
|
|
12
|
+
|
|
1
13
|
// src/types/Metadata.ts
|
|
2
|
-
var Metadata = Symbol("@pack
|
|
14
|
+
var Metadata = Symbol("@palantir/pack.document-schema/metadata");
|
|
3
15
|
function getMetadata(obj) {
|
|
4
16
|
const metadata = obj[Metadata];
|
|
5
17
|
if (metadata == null) {
|
|
@@ -8,6 +20,34 @@ function getMetadata(obj) {
|
|
|
8
20
|
return metadata;
|
|
9
21
|
}
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
// src/types/Model.ts
|
|
24
|
+
var ExternalRefType = {
|
|
25
|
+
DOC_REF: "docRef",
|
|
26
|
+
MEDIA_REF: "mediaRef",
|
|
27
|
+
OBJECT_REF: "objectRef",
|
|
28
|
+
USER_REF: "userRef"
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/types/ObjectRef.ts
|
|
32
|
+
var ObjectRefBrand = Symbol("pack:ObjectRef");
|
|
33
|
+
|
|
34
|
+
// src/types/PresenceEvent.ts
|
|
35
|
+
var PresenceEventDataType = {
|
|
36
|
+
ARRIVED: "presenceArrived",
|
|
37
|
+
DEPARTED: "presenceDeparted",
|
|
38
|
+
CUSTOM_EVENT: "customEvent",
|
|
39
|
+
UNKNOWN: "unknown"
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// src/types/RecordCollectionRef.ts
|
|
43
|
+
var RecordCollectionRefBrand = Symbol("pack:RecordCollectionRef");
|
|
44
|
+
|
|
45
|
+
// src/types/RecordRef.ts
|
|
46
|
+
var RecordRefBrand = Symbol("pack:RecordRef");
|
|
47
|
+
|
|
48
|
+
// src/types/UserRef.ts
|
|
49
|
+
var UserRefBrand = Symbol("pack:UserRef");
|
|
50
|
+
|
|
51
|
+
export { ActivityEventDataType, DocumentRefBrand, ExternalRefType, MediaRefBrand, Metadata, ObjectRefBrand, PresenceEventDataType, RecordCollectionRefBrand, RecordRefBrand, UserRefBrand, getMetadata };
|
|
12
52
|
//# sourceMappingURL=index.js.map
|
|
13
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/Metadata.ts"],"names":[],"mappings":";AAgBO,IAAM,QAAA,GAAW,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../src/types/ActivityEvent.ts","../../src/types/DocumentRef.ts","../../src/types/MediaRef.ts","../../src/types/Metadata.ts","../../src/types/Model.ts","../../src/types/ObjectRef.ts","../../src/types/PresenceEvent.ts","../../src/types/RecordCollectionRef.ts","../../src/types/RecordRef.ts","../../src/types/UserRef.ts"],"names":[],"mappings":";AAgBO,IAAM,qBAAA,GAAwB;AAAA,EACnC,YAAA,EAAc,aAAA;AAAA,EACd,OAAA,EAAS;AACX;;;ACHO,IAAM,gBAAA,GAAmB,OAAO,kBAAkB;;;ACAlD,IAAM,aAAA,GAAgB,OAAO,eAAe;;;ACA5C,IAAM,QAAA,GAAW,OAAO,yCAAyC;AACjE,SAAS,YAAY,GAAA,EAAK;AAE/B,EAAA,MAAM,QAAA,GAAW,IAAI,QAAQ,CAAA;AAC7B,EAAA,IAAI,YAAY,IAAA,EAAM;AACpB,IAAA,MAAM,IAAI,MAAM,+BAA+B,CAAA;AAAA,EACjD;AACA,EAAA,OAAO,QAAA;AACT;;;ACDO,IAAM,eAAA,GAAkB;AAAA,EAC7B,OAAA,EAAS,QAAA;AAAA,EACT,SAAA,EAAW,UAAA;AAAA,EACX,UAAA,EAAY,WAAA;AAAA,EACZ,QAAA,EAAU;AACZ;;;ACZO,IAAM,cAAA,GAAiB,OAAO,gBAAgB;;;ACA9C,IAAM,qBAAA,GAAwB;AAAA,EACnC,OAAA,EAAS,iBAAA;AAAA,EACT,QAAA,EAAU,kBAAA;AAAA,EACV,YAAA,EAAc,aAAA;AAAA,EACd,OAAA,EAAS;AACX;;;ACLO,IAAM,wBAAA,GAA2B,OAAO,0BAA0B;;;ACAlE,IAAM,cAAA,GAAiB,OAAO,gBAAgB;;;ACA9C,IAAM,YAAA,GAAe,OAAO,cAAc","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const ActivityEventDataType = {\n CUSTOM_EVENT: \"customEvent\",\n UNKNOWN: \"unknown\"\n};\n\n// TODO: add standard document activity events (need to be added to api types)","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DocumentRefBrand = Symbol(\"pack:DocumentRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const MediaRefBrand = Symbol(\"pack:MediaRef\");\n\n/**\n * @experimental\n */","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const Metadata = Symbol(\"@palantir/pack.document-schema/metadata\");\nexport function getMetadata(obj) {\n // TS always treats symbol keys as optional\n const metadata = obj[Metadata];\n if (metadata == null) {\n throw new Error(\"Object does not have metadata\");\n }\n return metadata;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A Model defines the structure of a document record or union.\n *\n * It includes a zod schema for validation and type information.\n */\n// TODO: I think we can/should hide the zod types\n\nexport const ExternalRefType = {\n DOC_REF: \"docRef\",\n MEDIA_REF: \"mediaRef\",\n OBJECT_REF: \"objectRef\",\n USER_REF: \"userRef\"\n};","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const ObjectRefBrand = Symbol(\"pack:ObjectRef\");\n\n/**\n * @experimental\n */","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const PresenceEventDataType = {\n ARRIVED: \"presenceArrived\",\n DEPARTED: \"presenceDeparted\",\n CUSTOM_EVENT: \"customEvent\",\n UNKNOWN: \"unknown\"\n};","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const RecordCollectionRefBrand = Symbol(\"pack:RecordCollectionRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const RecordRefBrand = Symbol(\"pack:RecordRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const UserRefBrand = Symbol(\"pack:UserRef\");"]}
|
package/build/cjs/index.cjs
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// src/types/ActivityEvent.ts
|
|
4
|
+
var ActivityEventDataType = {
|
|
5
|
+
CUSTOM_EVENT: "customEvent",
|
|
6
|
+
UNKNOWN: "unknown"
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// src/types/DocumentRef.ts
|
|
10
|
+
var DocumentRefBrand = Symbol("pack:DocumentRef");
|
|
11
|
+
|
|
12
|
+
// src/types/MediaRef.ts
|
|
13
|
+
var MediaRefBrand = Symbol("pack:MediaRef");
|
|
14
|
+
|
|
3
15
|
// src/types/Metadata.ts
|
|
4
|
-
var Metadata = Symbol("@pack
|
|
16
|
+
var Metadata = Symbol("@palantir/pack.document-schema/metadata");
|
|
5
17
|
function getMetadata(obj) {
|
|
6
18
|
const metadata = obj[Metadata];
|
|
7
19
|
if (metadata == null) {
|
|
@@ -10,7 +22,44 @@ function getMetadata(obj) {
|
|
|
10
22
|
return metadata;
|
|
11
23
|
}
|
|
12
24
|
|
|
25
|
+
// src/types/Model.ts
|
|
26
|
+
var ExternalRefType = {
|
|
27
|
+
DOC_REF: "docRef",
|
|
28
|
+
MEDIA_REF: "mediaRef",
|
|
29
|
+
OBJECT_REF: "objectRef",
|
|
30
|
+
USER_REF: "userRef"
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/types/ObjectRef.ts
|
|
34
|
+
var ObjectRefBrand = Symbol("pack:ObjectRef");
|
|
35
|
+
|
|
36
|
+
// src/types/PresenceEvent.ts
|
|
37
|
+
var PresenceEventDataType = {
|
|
38
|
+
ARRIVED: "presenceArrived",
|
|
39
|
+
DEPARTED: "presenceDeparted",
|
|
40
|
+
CUSTOM_EVENT: "customEvent",
|
|
41
|
+
UNKNOWN: "unknown"
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// src/types/RecordCollectionRef.ts
|
|
45
|
+
var RecordCollectionRefBrand = Symbol("pack:RecordCollectionRef");
|
|
46
|
+
|
|
47
|
+
// src/types/RecordRef.ts
|
|
48
|
+
var RecordRefBrand = Symbol("pack:RecordRef");
|
|
49
|
+
|
|
50
|
+
// src/types/UserRef.ts
|
|
51
|
+
var UserRefBrand = Symbol("pack:UserRef");
|
|
52
|
+
|
|
53
|
+
exports.ActivityEventDataType = ActivityEventDataType;
|
|
54
|
+
exports.DocumentRefBrand = DocumentRefBrand;
|
|
55
|
+
exports.ExternalRefType = ExternalRefType;
|
|
56
|
+
exports.MediaRefBrand = MediaRefBrand;
|
|
13
57
|
exports.Metadata = Metadata;
|
|
58
|
+
exports.ObjectRefBrand = ObjectRefBrand;
|
|
59
|
+
exports.PresenceEventDataType = PresenceEventDataType;
|
|
60
|
+
exports.RecordCollectionRefBrand = RecordCollectionRefBrand;
|
|
61
|
+
exports.RecordRefBrand = RecordRefBrand;
|
|
62
|
+
exports.UserRefBrand = UserRefBrand;
|
|
14
63
|
exports.getMetadata = getMetadata;
|
|
15
64
|
//# sourceMappingURL=index.cjs.map
|
|
16
65
|
//# sourceMappingURL=index.cjs.map
|
package/build/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/Metadata.ts"],"names":[],"mappings":";;;AAgBO,IAAM,QAAA,GAAW,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../src/types/ActivityEvent.ts","../../src/types/DocumentRef.ts","../../src/types/MediaRef.ts","../../src/types/Metadata.ts","../../src/types/Model.ts","../../src/types/ObjectRef.ts","../../src/types/PresenceEvent.ts","../../src/types/RecordCollectionRef.ts","../../src/types/RecordRef.ts","../../src/types/UserRef.ts"],"names":[],"mappings":";;;AAgBO,IAAM,qBAAA,GAAwB;AAAA,EACnC,YAAA,EAAc,aAAA;AAAA,EACd,OAAA,EAAS;AACX;;;ACHO,IAAM,gBAAA,GAAmB,OAAO,kBAAkB;;;ACAlD,IAAM,aAAA,GAAgB,OAAO,eAAe;;;ACA5C,IAAM,QAAA,GAAW,OAAO,yCAAyC;AACjE,SAAS,YAAY,GAAA,EAAK;AAE/B,EAAA,MAAM,QAAA,GAAW,IAAI,QAAQ,CAAA;AAC7B,EAAA,IAAI,YAAY,IAAA,EAAM;AACpB,IAAA,MAAM,IAAI,MAAM,+BAA+B,CAAA;AAAA,EACjD;AACA,EAAA,OAAO,QAAA;AACT;;;ACDO,IAAM,eAAA,GAAkB;AAAA,EAC7B,OAAA,EAAS,QAAA;AAAA,EACT,SAAA,EAAW,UAAA;AAAA,EACX,UAAA,EAAY,WAAA;AAAA,EACZ,QAAA,EAAU;AACZ;;;ACZO,IAAM,cAAA,GAAiB,OAAO,gBAAgB;;;ACA9C,IAAM,qBAAA,GAAwB;AAAA,EACnC,OAAA,EAAS,iBAAA;AAAA,EACT,QAAA,EAAU,kBAAA;AAAA,EACV,YAAA,EAAc,aAAA;AAAA,EACd,OAAA,EAAS;AACX;;;ACLO,IAAM,wBAAA,GAA2B,OAAO,0BAA0B;;;ACAlE,IAAM,cAAA,GAAiB,OAAO,gBAAgB;;;ACA9C,IAAM,YAAA,GAAe,OAAO,cAAc","file":"index.cjs","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const ActivityEventDataType = {\n CUSTOM_EVENT: \"customEvent\",\n UNKNOWN: \"unknown\"\n};\n\n// TODO: add standard document activity events (need to be added to api types)","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DocumentRefBrand = Symbol(\"pack:DocumentRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const MediaRefBrand = Symbol(\"pack:MediaRef\");\n\n/**\n * @experimental\n */","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const Metadata = Symbol(\"@palantir/pack.document-schema/metadata\");\nexport function getMetadata(obj) {\n // TS always treats symbol keys as optional\n const metadata = obj[Metadata];\n if (metadata == null) {\n throw new Error(\"Object does not have metadata\");\n }\n return metadata;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A Model defines the structure of a document record or union.\n *\n * It includes a zod schema for validation and type information.\n */\n// TODO: I think we can/should hide the zod types\n\nexport const ExternalRefType = {\n DOC_REF: \"docRef\",\n MEDIA_REF: \"mediaRef\",\n OBJECT_REF: \"objectRef\",\n USER_REF: \"userRef\"\n};","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const ObjectRefBrand = Symbol(\"pack:ObjectRef\");\n\n/**\n * @experimental\n */","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const PresenceEventDataType = {\n ARRIVED: \"presenceArrived\",\n DEPARTED: \"presenceDeparted\",\n CUSTOM_EVENT: \"customEvent\",\n UNKNOWN: \"unknown\"\n};","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const RecordCollectionRefBrand = Symbol(\"pack:RecordCollectionRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const RecordRefBrand = Symbol(\"pack:RecordRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const UserRefBrand = Symbol(\"pack:UserRef\");"]}
|
package/build/cjs/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Flavored } from '@palantir/pack.core';
|
|
1
2
|
import { ZodType } from 'zod';
|
|
2
3
|
|
|
3
4
|
declare const Metadata: symbol;
|
|
@@ -11,13 +12,88 @@ declare function getMetadata<T>(obj: WithMetadata<T>): T;
|
|
|
11
12
|
*
|
|
12
13
|
* It includes a zod schema for validation and type information.
|
|
13
14
|
*/
|
|
14
|
-
interface Model<T = unknown, Z extends ZodType<T> = ZodType<T>> extends WithMetadata<ModelMetadata
|
|
15
|
+
interface Model<T = unknown, Z extends ZodType<T> = ZodType<T>> extends WithMetadata<ModelMetadata<T>> {
|
|
15
16
|
readonly __type: T;
|
|
16
17
|
readonly zodSchema: Readonly<Z>;
|
|
17
18
|
}
|
|
18
19
|
type ModelData<M extends Model> = M["__type"];
|
|
19
|
-
interface
|
|
20
|
+
interface EditDescription<M extends Model = Model> {
|
|
21
|
+
readonly data: ModelData<M>;
|
|
22
|
+
readonly model: M;
|
|
23
|
+
}
|
|
24
|
+
declare const ExternalRefType: {
|
|
25
|
+
readonly DOC_REF: "docRef";
|
|
26
|
+
readonly MEDIA_REF: "mediaRef";
|
|
27
|
+
readonly OBJECT_REF: "objectRef";
|
|
28
|
+
readonly USER_REF: "userRef";
|
|
29
|
+
};
|
|
30
|
+
type ExternalRefType = typeof ExternalRefType[keyof typeof ExternalRefType];
|
|
31
|
+
interface ModelMetadata<T = unknown> {
|
|
32
|
+
readonly externalRefFieldTypes?: Readonly<Record<keyof T, ExternalRefType>>;
|
|
33
|
+
readonly name: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type UserId = Flavored<"pack:UserId">;
|
|
37
|
+
declare const UserRefBrand: unique symbol;
|
|
38
|
+
interface UserRef {
|
|
39
|
+
readonly userId: UserId;
|
|
40
|
+
readonly [UserRefBrand]: typeof UserRefBrand;
|
|
41
|
+
readonly get: (force?: boolean) => Promise<unknown>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type ActivityEventId = Flavored<"pack:EventId">;
|
|
45
|
+
declare const ActivityEventDataType: {
|
|
46
|
+
readonly CUSTOM_EVENT: "customEvent";
|
|
47
|
+
readonly UNKNOWN: "unknown";
|
|
48
|
+
};
|
|
49
|
+
interface ActivityEventDataCustom<M extends Model = Model> {
|
|
50
|
+
readonly type: typeof ActivityEventDataType.CUSTOM_EVENT;
|
|
51
|
+
readonly model: M;
|
|
52
|
+
readonly eventData: ModelData<M>;
|
|
53
|
+
}
|
|
54
|
+
interface ActivityEventDataUnknown {
|
|
55
|
+
readonly type: "unknown";
|
|
56
|
+
readonly rawType: string;
|
|
57
|
+
readonly rawData: unknown;
|
|
58
|
+
}
|
|
59
|
+
type ActivityEventData = ActivityEventDataCustom | ActivityEventDataUnknown;
|
|
60
|
+
interface ActivityEvent {
|
|
61
|
+
readonly aggregationKey: string;
|
|
62
|
+
readonly createdBy: UserId;
|
|
63
|
+
readonly createdInstant: number;
|
|
64
|
+
readonly eventData: ActivityEventData;
|
|
65
|
+
readonly eventId: ActivityEventId;
|
|
66
|
+
readonly isRead: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface DiscretionaryPrincipal_All {
|
|
70
|
+
"all": Record<string, never>;
|
|
71
|
+
"type": "all";
|
|
72
|
+
}
|
|
73
|
+
interface DiscretionaryPrincipal_UserId {
|
|
74
|
+
"type": "userId";
|
|
75
|
+
"userId": string;
|
|
76
|
+
}
|
|
77
|
+
interface DiscretionaryPrincipal_GroupId {
|
|
78
|
+
"groupId": string;
|
|
79
|
+
"type": "groupId";
|
|
80
|
+
}
|
|
81
|
+
type DiscretionaryPrincipal = DiscretionaryPrincipal_All | DiscretionaryPrincipal_GroupId | DiscretionaryPrincipal_UserId;
|
|
82
|
+
interface DocumentMetadata {
|
|
83
|
+
readonly documentTypeName: string;
|
|
20
84
|
readonly name: string;
|
|
85
|
+
readonly ontologyRid: string;
|
|
86
|
+
readonly security: {
|
|
87
|
+
readonly discretionary: {
|
|
88
|
+
readonly editors?: readonly DiscretionaryPrincipal[];
|
|
89
|
+
readonly owners: readonly DiscretionaryPrincipal[];
|
|
90
|
+
readonly viewers?: readonly DiscretionaryPrincipal[];
|
|
91
|
+
};
|
|
92
|
+
readonly mandatory: {
|
|
93
|
+
readonly classification?: readonly string[];
|
|
94
|
+
readonly markings?: readonly string[];
|
|
95
|
+
};
|
|
96
|
+
};
|
|
21
97
|
}
|
|
22
98
|
|
|
23
99
|
interface DocumentSchema extends WithMetadata<DocumentSchemaMetadata> {
|
|
@@ -32,4 +108,105 @@ interface DocumentSchemaMetadata {
|
|
|
32
108
|
readonly version: number;
|
|
33
109
|
}
|
|
34
110
|
|
|
35
|
-
|
|
111
|
+
declare const PresenceEventDataType: {
|
|
112
|
+
readonly ARRIVED: "presenceArrived";
|
|
113
|
+
readonly DEPARTED: "presenceDeparted";
|
|
114
|
+
readonly CUSTOM_EVENT: "customEvent";
|
|
115
|
+
readonly UNKNOWN: "unknown";
|
|
116
|
+
};
|
|
117
|
+
type PresenceEventDataType = typeof PresenceEventDataType[keyof typeof PresenceEventDataType];
|
|
118
|
+
interface PresenceEventDataArrived {
|
|
119
|
+
readonly type: typeof PresenceEventDataType.ARRIVED;
|
|
120
|
+
}
|
|
121
|
+
interface PresenceEventDataDeparted {
|
|
122
|
+
readonly type: typeof PresenceEventDataType.DEPARTED;
|
|
123
|
+
}
|
|
124
|
+
interface PresenceEventDataCustom<M extends Model = Model> {
|
|
125
|
+
readonly type: typeof PresenceEventDataType.CUSTOM_EVENT;
|
|
126
|
+
readonly eventData: ModelData<M>;
|
|
127
|
+
readonly model: M;
|
|
128
|
+
}
|
|
129
|
+
interface PresenceEventUnknown {
|
|
130
|
+
readonly type: "unknown";
|
|
131
|
+
readonly rawType: string;
|
|
132
|
+
readonly rawData: unknown;
|
|
133
|
+
}
|
|
134
|
+
type PresenceEventData = PresenceEventDataArrived | PresenceEventDataDeparted | PresenceEventDataCustom | PresenceEventUnknown;
|
|
135
|
+
interface PresenceEvent {
|
|
136
|
+
readonly userId: UserId;
|
|
137
|
+
readonly eventData: PresenceEventData;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
type Unsubscribe = () => void;
|
|
141
|
+
|
|
142
|
+
type RecordId = Flavored<"RecordId">;
|
|
143
|
+
declare const RecordRefBrand: unique symbol;
|
|
144
|
+
interface RecordRef<M extends Model = Model> {
|
|
145
|
+
readonly docRef: DocumentRef;
|
|
146
|
+
readonly id: RecordId;
|
|
147
|
+
readonly model: M;
|
|
148
|
+
readonly [RecordRefBrand]: typeof RecordRefBrand;
|
|
149
|
+
getSnapshot(): Promise<ModelData<M>>;
|
|
150
|
+
onChange(callback: (snapshot: ModelData<M>, recordRef: RecordRef<M>) => void): Unsubscribe;
|
|
151
|
+
onDeleted(callback: (recordRef: RecordRef<M>) => void): Unsubscribe;
|
|
152
|
+
set(record: ModelData<M>): Promise<void>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
declare const RecordCollectionRefBrand: unique symbol;
|
|
156
|
+
interface RecordCollectionRef<M extends Model = Model> {
|
|
157
|
+
readonly docRef: DocumentRef;
|
|
158
|
+
readonly model: M;
|
|
159
|
+
readonly [RecordCollectionRefBrand]: typeof RecordCollectionRefBrand;
|
|
160
|
+
delete(id: RecordId): Promise<void>;
|
|
161
|
+
get(id: RecordId): RecordRef<M> | undefined;
|
|
162
|
+
has(id: RecordId): boolean;
|
|
163
|
+
set(id: RecordId, state: ModelData<M>): Promise<void>;
|
|
164
|
+
readonly size: number;
|
|
165
|
+
[Symbol.iterator](): Iterator<RecordRef<M>>;
|
|
166
|
+
readonly onItemsAdded: (callback: (items: readonly RecordRef<M>[]) => void) => () => void;
|
|
167
|
+
readonly onItemsChanged: (callback: (items: readonly RecordRef<M>[]) => void) => () => void;
|
|
168
|
+
readonly onItemsDeleted: (callback: (items: readonly RecordRef<M>[]) => void) => () => void;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
type DocumentId = Flavored<"DocumentId">;
|
|
172
|
+
interface PresenceSubscriptionOptions {
|
|
173
|
+
readonly ignoreSelfUpdates?: boolean;
|
|
174
|
+
}
|
|
175
|
+
declare const DocumentRefBrand: unique symbol;
|
|
176
|
+
interface DocumentRef<D extends DocumentSchema = DocumentSchema> {
|
|
177
|
+
readonly id: DocumentId;
|
|
178
|
+
readonly schema: D;
|
|
179
|
+
readonly [DocumentRefBrand]: typeof DocumentRefBrand;
|
|
180
|
+
getDocSnapshot(): Promise<DocumentState<D>>;
|
|
181
|
+
getRecords<R extends Model>(model: R): RecordCollectionRef<R>;
|
|
182
|
+
onActivity(callback: (docRef: DocumentRef<D>, event: ActivityEvent) => void): Unsubscribe;
|
|
183
|
+
onMetadataChange(callback: (docRef: DocumentRef<D>, metadata: DocumentMetadata) => void): Unsubscribe;
|
|
184
|
+
onPresence(callback: (docRef: DocumentRef<D>, event: PresenceEvent) => void, options?: PresenceSubscriptionOptions): Unsubscribe;
|
|
185
|
+
onStateChange(callback: (docRef: DocumentRef<D>) => void): Unsubscribe;
|
|
186
|
+
updateCustomPresence<M extends Model = Model>(model: M, eventData: ModelData<M>): void;
|
|
187
|
+
withTransaction(fn: () => void, description?: EditDescription): void;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
type MediaId = Flavored<"MediaId">;
|
|
191
|
+
declare const MediaRefBrand: unique symbol;
|
|
192
|
+
/**
|
|
193
|
+
* @experimental
|
|
194
|
+
*/
|
|
195
|
+
interface MediaRef {
|
|
196
|
+
readonly mediaId: MediaId;
|
|
197
|
+
readonly [MediaRefBrand]: typeof MediaRefBrand;
|
|
198
|
+
readonly subscribe?: (callback: unknown) => unknown;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
type ObjectId = Flavored<"ObjectId">;
|
|
202
|
+
declare const ObjectRefBrand: unique symbol;
|
|
203
|
+
/**
|
|
204
|
+
* @experimental
|
|
205
|
+
*/
|
|
206
|
+
interface ObjectRef {
|
|
207
|
+
readonly objectId: ObjectId;
|
|
208
|
+
readonly [ObjectRefBrand]: typeof ObjectRefBrand;
|
|
209
|
+
readonly subscribe?: (callback: unknown) => unknown;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export { type ActivityEvent, type ActivityEventData, type ActivityEventDataCustom, ActivityEventDataType, type ActivityEventDataUnknown, type ActivityEventId, type DiscretionaryPrincipal, type DiscretionaryPrincipal_All, type DiscretionaryPrincipal_GroupId, type DiscretionaryPrincipal_UserId, type DocumentId, type DocumentMetadata, type DocumentRef, DocumentRefBrand, type DocumentSchema, type DocumentSchemaMetadata, type DocumentState, type EditDescription, ExternalRefType, type MediaId, type MediaRef, MediaRefBrand, Metadata, type Model, type ModelData, type ModelMetadata, type ObjectId, type ObjectRef, ObjectRefBrand, type PresenceEvent, type PresenceEventData, type PresenceEventDataArrived, type PresenceEventDataCustom, type PresenceEventDataDeparted, PresenceEventDataType, type PresenceEventUnknown, type PresenceSubscriptionOptions, type RecordCollectionRef, RecordCollectionRefBrand, type RecordId, type RecordRef, RecordRefBrand, type Unsubscribe, type UserId, type UserRef, UserRefBrand, type WithMetadata, getMetadata };
|
package/build/esm/index.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
// src/types/ActivityEvent.ts
|
|
2
|
+
var ActivityEventDataType = {
|
|
3
|
+
CUSTOM_EVENT: "customEvent",
|
|
4
|
+
UNKNOWN: "unknown"
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// src/types/DocumentRef.ts
|
|
8
|
+
var DocumentRefBrand = Symbol("pack:DocumentRef");
|
|
9
|
+
|
|
10
|
+
// src/types/MediaRef.ts
|
|
11
|
+
var MediaRefBrand = Symbol("pack:MediaRef");
|
|
12
|
+
|
|
1
13
|
// src/types/Metadata.ts
|
|
2
|
-
var Metadata = Symbol("@pack
|
|
14
|
+
var Metadata = Symbol("@palantir/pack.document-schema/metadata");
|
|
3
15
|
function getMetadata(obj) {
|
|
4
16
|
const metadata = obj[Metadata];
|
|
5
17
|
if (metadata == null) {
|
|
@@ -8,6 +20,34 @@ function getMetadata(obj) {
|
|
|
8
20
|
return metadata;
|
|
9
21
|
}
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
// src/types/Model.ts
|
|
24
|
+
var ExternalRefType = {
|
|
25
|
+
DOC_REF: "docRef",
|
|
26
|
+
MEDIA_REF: "mediaRef",
|
|
27
|
+
OBJECT_REF: "objectRef",
|
|
28
|
+
USER_REF: "userRef"
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/types/ObjectRef.ts
|
|
32
|
+
var ObjectRefBrand = Symbol("pack:ObjectRef");
|
|
33
|
+
|
|
34
|
+
// src/types/PresenceEvent.ts
|
|
35
|
+
var PresenceEventDataType = {
|
|
36
|
+
ARRIVED: "presenceArrived",
|
|
37
|
+
DEPARTED: "presenceDeparted",
|
|
38
|
+
CUSTOM_EVENT: "customEvent",
|
|
39
|
+
UNKNOWN: "unknown"
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// src/types/RecordCollectionRef.ts
|
|
43
|
+
var RecordCollectionRefBrand = Symbol("pack:RecordCollectionRef");
|
|
44
|
+
|
|
45
|
+
// src/types/RecordRef.ts
|
|
46
|
+
var RecordRefBrand = Symbol("pack:RecordRef");
|
|
47
|
+
|
|
48
|
+
// src/types/UserRef.ts
|
|
49
|
+
var UserRefBrand = Symbol("pack:UserRef");
|
|
50
|
+
|
|
51
|
+
export { ActivityEventDataType, DocumentRefBrand, ExternalRefType, MediaRefBrand, Metadata, ObjectRefBrand, PresenceEventDataType, RecordCollectionRefBrand, RecordRefBrand, UserRefBrand, getMetadata };
|
|
12
52
|
//# sourceMappingURL=index.js.map
|
|
13
53
|
//# sourceMappingURL=index.js.map
|
package/build/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/Metadata.ts"],"names":[],"mappings":";AAgBO,IAAM,QAAA,GAAW,OAAO,
|
|
1
|
+
{"version":3,"sources":["../../src/types/ActivityEvent.ts","../../src/types/DocumentRef.ts","../../src/types/MediaRef.ts","../../src/types/Metadata.ts","../../src/types/Model.ts","../../src/types/ObjectRef.ts","../../src/types/PresenceEvent.ts","../../src/types/RecordCollectionRef.ts","../../src/types/RecordRef.ts","../../src/types/UserRef.ts"],"names":[],"mappings":";AAgBO,IAAM,qBAAA,GAAwB;AAAA,EACnC,YAAA,EAAc,aAAA;AAAA,EACd,OAAA,EAAS;AACX;;;ACHO,IAAM,gBAAA,GAAmB,OAAO,kBAAkB;;;ACAlD,IAAM,aAAA,GAAgB,OAAO,eAAe;;;ACA5C,IAAM,QAAA,GAAW,OAAO,yCAAyC;AACjE,SAAS,YAAY,GAAA,EAAK;AAE/B,EAAA,MAAM,QAAA,GAAW,IAAI,QAAQ,CAAA;AAC7B,EAAA,IAAI,YAAY,IAAA,EAAM;AACpB,IAAA,MAAM,IAAI,MAAM,+BAA+B,CAAA;AAAA,EACjD;AACA,EAAA,OAAO,QAAA;AACT;;;ACDO,IAAM,eAAA,GAAkB;AAAA,EAC7B,OAAA,EAAS,QAAA;AAAA,EACT,SAAA,EAAW,UAAA;AAAA,EACX,UAAA,EAAY,WAAA;AAAA,EACZ,QAAA,EAAU;AACZ;;;ACZO,IAAM,cAAA,GAAiB,OAAO,gBAAgB;;;ACA9C,IAAM,qBAAA,GAAwB;AAAA,EACnC,OAAA,EAAS,iBAAA;AAAA,EACT,QAAA,EAAU,kBAAA;AAAA,EACV,YAAA,EAAc,aAAA;AAAA,EACd,OAAA,EAAS;AACX;;;ACLO,IAAM,wBAAA,GAA2B,OAAO,0BAA0B;;;ACAlE,IAAM,cAAA,GAAiB,OAAO,gBAAgB;;;ACA9C,IAAM,YAAA,GAAe,OAAO,cAAc","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const ActivityEventDataType = {\n CUSTOM_EVENT: \"customEvent\",\n UNKNOWN: \"unknown\"\n};\n\n// TODO: add standard document activity events (need to be added to api types)","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const DocumentRefBrand = Symbol(\"pack:DocumentRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const MediaRefBrand = Symbol(\"pack:MediaRef\");\n\n/**\n * @experimental\n */","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const Metadata = Symbol(\"@palantir/pack.document-schema/metadata\");\nexport function getMetadata(obj) {\n // TS always treats symbol keys as optional\n const metadata = obj[Metadata];\n if (metadata == null) {\n throw new Error(\"Object does not have metadata\");\n }\n return metadata;\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A Model defines the structure of a document record or union.\n *\n * It includes a zod schema for validation and type information.\n */\n// TODO: I think we can/should hide the zod types\n\nexport const ExternalRefType = {\n DOC_REF: \"docRef\",\n MEDIA_REF: \"mediaRef\",\n OBJECT_REF: \"objectRef\",\n USER_REF: \"userRef\"\n};","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const ObjectRefBrand = Symbol(\"pack:ObjectRef\");\n\n/**\n * @experimental\n */","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const PresenceEventDataType = {\n ARRIVED: \"presenceArrived\",\n DEPARTED: \"presenceDeparted\",\n CUSTOM_EVENT: \"customEvent\",\n UNKNOWN: \"unknown\"\n};","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const RecordCollectionRefBrand = Symbol(\"pack:RecordCollectionRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const RecordRefBrand = Symbol(\"pack:RecordRef\");","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const UserRefBrand = Symbol(\"pack:UserRef\");"]}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
|
+
export { ActivityEventDataType } from "./types/ActivityEvent.js";
|
|
2
|
+
export type { ActivityEvent, ActivityEventData, ActivityEventDataCustom, ActivityEventDataUnknown, ActivityEventId } from "./types/ActivityEvent.js";
|
|
3
|
+
export type { DiscretionaryPrincipal, DiscretionaryPrincipal_All, DiscretionaryPrincipal_GroupId, DiscretionaryPrincipal_UserId, DocumentMetadata } from "./types/DocumentMetadata.js";
|
|
4
|
+
export { DocumentRefBrand } from "./types/DocumentRef.js";
|
|
5
|
+
export type { DocumentId, DocumentRef, PresenceSubscriptionOptions } from "./types/DocumentRef.js";
|
|
1
6
|
export type { DocumentSchema, DocumentSchemaMetadata, DocumentState } from "./types/DocumentSchema.js";
|
|
7
|
+
export { MediaRefBrand } from "./types/MediaRef.js";
|
|
8
|
+
export type { MediaId, MediaRef } from "./types/MediaRef.js";
|
|
2
9
|
export { getMetadata, Metadata } from "./types/Metadata.js";
|
|
3
10
|
export type { WithMetadata } from "./types/Metadata.js";
|
|
4
|
-
export
|
|
11
|
+
export { ExternalRefType } from "./types/Model.js";
|
|
12
|
+
export type { EditDescription, Model, ModelData, ModelMetadata } from "./types/Model.js";
|
|
13
|
+
export { ObjectRefBrand } from "./types/ObjectRef.js";
|
|
14
|
+
export type { ObjectId, ObjectRef } from "./types/ObjectRef.js";
|
|
15
|
+
export { PresenceEventDataType } from "./types/PresenceEvent.js";
|
|
16
|
+
export type { PresenceEvent, PresenceEventData, PresenceEventDataArrived, PresenceEventDataCustom, PresenceEventDataDeparted, PresenceEventUnknown } from "./types/PresenceEvent.js";
|
|
17
|
+
export { RecordCollectionRefBrand } from "./types/RecordCollectionRef.js";
|
|
18
|
+
export type { RecordCollectionRef } from "./types/RecordCollectionRef.js";
|
|
19
|
+
export { RecordRefBrand } from "./types/RecordRef.js";
|
|
20
|
+
export type { RecordId, RecordRef } from "./types/RecordRef.js";
|
|
21
|
+
export type { Unsubscribe } from "./types/Unsubscribe.js";
|
|
22
|
+
export { UserRefBrand } from "./types/UserRef.js";
|
|
23
|
+
export type { UserId, UserRef } from "./types/UserRef.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cACE,gBACA,wBACA,qBACK;AACP,SAAS,aAAa,gBAAgB;AACtC,cAAc,oBAAoB;AAClC,cAAc,OAAO,WAAW,qBAAqB","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
1
|
+
{"mappings":"AAgBA,SAAS,6BAA6B;AACtC,cACE,eACA,mBACA,yBACA,0BACA,uBACK;AACP,cACE,wBACA,4BACA,gCACA,+BACA,wBACK;AACP,SAAS,wBAAwB;AACjC,cAAc,YAAY,aAAa,mCAAmC;AAC1E,cACE,gBACA,wBACA,qBACK;AACP,SAAS,qBAAqB;AAC9B,cAAc,SAAS,gBAAgB;AACvC,SAAS,aAAa,gBAAgB;AACtC,cAAc,oBAAoB;AAClC,SAAS,uBAAuB;AAChC,cAAc,iBAAiB,OAAO,WAAW,qBAAqB;AACtE,SAAS,sBAAsB;AAC/B,cAAc,UAAU,iBAAiB;AACzC,SAAS,6BAA6B;AACtC,cACE,eACA,mBACA,0BACA,yBACA,2BACA,4BACK;AACP,SAAS,gCAAgC;AACzC,cAAc,2BAA2B;AACzC,SAAS,sBAAsB;AAC/B,cAAc,UAAU,iBAAiB;AACzC,cAAc,mBAAmB;AACjC,SAAS,oBAAoB;AAC7B,cAAc,QAAQ,eAAe","names":[],"sources":["../../src/index.ts"],"version":3,"file":"index.d.ts"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Flavored } from "@palantir/pack.core";
|
|
2
|
+
import type { Model, ModelData } from "./Model.js";
|
|
3
|
+
import type { UserId } from "./UserRef.js";
|
|
4
|
+
export type ActivityEventId = Flavored<"pack:EventId">;
|
|
5
|
+
export declare const ActivityEventDataType: {
|
|
6
|
+
readonly CUSTOM_EVENT: "customEvent";
|
|
7
|
+
readonly UNKNOWN: "unknown";
|
|
8
|
+
};
|
|
9
|
+
export interface ActivityEventDataCustom<M extends Model = Model> {
|
|
10
|
+
readonly type: typeof ActivityEventDataType.CUSTOM_EVENT;
|
|
11
|
+
readonly model: M;
|
|
12
|
+
readonly eventData: ModelData<M>;
|
|
13
|
+
}
|
|
14
|
+
export interface ActivityEventDataUnknown {
|
|
15
|
+
readonly type: "unknown";
|
|
16
|
+
readonly rawType: string;
|
|
17
|
+
readonly rawData: unknown;
|
|
18
|
+
}
|
|
19
|
+
export type ActivityEventData = ActivityEventDataCustom | ActivityEventDataUnknown;
|
|
20
|
+
export interface ActivityEvent {
|
|
21
|
+
readonly aggregationKey: string;
|
|
22
|
+
readonly createdBy: UserId;
|
|
23
|
+
readonly createdInstant: number;
|
|
24
|
+
readonly eventData: ActivityEventData;
|
|
25
|
+
readonly eventId: ActivityEventId;
|
|
26
|
+
readonly isRead: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,cAAc,gBAAgB;AAC9B,cAAc,OAAO,iBAAiB;AACtC,cAAc,cAAc;AAE5B,YAAY,kBAAkB,SAAS;AAEvC,OAAO,cAAM;UACX,cAAc;UACd,SAAS;;AAGX,iBAAiB,wBAAwB,UAAU,QAAQ,OAAO;UACvD,aAAa,sBAAsB;UACnC,OAAO;UACP,WAAW,UAAU;;AAKhC,iBAAiB,yBAAyB;UAC/B,MAAM;UACN;UACA;;AAGX,YAAY,oBAAoB,0BAA0B;AAE1D,iBAAiB,cAAc;UACpB;UACA,WAAW;UACX;UACA,WAAW;UACX,SAAS;UACT","names":[],"sources":["../../../src/types/ActivityEvent.ts"],"version":3,"file":"ActivityEvent.d.ts"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface DiscretionaryPrincipal_All {
|
|
2
|
+
"all": Record<string, never>;
|
|
3
|
+
"type": "all";
|
|
4
|
+
}
|
|
5
|
+
export interface DiscretionaryPrincipal_UserId {
|
|
6
|
+
"type": "userId";
|
|
7
|
+
"userId": string;
|
|
8
|
+
}
|
|
9
|
+
export interface DiscretionaryPrincipal_GroupId {
|
|
10
|
+
"groupId": string;
|
|
11
|
+
"type": "groupId";
|
|
12
|
+
}
|
|
13
|
+
export type DiscretionaryPrincipal = DiscretionaryPrincipal_All | DiscretionaryPrincipal_GroupId | DiscretionaryPrincipal_UserId;
|
|
14
|
+
export interface DocumentMetadata {
|
|
15
|
+
readonly documentTypeName: string;
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly ontologyRid: string;
|
|
18
|
+
readonly security: {
|
|
19
|
+
readonly discretionary: {
|
|
20
|
+
readonly editors?: readonly DiscretionaryPrincipal[];
|
|
21
|
+
readonly owners: readonly DiscretionaryPrincipal[];
|
|
22
|
+
readonly viewers?: readonly DiscretionaryPrincipal[];
|
|
23
|
+
};
|
|
24
|
+
readonly mandatory: {
|
|
25
|
+
readonly classification?: readonly string[];
|
|
26
|
+
readonly markings?: readonly string[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,iBAAiB,2BAA2B;CAC1C,OAAO;CACP,QAAQ;;AAEV,iBAAiB,8BAA8B;CAC7C,QAAQ;CACR;;AAEF,iBAAiB,+BAA+B;CAC9C;CACA,QAAQ;;AAGV,YAAY,yBACR,6BACA,iCACA;AAEJ,iBAAiB,iBAAiB;UACvB;UACA;UACA;UACA,UAAU;WACR,eAAe;YACb,mBAAmB;YACnB,iBAAiB;YACjB,mBAAmB;;WAErB,WAAW;YACT;YACA","names":[],"sources":["../../../src/types/DocumentMetadata.ts"],"version":3,"file":"DocumentMetadata.d.ts"}
|