clarifai-web-grpc 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.github/workflows/ci.yml +41 -0
  2. package/.husky/commit-msg +4 -0
  3. package/.husky/pre-commit +4 -0
  4. package/.mocharc.yml +5 -0
  5. package/CHANGELOG.md +6 -0
  6. package/LICENCE +13 -0
  7. package/README.md +43 -0
  8. package/VERSION +1 -0
  9. package/dist/google/api/annotations_pb.d.ts +1 -0
  10. package/dist/google/api/annotations_pb.js +32 -0
  11. package/dist/google/api/http_pb.d.ts +1 -0
  12. package/dist/google/api/http_pb.js +813 -0
  13. package/dist/index.d.ts +5 -0
  14. package/dist/index.js +7 -0
  15. package/dist/proto/clarifai/api/resources_pb.d.ts +1 -0
  16. package/dist/proto/clarifai/api/resources_pb.js +32957 -0
  17. package/dist/proto/clarifai/api/serviceServiceClientPb.d.ts +275 -0
  18. package/dist/proto/clarifai/api/serviceServiceClientPb.js +904 -0
  19. package/dist/proto/clarifai/api/service_pb.d.ts +1 -0
  20. package/dist/proto/clarifai/api/service_pb.js +38791 -0
  21. package/dist/proto/clarifai/api/status/status_code_pb.d.ts +1 -0
  22. package/dist/proto/clarifai/api/status/status_code_pb.js +312 -0
  23. package/dist/proto/clarifai/api/status/status_pb.d.ts +1 -0
  24. package/dist/proto/clarifai/api/status/status_pb.js +473 -0
  25. package/dist/proto/clarifai/api/utils/extensions_pb.d.ts +1 -0
  26. package/dist/proto/clarifai/api/utils/extensions_pb.js +52 -0
  27. package/dist/proto/clarifai/api/utils/test_proto_pb.d.ts +1 -0
  28. package/dist/proto/clarifai/api/utils/test_proto_pb.js +521 -0
  29. package/dist/proto/clarifai/auth/scope/scope_pb.d.ts +1 -0
  30. package/dist/proto/clarifai/auth/scope/scope_pb.js +294 -0
  31. package/dist/proto/clarifai/auth/types/types_pb.d.ts +1 -0
  32. package/dist/proto/clarifai/auth/types/types_pb.js +26 -0
  33. package/dist/proto/clarifai/auth/util/extension_pb.d.ts +1 -0
  34. package/dist/proto/clarifai/auth/util/extension_pb.js +80 -0
  35. package/dist/resources.d.ts +1 -0
  36. package/dist/resources.js +1 -0
  37. package/dist/service.d.ts +1 -0
  38. package/dist/service.js +1 -0
  39. package/google/api/annotations_grpc_pb.js +1 -0
  40. package/google/api/annotations_pb.js +47 -0
  41. package/google/api/http_grpc_pb.js +1 -0
  42. package/google/api/http_pb.js +1005 -0
  43. package/index.ts +9 -0
  44. package/package.json +52 -0
  45. package/proto/clarifai/api/resources_pb.d.ts +5052 -0
  46. package/proto/clarifai/api/resources_pb.js +41204 -0
  47. package/proto/clarifai/api/serviceServiceClientPb.ts +3002 -0
  48. package/proto/clarifai/api/service_pb.d.ts +5582 -0
  49. package/proto/clarifai/api/service_pb.js +47897 -0
  50. package/proto/clarifai/api/status/status_code_pb.d.ts +296 -0
  51. package/proto/clarifai/api/status/status_code_pb.js +314 -0
  52. package/proto/clarifai/api/status/status_pb.d.ts +73 -0
  53. package/proto/clarifai/api/status/status_pb.js +580 -0
  54. package/proto/clarifai/api/utils/extensions_pb.d.ts +4 -0
  55. package/proto/clarifai/api/utils/extensions_pb.js +95 -0
  56. package/proto/clarifai/api/utils/test_proto_pb.d.ts +81 -0
  57. package/proto/clarifai/api/utils/test_proto_pb.js +640 -0
  58. package/proto/clarifai/auth/scope/scope_pb.d.ts +92 -0
  59. package/proto/clarifai/auth/scope/scope_pb.js +363 -0
  60. package/proto/clarifai/auth/types/types_pb.d.ts +10 -0
  61. package/proto/clarifai/auth/types/types_pb.js +28 -0
  62. package/proto/clarifai/auth/util/extension_pb.d.ts +6 -0
  63. package/proto/clarifai/auth/util/extension_pb.js +151 -0
  64. package/resources.ts +1 -0
  65. package/service.desc +10 -0
  66. package/service.ts +1 -0
  67. package/tests/basic.test.ts +14 -0
  68. package/tsconfig.json +25 -0
