clarifai-web-grpc 1.0.5 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/.eslintrc.yml +12 -0
  2. package/CHANGELOG.md +3 -2
  3. package/dist/google/api/annotations_grpc_pb.d.ts +0 -0
  4. package/dist/google/api/annotations_grpc_pb.js +2 -0
  5. package/dist/{cjs/google → google}/api/annotations_pb.d.ts +0 -0
  6. package/dist/{cjs/google → google}/api/annotations_pb.js +0 -0
  7. package/dist/google/api/http_grpc_pb.d.ts +0 -0
  8. package/dist/google/api/http_grpc_pb.js +2 -0
  9. package/dist/{cjs/google → google}/api/http_pb.d.ts +0 -0
  10. package/dist/{cjs/google → google}/api/http_pb.js +0 -0
  11. package/dist/{cjs/index.d.ts → index.d.ts} +0 -2
  12. package/dist/{cjs/index.js → index.js} +1 -5
  13. package/dist/{cjs/proto → proto}/clarifai/api/resources_pb.d.ts +0 -0
  14. package/dist/{cjs/proto → proto}/clarifai/api/resources_pb.js +0 -0
  15. package/dist/{cjs/proto → proto}/clarifai/api/serviceServiceClientPb.d.ts +0 -0
  16. package/dist/{cjs/proto → proto}/clarifai/api/serviceServiceClientPb.js +0 -0
  17. package/dist/{cjs/proto → proto}/clarifai/api/service_pb.d.ts +0 -0
  18. package/dist/{cjs/proto → proto}/clarifai/api/service_pb.js +0 -0
  19. package/dist/{cjs/proto → proto}/clarifai/api/status/status_code_pb.d.ts +0 -0
  20. package/dist/{cjs/proto → proto}/clarifai/api/status/status_code_pb.js +0 -0
  21. package/dist/{cjs/proto → proto}/clarifai/api/status/status_pb.d.ts +0 -0
  22. package/dist/{cjs/proto → proto}/clarifai/api/status/status_pb.js +0 -0
  23. package/dist/{cjs/proto → proto}/clarifai/api/utils/extensions_pb.d.ts +0 -0
  24. package/dist/{cjs/proto → proto}/clarifai/api/utils/extensions_pb.js +0 -0
  25. package/dist/{cjs/proto → proto}/clarifai/api/utils/test_proto_pb.d.ts +0 -0
  26. package/dist/{cjs/proto → proto}/clarifai/api/utils/test_proto_pb.js +0 -0
  27. package/dist/{cjs/proto → proto}/clarifai/auth/scope/scope_pb.d.ts +0 -0
  28. package/dist/{cjs/proto → proto}/clarifai/auth/scope/scope_pb.js +0 -0
  29. package/dist/{cjs/proto → proto}/clarifai/auth/types/types_pb.d.ts +0 -0
  30. package/dist/{cjs/proto → proto}/clarifai/auth/types/types_pb.js +0 -0
  31. package/dist/{cjs/proto → proto}/clarifai/auth/util/extension_pb.d.ts +0 -0
  32. package/dist/{cjs/proto → proto}/clarifai/auth/util/extension_pb.js +0 -0
  33. package/dist/resources.d.ts +12 -0
  34. package/dist/resources.js +47 -0
  35. package/dist/{cjs/service.d.ts → service.d.ts} +0 -0
  36. package/dist/{cjs/service.js → service.js} +0 -0
  37. package/lib/google/api/annotations_grpc_pb.d.ts +0 -0
  38. package/lib/google/api/annotations_grpc_pb.js +2 -0
  39. package/{dist/esm → lib}/google/api/annotations_pb.d.ts +0 -0
  40. package/{dist/esm → lib}/google/api/annotations_pb.js +0 -0
  41. package/lib/google/api/http_grpc_pb.d.ts +0 -0
  42. package/lib/google/api/http_grpc_pb.js +2 -0
  43. package/{dist/esm → lib}/google/api/http_pb.d.ts +0 -0
  44. package/{dist/esm → lib}/google/api/http_pb.js +0 -0
  45. package/{dist/esm → lib}/index.d.ts +0 -2
  46. package/{dist/esm → lib}/index.js +0 -2
  47. package/{dist/esm → lib}/proto/clarifai/api/resources_pb.d.ts +0 -0
  48. package/{dist/esm → lib}/proto/clarifai/api/resources_pb.js +0 -0
  49. package/{dist/esm → lib}/proto/clarifai/api/serviceServiceClientPb.d.ts +0 -0
  50. package/{dist/esm → lib}/proto/clarifai/api/serviceServiceClientPb.js +0 -0
  51. package/{dist/esm → lib}/proto/clarifai/api/service_pb.d.ts +0 -0
  52. package/{dist/esm → lib}/proto/clarifai/api/service_pb.js +0 -0
  53. package/{dist/esm → lib}/proto/clarifai/api/status/status_code_pb.d.ts +0 -0
  54. package/{dist/esm → lib}/proto/clarifai/api/status/status_code_pb.js +0 -0
  55. package/{dist/esm → lib}/proto/clarifai/api/status/status_pb.d.ts +0 -0
  56. package/{dist/esm → lib}/proto/clarifai/api/status/status_pb.js +0 -0
  57. package/{dist/esm → lib}/proto/clarifai/api/utils/extensions_pb.d.ts +0 -0
  58. package/{dist/esm → lib}/proto/clarifai/api/utils/extensions_pb.js +0 -0
  59. package/{dist/esm → lib}/proto/clarifai/api/utils/test_proto_pb.d.ts +0 -0
  60. package/{dist/esm → lib}/proto/clarifai/api/utils/test_proto_pb.js +0 -0
  61. package/{dist/esm → lib}/proto/clarifai/auth/scope/scope_pb.d.ts +0 -0
  62. package/{dist/esm → lib}/proto/clarifai/auth/scope/scope_pb.js +0 -0
  63. package/{dist/esm → lib}/proto/clarifai/auth/types/types_pb.d.ts +0 -0
  64. package/{dist/esm → lib}/proto/clarifai/auth/types/types_pb.js +0 -0
  65. package/{dist/esm → lib}/proto/clarifai/auth/util/extension_pb.d.ts +0 -0
  66. package/{dist/esm → lib}/proto/clarifai/auth/util/extension_pb.js +0 -0
  67. package/lib/resources.d.ts +12 -0
  68. package/lib/resources.js +11 -0
  69. package/{dist/esm → lib}/service.d.ts +0 -0
  70. package/{dist/esm → lib}/service.js +0 -0
  71. package/package.json +28 -6
  72. package/{google → src/google}/api/annotations_grpc_pb.js +0 -0
  73. package/{google → src/google}/api/annotations_pb.js +0 -0
  74. package/{google → src/google}/api/http_grpc_pb.js +0 -0
  75. package/{google → src/google}/api/http_pb.js +0 -0
  76. package/{proto → src/proto}/clarifai/api/resources_pb.d.ts +0 -0
  77. package/{proto → src/proto}/clarifai/api/resources_pb.js +0 -0
  78. package/{proto → src/proto}/clarifai/api/serviceServiceClientPb.ts +0 -0
  79. package/{proto → src/proto}/clarifai/api/service_pb.d.ts +0 -0
  80. package/{proto → src/proto}/clarifai/api/service_pb.js +0 -0
  81. package/{proto → src/proto}/clarifai/api/status/status_code_pb.d.ts +0 -0
  82. package/{proto → src/proto}/clarifai/api/status/status_code_pb.js +0 -0
  83. package/{proto → src/proto}/clarifai/api/status/status_pb.d.ts +0 -0
  84. package/{proto → src/proto}/clarifai/api/status/status_pb.js +0 -0
  85. package/{proto → src/proto}/clarifai/api/utils/extensions_pb.d.ts +0 -0
  86. package/{proto → src/proto}/clarifai/api/utils/extensions_pb.js +0 -0
  87. package/{proto → src/proto}/clarifai/api/utils/test_proto_pb.d.ts +0 -0
  88. package/{proto → src/proto}/clarifai/api/utils/test_proto_pb.js +0 -0
  89. package/{proto → src/proto}/clarifai/auth/scope/scope_pb.d.ts +0 -0
  90. package/{proto → src/proto}/clarifai/auth/scope/scope_pb.js +0 -0
  91. package/{proto → src/proto}/clarifai/auth/types/types_pb.d.ts +0 -0
  92. package/{proto → src/proto}/clarifai/auth/types/types_pb.js +0 -0
  93. package/{proto → src/proto}/clarifai/auth/util/extension_pb.d.ts +0 -0
  94. package/{proto → src/proto}/clarifai/auth/util/extension_pb.js +0 -0
  95. package/tests/basic.test.ts +3 -3
  96. package/tests/helpers.test.ts +47 -0
  97. package/tsconfig.cjs.json +1 -1
  98. package/tsconfig.json +2 -5
  99. package/dist/cjs/resources.d.ts +0 -2
  100. package/dist/cjs/resources.js +0 -16
  101. package/dist/esm/resources.d.ts +0 -2
  102. package/dist/esm/resources.js +0 -2
  103. package/index.ts +0 -11
  104. package/resources.ts +0 -2
  105. package/service.ts +0 -1
