@greensecurity/javascript-sdk 0.47.0-beta.1 → 0.47.0-beta.10
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/commonjs/__tests__/doAdmin.test.js +26 -0
- package/dist/commonjs/__tests__/doAdmin.test.js.map +1 -1
- package/dist/commonjs/__tests__/vendors.test.js +1 -1
- package/dist/commonjs/__tests__/zoneDevicesCreate.test.js +19 -1
- package/dist/commonjs/__tests__/zoneDevicesCreate.test.js.map +1 -1
- package/dist/commonjs/__tests__/zoneDevicesList.test.js +13 -1
- package/dist/commonjs/__tests__/zoneDevicesList.test.js.map +1 -1
- package/dist/commonjs/__tests__/zones.test.js +30 -2
- package/dist/commonjs/__tests__/zones.test.js.map +1 -1
- package/dist/commonjs/admin-funcs/doAdmin.d.ts +3 -1
- package/dist/commonjs/admin-funcs/doAdmin.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/doAdmin.js +11 -3
- package/dist/commonjs/admin-funcs/doAdmin.js.map +1 -1
- package/dist/commonjs/admin-funcs/lookupsAddressAutocomplete.d.ts +4 -0
- package/dist/commonjs/admin-funcs/lookupsAddressAutocomplete.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/lookupsAddressAutocomplete.js +17 -0
- package/dist/commonjs/admin-funcs/lookupsAddressAutocomplete.js.map +1 -0
- package/dist/commonjs/admin-funcs/lookupsAddressPlace.d.ts +4 -0
- package/dist/commonjs/admin-funcs/lookupsAddressPlace.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/lookupsAddressPlace.js +16 -0
- package/dist/commonjs/admin-funcs/lookupsAddressPlace.js.map +1 -0
- package/dist/commonjs/admin-funcs/lookupsAddressValidation.d.ts +13 -0
- package/dist/commonjs/admin-funcs/lookupsAddressValidation.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/lookupsAddressValidation.js +10 -0
- package/dist/commonjs/admin-funcs/lookupsAddressValidation.js.map +1 -0
- package/dist/commonjs/admin-funcs/networksCreate.d.ts +4 -0
- package/dist/commonjs/admin-funcs/networksCreate.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/networksCreate.js.map +1 -1
- package/dist/commonjs/admin-funcs/vendorCredentialCreateFormQuote.d.ts +18 -1
- package/dist/commonjs/admin-funcs/vendorCredentialCreateFormQuote.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/vendorCredentialCreateFormQuote.js +18 -2
- package/dist/commonjs/admin-funcs/vendorCredentialCreateFormQuote.js.map +1 -1
- package/dist/commonjs/admin-funcs/vendorCredentialGetFormLineItems.d.ts +5 -1
- package/dist/commonjs/admin-funcs/vendorCredentialGetFormLineItems.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/vendorCredentialGetFormLineItems.js +5 -2
- package/dist/commonjs/admin-funcs/vendorCredentialGetFormLineItems.js.map +1 -1
- package/dist/commonjs/admin-funcs/zoneDevicesDelete.d.ts +3 -0
- package/dist/commonjs/admin-funcs/zoneDevicesDelete.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesDelete.js +11 -0
- package/dist/commonjs/admin-funcs/zoneDevicesDelete.js.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesList.d.ts +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesList.d.ts.map +1 -1
- package/dist/commonjs/admin-funcs/zoneDevicesList.js +3 -0
- package/dist/commonjs/admin-funcs/zoneDevicesList.js.map +1 -1
- package/dist/commonjs/admin-funcs/zoneDevicesProvisioning.d.ts +3 -0
- package/dist/commonjs/admin-funcs/zoneDevicesProvisioning.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesProvisioning.js +15 -0
- package/dist/commonjs/admin-funcs/zoneDevicesProvisioning.js.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesUpdate.d.ts +10 -0
- package/dist/commonjs/admin-funcs/zoneDevicesUpdate.d.ts.map +1 -0
- package/dist/commonjs/admin-funcs/zoneDevicesUpdate.js +14 -0
- package/dist/commonjs/admin-funcs/zoneDevicesUpdate.js.map +1 -0
- package/dist/commonjs/apps/components.d.ts.map +1 -1
- package/dist/commonjs/apps/components.js +5 -0
- package/dist/commonjs/apps/components.js.map +1 -1
- package/dist/commonjs/index.extras.d.ts +14 -0
- package/dist/commonjs/index.extras.d.ts.map +1 -1
- package/dist/commonjs/index.extras.js +14 -0
- package/dist/commonjs/index.extras.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/operations/createinvoice.d.ts +25 -0
- package/dist/commonjs/models/operations/createinvoice.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createinvoice.js +10 -0
- package/dist/commonjs/models/operations/createinvoice.js.map +1 -1
- package/dist/commonjs/types/smartUnion.js +3 -3
- package/dist/commonjs/types/smartUnion.js.map +1 -1
- package/dist/esm/__tests__/doAdmin.test.js +27 -1
- package/dist/esm/__tests__/doAdmin.test.js.map +1 -1
- package/dist/esm/__tests__/vendors.test.js +1 -1
- package/dist/esm/__tests__/zoneDevicesCreate.test.js +19 -1
- package/dist/esm/__tests__/zoneDevicesCreate.test.js.map +1 -1
- package/dist/esm/__tests__/zoneDevicesList.test.js +13 -1
- package/dist/esm/__tests__/zoneDevicesList.test.js.map +1 -1
- package/dist/esm/__tests__/zones.test.js +30 -2
- package/dist/esm/__tests__/zones.test.js.map +1 -1
- package/dist/esm/admin-funcs/doAdmin.d.ts +3 -1
- package/dist/esm/admin-funcs/doAdmin.d.ts.map +1 -1
- package/dist/esm/admin-funcs/doAdmin.js +10 -3
- package/dist/esm/admin-funcs/doAdmin.js.map +1 -1
- package/dist/esm/admin-funcs/lookupsAddressAutocomplete.d.ts +4 -0
- package/dist/esm/admin-funcs/lookupsAddressAutocomplete.d.ts.map +1 -0
- package/dist/esm/admin-funcs/lookupsAddressAutocomplete.js +14 -0
- package/dist/esm/admin-funcs/lookupsAddressAutocomplete.js.map +1 -0
- package/dist/esm/admin-funcs/lookupsAddressPlace.d.ts +4 -0
- package/dist/esm/admin-funcs/lookupsAddressPlace.d.ts.map +1 -0
- package/dist/esm/admin-funcs/lookupsAddressPlace.js +13 -0
- package/dist/esm/admin-funcs/lookupsAddressPlace.js.map +1 -0
- package/dist/esm/admin-funcs/lookupsAddressValidation.d.ts +13 -0
- package/dist/esm/admin-funcs/lookupsAddressValidation.d.ts.map +1 -0
- package/dist/esm/admin-funcs/lookupsAddressValidation.js +7 -0
- package/dist/esm/admin-funcs/lookupsAddressValidation.js.map +1 -0
- package/dist/esm/admin-funcs/networksCreate.d.ts +4 -0
- package/dist/esm/admin-funcs/networksCreate.d.ts.map +1 -1
- package/dist/esm/admin-funcs/networksCreate.js.map +1 -1
- package/dist/esm/admin-funcs/vendorCredentialCreateFormQuote.d.ts +18 -1
- package/dist/esm/admin-funcs/vendorCredentialCreateFormQuote.d.ts.map +1 -1
- package/dist/esm/admin-funcs/vendorCredentialCreateFormQuote.js +18 -2
- package/dist/esm/admin-funcs/vendorCredentialCreateFormQuote.js.map +1 -1
- package/dist/esm/admin-funcs/vendorCredentialGetFormLineItems.d.ts +5 -1
- package/dist/esm/admin-funcs/vendorCredentialGetFormLineItems.d.ts.map +1 -1
- package/dist/esm/admin-funcs/vendorCredentialGetFormLineItems.js +5 -2
- package/dist/esm/admin-funcs/vendorCredentialGetFormLineItems.js.map +1 -1
- package/dist/esm/admin-funcs/zoneDevicesDelete.d.ts +3 -0
- package/dist/esm/admin-funcs/zoneDevicesDelete.d.ts.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesDelete.js +8 -0
- package/dist/esm/admin-funcs/zoneDevicesDelete.js.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesList.d.ts +1 -0
- package/dist/esm/admin-funcs/zoneDevicesList.d.ts.map +1 -1
- package/dist/esm/admin-funcs/zoneDevicesList.js +3 -0
- package/dist/esm/admin-funcs/zoneDevicesList.js.map +1 -1
- package/dist/esm/admin-funcs/zoneDevicesProvisioning.d.ts +3 -0
- package/dist/esm/admin-funcs/zoneDevicesProvisioning.d.ts.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesProvisioning.js +12 -0
- package/dist/esm/admin-funcs/zoneDevicesProvisioning.js.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesUpdate.d.ts +10 -0
- package/dist/esm/admin-funcs/zoneDevicesUpdate.d.ts.map +1 -0
- package/dist/esm/admin-funcs/zoneDevicesUpdate.js +11 -0
- package/dist/esm/admin-funcs/zoneDevicesUpdate.js.map +1 -0
- package/dist/esm/apps/components.d.ts.map +1 -1
- package/dist/esm/apps/components.js +5 -0
- package/dist/esm/apps/components.js.map +1 -1
- package/dist/esm/index.extras.d.ts +14 -0
- package/dist/esm/index.extras.d.ts.map +1 -1
- package/dist/esm/index.extras.js +14 -0
- package/dist/esm/index.extras.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/operations/createinvoice.d.ts +25 -0
- package/dist/esm/models/operations/createinvoice.d.ts.map +1 -1
- package/dist/esm/models/operations/createinvoice.js +10 -0
- package/dist/esm/models/operations/createinvoice.js.map +1 -1
- package/dist/esm/types/smartUnion.js +3 -3
- package/dist/esm/types/smartUnion.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/__tests__/doAdmin.test.ts +35 -0
- package/src/__tests__/vendors.test.ts +1 -1
- package/src/__tests__/zoneDevicesCreate.test.ts +25 -1
- package/src/__tests__/zoneDevicesList.test.ts +15 -1
- package/src/__tests__/zones.test.ts +30 -2
- package/src/admin-funcs/doAdmin.ts +20 -3
- package/src/admin-funcs/lookupsAddressAutocomplete.ts +23 -0
- package/src/admin-funcs/lookupsAddressPlace.ts +20 -0
- package/src/admin-funcs/lookupsAddressValidation.ts +21 -0
- package/src/admin-funcs/networksCreate.ts +5 -0
- package/src/admin-funcs/vendorCredentialCreateFormQuote.ts +20 -1
- package/src/admin-funcs/vendorCredentialGetFormLineItems.ts +5 -0
- package/src/admin-funcs/zoneDevicesDelete.ts +8 -0
- package/src/admin-funcs/zoneDevicesList.ts +4 -0
- package/src/admin-funcs/zoneDevicesProvisioning.ts +12 -0
- package/src/admin-funcs/zoneDevicesUpdate.ts +21 -0
- package/src/apps/components.ts +5 -0
- package/src/index.extras.ts +15 -0
- package/src/lib/config.ts +3 -3
- package/src/models/operations/createinvoice.ts +35 -0
- package/src/types/smartUnion.ts +3 -3
|
@@ -341,10 +341,27 @@ export async function $doPostForm(
|
|
|
341
341
|
return $doPostBody(route, form, {}, options);
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
export
|
|
344
|
+
export function $doPut<T extends object>(
|
|
345
345
|
route: string,
|
|
346
346
|
putData: T,
|
|
347
347
|
options?: RequestOptions,
|
|
348
|
+
): ReturnType<typeof $doJsonRequest> {
|
|
349
|
+
return $doJsonRequest("PUT", route, putData, options);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export function $doDelete(
|
|
353
|
+
route: string,
|
|
354
|
+
options?: RequestOptions,
|
|
355
|
+
): ReturnType<typeof $doJsonRequest> {
|
|
356
|
+
return $doJsonRequest("DELETE", route, undefined, options);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// PUT and DELETE share everything but the method; a DELETE sends no body.
|
|
360
|
+
async function $doJsonRequest(
|
|
361
|
+
method: "PUT" | "DELETE",
|
|
362
|
+
route: string,
|
|
363
|
+
data: object | undefined,
|
|
364
|
+
options?: RequestOptions,
|
|
348
365
|
): Promise<
|
|
349
366
|
[
|
|
350
367
|
Result<
|
|
@@ -367,7 +384,7 @@ export async function $doPut<T extends object>(
|
|
|
367
384
|
throw new Error("GreenSecurityCore client is not initialized.");
|
|
368
385
|
}
|
|
369
386
|
|
|
370
|
-
const body = encodeJSON("body",
|
|
387
|
+
const body = data === undefined ? undefined : encodeJSON("body", data, { explode: true });
|
|
371
388
|
|
|
372
389
|
// Extract the path parameters from the request object
|
|
373
390
|
const pathParams = {}; //extractRouteParameters(route, request);
|
|
@@ -399,7 +416,7 @@ export async function $doPut<T extends object>(
|
|
|
399
416
|
|
|
400
417
|
const requestRes = client._createRequest(context, {
|
|
401
418
|
security: requestSecurity,
|
|
402
|
-
method
|
|
419
|
+
method,
|
|
403
420
|
baseURL: options?.serverURL,
|
|
404
421
|
path: path,
|
|
405
422
|
headers: headers,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { $doGetSingle, hashToQueryString, internalApiResult } from "./doAdmin.js";
|
|
4
|
+
|
|
5
|
+
// Returns Google Places address suggestions for a partly typed street address.
|
|
6
|
+
export function lookupsAddressAutocomplete(
|
|
7
|
+
vendorCredentialId: number,
|
|
8
|
+
input: string,
|
|
9
|
+
sessionToken: string,
|
|
10
|
+
country?: string,
|
|
11
|
+
options?: RequestOptions,
|
|
12
|
+
): internalApiResult {
|
|
13
|
+
const params: Record<string, string> = {
|
|
14
|
+
vendor_credential_id: String(vendorCredentialId),
|
|
15
|
+
input,
|
|
16
|
+
session_token: sessionToken,
|
|
17
|
+
};
|
|
18
|
+
if (country) params["country"] = country;
|
|
19
|
+
|
|
20
|
+
return new APIPromise(
|
|
21
|
+
$doGetSingle(`/lookups/address-autocomplete?${hashToQueryString(params)}`, {}, options),
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { $doGetSingle, hashToQueryString, internalApiResult } from "./doAdmin.js";
|
|
4
|
+
|
|
5
|
+
// Returns the address fields for an autocomplete suggestion the user picked. Pass the same sessionToken used for
|
|
6
|
+
// the autocomplete requests.
|
|
7
|
+
export function lookupsAddressPlace(
|
|
8
|
+
vendorCredentialId: number,
|
|
9
|
+
placeId: string,
|
|
10
|
+
sessionToken: string,
|
|
11
|
+
options?: RequestOptions,
|
|
12
|
+
): internalApiResult {
|
|
13
|
+
const query = hashToQueryString({
|
|
14
|
+
vendor_credential_id: vendorCredentialId,
|
|
15
|
+
place_id: placeId,
|
|
16
|
+
session_token: sessionToken,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
return new APIPromise($doGetSingle(`/lookups/address-place?${query}`, {}, options));
|
|
20
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { $doPost, internalApiResult } from "./doAdmin.js";
|
|
4
|
+
|
|
5
|
+
export type lookupsAddressValidationRequest = {
|
|
6
|
+
vendor_credential_id: number;
|
|
7
|
+
address1: string;
|
|
8
|
+
address2?: string;
|
|
9
|
+
city?: string;
|
|
10
|
+
state?: string;
|
|
11
|
+
postal_code?: string;
|
|
12
|
+
country?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// Checks a shipping address with Google's Address Validation API
|
|
16
|
+
export function lookupsAddressValidation(
|
|
17
|
+
request: lookupsAddressValidationRequest,
|
|
18
|
+
options?: RequestOptions,
|
|
19
|
+
): internalApiResult {
|
|
20
|
+
return new APIPromise($doPost("/lookups/address-validation", request, options));
|
|
21
|
+
}
|
|
@@ -10,6 +10,9 @@ export type networkEthernetSettings = {
|
|
|
10
10
|
ip_address?: string;
|
|
11
11
|
netmask?: string;
|
|
12
12
|
gateway_address?: string;
|
|
13
|
+
// DNS servers for a static address; the gateway needs a primary one.
|
|
14
|
+
primary_dns?: string;
|
|
15
|
+
secondary_dns?: string;
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
export type networkWifiSettings = {
|
|
@@ -23,6 +26,8 @@ export type networkWifiSettings = {
|
|
|
23
26
|
ip_address?: string;
|
|
24
27
|
netmask?: string;
|
|
25
28
|
gateway_address?: string;
|
|
29
|
+
primary_dns?: string;
|
|
30
|
+
secondary_dns?: string;
|
|
26
31
|
};
|
|
27
32
|
|
|
28
33
|
// A file to send with the create. React Native's FormData takes this shape rather than a Blob.
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
2
3
|
import { $doPost, internalApiResult } from "./doAdmin.js";
|
|
3
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Quotes the fee the given form answers incur on a credential.
|
|
7
|
+
*
|
|
8
|
+
* `useCredits` declares that the payer intends to settle the order from their credit balance
|
|
9
|
+
* before their payment method is charged. It only affects how the convenience fee is tiered --
|
|
10
|
+
* the fee pays for card processing, so it is assessed on what the card is left to cover, and an
|
|
11
|
+
* order the balance covers in full carries none. No credits are debited here, and the balance is
|
|
12
|
+
* read from the payer's own ledger rather than taken from this call.
|
|
13
|
+
*
|
|
14
|
+
* Answers with: `{ id, is_quote, tax, convenience_fee, total, success }`. The three money
|
|
15
|
+
* fields are in cents, matching what the invoice endpoints report, so the quote prices the
|
|
16
|
+
* order on its own and no follow-up fetch of the invoice is needed.
|
|
17
|
+
*/
|
|
4
18
|
export function vendorCredentialCreateFormQuote(
|
|
5
19
|
vendorCredentialId: number,
|
|
6
20
|
jsonData: string,
|
|
21
|
+
useCredits = false,
|
|
22
|
+
/** Carries the caller's AbortSignal: the form re-prices as it is filled in, so a
|
|
23
|
+
* superseded request has to be droppable in flight. */
|
|
24
|
+
options?: RequestOptions,
|
|
7
25
|
): internalApiResult {
|
|
8
26
|
return new APIPromise($doPost(
|
|
9
27
|
`/vendors/credentials/${vendorCredentialId}/quote`,
|
|
10
|
-
{ json_data: jsonData },
|
|
28
|
+
{ json_data: jsonData, use_credits: useCredits },
|
|
29
|
+
options,
|
|
11
30
|
));
|
|
12
31
|
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
2
3
|
import { $doPost, internalApiResult } from "./doAdmin.js";
|
|
3
4
|
|
|
4
5
|
export function vendorCredentialGetFormLineItems(
|
|
5
6
|
vendorCredentialId: number,
|
|
6
7
|
jsonData: string,
|
|
8
|
+
/** Carries the caller's AbortSignal: the form re-prices as it is filled in, so a
|
|
9
|
+
* superseded request has to be droppable in flight. */
|
|
10
|
+
options?: RequestOptions,
|
|
7
11
|
): internalApiResult {
|
|
8
12
|
return new APIPromise($doPost(
|
|
9
13
|
`/vendors/credentials/${vendorCredentialId}/line-items`,
|
|
10
14
|
{ json_data: jsonData },
|
|
15
|
+
options,
|
|
11
16
|
));
|
|
12
17
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { $doDelete, internalApiResult } from "./doAdmin.js";
|
|
3
|
+
|
|
4
|
+
// Removes a gateway from the Gatekeeper device details screen and revokes its AWS IoT thing.
|
|
5
|
+
// Internal for the same reason as zoneDevicesCreate. 404 covers a gateway outside the caller's scope.
|
|
6
|
+
export function zoneDevicesDelete(zoneDeviceId: number): internalApiResult {
|
|
7
|
+
return new APIPromise($doDelete(`/zone-devices/${zoneDeviceId}`));
|
|
8
|
+
}
|
|
@@ -6,6 +6,7 @@ export type zoneDevicesListSortField = "id" | "name";
|
|
|
6
6
|
export type zoneDevicesListRequest = {
|
|
7
7
|
facilityId?: number;
|
|
8
8
|
zoneId?: number;
|
|
9
|
+
networkId?: number;
|
|
9
10
|
page?: number;
|
|
10
11
|
itemsPerPage?: number;
|
|
11
12
|
sort?: zoneDevicesListSortField;
|
|
@@ -36,6 +37,9 @@ export function zoneDevicesList(
|
|
|
36
37
|
if (request.zoneId !== undefined) {
|
|
37
38
|
query["zone_id"] = request.zoneId;
|
|
38
39
|
}
|
|
40
|
+
if (request.networkId !== undefined) {
|
|
41
|
+
query["network_id"] = request.networkId;
|
|
42
|
+
}
|
|
39
43
|
if (request.page !== undefined) {
|
|
40
44
|
query["page"] = request.page;
|
|
41
45
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { $doPost, internalApiResult } from "./doAdmin.js";
|
|
3
|
+
|
|
4
|
+
// Everything the Gatekeeper app writes to a gateway when it provisions it over the gateway's own
|
|
5
|
+
// Wi-Fi: the admin password, the AWS IoT certificate and broker, and the settings and
|
|
6
|
+
// secrets of the network it joins. The first call mints the password and certificate, hence POST.
|
|
7
|
+
//
|
|
8
|
+
// Internal for the same reason as zoneDevicesCreate. The response carries secrets: callers keep it
|
|
9
|
+
// in memory for the provisioning run and never persist or log it.
|
|
10
|
+
export function zoneDevicesProvisioning(zoneDeviceId: number): internalApiResult {
|
|
11
|
+
return new APIPromise($doPost(`/zone-devices/${zoneDeviceId}/provisioning`, {}));
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { APIPromise } from "../types/async.js";
|
|
2
|
+
import { $doPut, internalApiResult } from "./doAdmin.js";
|
|
3
|
+
import type { zoneDeviceConnectionType } from "./zoneDevicesCreate.js";
|
|
4
|
+
|
|
5
|
+
// Wire names, posted verbatim like zoneDevicesCreateRequest. Every field is optional: only what
|
|
6
|
+
// the edit changed is sent.
|
|
7
|
+
export type zoneDevicesUpdateRequest = {
|
|
8
|
+
zone_id?: number;
|
|
9
|
+
network_id?: number;
|
|
10
|
+
connection_type?: zoneDeviceConnectionType;
|
|
11
|
+
name?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// Edits a gateway from the Gatekeeper device details screen. This only updates the record; the
|
|
15
|
+
// app pushes the new network to the hardware using zoneDevicesProvisioning.
|
|
16
|
+
//
|
|
17
|
+
// Internal for the same reason as zoneDevicesCreate. 404 covers a gateway, zone or network outside
|
|
18
|
+
// the caller's scope, and a network not linked to the zone's facility.
|
|
19
|
+
export function zoneDevicesUpdate(zoneDeviceId: number, request: zoneDevicesUpdateRequest): internalApiResult {
|
|
20
|
+
return new APIPromise($doPut(`/zone-devices/${zoneDeviceId}`, request));
|
|
21
|
+
}
|
package/src/apps/components.ts
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Styling is tokens only. There is no `style`, `className` or colour value an app can pass, and
|
|
10
10
|
* every URL-shaped prop is typed so the host can refuse what the manifest did not grant.
|
|
11
|
+
*
|
|
12
|
+
* The Apps guides show screenshots of representative states and options for each component
|
|
13
|
+
* (not every contract state, such as a disabled Link, is pictured). A new component, or a change to
|
|
14
|
+
* how one looks or behaves, needs new or recaptured pictures in the same change; see
|
|
15
|
+
* .github/instructions/app-platform-ui.instructions.md.
|
|
11
16
|
*/
|
|
12
17
|
|
|
13
18
|
import { isHttpsUrl } from "./url.js";
|
package/src/index.extras.ts
CHANGED
|
@@ -66,6 +66,12 @@ import { zoneDevicesList } from "./admin-funcs/zoneDevicesList.js";
|
|
|
66
66
|
import { zoneDevicesGet } from "./admin-funcs/zoneDevicesGet.js";
|
|
67
67
|
import { zoneDevicesCreate } from "./admin-funcs/zoneDevicesCreate.js";
|
|
68
68
|
import { zoneDevicesMacAvailability } from "./admin-funcs/zoneDevicesMacAvailability.js";
|
|
69
|
+
import { zoneDevicesUpdate } from "./admin-funcs/zoneDevicesUpdate.js";
|
|
70
|
+
import { zoneDevicesProvisioning } from "./admin-funcs/zoneDevicesProvisioning.js";
|
|
71
|
+
import { zoneDevicesDelete } from "./admin-funcs/zoneDevicesDelete.js";
|
|
72
|
+
import { lookupsAddressValidation } from "./admin-funcs/lookupsAddressValidation.js";
|
|
73
|
+
import { lookupsAddressAutocomplete } from "./admin-funcs/lookupsAddressAutocomplete.js";
|
|
74
|
+
import { lookupsAddressPlace } from "./admin-funcs/lookupsAddressPlace.js";
|
|
69
75
|
|
|
70
76
|
// Third-party app platform contract (surfaces, manifest, host/sandbox protocol, components).
|
|
71
77
|
export * as apps from "./apps/index.js";
|
|
@@ -139,6 +145,12 @@ export const __internal = {
|
|
|
139
145
|
dismiss: dismissCommunication
|
|
140
146
|
},
|
|
141
147
|
|
|
148
|
+
lookups: {
|
|
149
|
+
validateAddress: lookupsAddressValidation,
|
|
150
|
+
autocompleteAddress: lookupsAddressAutocomplete,
|
|
151
|
+
getAddressPlace: lookupsAddressPlace
|
|
152
|
+
},
|
|
153
|
+
|
|
142
154
|
// Third-party app platform host (web-mobile-client, docs/third-party-apps/plan.md C8).
|
|
143
155
|
apps: {
|
|
144
156
|
listInstalledApps: appsListInstalledApps,
|
|
@@ -181,6 +193,9 @@ export const __internal = {
|
|
|
181
193
|
list: zoneDevicesList,
|
|
182
194
|
get: zoneDevicesGet,
|
|
183
195
|
create: zoneDevicesCreate,
|
|
196
|
+
update: zoneDevicesUpdate,
|
|
197
|
+
provisioning: zoneDevicesProvisioning,
|
|
198
|
+
delete: zoneDevicesDelete,
|
|
184
199
|
macAvailability: zoneDevicesMacAvailability
|
|
185
200
|
}
|
|
186
201
|
};
|
package/src/lib/config.ts
CHANGED
|
@@ -80,8 +80,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
80
80
|
export const SDK_METADATA = {
|
|
81
81
|
language: "typescript",
|
|
82
82
|
openapiDocVersion: "0.46.0",
|
|
83
|
-
sdkVersion: "0.47.0-beta.
|
|
84
|
-
genVersion: "2.
|
|
83
|
+
sdkVersion: "0.47.0-beta.10",
|
|
84
|
+
genVersion: "2.948.4",
|
|
85
85
|
userAgent:
|
|
86
|
-
"speakeasy-sdk/typescript 0.47.0-beta.
|
|
86
|
+
"speakeasy-sdk/typescript 0.47.0-beta.10 2.948.4 0.46.0 @greensecurity/javascript-sdk",
|
|
87
87
|
} as const;
|
|
@@ -58,6 +58,10 @@ export type Five = {
|
|
|
58
58
|
* A campaign opt-in code, taken from the link that carried the offer Deliberately not an enumeration. The server decides which codes are live, what each one grants, and who qualifies for it. These decisions change as campaigns come and go. The server ignores an unrecognized code, or one the account does not qualify for, and creates the invoice as if the code were absent, never returning an error. The server adds any line item the code earns, and it appears on the quote.
|
|
59
59
|
*/
|
|
60
60
|
promo?: string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
63
|
+
*/
|
|
64
|
+
useCredits?: boolean | undefined;
|
|
61
65
|
};
|
|
62
66
|
|
|
63
67
|
export const CreateInvoiceRequestBodyInvoicesPaymentHandler = {
|
|
@@ -105,6 +109,10 @@ export type Four = {
|
|
|
105
109
|
* A campaign opt-in code, taken from the link that carried the offer Deliberately not an enumeration. The server decides which codes are live, what each one grants, and who qualifies for it. These decisions change as campaigns come and go. The server ignores an unrecognized code, or one the account does not qualify for, and creates the invoice as if the code were absent, never returning an error. The server adds any line item the code earns, and it appears on the quote.
|
|
106
110
|
*/
|
|
107
111
|
promo?: string | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
114
|
+
*/
|
|
115
|
+
useCredits?: boolean | undefined;
|
|
108
116
|
};
|
|
109
117
|
|
|
110
118
|
export const CreateInvoiceRequestBodyPaymentHandler = {
|
|
@@ -152,6 +160,10 @@ export type Three = {
|
|
|
152
160
|
* A campaign opt-in code, taken from the link that carried the offer Deliberately not an enumeration. The server decides which codes are live, what each one grants, and who qualifies for it. These decisions change as campaigns come and go. The server ignores an unrecognized code, or one the account does not qualify for, and creates the invoice as if the code were absent, never returning an error. The server adds any line item the code earns, and it appears on the quote.
|
|
153
161
|
*/
|
|
154
162
|
promo?: string | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
165
|
+
*/
|
|
166
|
+
useCredits?: boolean | undefined;
|
|
155
167
|
};
|
|
156
168
|
|
|
157
169
|
export const RequestBodyPaymentHandler = {
|
|
@@ -197,6 +209,10 @@ export type CreateInvoiceRequestBody2 = {
|
|
|
197
209
|
* A campaign opt-in code, taken from the link that carried the offer Deliberately not an enumeration. The server decides which codes are live, what each one grants, and who qualifies for it. These decisions change as campaigns come and go. The server ignores an unrecognized code, or one the account does not qualify for, and creates the invoice as if the code were absent, never returning an error. The server adds any line item the code earns, and it appears on the quote.
|
|
198
210
|
*/
|
|
199
211
|
promo?: string | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
214
|
+
*/
|
|
215
|
+
useCredits?: boolean | undefined;
|
|
200
216
|
};
|
|
201
217
|
|
|
202
218
|
export const PaymentHandler = {
|
|
@@ -240,6 +256,10 @@ export type RequestBody1 = {
|
|
|
240
256
|
* A campaign opt-in code, taken from the link that carried the offer Deliberately not an enumeration. The server decides which codes are live, what each one grants, and who qualifies for it. These decisions change as campaigns come and go. The server ignores an unrecognized code, or one the account does not qualify for, and creates the invoice as if the code were absent, never returning an error. The server adds any line item the code earns, and it appears on the quote.
|
|
241
257
|
*/
|
|
242
258
|
promo?: string | undefined;
|
|
259
|
+
/**
|
|
260
|
+
* Set to `true` when the payer intends to settle this order from their credit balance before their payment method is charged. This affects only how the convenience fee is calculated: the fee pays for card processing, so it is assessed on the amount the card is left to cover once credits have been applied, and an order a balance covers in full carries none. No credits are debited here, and the balance is read from the payer's own ledger rather than taken from this request. Settle the credits with `POST /invoices/{id}/payment` and `use_credits: true`.
|
|
261
|
+
*/
|
|
262
|
+
useCredits?: boolean | undefined;
|
|
243
263
|
};
|
|
244
264
|
|
|
245
265
|
/**
|
|
@@ -336,6 +356,7 @@ export type Five$Outbound = {
|
|
|
336
356
|
credential_pricing_ids?: Array<number> | null | undefined;
|
|
337
357
|
invoice_type?: string | undefined;
|
|
338
358
|
promo?: string | undefined;
|
|
359
|
+
use_credits: boolean;
|
|
339
360
|
};
|
|
340
361
|
|
|
341
362
|
/** @internal */
|
|
@@ -350,11 +371,13 @@ export const Five$outboundSchema: z.ZodType<Five$Outbound, z.ZodTypeDef, Five> =
|
|
|
350
371
|
CreateInvoiceRequestBodyInvoicesRequestInvoiceType$outboundSchema
|
|
351
372
|
.optional(),
|
|
352
373
|
promo: z.string().optional(),
|
|
374
|
+
useCredits: z.boolean().default(false),
|
|
353
375
|
}).transform((v) => {
|
|
354
376
|
return remap$(v, {
|
|
355
377
|
vendorCredentialId: "vendor_credential_id",
|
|
356
378
|
credentialPricingIds: "credential_pricing_ids",
|
|
357
379
|
invoiceType: "invoice_type",
|
|
380
|
+
useCredits: "use_credits",
|
|
358
381
|
});
|
|
359
382
|
});
|
|
360
383
|
|
|
@@ -432,6 +455,7 @@ export type Four$Outbound = {
|
|
|
432
455
|
credential_pricing_ids?: Array<number> | null | undefined;
|
|
433
456
|
invoice_type?: string | undefined;
|
|
434
457
|
promo?: string | undefined;
|
|
458
|
+
use_credits: boolean;
|
|
435
459
|
};
|
|
436
460
|
|
|
437
461
|
/** @internal */
|
|
@@ -445,11 +469,13 @@ export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
|
|
|
445
469
|
invoiceType: CreateInvoiceRequestBodyInvoicesInvoiceType$outboundSchema
|
|
446
470
|
.optional(),
|
|
447
471
|
promo: z.string().optional(),
|
|
472
|
+
useCredits: z.boolean().default(false),
|
|
448
473
|
}).transform((v) => {
|
|
449
474
|
return remap$(v, {
|
|
450
475
|
systemId: "system_id",
|
|
451
476
|
credentialPricingIds: "credential_pricing_ids",
|
|
452
477
|
invoiceType: "invoice_type",
|
|
478
|
+
useCredits: "use_credits",
|
|
453
479
|
});
|
|
454
480
|
});
|
|
455
481
|
|
|
@@ -529,6 +555,7 @@ export type Three$Outbound = {
|
|
|
529
555
|
credential_pricing_ids?: Array<number> | null | undefined;
|
|
530
556
|
invoice_type?: string | undefined;
|
|
531
557
|
promo?: string | undefined;
|
|
558
|
+
use_credits: boolean;
|
|
532
559
|
};
|
|
533
560
|
|
|
534
561
|
/** @internal */
|
|
@@ -543,11 +570,13 @@ export const Three$outboundSchema: z.ZodType<
|
|
|
543
570
|
credentialPricingIds: z.nullable(z.array(z.number().int())).optional(),
|
|
544
571
|
invoiceType: CreateInvoiceRequestBodyInvoiceType$outboundSchema.optional(),
|
|
545
572
|
promo: z.string().optional(),
|
|
573
|
+
useCredits: z.boolean().default(false),
|
|
546
574
|
}).transform((v) => {
|
|
547
575
|
return remap$(v, {
|
|
548
576
|
facilityId: "facility_id",
|
|
549
577
|
credentialPricingIds: "credential_pricing_ids",
|
|
550
578
|
invoiceType: "invoice_type",
|
|
579
|
+
useCredits: "use_credits",
|
|
551
580
|
});
|
|
552
581
|
});
|
|
553
582
|
|
|
@@ -622,6 +651,7 @@ export type CreateInvoiceRequestBody2$Outbound = {
|
|
|
622
651
|
credential_pricing_ids?: Array<number> | null | undefined;
|
|
623
652
|
invoice_type?: string | undefined;
|
|
624
653
|
promo?: string | undefined;
|
|
654
|
+
use_credits: boolean;
|
|
625
655
|
};
|
|
626
656
|
|
|
627
657
|
/** @internal */
|
|
@@ -635,11 +665,13 @@ export const CreateInvoiceRequestBody2$outboundSchema: z.ZodType<
|
|
|
635
665
|
credentialPricingIds: z.nullable(z.array(z.number().int())).optional(),
|
|
636
666
|
invoiceType: RequestBodyInvoiceType$outboundSchema.optional(),
|
|
637
667
|
promo: z.string().optional(),
|
|
668
|
+
useCredits: z.boolean().default(false),
|
|
638
669
|
}).transform((v) => {
|
|
639
670
|
return remap$(v, {
|
|
640
671
|
companyId: "company_id",
|
|
641
672
|
credentialPricingIds: "credential_pricing_ids",
|
|
642
673
|
invoiceType: "invoice_type",
|
|
674
|
+
useCredits: "use_credits",
|
|
643
675
|
});
|
|
644
676
|
});
|
|
645
677
|
|
|
@@ -713,6 +745,7 @@ export type RequestBody1$Outbound = {
|
|
|
713
745
|
credential_pricing_ids?: Array<number> | null | undefined;
|
|
714
746
|
invoice_type?: string | undefined;
|
|
715
747
|
promo?: string | undefined;
|
|
748
|
+
use_credits: boolean;
|
|
716
749
|
};
|
|
717
750
|
|
|
718
751
|
/** @internal */
|
|
@@ -726,11 +759,13 @@ export const RequestBody1$outboundSchema: z.ZodType<
|
|
|
726
759
|
credentialPricingIds: z.nullable(z.array(z.number().int())).optional(),
|
|
727
760
|
invoiceType: InvoiceType$outboundSchema.optional(),
|
|
728
761
|
promo: z.string().optional(),
|
|
762
|
+
useCredits: z.boolean().default(false),
|
|
729
763
|
}).transform((v) => {
|
|
730
764
|
return remap$(v, {
|
|
731
765
|
vendorId: "vendor_id",
|
|
732
766
|
credentialPricingIds: "credential_pricing_ids",
|
|
733
767
|
invoiceType: "invoice_type",
|
|
768
|
+
useCredits: "use_credits",
|
|
734
769
|
});
|
|
735
770
|
});
|
|
736
771
|
|
package/src/types/smartUnion.ts
CHANGED
|
@@ -33,13 +33,13 @@ export function smartUnion<
|
|
|
33
33
|
> {
|
|
34
34
|
return z.unknown().transform((input, ctx) => {
|
|
35
35
|
const candidates: Candidate[] = [];
|
|
36
|
-
const errors: z.ZodIssue[][] =
|
|
36
|
+
const errors: z.ZodIssue[][] = [];
|
|
37
37
|
|
|
38
38
|
const parentUnrecognizedCtr = startCountingUnrecognized();
|
|
39
39
|
const parentZeroDefaultCtr = startCountingDefaultToZeroValue();
|
|
40
40
|
|
|
41
41
|
// Filter out invalid options
|
|
42
|
-
for (const
|
|
42
|
+
for (const option of options) {
|
|
43
43
|
const unrecognizedCtr = startCountingUnrecognized();
|
|
44
44
|
const zeroDefaultCtr = startCountingDefaultToZeroValue();
|
|
45
45
|
const result = option.safeParse(input);
|
|
@@ -54,7 +54,7 @@ export function smartUnion<
|
|
|
54
54
|
});
|
|
55
55
|
continue;
|
|
56
56
|
}
|
|
57
|
-
errors
|
|
57
|
+
errors.push(result.error.issues);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// No valid options
|