@virtru/dsp-sdk 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/.rush/temp/chunked-rush-logs/dsp-sdk._phase_build.chunks.jsonl +3 -3
  2. package/.rush/temp/chunked-rush-logs/dsp-sdk._phase_test.chunks.jsonl +9 -38
  3. package/.rush/temp/package-deps__phase_build.json +29 -17
  4. package/.rush/temp/shrinkwrap-deps.json +174 -85
  5. package/CHANGELOG.json +28 -0
  6. package/CHANGELOG.md +15 -1
  7. package/README.md +10 -0
  8. package/dist/src/gen/config/v1/tagging_pb.d.ts +88 -4
  9. package/dist/src/gen/config/v1/tagging_pb.js +60 -5
  10. package/dist/src/gen/policyimportexport/v1/policy_import_export_pb.d.ts +6 -0
  11. package/dist/src/gen/policyimportexport/v1/policy_import_export_pb.js +2 -1
  12. package/dist/src/gen/virtru/common/common_pb.d.ts +10 -10
  13. package/dist/src/gen/virtru/common/common_pb.js +29 -13
  14. package/dist/src/gen/virtru/policy/certificates/v1/certificates_pb.d.ts +14 -14
  15. package/dist/src/gen/virtru/policy/certificates/v1/certificates_pb.js +40 -16
  16. package/dist/src/gen/virtru/policy/objects_pb.d.ts +5 -5
  17. package/dist/src/gen/virtru/policy/objects_pb.js +26 -12
  18. package/dist/src/index.d.ts +0 -1
  19. package/dist/src/index.js +0 -1
  20. package/dist/src/lib/client.js +1 -1
  21. package/dist/src/lib/utils.js +9 -6
  22. package/dist/tests/dsp.test.js +1 -4
  23. package/package.json +9 -4
  24. package/src/gen/config/formatters/testdata/v1/test_pb.ts +1 -0
  25. package/src/gen/config/v1/config_connect.ts +111 -0
  26. package/src/gen/config/v1/tagging_pb.ts +106 -5
  27. package/src/gen/helloworld/v1/helloworld_connect.ts +49 -0
  28. package/src/gen/helloworld/v1/helloworld_pb.ts +6 -0
  29. package/src/gen/kas/nanotdf/v1/nanotdf_rewrap_connect.ts +39 -0
  30. package/src/gen/kas/nanotdf/v1/nanotdf_rewrap_pb.ts +207 -0
  31. package/src/gen/policyimportexport/v1/policy_import_export_connect.ts +56 -0
  32. package/src/gen/policyimportexport/v1/policy_import_export_pb.ts +10 -2
  33. package/src/gen/shared/v1/shared_connect.ts +61 -0
  34. package/src/gen/shared/v2/shared_connect.ts +39 -0
  35. package/src/gen/tagging/pdp/v2/externalprocessors/processor_connect.ts +156 -0
  36. package/src/gen/tagging/pdp/v2/tagging_connect.ts +73 -0
  37. package/src/gen/version/v1/version_connect.ts +31 -0
  38. package/src/gen/virtru/common/common_pb.ts +55 -33
  39. package/src/gen/virtru/policy/certificates/v1/certificates_pb.ts +188 -143
  40. package/src/gen/virtru/policy/objects_pb.ts +34 -16
  41. package/src/gen/web-admin/v1/config_connect.ts +52 -0
  42. package/src/index.ts +0 -1
  43. package/src/lib/client.ts +5 -1
  44. package/src/lib/utils.test.ts +76 -40
  45. package/src/lib/utils.ts +54 -29
  46. package/tests/dsp.test.ts +2 -6
  47. package/update-protos.sh +63 -0
@@ -1,50 +1,74 @@
1
- // @generated by protoc-gen-es v2.3.0 with parameter "target=ts"
2
- // @generated from file virtru/policy/certificates/v1/certificates.proto (package virtru.policy.certificates.v1, syntax proto3)
3
- /* eslint-disable */
4
- import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv1";
5
- import { file_buf_validate_validate } from "../../../../buf/validate/validate_pb";
6
- import { file_virtru_common_common } from "../../../common/common_pb";
7
- import { file_virtru_policy_objects } from "../../objects_pb";
1
+ /*
2
+ * Copyright (c) Virtru Corporation. All rights reserved.
3
+ *
4
+ * Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
5
+ */
6
+ import { fileDesc, messageDesc, serviceDesc, } from '@bufbuild/protobuf/codegenv1';
7
+ import { file_buf_validate_validate } from '../../../../buf/validate/validate_pb';
8
+ import { file_virtru_common_common } from '../../../common/common_pb';
9
+ import { file_virtru_policy_objects } from '../../objects_pb';
8
10
  /**
9
11
  * Describes the file virtru/policy/certificates/v1/certificates.proto.
10
12
  */
