Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
"compile": "tsc -p . && cp -r src/v1 build/src && cp -r proto* build && cp test/*.js build/test",
"prepare": "npm run compile",
"pretest": "npm run compile",
"proto": "npm run proto:datastore",
"proto": "npm run proto:datastore && npm run proto:appenginekey",
"proto:datastore": "mkdir -p proto && pbjs -t static-module -w commonjs -p node_modules/google-proto-files google/datastore/v1/datastore.proto | pbts -i long -o proto/datastore.d.ts -",
"proto:appenginekey": "mkdir -p proto && pbjs -t static-module -w commonjs protos/app_engine_key.proto | pbts -o proto/app_engine_key.d.ts -",
"docs-test": "linkinator docs",
"predocs-test": "npm run docs"
},
Expand Down
303 changes: 303 additions & 0 deletions proto/app_engine_key.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,303 @@
import * as $protobuf from "protobufjs";
/** Properties of a Reference. */
export interface IReference {

/** Reference app */
app: string;

/** Reference namespace */
namespace?: (string|null);

/** Reference path */
path: IPath;

/** Reference databaseId */
databaseId?: (string|null);
}

/** Represents a Reference. */
export class Reference implements IReference {

/**
* Constructs a new Reference.
* @param [properties] Properties to set
*/
constructor(properties?: IReference);

/** Reference app. */
public app: string;

/** Reference namespace. */
public namespace: string;

/** Reference path. */
public path: IPath;

/** Reference databaseId. */
public databaseId: string;

/**
* Creates a new Reference instance using the specified properties.
* @param [properties] Properties to set
* @returns Reference instance
*/
public static create(properties?: IReference): Reference;

/**
* Encodes the specified Reference message. Does not implicitly {@link Reference.verify|verify} messages.
* @param message Reference message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: IReference, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified Reference message, length delimited. Does not implicitly {@link Reference.verify|verify} messages.
* @param message Reference message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: IReference, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a Reference message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Reference
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Reference;

/**
* Decodes a Reference message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Reference
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Reference;

/**
* Verifies a Reference message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates a Reference message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Reference
*/
public static fromObject(object: { [k: string]: any }): Reference;

/**
* Creates a plain object from a Reference message. Also converts values to other types if specified.
* @param message Reference
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: Reference, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this Reference to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}

/** Properties of a Path. */
export interface IPath {

/** Path element */
element?: (Path.IElement[]|null);
}

/** Represents a Path. */
export class Path implements IPath {

/**
* Constructs a new Path.
* @param [properties] Properties to set
*/
constructor(properties?: IPath);

/** Path element. */
public element: Path.IElement[];

/**
* Creates a new Path instance using the specified properties.
* @param [properties] Properties to set
* @returns Path instance
*/
public static create(properties?: IPath): Path;

/**
* Encodes the specified Path message. Does not implicitly {@link Path.verify|verify} messages.
* @param message Path message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: IPath, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified Path message, length delimited. Does not implicitly {@link Path.verify|verify} messages.
* @param message Path message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: IPath, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes a Path message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Path
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Path;

/**
* Decodes a Path message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Path
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Path;

/**
* Verifies a Path message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates a Path message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Path
*/
public static fromObject(object: { [k: string]: any }): Path;

/**
* Creates a plain object from a Path message. Also converts values to other types if specified.
* @param message Path
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: Path, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this Path to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}

export namespace Path {

/** Properties of an Element. */
interface IElement {

/** Element type */
type: string;

/** Element id */
id?: (number|Long|null);

/** Element name */
name?: (string|null);
}

/** Represents an Element. */
class Element implements IElement {

/**
* Constructs a new Element.
* @param [properties] Properties to set
*/
constructor(properties?: Path.IElement);

/** Element type. */
public type: string;

/** Element id. */
public id: (number|Long);

/** Element name. */
public name: string;

/**
* Creates a new Element instance using the specified properties.
* @param [properties] Properties to set
* @returns Element instance
*/
public static create(properties?: Path.IElement): Path.Element;

/**
* Encodes the specified Element message. Does not implicitly {@link Path.Element.verify|verify} messages.
* @param message Element message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: Path.IElement, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified Element message, length delimited. Does not implicitly {@link Path.Element.verify|verify} messages.
* @param message Element message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: Path.IElement, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes an Element message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Element
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Path.Element;

/**
* Decodes an Element message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Element
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Path.Element;

/**
* Verifies an Element message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates an Element message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Element
*/
public static fromObject(object: { [k: string]: any }): Path.Element;

/**
* Creates a plain object from an Element message. Also converts values to other types if specified.
* @param message Element
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: Path.Element, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this Element to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}
}
16 changes: 16 additions & 0 deletions protos/app_engine_key.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto2";

message Reference {
required string app = 13;
optional string namespace = 20;
required Path path = 14;
optional string database_id = 23;
}

message Path {
repeated group Element = 1 {
required string type = 2;
optional int64 id = 3;
optional string name = 4;
}
}
Loading