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.
- package/.github/workflows/ci.yml +41 -0
- package/.husky/commit-msg +4 -0
- package/.husky/pre-commit +4 -0
- package/.mocharc.yml +5 -0
- package/CHANGELOG.md +6 -0
- package/LICENCE +13 -0
- package/README.md +43 -0
- package/VERSION +1 -0
- package/dist/google/api/annotations_pb.d.ts +1 -0
- package/dist/google/api/annotations_pb.js +32 -0
- package/dist/google/api/http_pb.d.ts +1 -0
- package/dist/google/api/http_pb.js +813 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +7 -0
- package/dist/proto/clarifai/api/resources_pb.d.ts +1 -0
- package/dist/proto/clarifai/api/resources_pb.js +32957 -0
- package/dist/proto/clarifai/api/serviceServiceClientPb.d.ts +275 -0
- package/dist/proto/clarifai/api/serviceServiceClientPb.js +904 -0
- package/dist/proto/clarifai/api/service_pb.d.ts +1 -0
- package/dist/proto/clarifai/api/service_pb.js +38791 -0
- package/dist/proto/clarifai/api/status/status_code_pb.d.ts +1 -0
- package/dist/proto/clarifai/api/status/status_code_pb.js +312 -0
- package/dist/proto/clarifai/api/status/status_pb.d.ts +1 -0
- package/dist/proto/clarifai/api/status/status_pb.js +473 -0
- package/dist/proto/clarifai/api/utils/extensions_pb.d.ts +1 -0
- package/dist/proto/clarifai/api/utils/extensions_pb.js +52 -0
- package/dist/proto/clarifai/api/utils/test_proto_pb.d.ts +1 -0
- package/dist/proto/clarifai/api/utils/test_proto_pb.js +521 -0
- package/dist/proto/clarifai/auth/scope/scope_pb.d.ts +1 -0
- package/dist/proto/clarifai/auth/scope/scope_pb.js +294 -0
- package/dist/proto/clarifai/auth/types/types_pb.d.ts +1 -0
- package/dist/proto/clarifai/auth/types/types_pb.js +26 -0
- package/dist/proto/clarifai/auth/util/extension_pb.d.ts +1 -0
- package/dist/proto/clarifai/auth/util/extension_pb.js +80 -0
- package/dist/resources.d.ts +1 -0
- package/dist/resources.js +1 -0
- package/dist/service.d.ts +1 -0
- package/dist/service.js +1 -0
- package/google/api/annotations_grpc_pb.js +1 -0
- package/google/api/annotations_pb.js +47 -0
- package/google/api/http_grpc_pb.js +1 -0
- package/google/api/http_pb.js +1005 -0
- package/index.ts +9 -0
- package/package.json +52 -0
- package/proto/clarifai/api/resources_pb.d.ts +5052 -0
- package/proto/clarifai/api/resources_pb.js +41204 -0
- package/proto/clarifai/api/serviceServiceClientPb.ts +3002 -0
- package/proto/clarifai/api/service_pb.d.ts +5582 -0
- package/proto/clarifai/api/service_pb.js +47897 -0
- package/proto/clarifai/api/status/status_code_pb.d.ts +296 -0
- package/proto/clarifai/api/status/status_code_pb.js +314 -0
- package/proto/clarifai/api/status/status_pb.d.ts +73 -0
- package/proto/clarifai/api/status/status_pb.js +580 -0
- package/proto/clarifai/api/utils/extensions_pb.d.ts +4 -0
- package/proto/clarifai/api/utils/extensions_pb.js +95 -0
- package/proto/clarifai/api/utils/test_proto_pb.d.ts +81 -0
- package/proto/clarifai/api/utils/test_proto_pb.js +640 -0
- package/proto/clarifai/auth/scope/scope_pb.d.ts +92 -0
- package/proto/clarifai/auth/scope/scope_pb.js +363 -0
- package/proto/clarifai/auth/types/types_pb.d.ts +10 -0
- package/proto/clarifai/auth/types/types_pb.js +28 -0
- package/proto/clarifai/auth/util/extension_pb.d.ts +6 -0
- package/proto/clarifai/auth/util/extension_pb.js +151 -0
- package/resources.ts +1 -0
- package/service.desc +10 -0
- package/service.ts +1 -0
- package/tests/basic.test.ts +14 -0
- 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
|
package/.mocharc.yml
ADDED
package/CHANGELOG.md
ADDED
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 {};
|