11
- export const file_virtru_policy_certificates_v1_certificates = /*@__PURE__*/ fileDesc("CjB2aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MS9jZXJ0aWZpY2F0ZXMucHJvdG8SHXZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxIl4KFE5hbWVzcGFjZUNlcnRpZmljYXRlEiEKDG5hbWVzcGFjZV9pZBgBIAEoCUILukgIyAEBcgOwAQESIwoOY2VydGlmaWNhdGVfaWQYAiABKAlCC7pICMgBAXIDsAEBIncKIkxpc3RDZXJ0aWZpY2F0ZXNCeU5hbWVzcGFjZVJlcXVlc3QSIQoMbmFtZXNwYWNlX2lkGAEgASgJQgu6SAjIAQFyA7ABARIuCgpwYWdpbmF0aW9uGAogASgLMhoudmlydHJ1LmNvbW1vbi5QYWdlUmVxdWVzdCKIAQojTGlzdENlcnRpZmljYXRlc0J5TmFtZXNwYWNlUmVzcG9uc2USMAoMY2VydGlmaWNhdGVzGAEgAygLMhoudmlydHJ1LnBvbGljeS5DZXJ0aWZpY2F0ZRIvCgpwYWdpbmF0aW9uGAogASgLMhsudmlydHJ1LmNvbW1vbi5QYWdlUmVzcG9uc2UiugMKI0Fzc2lnbkNlcnRpZmljYXRlVG9OYW1lc3BhY2VSZXF1ZXN0EiEKDG5hbWVzcGFjZV9pZBgBIAEoCUILukgIyAEBcgOwAQESEwoDcGVtGAIgASgJQga6SAPIAQESGwoGa2V5X2lkGAMgASgJQgu6SAjIAQFyA7ABARKdAQoNa2V5X2FsZ29yaXRobRgEIAEoDjIYLnZpcnRydS5wb2xpY3kuQWxnb3JpdGhtQmy6SGm6AWYKFWtleV9hbGdvcml0aG1fZGVmaW5lZBI0VGhlIGtleV9hbGdvcml0aG0gbXVzdCBiZSBvbmUgb2YgdGhlIGRlZmluZWQgdmFsdWVzLhoXdGhpcyBpbiBbMSwgMiwgMywgNCwgNV0SFAoEbmFtZRgFIAE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G9OYW1lc3BhY2USQi52aXJ0cnUucG9saWN5LmNlcnRpZmljYXRlcy52MS5Bc3NpZ25DZXJ0aWZpY2F0ZVRvTmFtZXNwYWNlUmVxdWVzdBpDLnZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxLkFzc2lnbkNlcnRpZmljYXRlVG9OYW1lc3BhY2VSZXNwb25zZSIAEq8BCh5SZW1vdmVDZXJ0aWZpY2F0ZUZyb21OYW1lc3BhY2USRC52aXJ0cnUucG9saWN5LmNlcnRpZmljYXRlcy52MS5SZW1vdmVDZXJ0aWZpY2F0ZUZyb21OYW1lc3BhY2VSZXF1ZXN0GkUudmlydHJ1LnBvbGljeS5jZXJ0aWZpY2F0ZXMudjEuUmVtb3ZlQ2VydGlmaWNhdGVGcm9tTmFtZXNwYWNlUmVzcG9uc2UiAELNAQohY29tLnZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxQhFDZXJ0aWZpY2F0ZXNQcm90b1ABogIDVlBDqgIdVmlydHJ1LlBvbGljeS5DZXJ0aWZpY2F0ZXMuVjHKAh1WaXJ0cnVcUG9saWN5XENlcnRpZmljYXRlc1xWMeICKVZpcnRydVxQb2xpY3lcQ2VydGlmaWNhdGVzXFYxXEdQQk1ldGFkYXRh6gIgVmlydHJ1OjpQb2xpY3k6OkNlcnRpZmljYXRlczo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_virtru_common_common, file_virtru_policy_objects]);
13
+ export const file_virtru_policy_certificates_v1_certificates =
14
+ /*@__PURE__*/
15
+ fileDesc('CjB2aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MS9jZXJ0aWZpY2F0ZXMucHJvdG8SHXZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxIl4KFE5hbWVzcGFjZUNlcnRpZmljYXRlEiEKDG5hbWVzcGFjZV9pZBgBIAEoCUILukgIyAEBcgOwAQESIwoOY2VydGlmaWNhdGVfaWQYAiABKAlCC7pICMgBAXIDsAEBIncK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lc3BhY2VSZXF1ZXN0GkUudmlydHJ1LnBvbGljeS5jZXJ0aWZpY2F0ZXMudjEuUmVtb3ZlQ2VydGlmaWNhdGVGcm9tTmFtZXNwYWNlUmVzcG9uc2UiAEK0AgohY29tLnZpcnRydS5wb2xpY3kuY2VydGlmaWNhdGVzLnYxQhFDZXJ0aWZpY2F0ZXNQcm90b1ABWmVnaXRodWIuY29tL3ZpcnRydS1jb3JwL2RhdGEtc2VjdXJpdHktcGxhdGZvcm0vc2RrL3YyL2dlbi92aXJ0cnUvcG9saWN5L2NlcnRpZmljYXRlcy92MTtjZXJ0aWZpY2F0ZXN2MaICA1ZQQ6oCHVZpcnRydS5Qb2xpY3kuQ2VydGlmaWNhdGVzLlYxygIdVmlydHJ1XFBvbGljeVxDZXJ0aWZpY2F0ZXNcVjHiAilWaXJ0cnVcUG9saWN5XENlcnRpZmljYXRlc1xWMVxHUEJNZXRhZGF0YeoCIFZpcnRydTo6UG9saWN5OjpDZXJ0aWZpY2F0ZXM6OlYxYgZwcm90bzM', [
16
+ file_buf_validate_validate,
17
+ file_virtru_common_common,
18
+ file_virtru_policy_objects,
19
+ ]);
12
20
  /**
13
21
  * Describes the message virtru.policy.certificates.v1.NamespaceCertificate.
14
22
  * Use `create(NamespaceCertificateSchema)` to create a new message.
15
23
  */
16
- export const NamespaceCertificateSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 0);
24
+ export const NamespaceCertificateSchema =
25
+ /*@__PURE__*/
26
+ messageDesc(file_virtru_policy_certificates_v1_certificates, 0);
17
27
  /**
18
28
  * Describes the message virtru.policy.certificates.v1.ListCertificatesByNamespaceRequest.
19
29
  * Use `create(ListCertificatesByNamespaceRequestSchema)` to create a new message.
20
30
  */
