clarifai-web-grpc 1.0.5 → 1.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/.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,11 @@
1
- ## [1.0.5](https://github.com/Clarifai/clarifai-web-grpc/compare/v1.0.4...v1.0.5) (2022-01-20)
1
+ # [1.1.0](https://github.com/Clarifai/clarifai-web-grpc/compare/v1.0.5...v1.1.0) (2022-01-25)
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
+ * export all the protobuf helpers ([c2ef895](https://github.com/Clarifai/clarifai-web-grpc/commit/c2ef89540400dd9db82e9436301896d51fd4b788))
7
+
8
+
9
+ ### Features
10
+
11
+ * move helpers from index to resources ([e3b6cf1](https://github.com/Clarifai/clarifai-web-grpc/commit/e3b6cf1bcb275c237246382e2f5e2e4b2905ae8e))
@@ -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';
package/dist/cjs/index.js CHANGED
@@ -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; } });
@@ -1,2 +1,12 @@
1
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';
2
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 { 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';
@@ -10,7 +10,38 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Struct = void 0;
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
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; } });
15
23
  var struct_pb_1 = require("google-protobuf/google/protobuf/struct_pb");
16
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; } });
@@ -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';
package/dist/esm/index.js CHANGED
@@ -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';
@@ -1,2 +1,12 @@
1
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';
2
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 { 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';
@@ -1,2 +1,11 @@
1
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';
2
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';
package/index.ts CHANGED
@@ -7,5 +7,3 @@ export class ClarifaiStub {
7
7
  }
8
8
 
9
9
  export { V2Client }
10
- export { Error, Metadata, ClientReadableStream } from 'grpc-web'
11
- export { BaseResponse } from './proto/clarifai/api/status/status_pb'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarifai-web-grpc",
3
- "version": "1.0.5",
3
+ "version": "1.1.0",
4
4
  "description": "The official Clarifai gRPC-web client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -32,7 +32,14 @@
32
32
  "@types/google-protobuf": "~3.7.0",
33
33
  "@types/mocha": "^9.0.0",
34
34
  "@types/node": "~10.17.0",
35
+ "@typescript-eslint/eslint-plugin": "^5.10.1",
36
+ "@typescript-eslint/parser": "^5.10.1",
35
37
  "chai": "^4.3.4",
38
+ "eslint": "^7.32.0",
39
+ "eslint-config-standard": "^16.0.3",
40
+ "eslint-plugin-import": "^2.25.4",
41
+ "eslint-plugin-node": "^11.1.0",
42
+ "eslint-plugin-promise": "^5.2.0",
36
43
  "husky": "^7.0.4",
37
44
  "mocha": "^9.1.3",
38
45
  "semantic-release": "^18.0.1",
package/resources.ts CHANGED
@@ -1,2 +1,15 @@
1
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'
2
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 {
10
+ DoubleValue, FloatValue, Int64Value, UInt64Value, Int32Value, UInt32Value,
11
+ BoolValue, StringValue, BytesValue
12
+ } from 'google-protobuf/google/protobuf/wrappers_pb'
13
+ export { Error, Metadata } from 'grpc-web'
14
+ export { Status, BaseResponse } from './proto/clarifai/api/status/status_pb'
15
+ export { StatusCode } from './proto/clarifai/api/status/status_code_pb'
@@ -1,8 +1,8 @@
1
+ import { describe, it } from 'mocha'
2
+ import { expect } from 'chai'
1
3
  import { ClarifaiStub as StubSRC } from '../index'
2
4
  import { ClarifaiStub as StubCJS } from '../dist/cjs/index'
3
5
  import { ClarifaiStub as StubESM } from '../dist/esm/index'
4
- import { describe, it } from 'mocha'
5
- import { expect } from 'chai'
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 '../resources'
4
+ import * as ResourcesCJS from '../dist/cjs/resources'
5
+ import * as ResourcesESM from '../dist/esm/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
+ })