You've already forked npm-core-sdk
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bfe215e83 | ||
|
|
a9e6f0b34d | ||
|
|
b5d741aaf8 |
2
.npmrc
Normal file
2
.npmrc
Normal file
@@ -0,0 +1,2 @@
|
||||
@reflex-platform:registry=https://git.dev.reflex-platform.com/api/packages/reflex-platform/npm/
|
||||
//git.dev.reflex-platform.com/api/packages/reflex-platform/npm/:_authToken="11177f1f316afadeca69c5cabe3e273ea1b2ed3f"
|
||||
51
README.md
51
README.md
@@ -0,0 +1,51 @@
|
||||
# Reflex Platform Core SDK
|
||||
|
||||
This is the official NPM Core SDK for **Reflex Platform**. It provides client stubs for interacting with Reflex Platform APIs through gRPC.
|
||||
|
||||
## Usage
|
||||
|
||||
Import the SDK in your JavaScript or TypeScript project and use it to communicate with **Reflex Platform** services.
|
||||
|
||||
```js
|
||||
import { ProjectServiceClient, GetMyUIContextRequest } from '@reflex-platform/npm-core-sdk';
|
||||
import { GrpcWebFetchTransport } from '@protobuf-ts/grpcweb-transport'
|
||||
import { type RpcOptions, type RpcInterceptor, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
||||
|
||||
const authInterceptor : RpcInterceptor = {
|
||||
interceptUnary(next, method, input, options: RpcOptions): UnaryCall {
|
||||
options.meta["Authorization"] = "Bearer YOUR_TOKEN";
|
||||
return next(method, input, options);
|
||||
}
|
||||
}
|
||||
|
||||
const coreTransportInstance = new GrpcWebFetchTransport({
|
||||
baseUrl: "grpc.core.dev.reflex-platform.com:443",
|
||||
interceptors: [authInterceptor]
|
||||
});
|
||||
|
||||
const client = new ProjectServiceClient(coreTransportInstance);
|
||||
|
||||
const contexts = await client.GetMyUIContext(new GetMyUIContextRequest());
|
||||
```
|
||||
|
||||
## gRPC Endpoint
|
||||
|
||||
The SDK connects to the following gRPC endpoint:
|
||||
|
||||
```
|
||||
grpc.core.dev.reflex-platform.com
|
||||
```
|
||||
|
||||
## Example Vue.js Application
|
||||
|
||||
A more complete Vue.js application that demonstrates how to integrate the **Reflex Platform NPM SDK** is available. This serves as a reference implementation for using the SDK in a frontend application.
|
||||
|
||||
Repository: [Vue RP Example](https://git.dev.reflex-platform.com/reflex-platform/vue-rp-example)
|
||||
|
||||
## Additional Resources
|
||||
|
||||
For more information on using the Reflex Platform SDK, please refer to the [documentation](https://docs.viz.dev.reflex-platform.com).
|
||||
|
||||
## License
|
||||
|
||||
This SDK is licensed under **MIT License**.
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface MessagingSettings {
|
||||
/**
|
||||
* @generated from protobuf field: string SenderLabel = 4
|
||||
*/
|
||||
SenderLabel: string; // SenderLabel is the label for the sender that will be displayed in messaging communications. Must be an alphanumeric sender ID (up to 11 chars, ASCII letters/digits/spaces)If not set, will use the default Hardis SCN label.
|
||||
SenderLabel: string; // SenderLabel is the label for the sender that will be displayed in messaging communications. Must be uppercase letters only (up to 11 chars). If not set, will use the default Hardis SCN label.
|
||||
}
|
||||
/**
|
||||
* MessagingSettingsHistory represents a record of changes made to the messaging settings for a specific project. It contains information about the user who made the change, the details of the messaging settings that were changed, and the timestamp of when the change was made.
|
||||
@@ -110,7 +110,7 @@ export interface PutMessagingSettingsRequest {
|
||||
/**
|
||||
* @generated from protobuf field: string SenderLabel = 4
|
||||
*/
|
||||
SenderLabel: string; // SenderLabel is the label for the sender that will be displayed in messaging communications. Must be an alphanumeric sender ID (up to 11 chars, ASCII letters/digits/spaces). If not set, will use the default Hardis SCN label.
|
||||
SenderLabel: string; // SenderLabel is the label for the sender that will be displayed in messaging communications. Must be uppercase letters only (up to 11 chars). If not set, will use the default Hardis SCN label.
|
||||
}
|
||||
/**
|
||||
* @generated from protobuf message api.PutMessagingSettingsResponse
|
||||
@@ -152,7 +152,7 @@ class MessagingSettings$Type extends MessageType<MessagingSettings> {
|
||||
{ no: 1, name: "ProjectID", kind: "scalar", localName: "ProjectID", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "MaxUsage", kind: "scalar", localName: "MaxUsage", jsonName: "MaxUsage", T: 2 /*ScalarType.FLOAT*/, options: { "n1validate.rules": { float: { gte: 0 } } } },
|
||||
{ no: 3, name: "Currency", kind: "enum", localName: "Currency", jsonName: "Currency", T: () => ["api.Currency", Currency], options: { "n1validate.rules": { enum: { definedOnly: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "<a href='https://en.wikipedia.org/wiki/ISO_4217'>ISO 4217</a> currency code", example: "[\"EUR\", \"USD\"]" } } },
|
||||
{ no: 4, name: "SenderLabel", kind: "scalar", localName: "SenderLabel", jsonName: "SenderLabel", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { pattern: "^[a-zA-Z0-9 &]{1,11}$", ignoreEmpty: true } } } }
|
||||
{ no: 4, name: "SenderLabel", kind: "scalar", localName: "SenderLabel", jsonName: "SenderLabel", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { pattern: "^[A-Z]{1,11}$", ignoreEmpty: true } } } }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<MessagingSettings>): MessagingSettings {
|
||||
@@ -470,7 +470,7 @@ class PutMessagingSettingsRequest$Type extends MessageType<PutMessagingSettingsR
|
||||
{ no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "n1validate.rules": { message: { required: true } } } },
|
||||
{ no: 2, name: "MaxUsage", kind: "scalar", localName: "MaxUsage", jsonName: "MaxUsage", T: 2 /*ScalarType.FLOAT*/, options: { "n1validate.rules": { float: { gte: 0 } } } },
|
||||
{ no: 3, name: "Currency", kind: "enum", localName: "Currency", jsonName: "Currency", T: () => ["api.Currency", Currency], options: { "n1validate.rules": { enum: { definedOnly: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "<a href='https://en.wikipedia.org/wiki/ISO_4217'>ISO 4217</a> currency code", example: "[\"EUR\", \"USD\"]" } } },
|
||||
{ no: 4, name: "SenderLabel", kind: "scalar", localName: "SenderLabel", jsonName: "SenderLabel", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { pattern: "^[a-zA-Z0-9 &]{1,11}$", ignoreEmpty: true } } } }
|
||||
{ no: 4, name: "SenderLabel", kind: "scalar", localName: "SenderLabel", jsonName: "SenderLabel", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { pattern: "^[A-Z]{1,11}$", ignoreEmpty: true } } } }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "MaxUsage", "Currency", "SenderLabel"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<PutMessagingSettingsRequest>): PutMessagingSettingsRequest {
|
||||
|
||||
4
org.ts
4
org.ts
@@ -525,7 +525,7 @@ class Organisation$Type extends MessageType<Organisation> {
|
||||
constructor() {
|
||||
super("api.Organisation", [
|
||||
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$" } } },
|
||||
{ no: 2, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "\\S" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "\\S" } } },
|
||||
{ no: 3, name: "IDPs", kind: "message", localName: "IDPs", jsonName: "IDPs", repeat: 2 /*RepeatType.UNPACKED*/, T: () => IDP },
|
||||
{ no: 4, name: "status", kind: "enum", T: () => ["api.StatusEnum", StatusEnum], options: { "n1validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 5, name: "Modules", kind: "message", localName: "Modules", jsonName: "Modules", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Module },
|
||||
@@ -759,7 +759,7 @@ class UpdateOrganisationRequest$Type extends MessageType<UpdateOrganisationReque
|
||||
constructor() {
|
||||
super("api.UpdateOrganisationRequest", [
|
||||
{ no: 2, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestOrganisationHeader, options: { "n1validate.rules": { message: { required: true } } } },
|
||||
{ no: 3, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "^[a-zA-Z0-9]+(?:[- ][a-zA-Z0-9]+)*$" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "^[a-zA-Z0-9]+(?:[- ][a-zA-Z0-9]+)*$" } } },
|
||||
{ no: 3, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "\\S" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "\\S" } } },
|
||||
{ no: 4, name: "DefaultLanguageISO6391", kind: "scalar", localName: "DefaultLanguageISO6391", jsonName: "DefaultLanguageISO6391", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "2", maxLen: "3", languageIso639: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "<a href='https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes'>ISO 639 code</a> message language", example: "\"en\"" } } }
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@reflex-platform/npm-core-sdk",
|
||||
"version": "1.15.0-SNAPSHOT-260709132257",
|
||||
"version": "1.15.0-SNAPSHOT-260720121810",
|
||||
"description": "npm libs from core model proto files",
|
||||
"homepage": "",
|
||||
"homepage": "https://git.dev.reflex-platform.com/reflex-platform",
|
||||
"main": "index.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": ""
|
||||
"url": "git+https://git.dev.reflex-platform.com/reflex-platform/npm-core-sdk.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
|
||||
12
proj.ts
12
proj.ts
@@ -467,10 +467,10 @@ class ProjectCreation$Type extends MessageType<ProjectCreation> {
|
||||
constructor() {
|
||||
super("api.ProjectCreation", [
|
||||
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$" } } },
|
||||
{ no: 2, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "^[a-zA-Z0-9]+(?:[- ][a-zA-Z0-9]+)*$" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "^[a-zA-Z0-9]+(?:[- ][a-zA-Z0-9]+)*$" } } },
|
||||
{ no: 2, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "\\S" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "\\S" } } },
|
||||
{ no: 3, name: "Modules", kind: "message", localName: "Modules", jsonName: "Modules", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Module },
|
||||
{ no: 4, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.ProjectType", ProjectType], options: { "n1validate.rules": { enum: { definedOnly: true } } } }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name"] } } });
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ID", "Name", "Type"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<ProjectCreation>): ProjectCreation {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
@@ -538,12 +538,12 @@ class Project$Type extends MessageType<Project> {
|
||||
constructor() {
|
||||
super("api.Project", [
|
||||
{ no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "^([a-z0-9-])+$" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "^([a-z0-9-])+$" } } },
|
||||
{ no: 2, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 2, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "\\S" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "\\S" } } },
|
||||
{ no: 3, name: "OrganisationID", kind: "scalar", localName: "OrganisationID", jsonName: "OrganisationID", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 4, name: "status", kind: "enum", T: () => ["api.ProjectStatusEnum", ProjectStatusEnum], options: { "n1validate.rules": { enum: { definedOnly: true } } } },
|
||||
{ no: 5, name: "Modules", kind: "message", localName: "Modules", jsonName: "Modules", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Module },
|
||||
{ no: 6, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.ProjectType", ProjectType], options: { "n1validate.rules": { enum: { definedOnly: true } } } }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ID", "Name", "OrganisationID"] } } });
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ID", "Name", "OrganisationID", "Type"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<Project>): Project {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
@@ -1027,9 +1027,9 @@ class UpdateProjectRequest$Type extends MessageType<UpdateProjectRequest> {
|
||||
constructor() {
|
||||
super("api.UpdateProjectRequest", [
|
||||
{ no: 2, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "n1validate.rules": { message: { required: true } } } },
|
||||
{ no: 3, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1" } } } },
|
||||
{ no: 3, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "n1validate.rules": { string: { minLen: "1", pattern: "\\S" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { pattern: "\\S" } } },
|
||||
{ no: 4, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.ProjectType", ProjectType], options: { "n1validate.rules": { enum: { definedOnly: true } } } }
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
|
||||
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Name", "Type"] } } });
|
||||
}
|
||||
create(value?: PartialMessage<UpdateProjectRequest>): UpdateProjectRequest {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
|
||||
Reference in New Issue
Block a user