@stepzen/sdk 0.25.0-beta.0 → 0.25.0-beta.2
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.
|
@@ -11,7 +11,9 @@ export declare const fetchGraphQLQuery: <T = Record<string, any>>({ url, query,
|
|
|
11
11
|
query: string;
|
|
12
12
|
variables?: Record<string, any> | undefined;
|
|
13
13
|
headers?: Record<string, any> | undefined;
|
|
14
|
-
}) => Promise<
|
|
14
|
+
}) => Promise<ExecutionResult<T, {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}>>;
|
|
15
17
|
export declare const fetchZenCtlGraphQLQuery: <T = Record<string, any>>({ account, adminKey, deploymentType, query, variables, sdkConfig, }: {
|
|
16
18
|
account: string;
|
|
17
19
|
adminKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/shared/graphql-client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AAE5C,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/shared/graphql-client.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AAE5C,OAAO,EAAC,kBAAkB,EAAC,MAAM,SAAS,CAAA;AAK1C,oBAAY,eAAe,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACnD,sBAAsB,CAAC,KAAK,CAAC,GAC7B,oBAAoB,CAAC,KAAK,CAAC,CAAA;AAG/B,aAAK,sBAAsB,CAAC,KAAK,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG;IAC5D,IAAI,EAAE,KAAK,CAAA;IACX,MAAM,EAAE,SAAS,CAAA;CAClB,CAAA;AAGD,aAAK,oBAAoB,CAAC,KAAK,IAAI,eAAe,CAAC,KAAK,CAAC,GACvD,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;AAElD,eAAO,MAAM,iBAAiB;SAMvB,GAAG,GAAG,MAAM;WACV,MAAM;;;;;GA+Cd,CAAA;AAED,eAAO,MAAM,uBAAuB;aAQzB,MAAM;cACL,MAAM;oBACA,MAAM;WACf,MAAM;;eAEF,kBAAkB;iCAe9B,CAAA;AAED,eAAO,MAAM,8BAA8B;SAMpC,GAAG,GAAG,MAAM;WACV,MAAM;;eAEF,kBAAkB;iCAc9B,CAAA"}
|
|
@@ -46,7 +46,7 @@ const fetchGraphQLQuery = async ({ url, query, variables = {}, headers = {}, })
|
|
|
46
46
|
exports.fetchGraphQLQuery = fetchGraphQLQuery;
|
|
47
47
|
const fetchZenCtlGraphQLQuery = async ({ account, adminKey, deploymentType, query, variables = {}, sdkConfig, }) => {
|
|
48
48
|
try {
|
|
49
|
-
return await (0, exports.fetchGraphQLQuery)({
|
|
49
|
+
return (await (0, exports.fetchGraphQLQuery)({
|
|
50
50
|
url: sdkConfig.zenctlApiUrl,
|
|
51
51
|
query,
|
|
52
52
|
variables,
|
|
@@ -54,7 +54,7 @@ const fetchZenCtlGraphQLQuery = async ({ account, adminKey, deploymentType, quer
|
|
|
54
54
|
'user-agent': (0, request_1.getUserAgent)(sdkConfig),
|
|
55
55
|
host: `stepzen.${deploymentType}.net`,
|
|
56
56
|
},
|
|
57
|
-
});
|
|
57
|
+
}));
|
|
58
58
|
}
|
|
59
59
|
catch (error) {
|
|
60
60
|
throw new Error(`Failed to connect to ZenCtl API. ${error}`);
|
|
@@ -63,14 +63,14 @@ const fetchZenCtlGraphQLQuery = async ({ account, adminKey, deploymentType, quer
|
|
|
63
63
|
exports.fetchZenCtlGraphQLQuery = fetchZenCtlGraphQLQuery;
|
|
64
64
|
const fetchPublicAccountGraphQLQuery = async ({ url, query, variables = {}, sdkConfig, }) => {
|
|
65
65
|
try {
|
|
66
|
-
return await (0, exports.fetchGraphQLQuery)({
|
|
66
|
+
return (await (0, exports.fetchGraphQLQuery)({
|
|
67
67
|
url,
|
|
68
68
|
query,
|
|
69
69
|
variables,
|
|
70
70
|
headers: {
|
|
71
71
|
'user-agent': (0, request_1.getUserAgent)(sdkConfig),
|
|
72
72
|
},
|
|
73
|
-
});
|
|
73
|
+
}));
|
|
74
74
|
}
|
|
75
75
|
catch (error) {
|
|
76
76
|
throw new Error(`Failed to connect to Public Account API. ${error}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.js","sourceRoot":"","sources":["../../src/shared/graphql-client.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,+BAA8B;AAC9B,0CAAkC;AAIlC,uCAAsC;
|
|
1
|
+
{"version":3,"file":"graphql-client.js","sourceRoot":"","sources":["../../src/shared/graphql-client.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C,+BAA8B;AAC9B,0CAAkC;AAIlC,uCAAsC;AAkB/B,MAAM,iBAAiB,GAAG,KAAK,EAA2B,EAC/D,GAAG,EACH,KAAK,EACL,SAAS,GAAG,EAAE,EACd,OAAO,GAAG,EAAE,GAMb,EAA+B,EAAE;IAChC,KAAK,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAA;IAC7B,KAAK,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,CAAA;IACrC,KAAK,CAAC,mBAAmB,CAAC,CAAC,KAAK,CAAC,CAAA;IACjC,KAAK,CAAC,uBAAuB,CAAC,CAAC,SAAS,CAAC,CAAA;IAEzC,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAK,EAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,GAAG,OAAO;aACX;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,KAAK;gBACL,SAAS;aACV,C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,CAAuB,CAAA;KAC1B;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,oCAAoC,KAAK,EAAE,CAAC,CAAA;KAC7D;AACH,CAAC,CAAA;AA5BY,QAAA,uBAAuB,2BA4BnC;AAEM,MAAM,8BAA8B,GAAG,KAAK,EAA2B,EAC5E,GAAG,EACH,KAAK,EACL,SAAS,GAAG,EAAE,EACd,SAAS,GAMV,EAA+B,EAAE;IAChC,IAAI;QACF,OAAO,CAAC,MAAM,IAAA,yBAAiB,EAAC;YAC9B,GAAG;YACH,KAAK;YACL,SAAS;YACT,OAAO,EAAE;gBACP,YAAY,EAAE,IAAA,sBAAY,EAAC,SAAS,CAAC;aACtC;SACF,CAAC,CAAuB,CAAA;KAC1B;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,4CAA4C,KAAK,EAAE,CAAC,CAAA;KACrE;AACH,CAAC,CAAA;AAvBY,QAAA,8BAA8B,kCAuB1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stepzen/sdk",
|
|
3
|
-
"version": "0.25.0-beta.
|
|
3
|
+
"version": "0.25.0-beta.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Darren Waddell <darren@stepzen.com>",
|
|
6
6
|
"homepage": "https://stepzen.com",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"posttest": "prettier . --check"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@stepzen/fetch": "^0.25.0-beta.
|
|
26
|
-
"@stepzen/transpiler": "^0.25.0-beta.
|
|
25
|
+
"@stepzen/fetch": "^0.25.0-beta.2",
|
|
26
|
+
"@stepzen/transpiler": "^0.25.0-beta.2",
|
|
27
27
|
"archiver": "^5.3.0",
|
|
28
28
|
"debug": "^4.3.4",
|
|
29
29
|
"dotenv": "^16.0.1",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"prettier": "^2.5.1",
|
|
50
50
|
"ts-node": "^10.8.2"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "55262b11405cd71a5008ce42ae61e8575848b380"
|
|
53
53
|
}
|
|
@@ -7,7 +7,8 @@ import type {ExecutionResult} from 'graphql'
|
|
|
7
7
|
import {SDKConfigurationV2} from './types'
|
|
8
8
|
import {getUserAgent} from './request'
|
|
9
9
|
|
|
10
|
-
// StepZen offers stronger
|
|
10
|
+
// The StepZen's ZenCtl GraphQL API offers stronger guarantees than defined in
|
|
11
|
+
// the GraphQL standard:
|
|
11
12
|
export type GraphQLResponse<TData = Record<string, any>> =
|
|
12
13
|
| GraphQLSuccessResponse<TData>
|
|
13
14
|
| GraphQLErrorResponse<TData>
|
|
@@ -32,7 +33,7 @@ export const fetchGraphQLQuery = async <T = Record<string, any>>({
|
|
|
32
33
|
query: string
|
|
33
34
|
variables?: Record<string, any>
|
|
34
35
|
headers?: Record<string, any>
|
|
35
|
-
}): Promise<
|
|
36
|
+
}): Promise<ExecutionResult<T>> => {
|
|
36
37
|
debug('stepzen:sdk:url')(url)
|
|
37
38
|
debug('stepzen:sdk:headers')(headers)
|
|
38
39
|
debug('stepzen:sdk:query')(query)
|
|
@@ -94,7 +95,7 @@ export const fetchZenCtlGraphQLQuery = async <T = Record<string, any>>({
|
|
|
94
95
|
sdkConfig: SDKConfigurationV2
|
|
95
96
|
}): Promise<GraphQLResponse<T>> => {
|
|
96
97
|
try {
|
|
97
|
-
return await fetchGraphQLQuery({
|
|
98
|
+
return (await fetchGraphQLQuery({
|
|
98
99
|
url: sdkConfig.zenctlApiUrl,
|
|
99
100
|
query,
|
|
100
101
|
variables,
|
|
@@ -102,7 +103,7 @@ export const fetchZenCtlGraphQLQuery = async <T = Record<string, any>>({
|
|
|
102
103
|
'user-agent': getUserAgent(sdkConfig),
|
|
103
104
|
host: `stepzen.${deploymentType}.net`,
|
|
104
105
|
},
|
|
105
|
-
})
|
|
106
|
+
})) as GraphQLResponse<T>
|
|
106
107
|
} catch (error) {
|
|
107
108
|
throw new Error(`Failed to connect to ZenCtl API. ${error}`)
|
|
108
109
|
}
|
|
@@ -120,14 +121,14 @@ export const fetchPublicAccountGraphQLQuery = async <T = Record<string, any>>({
|
|
|
120
121
|
sdkConfig: SDKConfigurationV2
|
|
121
122
|
}): Promise<GraphQLResponse<T>> => {
|
|
122
123
|
try {
|
|
123
|
-
return await fetchGraphQLQuery({
|
|
124
|
+
return (await fetchGraphQLQuery({
|
|
124
125
|
url,
|
|
125
126
|
query,
|
|
126
127
|
variables,
|
|
127
128
|
headers: {
|
|
128
129
|
'user-agent': getUserAgent(sdkConfig),
|
|
129
130
|
},
|
|
130
|
-
})
|
|
131
|
+
})) as GraphQLResponse<T>
|
|
131
132
|
} catch (error) {
|
|
132
133
|
throw new Error(`Failed to connect to Public Account API. ${error}`)
|
|
133
134
|
}
|