21
- export const ListCertificatesByNamespaceRequestSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 1);
31
+ export const ListCertificatesByNamespaceRequestSchema =
32
+ /*@__PURE__*/
33
+ messageDesc(file_virtru_policy_certificates_v1_certificates, 1);
22
34
  /**
23
35
  * Describes the message virtru.policy.certificates.v1.ListCertificatesByNamespaceResponse.
24
36
  * Use `create(ListCertificatesByNamespaceResponseSchema)` to create a new message.
25
37
  */
26
- export const ListCertificatesByNamespaceResponseSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 2);
38
+ export const ListCertificatesByNamespaceResponseSchema =
39
+ /*@__PURE__*/
40
+ messageDesc(file_virtru_policy_certificates_v1_certificates, 2);
27
41
  /**
28
42
  * Describes the message virtru.policy.certificates.v1.AssignCertificateToNamespaceRequest.
29
43
  * Use `create(AssignCertificateToNamespaceRequestSchema)` to create a new message.
30
44
  */
31
- export const AssignCertificateToNamespaceRequestSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 3);
45
+ export const AssignCertificateToNamespaceRequestSchema =
46
+ /*@__PURE__*/
47
+ messageDesc(file_virtru_policy_certificates_v1_certificates, 3);
32
48
  /**
33
49
  * Describes the message virtru.policy.certificates.v1.AssignCertificateToNamespaceResponse.
34
50
  * Use `create(AssignCertificateToNamespaceResponseSchema)` to create a new message.
35
51
  */
36
- export const AssignCertificateToNamespaceResponseSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 4);
52
+ export const AssignCertificateToNamespaceResponseSchema =
53
+ /*@__PURE__*/
54
+ messageDesc(file_virtru_policy_certificates_v1_certificates, 4);
37
55
  /**
38
56
  * Describes the message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceRequest.
39
57
  * Use `create(RemoveCertificateFromNamespaceRequestSchema)` to create a new message.
40
58
  */
