@droz-js/sdk 0.2.14 → 0.2.15
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/package.json +1 -1
- package/src/client/helpers.d.ts +1 -1
- package/src/client/helpers.js +1 -1
- package/src/drozadmin.d.ts +18 -0
- package/src/drozadmin.js +21 -0
- package/src/sdks/drozchat.d.ts +1 -1
- package/src/sdks/drozcommons.d.ts +172 -0
- package/src/sdks/drozcommons.js +77 -0
- package/src/sdks/nucleus.d.ts +3 -5
- package/src/sdks/nucleus.js +1 -3
package/package.json
CHANGED
package/src/client/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExecutionResult } from 'graphql';
|
|
2
|
-
export declare const serviceDiscoveryEndpoint = "https://
|
|
2
|
+
export declare const serviceDiscoveryEndpoint = "https://root.droz.services";
|
|
3
3
|
export type AuthorizationProvider = string | (() => Promise<string>) | (() => string);
|
|
4
4
|
export type Requester<C = {}> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
|
|
5
5
|
export type GetSdk<Sdk> = (requester: Requester<Sdk>) => Sdk;
|
package/src/client/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mapAsyncIterableGraphqlResponse = exports.mapGraphqlResponse = exports.resolveAuthorization = exports.toAuthorizationProvider = exports.serviceDiscoveryEndpoint = void 0;
|
|
4
|
-
exports.serviceDiscoveryEndpoint = 'https://
|
|
4
|
+
exports.serviceDiscoveryEndpoint = 'https://root.droz.services';
|
|
5
5
|
function toAuthorizationProvider(type, ...values) {
|
|
6
6
|
// this means it is unsetting the authorization token
|
|
7
7
|
if (!type)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './sdks/drozcommons';
|
|
2
|
+
export declare const DrozAdmin: new (options?: import("./client/http").HttpClientOptions) => {
|
|
3
|
+
readonly http: any;
|
|
4
|
+
forTenant(tenant: string): any;
|
|
5
|
+
withAuthorization(authorization: import("./client/helpers").AuthorizationProvider): any;
|
|
6
|
+
withCustomHeaders(headers: () => Record<string, string>): any;
|
|
7
|
+
} & {
|
|
8
|
+
listServices(variables: import("./sdks/drozcommons").Exact<{
|
|
9
|
+
tenantId: string;
|
|
10
|
+
}>, options?: unknown): Promise<import("./sdks/drozcommons").ListServicesQuery>;
|
|
11
|
+
getTenant(variables: import("./sdks/drozcommons").Exact<{
|
|
12
|
+
tenantId: string;
|
|
13
|
+
withServices?: boolean;
|
|
14
|
+
}>, options?: unknown): Promise<import("./sdks/drozcommons").GetTenantQuery>;
|
|
15
|
+
listTenants(variables?: import("./sdks/drozcommons").Exact<{
|
|
16
|
+
withServices?: boolean;
|
|
17
|
+
}>, options?: unknown): Promise<import("./sdks/drozcommons").ListTenantsQuery>;
|
|
18
|
+
};
|
package/src/drozadmin.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.DrozAdmin = void 0;
|
|
18
|
+
const http_1 = require("./client/http");
|
|
19
|
+
const drozcommons_1 = require("./sdks/drozcommons");
|
|
20
|
+
__exportStar(require("./sdks/drozcommons"), exports);
|
|
21
|
+
exports.DrozAdmin = (0, http_1.HttpClientBuilder)(drozcommons_1.serviceName, drozcommons_1.getSdk);
|
package/src/sdks/drozchat.d.ts
CHANGED
|
@@ -262,7 +262,7 @@ export type TicketCustomer = {
|
|
|
262
262
|
email: Scalars['String']['output'];
|
|
263
263
|
id: Scalars['ID']['output'];
|
|
264
264
|
name: Scalars['String']['output'];
|
|
265
|
-
phone
|
|
265
|
+
phone?: Maybe<Scalars['String']['output']>;
|
|
266
266
|
updatedAt: Scalars['String']['output'];
|
|
267
267
|
};
|
|
268
268
|
export type TicketMessage = {
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
export type Maybe<T> = T;
|
|
2
|
+
export type InputMaybe<T> = T;
|
|
3
|
+
export type Exact<T extends {
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}> = {
|
|
6
|
+
[K in keyof T]: T[K];
|
|
7
|
+
};
|
|
8
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
9
|
+
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
10
|
+
};
|
|
11
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
12
|
+
[SubKey in K]: Maybe<T[SubKey]>;
|
|
13
|
+
};
|
|
14
|
+
export type MakeEmpty<T extends {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}, K extends keyof T> = {
|
|
17
|
+
[_ in K]?: never;
|
|
18
|
+
};
|
|
19
|
+
export type Incremental<T> = T | {
|
|
20
|
+
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
|
|
21
|
+
};
|
|
22
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
23
|
+
export type Scalars = {
|
|
24
|
+
ID: {
|
|
25
|
+
input: string;
|
|
26
|
+
output: string;
|
|
27
|
+
};
|
|
28
|
+
String: {
|
|
29
|
+
input: string;
|
|
30
|
+
output: string;
|
|
31
|
+
};
|
|
32
|
+
Boolean: {
|
|
33
|
+
input: boolean;
|
|
34
|
+
output: boolean;
|
|
35
|
+
};
|
|
36
|
+
Int: {
|
|
37
|
+
input: number;
|
|
38
|
+
output: number;
|
|
39
|
+
};
|
|
40
|
+
Float: {
|
|
41
|
+
input: number;
|
|
42
|
+
output: number;
|
|
43
|
+
};
|
|
44
|
+
Base64: {
|
|
45
|
+
input: object;
|
|
46
|
+
output: string;
|
|
47
|
+
};
|
|
48
|
+
DRN: {
|
|
49
|
+
input: string;
|
|
50
|
+
output: string;
|
|
51
|
+
};
|
|
52
|
+
Date: {
|
|
53
|
+
input: Date;
|
|
54
|
+
output: Date;
|
|
55
|
+
};
|
|
56
|
+
DateTime: {
|
|
57
|
+
input: Date;
|
|
58
|
+
output: Date;
|
|
59
|
+
};
|
|
60
|
+
EmailAddress: {
|
|
61
|
+
input: string;
|
|
62
|
+
output: string;
|
|
63
|
+
};
|
|
64
|
+
JSON: {
|
|
65
|
+
input: any;
|
|
66
|
+
output: any;
|
|
67
|
+
};
|
|
68
|
+
JSONObject: {
|
|
69
|
+
input: any;
|
|
70
|
+
output: any;
|
|
71
|
+
};
|
|
72
|
+
PhoneNumber: {
|
|
73
|
+
input: string;
|
|
74
|
+
output: string;
|
|
75
|
+
};
|
|
76
|
+
Set: {
|
|
77
|
+
input: Set<any>;
|
|
78
|
+
output: any[];
|
|
79
|
+
};
|
|
80
|
+
URL: {
|
|
81
|
+
input: string;
|
|
82
|
+
output: string;
|
|
83
|
+
};
|
|
84
|
+
Void: {
|
|
85
|
+
input: void;
|
|
86
|
+
output: void;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export declare enum AppInstanceStatus {
|
|
90
|
+
Active = "Active",
|
|
91
|
+
Failing = "Failing",
|
|
92
|
+
Inactive = "Inactive"
|
|
93
|
+
}
|
|
94
|
+
export type Mutation = {
|
|
95
|
+
version?: Maybe<Scalars['String']['output']>;
|
|
96
|
+
};
|
|
97
|
+
export type PageInfo = {
|
|
98
|
+
hasNext: Scalars['Boolean']['output'];
|
|
99
|
+
next?: Maybe<Scalars['Base64']['output']>;
|
|
100
|
+
};
|
|
101
|
+
export type Query = {
|
|
102
|
+
app?: Maybe<Scalars['DRN']['output']>;
|
|
103
|
+
getHttpEndpoint?: Maybe<Scalars['String']['output']>;
|
|
104
|
+
getTenant?: Maybe<Tenant>;
|
|
105
|
+
listServices: Array<Maybe<Service>>;
|
|
106
|
+
listTenants: Array<Maybe<Tenant>>;
|
|
107
|
+
version?: Maybe<Scalars['String']['output']>;
|
|
108
|
+
};
|
|
109
|
+
export type QueryGetTenantArgs = {
|
|
110
|
+
tenantId: Scalars['ID']['input'];
|
|
111
|
+
};
|
|
112
|
+
export type QueryListServicesArgs = {
|
|
113
|
+
tenantId: Scalars['ID']['input'];
|
|
114
|
+
};
|
|
115
|
+
export type Service = {
|
|
116
|
+
accountId: Scalars['ID']['output'];
|
|
117
|
+
endpoint: Scalars['String']['output'];
|
|
118
|
+
serviceId: Scalars['ID']['output'];
|
|
119
|
+
tenantId: Scalars['ID']['output'];
|
|
120
|
+
type: Scalars['String']['output'];
|
|
121
|
+
};
|
|
122
|
+
export type Tenant = {
|
|
123
|
+
accountId: Scalars['ID']['output'];
|
|
124
|
+
createdAt: Scalars['DateTime']['output'];
|
|
125
|
+
name?: Maybe<Scalars['String']['output']>;
|
|
126
|
+
services: Array<Maybe<Service>>;
|
|
127
|
+
tenantId: Scalars['ID']['output'];
|
|
128
|
+
updatedAt: Scalars['DateTime']['output'];
|
|
129
|
+
};
|
|
130
|
+
export declare enum Typenames {
|
|
131
|
+
Any = "Any",
|
|
132
|
+
GraphqlConnections = "GraphqlConnections",
|
|
133
|
+
GraphqlSubscriptions = "GraphqlSubscriptions"
|
|
134
|
+
}
|
|
135
|
+
export type ServiceFragment = Pick<Service, 'accountId' | 'tenantId' | 'serviceId' | 'type' | 'endpoint'>;
|
|
136
|
+
export type ListServicesQueryVariables = Exact<{
|
|
137
|
+
tenantId: Scalars['ID']['input'];
|
|
138
|
+
}>;
|
|
139
|
+
export type ListServicesQuery = {
|
|
140
|
+
listServices: Array<Maybe<ServiceFragment>>;
|
|
141
|
+
};
|
|
142
|
+
export type TenantFragment = Pick<Tenant, 'tenantId' | 'name' | 'createdAt' | 'updatedAt'>;
|
|
143
|
+
export type GetTenantQueryVariables = Exact<{
|
|
144
|
+
tenantId: Scalars['ID']['input'];
|
|
145
|
+
withServices?: InputMaybe<Scalars['Boolean']['input']>;
|
|
146
|
+
}>;
|
|
147
|
+
export type GetTenantQuery = {
|
|
148
|
+
getTenant?: Maybe<({
|
|
149
|
+
services?: Array<Maybe<ServiceFragment>>;
|
|
150
|
+
} & TenantFragment)>;
|
|
151
|
+
};
|
|
152
|
+
export type ListTenantsQueryVariables = Exact<{
|
|
153
|
+
withServices?: InputMaybe<Scalars['Boolean']['input']>;
|
|
154
|
+
}>;
|
|
155
|
+
export type ListTenantsQuery = {
|
|
156
|
+
listTenants: Array<Maybe<({
|
|
157
|
+
services?: Array<Maybe<ServiceFragment>>;
|
|
158
|
+
} & TenantFragment)>>;
|
|
159
|
+
};
|
|
160
|
+
export declare const ServiceFragmentDoc = "\n fragment service on Service {\n accountId\n tenantId\n serviceId\n type\n endpoint\n}\n ";
|
|
161
|
+
export declare const TenantFragmentDoc = "\n fragment tenant on Tenant {\n tenantId\n name\n createdAt\n updatedAt\n}\n ";
|
|
162
|
+
export declare const ListServicesDocument = "\n query listServices($tenantId: ID!) {\n listServices(tenantId: $tenantId) {\n ...service\n }\n}\n \n fragment service on Service {\n accountId\n tenantId\n serviceId\n type\n endpoint\n}\n ";
|
|
163
|
+
export declare const GetTenantDocument = "\n query getTenant($tenantId: ID!, $withServices: Boolean = true) {\n getTenant(tenantId: $tenantId) {\n ...tenant\n services @include(if: $withServices) {\n ...service\n }\n }\n}\n \n fragment tenant on Tenant {\n tenantId\n name\n createdAt\n updatedAt\n}\n \n\n fragment service on Service {\n accountId\n tenantId\n serviceId\n type\n endpoint\n}\n ";
|
|
164
|
+
export declare const ListTenantsDocument = "\n query listTenants($withServices: Boolean = false) {\n listTenants {\n ...tenant\n services @include(if: $withServices) {\n ...service\n }\n }\n}\n \n fragment tenant on Tenant {\n tenantId\n name\n createdAt\n updatedAt\n}\n \n\n fragment service on Service {\n accountId\n tenantId\n serviceId\n type\n endpoint\n}\n ";
|
|
165
|
+
export type Requester<C = {}, E = unknown> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
|
|
166
|
+
export declare function getSdk<C, E>(requester: Requester<C, E>): {
|
|
167
|
+
listServices(variables: ListServicesQueryVariables, options?: C): Promise<ListServicesQuery>;
|
|
168
|
+
getTenant(variables: GetTenantQueryVariables, options?: C): Promise<GetTenantQuery>;
|
|
169
|
+
listTenants(variables?: ListTenantsQueryVariables, options?: C): Promise<ListTenantsQuery>;
|
|
170
|
+
};
|
|
171
|
+
export type Sdk = ReturnType<typeof getSdk>;
|
|
172
|
+
export declare const serviceName = "@droz/drozcommons";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.serviceName = exports.getSdk = exports.ListTenantsDocument = exports.GetTenantDocument = exports.ListServicesDocument = exports.TenantFragmentDoc = exports.ServiceFragmentDoc = exports.Typenames = exports.AppInstanceStatus = void 0;
|
|
5
|
+
var AppInstanceStatus;
|
|
6
|
+
(function (AppInstanceStatus) {
|
|
7
|
+
AppInstanceStatus["Active"] = "Active";
|
|
8
|
+
AppInstanceStatus["Failing"] = "Failing";
|
|
9
|
+
AppInstanceStatus["Inactive"] = "Inactive";
|
|
10
|
+
})(AppInstanceStatus || (exports.AppInstanceStatus = AppInstanceStatus = {}));
|
|
11
|
+
var Typenames;
|
|
12
|
+
(function (Typenames) {
|
|
13
|
+
Typenames["Any"] = "Any";
|
|
14
|
+
Typenames["GraphqlConnections"] = "GraphqlConnections";
|
|
15
|
+
Typenames["GraphqlSubscriptions"] = "GraphqlSubscriptions";
|
|
16
|
+
})(Typenames || (exports.Typenames = Typenames = {}));
|
|
17
|
+
exports.ServiceFragmentDoc = `
|
|
18
|
+
fragment service on Service {
|
|
19
|
+
accountId
|
|
20
|
+
tenantId
|
|
21
|
+
serviceId
|
|
22
|
+
type
|
|
23
|
+
endpoint
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
exports.TenantFragmentDoc = `
|
|
27
|
+
fragment tenant on Tenant {
|
|
28
|
+
tenantId
|
|
29
|
+
name
|
|
30
|
+
createdAt
|
|
31
|
+
updatedAt
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
exports.ListServicesDocument = `
|
|
35
|
+
query listServices($tenantId: ID!) {
|
|
36
|
+
listServices(tenantId: $tenantId) {
|
|
37
|
+
...service
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
${exports.ServiceFragmentDoc}`;
|
|
41
|
+
exports.GetTenantDocument = `
|
|
42
|
+
query getTenant($tenantId: ID!, $withServices: Boolean = true) {
|
|
43
|
+
getTenant(tenantId: $tenantId) {
|
|
44
|
+
...tenant
|
|
45
|
+
services @include(if: $withServices) {
|
|
46
|
+
...service
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
${exports.TenantFragmentDoc}
|
|
51
|
+
${exports.ServiceFragmentDoc}`;
|
|
52
|
+
exports.ListTenantsDocument = `
|
|
53
|
+
query listTenants($withServices: Boolean = false) {
|
|
54
|
+
listTenants {
|
|
55
|
+
...tenant
|
|
56
|
+
services @include(if: $withServices) {
|
|
57
|
+
...service
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
${exports.TenantFragmentDoc}
|
|
62
|
+
${exports.ServiceFragmentDoc}`;
|
|
63
|
+
function getSdk(requester) {
|
|
64
|
+
return {
|
|
65
|
+
listServices(variables, options) {
|
|
66
|
+
return requester(exports.ListServicesDocument, variables, options);
|
|
67
|
+
},
|
|
68
|
+
getTenant(variables, options) {
|
|
69
|
+
return requester(exports.GetTenantDocument, variables, options);
|
|
70
|
+
},
|
|
71
|
+
listTenants(variables, options) {
|
|
72
|
+
return requester(exports.ListTenantsDocument, variables, options);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
exports.getSdk = getSdk;
|
|
77
|
+
exports.serviceName = '@droz/drozcommons';
|
package/src/sdks/nucleus.d.ts
CHANGED
|
@@ -265,7 +265,7 @@ export type Mutation = {
|
|
|
265
265
|
removeStateMachineConfigState?: Maybe<StateMachineConfig>;
|
|
266
266
|
setSessionAttribute?: Maybe<Scalars['JSON']['output']>;
|
|
267
267
|
startSession?: Maybe<Session>;
|
|
268
|
-
unregisterAppInstance
|
|
268
|
+
unregisterAppInstance?: Maybe<AppInstance>;
|
|
269
269
|
updateAgent?: Maybe<Agent>;
|
|
270
270
|
updateCredentials: SafeCredentials;
|
|
271
271
|
updateCronJob: CronJob;
|
|
@@ -563,11 +563,9 @@ export declare enum Typenames {
|
|
|
563
563
|
CustomersIndex = "CustomersIndex",
|
|
564
564
|
GraphqlConnections = "GraphqlConnections",
|
|
565
565
|
GraphqlSubscriptions = "GraphqlSubscriptions",
|
|
566
|
-
MachineConfigAliases = "MachineConfigAliases",
|
|
567
566
|
MachineConfigs = "MachineConfigs",
|
|
568
567
|
MachineStates = "MachineStates",
|
|
569
|
-
|
|
570
|
-
SessionStorage = "SessionStorage",
|
|
568
|
+
SessionAttributes = "SessionAttributes",
|
|
571
569
|
Sessions = "Sessions"
|
|
572
570
|
}
|
|
573
571
|
export type UnregisterAppInstanceInput = {
|
|
@@ -696,7 +694,7 @@ export type UnregisterAppInstanceMutationVariables = Exact<{
|
|
|
696
694
|
input: UnregisterAppInstanceInput;
|
|
697
695
|
}>;
|
|
698
696
|
export type UnregisterAppInstanceMutation = {
|
|
699
|
-
unregisterAppInstance
|
|
697
|
+
unregisterAppInstance?: Maybe<AppInstanceFragment>;
|
|
700
698
|
};
|
|
701
699
|
export type GetAmplifyConfigQueryVariables = Exact<{
|
|
702
700
|
[key: string]: never;
|
package/src/sdks/nucleus.js
CHANGED
|
@@ -53,11 +53,9 @@ var Typenames;
|
|
|
53
53
|
Typenames["CustomersIndex"] = "CustomersIndex";
|
|
54
54
|
Typenames["GraphqlConnections"] = "GraphqlConnections";
|
|
55
55
|
Typenames["GraphqlSubscriptions"] = "GraphqlSubscriptions";
|
|
56
|
-
Typenames["MachineConfigAliases"] = "MachineConfigAliases";
|
|
57
56
|
Typenames["MachineConfigs"] = "MachineConfigs";
|
|
58
57
|
Typenames["MachineStates"] = "MachineStates";
|
|
59
|
-
Typenames["
|
|
60
|
-
Typenames["SessionStorage"] = "SessionStorage";
|
|
58
|
+
Typenames["SessionAttributes"] = "SessionAttributes";
|
|
61
59
|
Typenames["Sessions"] = "Sessions";
|
|
62
60
|
})(Typenames || (exports.Typenames = Typenames = {}));
|
|
63
61
|
exports.AgentFragmentDoc = `
|