@@ -0,0 +1,41 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-20.04
13
+ steps:
14
+ # Setup steps
15
+ - uses: actions/checkout@v2
16
+ - uses: actions/setup-node@v2
17
+ with:
18
+ node-version: 16
19
+ - name: Install deps
20
+ run: yarn install
21
+ - name: Run tests
22
+ run: yarn test
23
+ - name: Build package
24
+ run: yarn build
25
+
26
+ release:
27
+ needs: build
28
+ runs-on: ubuntu-20.04
29
+ steps:
30
+ # Setup steps
31
+ - uses: actions/checkout@v2
32
+ - uses: actions/setup-node@v2
33
+ with:
34
+ node-version: 16
35
+ - name: Install deps
36
+ run: yarn install
37
+ - name: Release it
38
+ env:
39
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41
+ run: yarn release
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn commitlint --edit "$1"
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn test
package/.mocharc.yml ADDED
@@ -0,0 +1,5 @@
1
+ color: true
2
+ extension:
3
+ - ts
4
+ require: ts-node/register
5
+ spec: tests/**/*.test.ts
package/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # 1.0.0 (2022-01-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add GITHUB_TOKEN to workflow ([a162ad1](https://github.com/Clarifai/clarifai-web-grpc/commit/a162ad1ad8d7a0c5559a25cba62ef3190833d256))
package/LICENCE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2021 Clarifai, Inc.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # clarifai-web-grpc
2
+
3
+ The official Clarifai gRPC client for use in client browser applications.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ yarn add clarifai-web-grpc
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { ClarifaiStub } from 'clarifai-web-grpc'
15
+ import { App } from './resources'
16
+ import { PostAppsRequest } from './service'
17
+
18
+ const client = ClarifaiStub.grpc()
19
+ // use client to create an App
20
+
21
+ const app = new App()
22
+ app.setId('cat-app')
23
+ app.setDefaultWorkflowId('General-Detection')
24
+ app.setDescription('An app for cats')
25
+
26
+ const req = new PostAppsRequest()
27
+ req.setAppsList([
28
+ app
29
+ ])
30
+
31
+ const auth = {
32
+ 'X-Clarifai-Session-Token': 'MY-CLARIFAI-PERSONAL-ACCESS-TOKEN',
33
+ }
34
+
35
+ client.postApps(req, auth, (err, resp) => {
36
+ if (err) {
37
+ console.error(err)
38
+ } else {
39
+ console.log(resp.getAppsList()[0].getId()) // logs "cat-app"
40
+ }
41
+ })
42
+
43
+ ```
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 7.10.0
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ // source: google/api/annotations.proto
3
+ /**
4
+ * @fileoverview
5
+ * @enhanceable
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+ var jspb = require('google-protobuf');
14
+ var goog = jspb;
15
+ var global = Function('return this')();
16
+ var google_api_http_pb = require('../../google/api/http_pb.js');
17
+ goog.object.extend(proto, google_api_http_pb);
18
+ var google_protobuf_descriptor_pb = require('google-protobuf/google/protobuf/descriptor_pb.js');
19
+ goog.object.extend(proto, google_protobuf_descriptor_pb);
20
+ goog.exportSymbol('proto.google.api.http', null, global);
21
+ /**
22
+ * A tuple of {field number, class constructor} for the extension
23
+ * field named `http`.
24
+ * @type {!jspb.ExtensionFieldInfo<!proto.google.api.HttpRule>}
25
+ */
26
+ proto.google.api.http = new jspb.ExtensionFieldInfo(72295728, { http: 0 }, google_api_http_pb.HttpRule,
27
+ /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ (google_api_http_pb.HttpRule.toObject), 0);
28
+ google_protobuf_descriptor_pb.MethodOptions.extensionsBinary[72295728] = new jspb.ExtensionFieldBinaryInfo(proto.google.api.http, jspb.BinaryReader.prototype.readMessage, jspb.BinaryWriter.prototype.writeMessage, google_api_http_pb.HttpRule.serializeBinaryToWriter, google_api_http_pb.HttpRule.deserializeBinaryFromReader, false);
29
+ // This registers the extension field with the extended class, so that
30
+ // toObject() will function correctly.
31
+ google_protobuf_descriptor_pb.MethodOptions.extensions[72295728] = proto.google.api.http;
32
+ goog.object.extend(exports, proto.google.api);
@@ -0,0 +1 @@
1
+ export {};