41
- export const RemoveCertificateFromNamespaceRequestSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 5);
59
+ export const RemoveCertificateFromNamespaceRequestSchema =
60
+ /*@__PURE__*/
61
+ messageDesc(file_virtru_policy_certificates_v1_certificates, 5);
42
62
  /**
43
63
  * Describes the message virtru.policy.certificates.v1.RemoveCertificateFromNamespaceResponse.
44
64
  * Use `create(RemoveCertificateFromNamespaceResponseSchema)` to create a new message.
45
65
  */
46
- export const RemoveCertificateFromNamespaceResponseSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_certificates_v1_certificates, 6);
66
+ export const RemoveCertificateFromNamespaceResponseSchema =
67
+ /*@__PURE__*/
68
+ messageDesc(file_virtru_policy_certificates_v1_certificates, 6);
47
69
  /**
48
70
  * @generated from service virtru.policy.certificates.v1.CertificateService
49
71
  */
50
- export const CertificateService = /*@__PURE__*/ serviceDesc(file_virtru_policy_certificates_v1_certificates, 0);
72
+ export const CertificateService =
73
+ /*@__PURE__*/
74
+ serviceDesc(file_virtru_policy_certificates_v1_certificates, 0);
@@ -1,6 +1,6 @@
1
- import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
2
- import type { Metadata } from "../common/common_pb";
3
- import type { Message } from "@bufbuild/protobuf";
1
+ import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv1';
2
+ import type { Metadata } from '../common/common_pb';
3
+ import type { Message } from '@bufbuild/protobuf';
4
4
  /**
5
5
  * Describes the file virtru/policy/objects.proto.
6
6
  */
@@ -8,7 +8,7 @@ export declare const file_virtru_policy_objects: GenFile;
8
8
  /**
9
9
  * @generated from message virtru.policy.Certificate
10
10
  */
