@devrev/typescript-sdk 1.1.24 → 1.1.27
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/auto-generated/beta/beta-devrev-sdk.d.ts +869 -28
- package/dist/auto-generated/beta/beta-devrev-sdk.js +249 -3
- package/dist/auto-generated/public-devrev-sdk.d.ts +107 -2
- package/dist/auto-generated/public-devrev-sdk.js +14 -1
- package/dist/snap-ins/index.d.ts +4 -0
- package/dist/snap-ins/index.js +20 -0
- package/dist/snap-ins/interfaces.d.ts +15 -0
- package/dist/snap-ins/interfaces.js +2 -0
- package/dist/snap-ins/schema.pb.d.ts +461 -0
- package/dist/snap-ins/schema.pb.js +678 -0
- package/dist/snap-ins/stock_objects.d.ts +16 -0
- package/dist/snap-ins/stock_objects.js +28 -0
- package/dist/snap-ins/struct.pb.d.ts +201 -0
- package/dist/snap-ins/struct.pb.js +491 -0
- package/dist/snap-ins/types.d.ts +166 -0
- package/dist/snap-ins/types.js +15 -0
- package/dist/snap-ins/types.test.d.ts +1 -0
- package/dist/snap-ins/types.test.js +81 -0
- package/package.json +2 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const DEVORG_OID = 'don:identity:dvrv-us-1:devo/TEST-DEVORG';
|
|
4
|
+
const AUTOMATION_ID = 'don:integration:dvrv-us-1:devo/TEST-DEVORG:automation/00000000-0000-0000-0000-000000000000';
|
|
5
|
+
const SOURCE_ID = 'don:integration:dvrv-us-1:devo/TEST-DEVORG:automation/00000000-0000-0000-0000-000000000000';
|
|
6
|
+
const SNAP_IN_ID = 'don:integration:dvrv-us-1:devo/TEST-DEVORG:snap_in/00000000-0000-0000-0000-000000000000';
|
|
7
|
+
const SNAP_IN_VERSION_ID = 'don:integration:dvrv-us-1:devo/TEST-DEVORG:snap_in_package/00000000-0000-0000-0000-000000000000';
|
|
8
|
+
const SERVICE_ACCOUNT_ID = 'don:identity:dvrv-us-1:devo/TEST-DEVORG:svcacc/00000000-0000-0000-0000-000000000000';
|
|
9
|
+
describe('Snap-ins types', () => {
|
|
10
|
+
describe('Context', () => {
|
|
11
|
+
test('should have the required properties', () => {
|
|
12
|
+
const context = {
|
|
13
|
+
dev_oid: DEVORG_OID,
|
|
14
|
+
source_id: SOURCE_ID,
|
|
15
|
+
snap_in_id: SNAP_IN_ID,
|
|
16
|
+
snap_in_version_id: SNAP_IN_VERSION_ID,
|
|
17
|
+
service_account_id: SERVICE_ACCOUNT_ID,
|
|
18
|
+
secrets: { secret1: 'value1', secret2: 'value2' },
|
|
19
|
+
};
|
|
20
|
+
expect(context).toHaveProperty('dev_oid');
|
|
21
|
+
expect(context).toHaveProperty('source_id');
|
|
22
|
+
expect(context).toHaveProperty('snap_in_id');
|
|
23
|
+
expect(context).toHaveProperty('snap_in_version_id');
|
|
24
|
+
expect(context).toHaveProperty('service_account_id');
|
|
25
|
+
expect(context).toHaveProperty('secrets');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe('ExecutionMetadata', () => {
|
|
29
|
+
test('should have the required properties', () => {
|
|
30
|
+
const executionMetadata = {
|
|
31
|
+
request_id: 'request-123',
|
|
32
|
+
function_name: 'functionName',
|
|
33
|
+
event_type: 'eventType',
|
|
34
|
+
devrev_endpoint: 'https://api.devrev.ai',
|
|
35
|
+
};
|
|
36
|
+
expect(executionMetadata).toHaveProperty('request_id');
|
|
37
|
+
expect(executionMetadata).toHaveProperty('function_name');
|
|
38
|
+
expect(executionMetadata).toHaveProperty('event_type');
|
|
39
|
+
expect(executionMetadata).toHaveProperty('devrev_endpoint');
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
describe('InputData', () => {
|
|
43
|
+
test('should have the required properties', () => {
|
|
44
|
+
const inputData = {
|
|
45
|
+
global_values: { key1: 'value1', key2: 'value2' },
|
|
46
|
+
event_sources: { source1: 'source1', source2: 'source2' },
|
|
47
|
+
};
|
|
48
|
+
expect(inputData).toHaveProperty('global_values');
|
|
49
|
+
expect(inputData).toHaveProperty('event_sources');
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
describe('FunctionInput', () => {
|
|
53
|
+
test('should have the required properties', () => {
|
|
54
|
+
const functionInput = {
|
|
55
|
+
payload: { key1: 'value1', key2: 'value2' },
|
|
56
|
+
context: {
|
|
57
|
+
dev_oid: DEVORG_OID,
|
|
58
|
+
source_id: SOURCE_ID,
|
|
59
|
+
snap_in_id: SNAP_IN_ID,
|
|
60
|
+
snap_in_version_id: SNAP_IN_VERSION_ID,
|
|
61
|
+
service_account_id: SERVICE_ACCOUNT_ID,
|
|
62
|
+
secrets: { secret1: 'value1', secret2: 'value2' },
|
|
63
|
+
},
|
|
64
|
+
execution_metadata: {
|
|
65
|
+
request_id: 'request-123',
|
|
66
|
+
function_name: 'functionName',
|
|
67
|
+
event_type: 'eventType',
|
|
68
|
+
devrev_endpoint: 'https://api.devrev.ai',
|
|
69
|
+
},
|
|
70
|
+
input_data: {
|
|
71
|
+
global_values: { key1: 'value1', key2: 'value2' },
|
|
72
|
+
event_sources: { source1: 'source1', source2: 'source2' },
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
expect(functionInput).toHaveProperty('payload');
|
|
76
|
+
expect(functionInput).toHaveProperty('context');
|
|
77
|
+
expect(functionInput).toHaveProperty('execution_metadata');
|
|
78
|
+
expect(functionInput).toHaveProperty('input_data');
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devrev/typescript-sdk",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.27",
|
|
4
4
|
"description": "## SDK Generation",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@types/yargs": "^17.0.22",
|
|
47
47
|
"axios": "^1.3.6",
|
|
48
48
|
"dotenv": "^16.0.3",
|
|
49
|
+
"protobufjs": "^7.3.0",
|
|
49
50
|
"yargs": "^17.6.2"
|
|
50
51
|
},
|
|
51
52
|
"repository": {
|