package/.eslintrc.yml ADDED
@@ -0,0 +1,12 @@
1
+ env:
2
+ browser: true
3
+ es2021: true
4
+ extends:
5
+ - standard
6
+ parser: '@typescript-eslint/parser'
7
+ parserOptions:
8
+ ecmaVersion: 12
9
+ sourceType: module
10
+ plugins:
11
+ - '@typescript-eslint'
12
+ rules: {}
package/CHANGELOG.md CHANGED
@@ -1,6 +1,7 @@
1
- ## [1.0.5](https://github.com/Clarifai/clarifai-web-grpc/compare/v1.0.4...v1.0.5) (2022-01-20)
1
+ ## [1.1.3](https://github.com/Clarifai/clarifai-web-grpc/compare/v1.1.2...v1.1.3) (2022-01-28)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * correct default host. re-export struct for convenience ([c71e83f](https://github.com/Clarifai/clarifai-web-grpc/commit/c71e83f0f41e4c57274676bf9e90eea6f56ff850))
6
+ * fix the paths in the lint cmd ([31e58c8](https://github.com/Clarifai/clarifai-web-grpc/commit/31e58c876dbc7414637b9608c42d3217be34a366))
7
+ * move stuff to src, split dist/esm to lib for easier entry references ([a41e660](https://github.com/Clarifai/clarifai-web-grpc/commit/a41e660324233900339579696f97e8330bad4b31))
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ // GENERATED CODE -- NO SERVICES IN PROTO
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ // GENERATED CODE -- NO SERVICES IN PROTO
File without changes
File without changes
@@ -3,5 +3,3 @@ export declare class ClarifaiStub {
3
3
  static grpc(hostname?: string): V2Client;
4
4
  }
5
5
  export { V2Client };
6
- export { Error, Metadata, ClientReadableStream } from 'grpc-web';
7
- export { BaseResponse } from './proto/clarifai/api/status/status_pb';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseResponse = exports.ClientReadableStream = exports.V2Client = exports.ClarifaiStub = void 0;
3
+ exports.V2Client = exports.ClarifaiStub = void 0;
4
4
  const serviceServiceClientPb_1 = require("./proto/clarifai/api/serviceServiceClientPb");
5
5
  Object.defineProperty(exports, "V2Client", { enumerable: true, get: function () { return serviceServiceClientPb_1.V2Client; } });
6
6
  class ClarifaiStub {
@@ -9,7 +9,3 @@ class ClarifaiStub {
9
9
  }
10
10
  }
11
11
  exports.ClarifaiStub = ClarifaiStub;
12
- var grpc_web_1 = require("grpc-web");
13
- Object.defineProperty(exports, "ClientReadableStream", { enumerable: true, get: function () { return grpc_web_1.ClientReadableStream; } });
14
- var status_pb_1 = require("./proto/clarifai/api/status/status_pb");
15
- Object.defineProperty(exports, "BaseResponse", { enumerable: true, get: function () { return status_pb_1.BaseResponse; } });
@@ -0,0 +1,12 @@
1
+ export * from './proto/clarifai/api/resources_pb';
2
+ export { Any } from 'google-protobuf/google/protobuf/any_pb';
3
+ export { Api } from 'google-protobuf/google/protobuf/api_pb';
4
+ export { Duration } from 'google-protobuf/google/protobuf/duration_pb';
5
+ export { Empty } from 'google-protobuf/google/protobuf/empty_pb';
6
+ export { Struct } from 'google-protobuf/google/protobuf/struct_pb';
7
+ export { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
8
+ export { Type, Field, Enum, EnumValue, Option } from 'google-protobuf/google/protobuf/type_pb';
9
+ export { DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue } from 'google-protobuf/google/protobuf/wrappers_pb';
10
+ export type { Error, Metadata } from 'grpc-web';
11
+ export { Status, BaseResponse } from './proto/clarifai/api/status/status_pb';
12
+ export { StatusCode } from './proto/clarifai/api/status/status_code_pb';
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.StatusCode = exports.BaseResponse = exports.Status = exports.BytesValue = exports.StringValue = exports.BoolValue = exports.UInt32Value = exports.Int32Value = exports.UInt64Value = exports.Int64Value = exports.FloatValue = exports.DoubleValue = exports.Option = exports.EnumValue = exports.Enum = exports.Field = exports.Type = exports.Timestamp = exports.Struct = exports.Empty = exports.Duration = exports.Api = exports.Any = void 0;
14
+ __exportStar(require("./proto/clarifai/api/resources_pb"), exports);
15
+ var any_pb_1 = require("google-protobuf/google/protobuf/any_pb");
16
+ Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return any_pb_1.Any; } });
17
+ var api_pb_1 = require("google-protobuf/google/protobuf/api_pb");
18
+ Object.defineProperty(exports, "Api", { enumerable: true, get: function () { return api_pb_1.Api; } });
19
+ var duration_pb_1 = require("google-protobuf/google/protobuf/duration_pb");
20
+ Object.defineProperty(exports, "Duration", { enumerable: true, get: function () { return duration_pb_1.Duration; } });
21
+ var empty_pb_1 = require("google-protobuf/google/protobuf/empty_pb");
22
+ Object.defineProperty(exports, "Empty", { enumerable: true, get: function () { return empty_pb_1.Empty; } });
23
+ var struct_pb_1 = require("google-protobuf/google/protobuf/struct_pb");
24
+ Object.defineProperty(exports, "Struct", { enumerable: true, get: function () { return struct_pb_1.Struct; } });
25
+ var timestamp_pb_1 = require("google-protobuf/google/protobuf/timestamp_pb");
26
+ Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return timestamp_pb_1.Timestamp; } });
27
+ var type_pb_1 = require("google-protobuf/google/protobuf/type_pb");
28
+ Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return type_pb_1.Type; } });
29
+ Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return type_pb_1.Field; } });
30
+ Object.defineProperty(exports, "Enum", { enumerable: true, get: function () { return type_pb_1.Enum; } });
31
+ Object.defineProperty(exports, "EnumValue", { enumerable: true, get: function () { return type_pb_1.EnumValue; } });
32
+ Object.defineProperty(exports, "Option", { enumerable: true, get: function () { return type_pb_1.Option; } });
33
+ var wrappers_pb_1 = require("google-protobuf/google/protobuf/wrappers_pb");
34
+ Object.defineProperty(exports, "DoubleValue", { enumerable: true, get: function () { return wrappers_pb_1.DoubleValue; } });
35
+ Object.defineProperty(exports, "FloatValue", { enumerable: true, get: function () { return wrappers_pb_1.FloatValue; } });
36
+ Object.defineProperty(exports, "Int64Value", { enumerable: true, get: function () { return wrappers_pb_1.Int64Value; } });
37
+ Object.defineProperty(exports, "UInt64Value", { enumerable: true, get: function () { return wrappers_pb_1.UInt64Value; } });
38
+ Object.defineProperty(exports, "Int32Value", { enumerable: true, get: function () { return wrappers_pb_1.Int32Value; } });
39
+ Object.defineProperty(exports, "UInt32Value", { enumerable: true, get: function () { return wrappers_pb_1.UInt32Value; } });
40
+ Object.defineProperty(exports, "BoolValue", { enumerable: true, get: function () { return wrappers_pb_1.BoolValue; } });
41
+ Object.defineProperty(exports, "StringValue", { enumerable: true, get: function () { return wrappers_pb_1.StringValue; } });
42
+ Object.defineProperty(exports, "BytesValue", { enumerable: true, get: function () { return wrappers_pb_1.BytesValue; } });
43
+ var status_pb_1 = require("./proto/clarifai/api/status/status_pb");
44
+ Object.defineProperty(exports, "Status", { enumerable: true, get: function () { return status_pb_1.Status; } });
45
+ Object.defineProperty(exports, "BaseResponse", { enumerable: true, get: function () { return status_pb_1.BaseResponse; } });
46
+ var status_code_pb_1 = require("./proto/clarifai/api/status/status_code_pb");
47
+ Object.defineProperty(exports, "StatusCode", { enumerable: true, get: function () { return status_code_pb_1.StatusCode; } });
File without changes
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ // GENERATED CODE -- NO SERVICES IN PROTO
File without changes
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ // GENERATED CODE -- NO SERVICES IN PROTO
File without changes
File without changes
@@ -3,5 +3,3 @@ export declare class ClarifaiStub {
3
3
  static grpc(hostname?: string): V2Client;
4
4
  }
