linuxcnc-grpc 0.6.0-beta.1
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/dist/__tests__/client.test.d.ts +6 -0
- package/dist/__tests__/client.test.js +292 -0
- package/dist/hal.d.ts +637 -0
- package/dist/hal.js +4149 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +70 -0
- package/dist/linuxcnc.d.ts +903 -0
- package/dist/linuxcnc.js +7441 -0
- package/package.json +54 -0
- package/src/__tests__/client.test.ts +373 -0
- package/src/hal.ts +5153 -0
- package/src/index.ts +35 -0
- package/src/linuxcnc.ts +8840 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LinuxCNC gRPC client for TypeScript/JavaScript
|
|
3
|
+
*
|
|
4
|
+
* This package provides TypeScript types and gRPC client stubs for
|
|
5
|
+
* communicating with a LinuxCNC gRPC server.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { LinuxCNCServiceClient, GetStatusRequest, credentials } from 'linuxcnc-grpc';
|
|
10
|
+
*
|
|
11
|
+
* const client = new LinuxCNCServiceClient(
|
|
12
|
+
* 'localhost:50051',
|
|
13
|
+
* credentials.createInsecure()
|
|
14
|
+
* );
|
|
15
|
+
*
|
|
16
|
+
* client.getStatus(GetStatusRequest.create(), (err, status) => {
|
|
17
|
+
* if (err) {
|
|
18
|
+
* console.error('Error:', err);
|
|
19
|
+
* return;
|
|
20
|
+
* }
|
|
21
|
+
* console.log('Status:', status);
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
import * as grpc from '@grpc/grpc-js';
|
|
26
|
+
export declare const credentials: {
|
|
27
|
+
combineChannelCredentials: (channelCredentials: grpc.ChannelCredentials, ...callCredentials: grpc.CallCredentials[]) => grpc.ChannelCredentials;
|
|
28
|
+
combineCallCredentials: (first: grpc.CallCredentials, ...additional: grpc.CallCredentials[]) => grpc.CallCredentials;
|
|
29
|
+
createInsecure: typeof grpc.ChannelCredentials.createInsecure;
|
|
30
|
+
createSsl: typeof grpc.ChannelCredentials.createSsl;
|
|
31
|
+
createFromSecureContext: typeof grpc.ChannelCredentials.createFromSecureContext;
|
|
32
|
+
createFromMetadataGenerator: typeof grpc.CallCredentials.createFromMetadataGenerator;
|
|
33
|
+
createFromGoogleCredential: typeof grpc.CallCredentials.createFromGoogleCredential;
|
|
34
|
+
createEmpty: typeof grpc.CallCredentials.createEmpty;
|
|
35
|
+
};
|
|
36
|
+
export declare const Metadata: typeof grpc.Metadata;
|
|
37
|
+
export declare const status: typeof grpc.status;
|
|
38
|
+
export type { ServiceError } from '@grpc/grpc-js';
|
|
39
|
+
export * from './linuxcnc';
|
|
40
|
+
export * from './hal';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* LinuxCNC gRPC client for TypeScript/JavaScript
|
|
4
|
+
*
|
|
5
|
+
* This package provides TypeScript types and gRPC client stubs for
|
|
6
|
+
* communicating with a LinuxCNC gRPC server.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { LinuxCNCServiceClient, GetStatusRequest, credentials } from 'linuxcnc-grpc';
|
|
11
|
+
*
|
|
12
|
+
* const client = new LinuxCNCServiceClient(
|
|
13
|
+
* 'localhost:50051',
|
|
14
|
+
* credentials.createInsecure()
|
|
15
|
+
* );
|
|
16
|
+
*
|
|
17
|
+
* client.getStatus(GetStatusRequest.create(), (err, status) => {
|
|
18
|
+
* if (err) {
|
|
19
|
+
* console.error('Error:', err);
|
|
20
|
+
* return;
|
|
21
|
+
* }
|
|
22
|
+
* console.log('Status:', status);
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
27
|
+
if (k2 === undefined) k2 = k;
|
|
28
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
29
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
30
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
31
|
+
}
|
|
32
|
+
Object.defineProperty(o, k2, desc);
|
|
33
|
+
}) : (function(o, m, k, k2) {
|
|
34
|
+
if (k2 === undefined) k2 = k;
|
|
35
|
+
o[k2] = m[k];
|
|
36
|
+
}));
|
|
37
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
38
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
39
|
+
}) : function(o, v) {
|
|
40
|
+
o["default"] = v;
|
|
41
|
+
});
|
|
42
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
43
|
+
var ownKeys = function(o) {
|
|
44
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
45
|
+
var ar = [];
|
|
46
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
47
|
+
return ar;
|
|
48
|
+
};
|
|
49
|
+
return ownKeys(o);
|
|
50
|
+
};
|
|
51
|
+
return function (mod) {
|
|
52
|
+
if (mod && mod.__esModule) return mod;
|
|
53
|
+
var result = {};
|
|
54
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
55
|
+
__setModuleDefault(result, mod);
|
|
56
|
+
return result;
|
|
57
|
+
};
|
|
58
|
+
})();
|
|
59
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
60
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
61
|
+
};
|
|
62
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
+
exports.status = exports.Metadata = exports.credentials = void 0;
|
|
64
|
+
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
65
|
+
// Re-export grpc utilities to avoid version conflicts
|
|
66
|
+
exports.credentials = grpc.credentials;
|
|
67
|
+
exports.Metadata = grpc.Metadata;
|
|
68
|
+
exports.status = grpc.status;
|
|
69
|
+
__exportStar(require("./linuxcnc"), exports);
|
|
70
|
+
__exportStar(require("./hal"), exports);
|