Add js context to get_activation api method.

This commit is contained in:
Orne Brocaar
2024-02-06 13:16:26 +00:00
parent 8cde64c4b7
commit d599e7a276
38 changed files with 2149 additions and 1641 deletions

View File

@ -128,6 +128,32 @@ export namespace MetricDataset {
}
}
export class JoinServerContext extends jspb.Message {
getSessionKeyId(): string;
setSessionKeyId(value: string): void;
hasAppSKey(): boolean;
clearAppSKey(): void;
getAppSKey(): KeyEnvelope | undefined;
setAppSKey(value?: KeyEnvelope): void;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): JoinServerContext.AsObject;
static toObject(includeInstance: boolean, msg: JoinServerContext): JoinServerContext.AsObject;
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
static serializeBinaryToWriter(message: JoinServerContext, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): JoinServerContext;
static deserializeBinaryFromReader(message: JoinServerContext, reader: jspb.BinaryReader): JoinServerContext;
}
export namespace JoinServerContext {
export type AsObject = {
sessionKeyId: string,
appSKey?: KeyEnvelope.AsObject,
}
}
export interface ModulationMap {
LORA: 0;
FSK: 1;

View File

@ -16,6 +16,7 @@ var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/time
goog.object.extend(proto, google_protobuf_timestamp_pb);
goog.exportSymbol('proto.common.Aggregation', null, global);
goog.exportSymbol('proto.common.DeviceClass', null, global);
goog.exportSymbol('proto.common.JoinServerContext', null, global);
goog.exportSymbol('proto.common.KeyEnvelope', null, global);
goog.exportSymbol('proto.common.Location', null, global);
goog.exportSymbol('proto.common.LocationSource', null, global);
@ -111,6 +112,27 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.common.MetricDataset.displayName = 'proto.common.MetricDataset';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.common.JoinServerContext = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.common.JoinServerContext, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.common.JoinServerContext.displayName = 'proto.common.JoinServerContext';
}
@ -1004,6 +1026,187 @@ proto.common.MetricDataset.prototype.clearDataList = function() {
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.common.JoinServerContext.prototype.toObject = function(opt_includeInstance) {
return proto.common.JoinServerContext.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.common.JoinServerContext} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.common.JoinServerContext.toObject = function(includeInstance, msg) {
var f, obj = {
sessionKeyId: jspb.Message.getFieldWithDefault(msg, 1, ""),
appSKey: (f = msg.getAppSKey()) && proto.common.KeyEnvelope.toObject(includeInstance, f)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.common.JoinServerContext}
*/
proto.common.JoinServerContext.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.common.JoinServerContext;
return proto.common.JoinServerContext.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.common.JoinServerContext} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.common.JoinServerContext}
*/
proto.common.JoinServerContext.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setSessionKeyId(value);
break;
case 2:
var value = new proto.common.KeyEnvelope;
reader.readMessage(value,proto.common.KeyEnvelope.deserializeBinaryFromReader);
msg.setAppSKey(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.common.JoinServerContext.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.common.JoinServerContext.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.common.JoinServerContext} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.common.JoinServerContext.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getSessionKeyId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getAppSKey();
if (f != null) {
writer.writeMessage(
2,
f,
proto.common.KeyEnvelope.serializeBinaryToWriter
);
}
};
/**
* optional string session_key_id = 1;
* @return {string}
*/
proto.common.JoinServerContext.prototype.getSessionKeyId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.common.JoinServerContext} returns this
*/
proto.common.JoinServerContext.prototype.setSessionKeyId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional KeyEnvelope app_s_key = 2;
* @return {?proto.common.KeyEnvelope}
*/
proto.common.JoinServerContext.prototype.getAppSKey = function() {
return /** @type{?proto.common.KeyEnvelope} */ (
jspb.Message.getWrapperField(this, proto.common.KeyEnvelope, 2));
};
/**
* @param {?proto.common.KeyEnvelope|undefined} value
* @return {!proto.common.JoinServerContext} returns this
*/
proto.common.JoinServerContext.prototype.setAppSKey = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.common.JoinServerContext} returns this
*/
proto.common.JoinServerContext.prototype.clearAppSKey = function() {
return this.setAppSKey(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.common.JoinServerContext.prototype.hasAppSKey = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* @enum {number}
*/