@greensecurity/javascript-sdk 0.9.1 → 0.10.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.
- package/README.md +14 -5
- package/funcs/organizationsGetFacility.d.ts +2 -1
- package/funcs/organizationsGetFacility.d.ts.map +1 -1
- package/funcs/organizationsGetFacility.js +11 -7
- package/funcs/organizationsGetFacility.js.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts +2 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.js +11 -7
- package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
- package/funcs/userGetCurrentUser.d.ts +2 -1
- package/funcs/userGetCurrentUser.d.ts.map +1 -1
- package/funcs/userGetCurrentUser.js +10 -6
- package/funcs/userGetCurrentUser.js.map +1 -1
- package/funcs/userGetUserById.d.ts +2 -1
- package/funcs/userGetUserById.d.ts.map +1 -1
- package/funcs/userGetUserById.js +11 -7
- package/funcs/userGetUserById.js.map +1 -1
- package/funcs/userLogsUserIntoTheSystem.d.ts +2 -1
- package/funcs/userLogsUserIntoTheSystem.d.ts.map +1 -1
- package/funcs/userLogsUserIntoTheSystem.js +11 -7
- package/funcs/userLogsUserIntoTheSystem.js.map +1 -1
- package/funcs/userMagiclink.d.ts +17 -0
- package/funcs/userMagiclink.d.ts.map +1 -0
- package/funcs/userMagiclink.js +115 -0
- package/funcs/userMagiclink.js.map +1 -0
- package/funcs/userPassword.d.ts +18 -0
- package/funcs/userPassword.d.ts.map +1 -0
- package/funcs/userPassword.js +116 -0
- package/funcs/userPassword.js.map +1 -0
- package/funcs/userPasswordResetRequest.d.ts +17 -0
- package/funcs/userPasswordResetRequest.d.ts.map +1 -0
- package/funcs/userPasswordResetRequest.js +115 -0
- package/funcs/userPasswordResetRequest.js.map +1 -0
- package/funcs/vendorsCreateVendorRegistration.d.ts +2 -1
- package/funcs/vendorsCreateVendorRegistration.d.ts.map +1 -1
- package/funcs/vendorsCreateVendorRegistration.js +11 -7
- package/funcs/vendorsCreateVendorRegistration.js.map +1 -1
- package/funcs/vendorsListVendorJobTitles.d.ts +2 -1
- package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/funcs/vendorsListVendorJobTitles.js +11 -7
- package/funcs/vendorsListVendorJobTitles.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/magiclink.d.ts +57 -0
- package/models/operations/magiclink.d.ts.map +1 -0
- package/models/operations/magiclink.js +96 -0
- package/models/operations/magiclink.js.map +1 -0
- package/models/operations/password.d.ts +59 -0
- package/models/operations/password.d.ts.map +1 -0
- package/models/operations/password.js +107 -0
- package/models/operations/password.js.map +1 -0
- package/models/operations/passwordresetrequest.d.ts +57 -0
- package/models/operations/passwordresetrequest.d.ts.map +1 -0
- package/models/operations/passwordresetrequest.js +96 -0
- package/models/operations/passwordresetrequest.js.map +1 -0
- package/package.json +1 -1
- package/react-query/index.d.ts +3 -0
- package/react-query/index.d.ts.map +1 -1
- package/react-query/index.js +3 -0
- package/react-query/index.js.map +1 -1
- package/react-query/userMagiclink.d.ts +23 -0
- package/react-query/userMagiclink.d.ts.map +1 -0
- package/react-query/userMagiclink.js +47 -0
- package/react-query/userMagiclink.js.map +1 -0
- package/react-query/userPassword.d.ts +24 -0
- package/react-query/userPassword.d.ts.map +1 -0
- package/react-query/userPassword.js +48 -0
- package/react-query/userPassword.js.map +1 -0
- package/react-query/userPasswordResetRequest.d.ts +23 -0
- package/react-query/userPasswordResetRequest.d.ts.map +1 -0
- package/react-query/userPasswordResetRequest.js +47 -0
- package/react-query/userPasswordResetRequest.js.map +1 -0
- package/sdk/user.d.ts +22 -0
- package/sdk/user.d.ts.map +1 -1
- package/sdk/user.js +31 -0
- package/sdk/user.js.map +1 -1
- package/src/funcs/organizationsGetFacility.ts +37 -8
- package/src/funcs/organizationsListOrSearchFacilities.ts +35 -8
- package/src/funcs/userGetCurrentUser.ts +33 -7
- package/src/funcs/userGetUserById.ts +36 -8
- package/src/funcs/userLogsUserIntoTheSystem.ts +36 -8
- package/src/funcs/userMagiclink.ts +162 -0
- package/src/funcs/userPassword.ts +163 -0
- package/src/funcs/userPasswordResetRequest.ts +163 -0
- package/src/funcs/vendorsCreateVendorRegistration.ts +36 -8
- package/src/funcs/vendorsListVendorJobTitles.ts +37 -8
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +1 -1
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/magiclink.ts +127 -0
- package/src/models/operations/password.ts +140 -0
- package/src/models/operations/passwordresetrequest.ts +131 -0
- package/src/react-query/index.ts +3 -0
- package/src/react-query/userMagiclink.ts +88 -0
- package/src/react-query/userPassword.ts +89 -0
- package/src/react-query/userPasswordResetRequest.ts +89 -0
- package/src/sdk/user.ts +55 -0
- package/src/types/async.ts +68 -0
- package/types/async.d.ts +23 -0
- package/types/async.d.ts.map +1 -0
- package/types/async.js +44 -0
- package/types/async.js.map +1 -0
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/greensecurity/README.md +0 -14
- package/docs/sdks/organizations/README.md +0 -252
- package/docs/sdks/user/README.md +0 -348
- package/docs/sdks/vendors/README.md +0 -219
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { userMagiclink } from "../funcs/userMagiclink.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type UserMagiclinkMutationVariables = {
|
|
20
|
+
request: operations.MagiclinkRequestBody;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type UserMagiclinkMutationData = operations.MagiclinkResponseBody;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Magic link
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* It sends an email with a magic link to allow the user to log in.
|
|
31
|
+
*/
|
|
32
|
+
export function useUserMagiclinkMutation(
|
|
33
|
+
options?: MutationHookOptions<
|
|
34
|
+
UserMagiclinkMutationData,
|
|
35
|
+
Error,
|
|
36
|
+
UserMagiclinkMutationVariables
|
|
37
|
+
>,
|
|
38
|
+
): UseMutationResult<
|
|
39
|
+
UserMagiclinkMutationData,
|
|
40
|
+
Error,
|
|
41
|
+
UserMagiclinkMutationVariables
|
|
42
|
+
> {
|
|
43
|
+
const client = useGreenSecurityContext();
|
|
44
|
+
return useMutation({
|
|
45
|
+
...buildUserMagiclinkMutation(client, options),
|
|
46
|
+
...options,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function mutationKeyUserMagiclink(): MutationKey {
|
|
51
|
+
return ["@greensecurity/javascript-sdk", "user", "magiclink"];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function buildUserMagiclinkMutation(
|
|
55
|
+
client$: GreenSecurityCore,
|
|
56
|
+
hookOptions?: RequestOptions,
|
|
57
|
+
): {
|
|
58
|
+
mutationKey: MutationKey;
|
|
59
|
+
mutationFn: (
|
|
60
|
+
variables: UserMagiclinkMutationVariables,
|
|
61
|
+
) => Promise<UserMagiclinkMutationData>;
|
|
62
|
+
} {
|
|
63
|
+
return {
|
|
64
|
+
mutationKey: mutationKeyUserMagiclink(),
|
|
65
|
+
mutationFn: function userMagiclinkMutationFn({
|
|
66
|
+
request,
|
|
67
|
+
options,
|
|
68
|
+
}): Promise<UserMagiclinkMutationData> {
|
|
69
|
+
const mergedOptions = {
|
|
70
|
+
...hookOptions,
|
|
71
|
+
...options,
|
|
72
|
+
fetchOptions: {
|
|
73
|
+
...hookOptions?.fetchOptions,
|
|
74
|
+
...options?.fetchOptions,
|
|
75
|
+
signal: combineSignals(
|
|
76
|
+
hookOptions?.fetchOptions?.signal,
|
|
77
|
+
options?.fetchOptions?.signal,
|
|
78
|
+
),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
return unwrapAsync(userMagiclink(
|
|
82
|
+
client$,
|
|
83
|
+
request,
|
|
84
|
+
mergedOptions,
|
|
85
|
+
));
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { userPassword } from "../funcs/userPassword.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type UserPasswordMutationVariables = {
|
|
20
|
+
request: operations.PasswordRequestBody;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type UserPasswordMutationData = operations.PasswordResponseBody;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Password reset
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Resets the a user's password using a password_reset_id that was sent to them via email.
|
|
31
|
+
* See /users/passwordresetrequest to initiate a password reset flow.
|
|
32
|
+
*/
|
|
33
|
+
export function useUserPasswordMutation(
|
|
34
|
+
options?: MutationHookOptions<
|
|
35
|
+
UserPasswordMutationData,
|
|
36
|
+
Error,
|
|
37
|
+
UserPasswordMutationVariables
|
|
38
|
+
>,
|
|
39
|
+
): UseMutationResult<
|
|
40
|
+
UserPasswordMutationData,
|
|
41
|
+
Error,
|
|
42
|
+
UserPasswordMutationVariables
|
|
43
|
+
> {
|
|
44
|
+
const client = useGreenSecurityContext();
|
|
45
|
+
return useMutation({
|
|
46
|
+
...buildUserPasswordMutation(client, options),
|
|
47
|
+
...options,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function mutationKeyUserPassword(): MutationKey {
|
|
52
|
+
return ["@greensecurity/javascript-sdk", "user", "password"];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function buildUserPasswordMutation(
|
|
56
|
+
client$: GreenSecurityCore,
|
|
57
|
+
hookOptions?: RequestOptions,
|
|
58
|
+
): {
|
|
59
|
+
mutationKey: MutationKey;
|
|
60
|
+
mutationFn: (
|
|
61
|
+
variables: UserPasswordMutationVariables,
|
|
62
|
+
) => Promise<UserPasswordMutationData>;
|
|
63
|
+
} {
|
|
64
|
+
return {
|
|
65
|
+
mutationKey: mutationKeyUserPassword(),
|
|
66
|
+
mutationFn: function userPasswordMutationFn({
|
|
67
|
+
request,
|
|
68
|
+
options,
|
|
69
|
+
}): Promise<UserPasswordMutationData> {
|
|
70
|
+
const mergedOptions = {
|
|
71
|
+
...hookOptions,
|
|
72
|
+
...options,
|
|
73
|
+
fetchOptions: {
|
|
74
|
+
...hookOptions?.fetchOptions,
|
|
75
|
+
...options?.fetchOptions,
|
|
76
|
+
signal: combineSignals(
|
|
77
|
+
hookOptions?.fetchOptions?.signal,
|
|
78
|
+
options?.fetchOptions?.signal,
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
return unwrapAsync(userPassword(
|
|
83
|
+
client$,
|
|
84
|
+
request,
|
|
85
|
+
mergedOptions,
|
|
86
|
+
));
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
MutationKey,
|
|
7
|
+
useMutation,
|
|
8
|
+
UseMutationResult,
|
|
9
|
+
} from "@tanstack/react-query";
|
|
10
|
+
import { GreenSecurityCore } from "../core.js";
|
|
11
|
+
import { userPasswordResetRequest } from "../funcs/userPasswordResetRequest.js";
|
|
12
|
+
import { combineSignals } from "../lib/primitives.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
16
|
+
import { useGreenSecurityContext } from "./_context.js";
|
|
17
|
+
import { MutationHookOptions } from "./_types.js";
|
|
18
|
+
|
|
19
|
+
export type UserPasswordResetRequestMutationVariables = {
|
|
20
|
+
request: operations.PasswordResetRequestRequestBody;
|
|
21
|
+
options?: RequestOptions;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type UserPasswordResetRequestMutationData =
|
|
25
|
+
operations.PasswordResetRequestResponseBody;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Password reset request
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* It sends an email with a link for resetting a user's password.
|
|
32
|
+
*/
|
|
33
|
+
export function useUserPasswordResetRequestMutation(
|
|
34
|
+
options?: MutationHookOptions<
|
|
35
|
+
UserPasswordResetRequestMutationData,
|
|
36
|
+
Error,
|
|
37
|
+
UserPasswordResetRequestMutationVariables
|
|
38
|
+
>,
|
|
39
|
+
): UseMutationResult<
|
|
40
|
+
UserPasswordResetRequestMutationData,
|
|
41
|
+
Error,
|
|
42
|
+
UserPasswordResetRequestMutationVariables
|
|
43
|
+
> {
|
|
44
|
+
const client = useGreenSecurityContext();
|
|
45
|
+
return useMutation({
|
|
46
|
+
...buildUserPasswordResetRequestMutation(client, options),
|
|
47
|
+
...options,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function mutationKeyUserPasswordResetRequest(): MutationKey {
|
|
52
|
+
return ["@greensecurity/javascript-sdk", "user", "passwordResetRequest"];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function buildUserPasswordResetRequestMutation(
|
|
56
|
+
client$: GreenSecurityCore,
|
|
57
|
+
hookOptions?: RequestOptions,
|
|
58
|
+
): {
|
|
59
|
+
mutationKey: MutationKey;
|
|
60
|
+
mutationFn: (
|
|
61
|
+
variables: UserPasswordResetRequestMutationVariables,
|
|
62
|
+
) => Promise<UserPasswordResetRequestMutationData>;
|
|
63
|
+
} {
|
|
64
|
+
return {
|
|
65
|
+
mutationKey: mutationKeyUserPasswordResetRequest(),
|
|
66
|
+
mutationFn: function userPasswordResetRequestMutationFn({
|
|
67
|
+
request,
|
|
68
|
+
options,
|
|
69
|
+
}): Promise<UserPasswordResetRequestMutationData> {
|
|
70
|
+
const mergedOptions = {
|
|
71
|
+
...hookOptions,
|
|
72
|
+
...options,
|
|
73
|
+
fetchOptions: {
|
|
74
|
+
...hookOptions?.fetchOptions,
|
|
75
|
+
...options?.fetchOptions,
|
|
76
|
+
signal: combineSignals(
|
|
77
|
+
hookOptions?.fetchOptions?.signal,
|
|
78
|
+
options?.fetchOptions?.signal,
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
return unwrapAsync(userPasswordResetRequest(
|
|
83
|
+
client$,
|
|
84
|
+
request,
|
|
85
|
+
mergedOptions,
|
|
86
|
+
));
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
package/src/sdk/user.ts
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import { userGetCurrentUser } from "../funcs/userGetCurrentUser.js";
|
|
6
6
|
import { userGetUserById } from "../funcs/userGetUserById.js";
|
|
7
7
|
import { userLogsUserIntoTheSystem } from "../funcs/userLogsUserIntoTheSystem.js";
|
|
8
|
+
import { userMagiclink } from "../funcs/userMagiclink.js";
|
|
9
|
+
import { userPassword } from "../funcs/userPassword.js";
|
|
10
|
+
import { userPasswordResetRequest } from "../funcs/userPasswordResetRequest.js";
|
|
8
11
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
12
|
import * as components from "../models/components/index.js";
|
|
10
13
|
import * as operations from "../models/operations/index.js";
|
|
@@ -89,4 +92,56 @@ export class User extends ClientSDK {
|
|
|
89
92
|
options,
|
|
90
93
|
));
|
|
91
94
|
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Magic link
|
|
98
|
+
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* It sends an email with a magic link to allow the user to log in.
|
|
101
|
+
*/
|
|
102
|
+
async magiclink(
|
|
103
|
+
request: operations.MagiclinkRequestBody,
|
|
104
|
+
options?: RequestOptions,
|
|
105
|
+
): Promise<operations.MagiclinkResponseBody> {
|
|
106
|
+
return unwrapAsync(userMagiclink(
|
|
107
|
+
this,
|
|
108
|
+
request,
|
|
109
|
+
options,
|
|
110
|
+
));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Password reset request
|
|
115
|
+
*
|
|
116
|
+
* @remarks
|
|
117
|
+
* It sends an email with a link for resetting a user's password.
|
|
118
|
+
*/
|
|
119
|
+
async passwordResetRequest(
|
|
120
|
+
request: operations.PasswordResetRequestRequestBody,
|
|
121
|
+
options?: RequestOptions,
|
|
122
|
+
): Promise<operations.PasswordResetRequestResponseBody> {
|
|
123
|
+
return unwrapAsync(userPasswordResetRequest(
|
|
124
|
+
this,
|
|
125
|
+
request,
|
|
126
|
+
options,
|
|
127
|
+
));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Password reset
|
|
132
|
+
*
|
|
133
|
+
* @remarks
|
|
134
|
+
* Resets the a user's password using a password_reset_id that was sent to them via email.
|
|
135
|
+
* See /users/passwordresetrequest to initiate a password reset flow.
|
|
136
|
+
*/
|
|
137
|
+
async password(
|
|
138
|
+
request: operations.PasswordRequestBody,
|
|
139
|
+
options?: RequestOptions,
|
|
140
|
+
): Promise<operations.PasswordResponseBody> {
|
|
141
|
+
return unwrapAsync(userPassword(
|
|
142
|
+
this,
|
|
143
|
+
request,
|
|
144
|
+
options,
|
|
145
|
+
));
|
|
146
|
+
}
|
|
92
147
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type APICall =
|
|
6
|
+
| {
|
|
7
|
+
status: "complete";
|
|
8
|
+
request: Request;
|
|
9
|
+
response: Response;
|
|
10
|
+
}
|
|
11
|
+
| {
|
|
12
|
+
status: "request-error";
|
|
13
|
+
request: Request;
|
|
14
|
+
response?: undefined;
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
status: "invalid";
|
|
18
|
+
request?: undefined;
|
|
19
|
+
response?: undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export class APIPromise<T> implements Promise<T> {
|
|
23
|
+
readonly #promise: Promise<[T, APICall]>;
|
|
24
|
+
readonly #unwrapped: Promise<T>;
|
|
25
|
+
|
|
26
|
+
readonly [Symbol.toStringTag] = "APIPromise";
|
|
27
|
+
|
|
28
|
+
constructor(p: [T, APICall] | Promise<[T, APICall]>) {
|
|
29
|
+
this.#promise = p instanceof Promise ? p : Promise.resolve(p);
|
|
30
|
+
this.#unwrapped =
|
|
31
|
+
p instanceof Promise
|
|
32
|
+
? this.#promise.then(([value]) => value)
|
|
33
|
+
: Promise.resolve(p[0]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
then<TResult1 = T, TResult2 = never>(
|
|
37
|
+
onfulfilled?:
|
|
38
|
+
| ((value: T) => TResult1 | PromiseLike<TResult1>)
|
|
39
|
+
| null
|
|
40
|
+
| undefined,
|
|
41
|
+
onrejected?:
|
|
42
|
+
| ((reason: any) => TResult2 | PromiseLike<TResult2>)
|
|
43
|
+
| null
|
|
44
|
+
| undefined,
|
|
45
|
+
): Promise<TResult1 | TResult2> {
|
|
46
|
+
return this.#promise.then(
|
|
47
|
+
onfulfilled ? ([value]) => onfulfilled(value) : void 0,
|
|
48
|
+
onrejected,
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
catch<TResult = never>(
|
|
53
|
+
onrejected?:
|
|
54
|
+
| ((reason: any) => TResult | PromiseLike<TResult>)
|
|
55
|
+
| null
|
|
56
|
+
| undefined,
|
|
57
|
+
): Promise<T | TResult> {
|
|
58
|
+
return this.#unwrapped.catch(onrejected);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<T> {
|
|
62
|
+
return this.#unwrapped.finally(onfinally);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
$inspect(): Promise<[T, APICall]> {
|
|
66
|
+
return this.#promise;
|
|
67
|
+
}
|
|
68
|
+
}
|
package/types/async.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type APICall = {
|
|
2
|
+
status: "complete";
|
|
3
|
+
request: Request;
|
|
4
|
+
response: Response;
|
|
5
|
+
} | {
|
|
6
|
+
status: "request-error";
|
|
7
|
+
request: Request;
|
|
8
|
+
response?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
status: "invalid";
|
|
11
|
+
request?: undefined;
|
|
12
|
+
response?: undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare class APIPromise<T> implements Promise<T> {
|
|
15
|
+
#private;
|
|
16
|
+
readonly [Symbol.toStringTag] = "APIPromise";
|
|
17
|
+
constructor(p: [T, APICall] | Promise<[T, APICall]>);
|
|
18
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null | undefined, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null | undefined): Promise<TResult1 | TResult2>;
|
|
19
|
+
catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null | undefined): Promise<T | TResult>;
|
|
20
|
+
finally(onfinally?: (() => void) | null | undefined): Promise<T>;
|
|
21
|
+
$inspect(): Promise<[T, APICall]>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=async.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../src/types/async.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GACf;IACE,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;CACpB,GACD;IACE,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GACD;IACE,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEN,qBAAa,UAAU,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;;IAI9C,QAAQ,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,gBAAgB;gBAEjC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAQnD,IAAI,CAAC,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EACjC,WAAW,CAAC,EACR,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAChD,IAAI,GACJ,SAAS,EACb,UAAU,CAAC,EACP,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GACnD,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAO/B,KAAK,CAAC,OAAO,GAAG,KAAK,EACnB,UAAU,CAAC,EACP,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,GACjD,IAAI,GACJ,SAAS,GACZ,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC;IAIvB,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhE,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;CAGlC"}
|
package/types/async.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
6
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
9
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _APIPromise_promise, _APIPromise_unwrapped, _a;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.APIPromise = void 0;
|
|
19
|
+
class APIPromise {
|
|
20
|
+
constructor(p) {
|
|
21
|
+
_APIPromise_promise.set(this, void 0);
|
|
22
|
+
_APIPromise_unwrapped.set(this, void 0);
|
|
23
|
+
this[_a] = "APIPromise";
|
|
24
|
+
__classPrivateFieldSet(this, _APIPromise_promise, p instanceof Promise ? p : Promise.resolve(p), "f");
|
|
25
|
+
__classPrivateFieldSet(this, _APIPromise_unwrapped, p instanceof Promise
|
|
26
|
+
? __classPrivateFieldGet(this, _APIPromise_promise, "f").then(([value]) => value)
|
|
27
|
+
: Promise.resolve(p[0]), "f");
|
|
28
|
+
}
|
|
29
|
+
then(onfulfilled, onrejected) {
|
|
30
|
+
return __classPrivateFieldGet(this, _APIPromise_promise, "f").then(onfulfilled ? ([value]) => onfulfilled(value) : void 0, onrejected);
|
|
31
|
+
}
|
|
32
|
+
catch(onrejected) {
|
|
33
|
+
return __classPrivateFieldGet(this, _APIPromise_unwrapped, "f").catch(onrejected);
|
|
34
|
+
}
|
|
35
|
+
finally(onfinally) {
|
|
36
|
+
return __classPrivateFieldGet(this, _APIPromise_unwrapped, "f").finally(onfinally);
|
|
37
|
+
}
|
|
38
|
+
$inspect() {
|
|
39
|
+
return __classPrivateFieldGet(this, _APIPromise_promise, "f");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.APIPromise = APIPromise;
|
|
43
|
+
_APIPromise_promise = new WeakMap(), _APIPromise_unwrapped = new WeakMap(), _a = Symbol.toStringTag;
|
|
44
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../src/types/async.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;AAmBH,MAAa,UAAU;IAMrB,YAAY,CAAuC;QAL1C,sCAAgC;QAChC,wCAAuB;QAEvB,QAAoB,GAAG,YAAY,CAAC;QAG3C,uBAAA,IAAI,uBAAY,CAAC,YAAY,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,MAAA,CAAC;QAC9D,uBAAA,IAAI,yBACF,CAAC,YAAY,OAAO;YAClB,CAAC,CAAC,uBAAA,IAAI,2BAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC;YACxC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAA,CAAC;IAC9B,CAAC;IAED,IAAI,CACF,WAGa,EACb,UAGa;QAEb,OAAO,uBAAA,IAAI,2BAAS,CAAC,IAAI,CACvB,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EACtD,UAAU,CACX,CAAC;IACJ,CAAC;IAED,KAAK,CACH,UAGa;QAEb,OAAO,uBAAA,IAAI,6BAAW,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,CAAC,SAA2C;QACjD,OAAO,uBAAA,IAAI,6BAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED,QAAQ;QACN,OAAO,uBAAA,IAAI,2BAAS,CAAC;IACvB,CAAC;CACF;AA9CD,gCA8CC;iFA1CW,MAAM,CAAC,WAAW"}
|
package/.devcontainer/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<div align="center">
|
|
3
|
-
<a href="https://codespaces.new/repconnex/repconnex.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
|
|
4
|
-
</div>
|
|
5
|
-
<br>
|
|
6
|
-
|
|
7
|
-
> **Remember to shutdown a GitHub Codespace when it is not in use!**
|
|
8
|
-
|
|
9
|
-
# Dev Containers Quick Start
|
|
10
|
-
|
|
11
|
-
The default location for usage snippets is the `samples` directory.
|
|
12
|
-
|
|
13
|
-
## Running a Usage Sample
|
|
14
|
-
|
|
15
|
-
A sample usage example has been provided in a `root.ts` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
ts-node root.ts
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Generating Additional Usage Samples
|
|
22
|
-
|
|
23
|
-
The speakeasy CLI allows you to generate more usage snippets. Here's how:
|
|
24
|
-
|
|
25
|
-
- To generate a sample for a specific operation by providing an operation ID, use:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
speakeasy generate usage -s https://example.com/OVERWRITE_WHEN_SAMPLE_SPEC_IS_WRITTEN -l typescript -i {INPUT_OPERATION_ID} -o ./samples
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
- To generate samples for an entire namespace (like a tag or group name), use:
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
speakeasy generate usage -s https://example.com/OVERWRITE_WHEN_SAMPLE_SPEC_IS_WRITTEN -l typescript -n {INPUT_TAG_NAME} -o ./samples
|
|
35
|
-
```
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# GreenSecurity SDK
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
API Reference: The Green Security API is organized around [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer).
|
|
6
|
-
Our API has predictable resource-oriented URLs, accepts [JSON-encoded](http://www.json.org/) request bodies,
|
|
7
|
-
returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
|
|
8
|
-
|
|
9
|
-
The API is updated frequently, so be sure to check back often for the latest information.
|
|
10
|
-
|
|
11
|
-
Some useful links:
|
|
12
|
-
- [OpenAPI Reference](https://www.speakeasy.com/openapi)
|
|
13
|
-
|
|
14
|
-
### Available Operations
|