11
- export type Certificate = Message<"virtru.policy.Certificate"> & {
11
+ export type Certificate = Message<'virtru.policy.Certificate'> & {
12
12
  /**
13
13
  * @generated from field: string id = 1;
14
14
  */
@@ -60,7 +60,7 @@ export declare const CertificateSchema: GenMessage<Certificate>;
60
60
  /**
61
61
  * @generated from message virtru.policy.CertificateMapping
62
62
  */
63
- export type CertificateMapping = Message<"virtru.policy.CertificateMapping"> & {
63
+ export type CertificateMapping = Message<'virtru.policy.CertificateMapping'> & {
64
64
  /**
65
65
  * @generated from field: string id = 1;
66
66
  */
@@ -1,23 +1,31 @@
1
- // @generated by protoc-gen-es v2.3.0 with parameter "target=ts"
2
- // @generated from file virtru/policy/objects.proto (package virtru.policy, syntax proto3)
3
- /* eslint-disable */
4
- import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv1";
5
- import { file_buf_validate_validate } from "../../buf/validate/validate_pb";
6
- import { file_virtru_common_common } from "../common/common_pb";
1
+ /*
2
+ * Copyright (c) Virtru Corporation. All rights reserved.
3
+ *
4
+ * Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
5
+ */
6
+ import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv1';
7
+ import { file_buf_validate_validate } from '../../buf/validate/validate_pb';
8
+ import { file_virtru_common_common } from '../common/common_pb';
7
9
  /**
8
10
  * Describes the file virtru/policy/objects.proto.
9
11
  */
10
- export const file_virtru_policy_objects = /*@__PURE__*/ fileDesc("Cht2aXJ0cnUvcG9saWN5L29iamVjdHMucHJvdG8SDXZpcnRydS5wb2xpY3kinwIKC0NlcnRpZmljYXRlEgoKAmlkGAEgASgJEg4KBmtleV9pZBgCIAEoCRIvCg1rZXlfYWxnb3JpdGhtGAMgASgOMhgudmlydHJ1LnBvbGljeS5BbGdvcml0aG0SLAoKa2V5X3N0YXR1cxgEIAEoDjIYLnZpcnRydS5wb2xpY3kuS2V5U3RhdHVzEhQKA3BlbRgFIAEoCUIHukgEcgIQARIVCgRuYW1lGAYgASgJQge6SARyAhABEigKCGtleV9tb2RlGAcgASgOMhYudmlydHJ1LnBvbGljeS5LZXlNb2RlEhMKC2ZpbmdlcnByaW50GAggASgJEikKCG1ldGFkYXRhGGQgASgLMhcudmlydHJ1LmNvbW1vbi5NZXRhZGF0YSKXAQoSQ2VydGlmaWNhdGVNYXBwaW5nEhQKAmlkGAEgASgJQgi6SAVyA7ABARIgCg5jZXJ0aWZpY2F0ZV9pZBgCIAEoCUIIukgFcgOwAQESHgoMbmFtZXNwYWNlX2lkGAMgASgJQgi6SAVyA7ABARIpCghtZXRhZGF0YRhkIAEoCzIXLnZpcnRydS5jb21tb24uTWV0YWRhdGEqmwEKCUFsZ29yaXRobRIZChVBTEdPUklUSE1fVU5TUEVDSUZJRUQQABIWChJBTEdPUklUSE1fUlNBXzIwNDgQARIWChJBTEdPUklUSE1fUlNBXzQwOTYQAhIVChFBTEdPUklUSE1fRUNfUDI1NhADEhUKEUFMR09SSVRITV9FQ19QMzg0EAQSFQoRQUxHT1JJVEhNX0VDX1A1MjEQBSpWCglLZXlTdGF0dXMSGgoWS0VZX1NUQVRVU19VTlNQRUNJRklFRBAAEhUKEUtFWV9TVEFUVVNfQUNUSVZFEAESFgoSS0VZX1NUQVRVU19ST1RBVEVEEAIqlAEKB0tleU1vZGUSGAoUS0VZX01PREVfVU5TUEVDSUZJRUQQABIcChhLRVlfTU9ERV9DT05GSUdfUk9PVF9LRVkQARIeChpLRVlfTU9ERV9QUk9WSURFUl9ST09UX0tFWRACEhMKD0tFWV9NT0RFX1JFTU9URRADEhwKGEtFWV9NT0RFX1BVQkxJQ19LRVlfT05MWRAEQnYKEWNvbS52aXJ0cnUucG9saWN5QgxPYmplY3RzUHJvdG9QAaICA1ZQWKoCDVZpcnRydS5Qb2xpY3nKAg1WaXJ0cnVcUG9saWN54gIZVmlydHJ1XFBvbGljeVxHUEJNZXRhZGF0YeoCDlZpcnRydTo6UG9saWN5YgZwcm90bzM", [file_buf_validate_validate, file_virtru_common_common]);
12
+ export const file_virtru_policy_objects =
13
+ /*@__PURE__*/
14
+ fileDesc('Cht2aXJ0cnUvcG9saWN5L29iamVjdHMucHJvdG8SDXZpcnRydS5wb2xpY3kinwIKC0NlcnRpZmljYXRlEgoKAmlkGAEgASgJEg4KBmtleV9pZBgCIAEoCRIvCg1rZXlfYWxnb3JpdGhtGAMgASgOMhgudmlydHJ1LnBvbGljeS5BbGdvcml0aG0SLAoKa2V5X3N0YXR1cxgEIAEoDjIYLnZpcnRydS5wb2xpY3kuS2V5U3RhdHVzEhQKA3BlbRgFIAEoCUIHukgEcgIQARIVCgRuYW1lGAYgASgJQge6SARyAhABEigK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Qb2xpY3lcR1BCTWV0YWRhdGHqAg5WaXJ0cnU6OlBvbGljeWIGcHJvdG8z', [file_buf_validate_validate, file_virtru_common_common]);
11
15
  /**
12
16
  * Describes the message virtru.policy.Certificate.
13
17
  * Use `create(CertificateSchema)` to create a new message.
14
18
  */
15
- export const CertificateSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_objects, 0);
19
+ export const CertificateSchema =
20
+ /*@__PURE__*/
21
+ messageDesc(file_virtru_policy_objects, 0);
16
22
  /**
17
23
  * Describes the message virtru.policy.CertificateMapping.
18
24
  * Use `create(CertificateMappingSchema)` to create a new message.
19
25
  */
20
- export const CertificateMappingSchema = /*@__PURE__*/ messageDesc(file_virtru_policy_objects, 1);
26
+ export const CertificateMappingSchema =
27
+ /*@__PURE__*/
28
+ messageDesc(file_virtru_policy_objects, 1);
21
29
  /**
22
30
  * @generated from enum virtru.policy.Algorithm
23
31
  */
@@ -51,7 +59,9 @@ export var Algorithm;
51
59
  /**
52
60
  * Describes the enum virtru.policy.Algorithm.
53
61
  */
54
- export const AlgorithmSchema = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 0);
62
+ export const AlgorithmSchema =
63
+ /*@__PURE__*/
64
+ enumDesc(file_virtru_policy_objects, 0);
55
65
  /**
56
66
  * @generated from enum virtru.policy.KeyStatus
57
67
  */
@@ -73,7 +83,9 @@ export var KeyStatus;
73
83
  /**
74
84
  * Describes the enum virtru.policy.KeyStatus.
75
85
  */
76
- export const KeyStatusSchema = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 1);
86
+ export const KeyStatusSchema =
87
+ /*@__PURE__*/
88
+ enumDesc(file_virtru_policy_objects, 1);
77
89
  /**
78
90
  * Describes the management and operational mode of a cryptographic key.
79
91
  *
@@ -123,4 +135,6 @@ export var KeyMode;
123
135
  /**
124
136
  * Describes the enum virtru.policy.KeyMode.
125
137
  */
126
- export const KeyModeSchema = /*@__PURE__*/ enumDesc(file_virtru_policy_objects, 2);
138
+ export const KeyModeSchema =
139
+ /*@__PURE__*/
140
+ enumDesc(file_virtru_policy_objects, 2);
@@ -18,4 +18,3 @@ export { DSP, createDSP } from './lib/dsp';
18
18
  export { version, clientType, tdfSpecVersion, type DecoratedStream, type CreateZTDFOptions, } from '@opentdf/sdk';
19
19
  export { AuthProviders, type AuthProvider } from '@opentdf/sdk';
20
20
  export * as singlecontainer from '@opentdf/sdk/singlecontainer';
21
- export * as nano from '@opentdf/sdk/nano';
package/dist/src/index.js CHANGED
@@ -25,4 +25,3 @@ export { version, clientType, tdfSpecVersion, } from '@opentdf/sdk';
25
25
  // TODO: remove this export once the SDK is updated to deprecate the AuthProvider
26
26
  export { AuthProviders } from '@opentdf/sdk';
27
27
  export * as singlecontainer from '@opentdf/sdk/singlecontainer';
28
- export * as nano from '@opentdf/sdk/nano';
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
5
5
  */
6
- import { createClient } from '@connectrpc/connect';
6
+ import { createClient, } from '@connectrpc/connect';
7
7
  import { createConnectTransport } from '@connectrpc/connect-web';
8
8
  import { ConfigService } from '../gen/config/v1/config_pb';
9
9
  import { PolicyArtifactService } from '../gen/policyimportexport/v1/policy_import_export_pb';
@@ -3,12 +3,12 @@
3
3
  *
4
4
  * Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
5
5
  */
6
- import { AuthProviders, OpenTDF, PermissionDeniedError } from '@opentdf/sdk';
6
+ import { AuthProviders, OpenTDF, PermissionDeniedError, } from '@opentdf/sdk';
7
7
  import { PlatformClient } from '@opentdf/sdk/platform';
8
8
  import { ActiveStateEnum } from '@opentdf/sdk/platform/common/common_pb.js';
9
9
  import * as asn1js from 'asn1js';
10
10
  import * as pkijs from 'pkijs';
11
- import { MAX_CERT_BYTES, MAX_CERTS } from "./consts";
11
+ import { MAX_CERT_BYTES, MAX_CERTS } from './consts';
12
12
  import { DSPClient } from './client';
13
13
  /**
14
14
  * Creates an interceptor that adds authentication headers to outgoing requests.
@@ -207,7 +207,6 @@ export async function getTrustedCertificates(options) {
207
207
  }
208
208
  }
209
209
  catch (error) {
210
- console.error('Error retrieving namespace certificates:', error);
211
210
  throw error;
212
211
  }
213
212
  return certificates;
@@ -311,7 +310,8 @@ export async function validateJWSCertificateChain(x5c, trustedRootCertificates)
311
310
  if (x5c.length > MAX_CERTS) {
312
311
  throw new Error(`Too many certificates in x5c (max ${MAX_CERTS})`);
313
312
  }
314
- if (!Array.isArray(trustedRootCertificates) || trustedRootCertificates.length === 0) {
313
+ if (!Array.isArray(trustedRootCertificates) ||
314
+ trustedRootCertificates.length === 0) {
315
315
  throw new Error('No trusted root certificates provided');
316
316
  }
317
317
  // Parse chain certs (base64 DER)
@@ -369,7 +369,8 @@ export async function validateJWSCertificateChain(x5c, trustedRootCertificates)
369
369
  const leaf = chainCertificates[0];
370
370
  const leafSubject = getNameStringSafe(leaf.subject);
371
371
  const leafIssuer = getNameStringSafe(leaf.issuer);
372
- const baseMsg = verificationResult.resultMessage || 'Certificate chain validation failed';
372
+ const baseMsg = verificationResult.resultMessage ||
373
+ 'Certificate chain validation failed';
373
374
  throw new Error(`${baseMsg} (leaf subject='${leafSubject}', issuer='${leafIssuer}')`);
374
375
  }
375
376
  return {
@@ -382,7 +383,9 @@ export async function validateJWSCertificateChain(x5c, trustedRootCertificates)
382
383
  }
383
384
  catch (error) {
384
385
  const msg = error instanceof Error ? error.message : 'Unknown error';
385
- const warnSuffix = warnings.length ? `; warnings: ${warnings.join(' | ')}` : '';
386
+ const warnSuffix = warnings.length
387
+ ? `; warnings: ${warnings.join(' | ')}`
388
+ : '';
386
389
  throw new Error(`Validation error: ${msg}${warnSuffix}`);
387
390
  }
388
391
  }
@@ -55,7 +55,7 @@ test('should create a new DSP instance with platformUrl', () => {
55
55
  expect(dsp).toBeInstanceOf(DSP);
56
56
  });
57
57
  test('should throw an error if platformUrl is not provided', () => {
58
- expect(() => new DSP({})).toThrowError('Client ID or custom AuthProvider must be defined');
58
+ expect(() => new DSP({ authProvider })).toThrowError('platformUrl is required for DSP client');
59
59
  });
60
60
  test('should create a new DSP instance with platformUrl and authProvider', () => {
61
61
  const dsp = new DSP({ platformUrl, authProvider });
@@ -90,6 +90,3 @@ test('should expose expected service structure', () => {
90
90
  test('should throw if authProvider is missing', () => {
91
91
  expect(() => new DSP({ platformUrl })).toThrowError('Client ID or custom AuthProvider must be defined');
92
92
  });
93
- test('should throw an error if platformUrl is not provided', async () => {
94
- expect(() => new DSP({})).toThrowError();
95
- });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virtru/dsp-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "main": "dist/src/index.js",
6
6
  "exports": {
@@ -19,22 +19,26 @@
19
19
  "node": ">=18.0.0"
20
20
  },
21
21
  "devDependencies": {
22
+ "@eslint/js": "~9.39.2",
22
23
  "@types/node": "^22.0.0",
23
24
  "@vitest/browser": "~3.1.3",
25
+ "eslint": "^9.17.0",
26
+ "eslint-plugin-prettier": "^5.2.1",
24
27
  "globals": "^16.3.0",
25
28
  "jsdom": "^22.1.0",
26
29
  "msw": "^2.8.4",
27
30
  "playwright": "^1.52.0",
31
+ "typescript": "5.8.2",
32
+ "typescript-eslint": "^8.39.1",
28
33
  "vite": "^5.4.21",
29
34
  "vite-plugin-dts": "^4.5.4",
30
- "vitest": "~3.1.3",
31
- "typescript": "5.8.2"
35
+ "vitest": "~3.1.3"
32
36
  },
33
37
  "dependencies": {
34
38
  "@bufbuild/protobuf": "^2.7.0",
35
39
  "@connectrpc/connect": "~2.0.2",
36
40
  "@connectrpc/connect-web": "~2.0.2",
37
- "@opentdf/sdk": "0.8.0-rc.73",
41
+ "@opentdf/sdk": "0.9.0-rc.82",
38
42
  "@rushstack/heft": "^0.50.0",
39
43
  "asn1js": "^3.0.5",
40
44
  "pkijs": "^3.0.19"
@@ -44,6 +48,7 @@
44
48
  "lint": "eslint .",
45
49
  "lint:fix": "eslint . --fix",
46
50
  "test": "npx vitest --run",
51
+ "update-protos": "./update-protos.sh",
47
52
  "_phase:build": "heft build --clean",
48
53
  "_phase:test": "npm run test && heft test --no-build"
49
54
  }
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
5
5
  */
6
+
6
7
  // @generated by protoc-gen-es v2.3.0 with parameter "target=ts"
7
8
  // @generated from file config/formatters/testdata/v1/test.proto (package config.formatters.testdata.v1, syntax proto3)
8
9
  /* eslint-disable */
@@ -0,0 +1,111 @@
1
+ /*
2
+ * Copyright (c) Virtru Corporation. All rights reserved.
3
+ *
4
+ * Your use of this file is governed by the Virtu Terms of Service <https://www.virtru.com/terms-of-service/>.
5
+ */
6
+
7
+ // @generated by protoc-gen-connect-es v1.6.1 with parameter "target=ts"
8
+ // @generated from file config/v1/config.proto (package config.v1, syntax proto3)
9
+ /* eslint-disable */
10
+ // @ts-nocheck
11
+
12
+ import {
13
+ GetKASConfigRequest,
14
+ GetKASConfigResponse,
15
+ GetOutlookConfigRequest,
16
+ GetOutlookConfigResponse,
17
+ GetSecureViewerConfigRequest,
18
+ GetSecureViewerConfigResponse,
19
+ GetTaggingPDPConfigRequest,
20
+ GetTaggingPDPConfigResponse,
21
+ SetKASConfigRequest,
22
+ SetKASConfigResponse,
23
+ SetOutlookConfigRequest,
24
+ SetOutlookConfigResponse,
25
+ SetSecureViewerConfigRequest,
26
+ SetSecureViewerConfigResponse,
27
+ SetTaggingPDPConfigRequest,
28
+ SetTaggingPDPConfigResponse,
29
+ } from './config_pb.js';
30
+ import { MethodKind } from '@bufbuild/protobuf';
31
+
32
+ /**
33
+ * @generated from service config.v1.ConfigService
34
+ */
35
+ export const ConfigService = {
36
+ typeName: 'config.v1.ConfigService',
37
+ methods: {
38
+ /**
39
+ * @generated from rpc config.v1.ConfigService.GetTaggingPDPConfig
40
+ */
41
+ getTaggingPDPConfig: {
42
+ name: 'GetTaggingPDPConfig',
43
+ I: GetTaggingPDPConfigRequest,
44
+ O: GetTaggingPDPConfigResponse,
45
+ kind: MethodKind.Unary,
46
+ },
47
+ /**
48
+ * @generated from rpc config.v1.ConfigService.SetTaggingPDPConfig
49
+ */
50
+ setTaggingPDPConfig: {
51
+ name: 'SetTaggingPDPConfig',
52
+ I: SetTaggingPDPConfigRequest,
53
+ O: SetTaggingPDPConfigResponse,
54
+ kind: MethodKind.Unary,
55
+ },
56
+ /**
57
+ * @generated from rpc config.v1.ConfigService.GetSecureViewerConfig
58
+ */
59
+ getSecureViewerConfig: {
60
+ name: 'GetSecureViewerConfig',
61
+ I: GetSecureViewerConfigRequest,
62
+ O: GetSecureViewerConfigResponse,
63
+ kind: MethodKind.Unary,
64
+ },
65
+ /**
66
+ * @generated from rpc config.v1.ConfigService.SetSecureViewerConfig
67
+ */
68
+ setSecureViewerConfig: {
69
+ name: 'SetSecureViewerConfig',
70
+ I: SetSecureViewerConfigRequest,
71
+ O: SetSecureViewerConfigResponse,
72
+ kind: MethodKind.Unary,
73
+ },
74
+ /**
75
+ * @generated from rpc config.v1.ConfigService.GetOutlookConfig
76
+ */
77
+ getOutlookConfig: {
78
+ name: 'GetOutlookConfig',
79
+ I: GetOutlookConfigRequest,
80
+ O: GetOutlookConfigResponse,
81
+ kind: MethodKind.Unary,
82
+ },
83
+ /**
84
+ * @generated from rpc config.v1.ConfigService.SetOutlookConfig
85
+ */
86
+ setOutlookConfig: {
87
+ name: 'SetOutlookConfig',
88
+ I: SetOutlookConfigRequest,
89
+ O: SetOutlookConfigResponse,
90
+ kind: MethodKind.Unary,
91
+ },
92
+ /**
93
+ * @generated from rpc config.v1.ConfigService.GetKASConfig
94
+ */
95
+ getKASConfig: {
96
+ name: 'GetKASConfig',
97
+ I: GetKASConfigRequest,
98
+ O: GetKASConfigResponse,
99
+ kind: MethodKind.Unary,
100
+ },
101
+ /**
102
+ * @generated from rpc config.v1.ConfigService.SetKASConfig
103
+ */
104
+ setKASConfig: {
105
+ name: 'SetKASConfig',
106
+ I: SetKASConfigRequest,
107
+ O: SetKASConfigResponse,
108
+ kind: MethodKind.Unary,
109
+ },
110
+ },
111
+ } as const;