5
5
  export { V2Client };
6
- export { Error, Metadata, ClientReadableStream } from 'grpc-web';
7
- export { BaseResponse } from './proto/clarifai/api/status/status_pb';
@@ -5,5 +5,3 @@ export class ClarifaiStub {
5
5
  }
6
6
  }
7
7
  export { V2Client };
8
- export { ClientReadableStream } from 'grpc-web';
9
- export { BaseResponse } from './proto/clarifai/api/status/status_pb';
@@ -0,0 +1,12 @@
1
+ export * from './proto/clarifai/api/resources_pb';
2
+ export { Any } from 'google-protobuf/google/protobuf/any_pb';
3
+ export { Api } from 'google-protobuf/google/protobuf/api_pb';
4
+ export { Duration } from 'google-protobuf/google/protobuf/duration_pb';
5
+ export { Empty } from 'google-protobuf/google/protobuf/empty_pb';
6
+ export { Struct } from 'google-protobuf/google/protobuf/struct_pb';
7
+ export { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
8
+ export { Type, Field, Enum, EnumValue, Option } from 'google-protobuf/google/protobuf/type_pb';
9
+ export { DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue } from 'google-protobuf/google/protobuf/wrappers_pb';
10
+ export type { Error, Metadata } from 'grpc-web';
11
+ export { Status, BaseResponse } from './proto/clarifai/api/status/status_pb';
12
+ export { StatusCode } from './proto/clarifai/api/status/status_code_pb';
@@ -0,0 +1,11 @@
1
+ export * from './proto/clarifai/api/resources_pb';
2
+ export { Any } from 'google-protobuf/google/protobuf/any_pb';
3
+ export { Api } from 'google-protobuf/google/protobuf/api_pb';
4
+ export { Duration } from 'google-protobuf/google/protobuf/duration_pb';
5
+ export { Empty } from 'google-protobuf/google/protobuf/empty_pb';
6
+ export { Struct } from 'google-protobuf/google/protobuf/struct_pb';
7
+ export { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
8
+ export { Type, Field, Enum, EnumValue, Option } from 'google-protobuf/google/protobuf/type_pb';
9
+ export { DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value, BoolValue, StringValue, BytesValue } from 'google-protobuf/google/protobuf/wrappers_pb';
10
+ export { Status, BaseResponse } from './proto/clarifai/api/status/status_pb';
11
+ export { StatusCode } from './proto/clarifai/api/status/status_code_pb';
File without changes
File without changes
package/package.json CHANGED
@@ -1,18 +1,33 @@
1
1
  {
2
2
  "name": "clarifai-web-grpc",
3
- "version": "1.0.5",
3
+ "version": "1.1.3",
4
4
  "description": "The official Clarifai gRPC-web client",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/esm/index.d.ts",
5
+ "main": "dist/index.js",
6
+ "module": "lib/index.js",
7
+ "types": "lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./lib/index.js",
11
+ "require": "./dist/index.js"
12
+ },
13
+ "./resources": {
14
+ "import": "./lib/resources.js",
15
+ "require": "./dist/resources.js"
16
+ },
17
+ "./service": {
18
+ "import": "./lib/service.js",
19
+ "require": "./dist/service.js"
20
+ }
21
+ },
8
22
  "repository": "https://github.com/Clarifai/clarifai-web-grpc",
9
23
  "author": "Clarifai Inc.",
10
24
  "license": "Apache-2.0",
11
25
  "keywords": [],
12
26
  "scripts": {
13
27
  "test": "mocha",
14
- "lint": "standard index.ts resources.ts service.ts",
15
- "clean": "rm -rf dist clarifai-web-grpc-*.tgz",
28
+ "lint": "eslint ./src/index.ts ./src/resources.ts ./src/service.ts",
29
+ "clean": "rm -rf dist lib clarifai-web-grpc-*.tgz",
30
+ "typecheck": "tsc --pretty --noEmit",
16
31
  "build:cjs": "tsc -b tsconfig.cjs.json",
17
32
  "build:esm": "tsc -b",
18
33
  "build": "yarn build:esm && yarn build:cjs",
@@ -32,7 +47,14 @@
32
47
  "@types/google-protobuf": "~3.7.0",
33
48
  "@types/mocha": "^9.0.0",
34
49
  "@types/node": "~10.17.0",
50
+ "@typescript-eslint/eslint-plugin": "^5.10.1",
51
+ "@typescript-eslint/parser": "^5.10.1",
35
52
  "chai": "^4.3.4",
53
+ "eslint": "^7.32.0",
54
+ "eslint-config-standard": "^16.0.3",
55
+ "eslint-plugin-import": "^2.25.4",
56
+ "eslint-plugin-node": "^11.1.0",
57
+ "eslint-plugin-promise": "^5.2.0",
36
58
  "husky": "^7.0.4",
37
59
  "mocha": "^9.1.3",
38
60
  "semantic-release": "^18.0.1",
File without changes
File without changes
File without changes
File without changes
@@ -1,8 +1,8 @@
1
- import { ClarifaiStub as StubSRC } from '../index'
2
- import { ClarifaiStub as StubCJS } from '../dist/cjs/index'
3
- import { ClarifaiStub as StubESM } from '../dist/esm/index'
4
1
  import { describe, it } from 'mocha'
5
2
  import { expect } from 'chai'
3
+ import { ClarifaiStub as StubSRC } from '../src/index'
4
+ import { ClarifaiStub as StubCJS } from '../dist/index'
5
+ import { ClarifaiStub as StubESM } from '../lib/index'
6
6
 
7
7
  describe('Client Stub (src)', () => {
8
8
  it('works', () => {
@@ -0,0 +1,47 @@
1
+ import { describe, it } from 'mocha'
2
+ import { expect } from 'chai'
3
+ import * as ResourcesSRC from '../src/resources'
4
+ import * as ResourcesCJS from '../dist/resources'
5
+ import * as ResourcesESM from '../lib/resources'
6
+
7
+ function verifyInterface (modInterface: Record<string, unknown>) {
8
+ expect(modInterface.Any).to.be.instanceOf(Function)
9
+ expect(modInterface.Api).to.be.instanceOf(Function)
10
+ expect(modInterface.Duration).to.be.instanceOf(Function)
11
+ expect(modInterface.Empty).to.be.instanceOf(Function)
12
+ expect(modInterface.Struct).to.be.instanceOf(Function)
13
+ expect(modInterface.Timestamp).to.be.instanceOf(Function)
14
+ expect(modInterface.Type).to.be.instanceOf(Function)
15
+ expect(modInterface.Field).to.be.instanceOf(Function)
16
+ expect(modInterface.Enum).to.be.instanceOf(Function)
17
+ expect(modInterface.EnumValue).to.be.instanceOf(Function)
18
+ expect(modInterface.Option).to.be.instanceOf(Function)
19
+ expect(modInterface.DoubleValue).to.be.instanceOf(Function)
20
+ expect(modInterface.FloatValue).to.be.instanceOf(Function)
21
+ expect(modInterface.Int64Value).to.be.instanceOf(Function)
22
+ expect(modInterface.UInt64Value).to.be.instanceOf(Function)
23
+ expect(modInterface.Int32Value).to.be.instanceOf(Function)
24
+ expect(modInterface.UInt32Value).to.be.instanceOf(Function)
25
+ expect(modInterface.BoolValue).to.be.instanceOf(Function)
26
+ expect(modInterface.StringValue).to.be.instanceOf(Function)
27
+ expect(modInterface.BytesValue).to.be.instanceOf(Function)
28
+ expect(modInterface.BaseResponse).to.be.instanceOf(Function)
29
+ }
30
+
31
+ describe('Resources/Helpers (src)', () => {
32
+ it('exports various google-protobuf & grpc-web helper classes', () => {
33
+ verifyInterface(ResourcesSRC)
34
+ })
35
+ })
36
+
37
+ describe('Resources/Helpers (cjs)', () => {
38
+ it('exports various google-protobuf & grpc-web helper classes', () => {
39
+ verifyInterface(ResourcesCJS)
40
+ })
41
+ })
42
+
43
+ describe('Resources/Helpers (esm)', () => {
44
+ it('exports various google-protobuf & grpc-web helper classes', () => {
45
+ verifyInterface(ResourcesESM)
46
+ })
47
+ })
package/tsconfig.cjs.json CHANGED
@@ -2,6 +2,6 @@
2
2
  "extends": "./tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "module": "CommonJS",
5
- "outDir": "./dist/cjs"
5
+ "outDir": "./dist"
6
6
  }
7
7
  }
package/tsconfig.json CHANGED
@@ -5,14 +5,11 @@
5
5
  "strict": true,
6
6
  "declaration": true,
7
7
  "allowJs": true,
8
- "outDir": "./dist/esm",
8
+ "outDir": "./lib",
9
9
  "moduleResolution": "node"
10
10
  },
11
11
  "include": [
12
- "./index.ts",
13
- "./resources.ts",
14
- "./service.ts",
15
- "proto/",
12
+ "./src",
16
13
  ],
17
14
  "exclude": [
18
15
  "node_modules"
@@ -1,2 +0,0 @@
1
- export * from './proto/clarifai/api/resources_pb';
2
- export { Struct } from 'google-protobuf/google/protobuf/struct_pb';
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Struct = void 0;
14
- __exportStar(require("./proto/clarifai/api/resources_pb"), exports);
15
- var struct_pb_1 = require("google-protobuf/google/protobuf/struct_pb");
16
- Object.defineProperty(exports, "Struct", { enumerable: true, get: function () { return struct_pb_1.Struct; } });
@@ -1,2 +0,0 @@
1
- export * from './proto/clarifai/api/resources_pb';
2
- export { Struct } from 'google-protobuf/google/protobuf/struct_pb';
@@ -1,2 +0,0 @@
1
- export * from './proto/clarifai/api/resources_pb';
2
- export { Struct } from 'google-protobuf/google/protobuf/struct_pb';
package/index.ts DELETED
@@ -1,11 +0,0 @@
1
- import { V2Client } from './proto/clarifai/api/serviceServiceClientPb'
2
-
3
- export class ClarifaiStub {
4
- static grpc (hostname = 'api-grpc-web.clarifai.com') {
5
- return new V2Client(hostname)
6
- }
7
- }
8
-
9
- export { V2Client }
10
- export { Error, Metadata, ClientReadableStream } from 'grpc-web'
11
- export { BaseResponse } from './proto/clarifai/api/status/status_pb'
package/resources.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './proto/clarifai/api/resources_pb'
2
- export { Struct } from 'google-protobuf/google/protobuf/struct_pb'
package/service.ts DELETED
@@ -1 +0,0 @@
1
- export * from './proto/clarifai/api/service_pb'