@gr4vy/sdk 2.2.0 → 2.3.0
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 +7 -0
- package/funcs/auditLogsList.d.ts.map +1 -1
- package/funcs/auditLogsList.js +1 -2
- package/funcs/auditLogsList.js.map +1 -1
- package/funcs/buyersList.d.ts.map +1 -1
- package/funcs/buyersList.js +1 -2
- package/funcs/buyersList.js.map +1 -1
- package/funcs/giftCardsList.d.ts.map +1 -1
- package/funcs/giftCardsList.js +1 -2
- package/funcs/giftCardsList.js.map +1 -1
- package/funcs/merchantAccountsList.d.ts.map +1 -1
- package/funcs/merchantAccountsList.js +1 -2
- package/funcs/merchantAccountsList.js.map +1 -1
- package/funcs/paymentLinksList.d.ts.map +1 -1
- package/funcs/paymentLinksList.js +1 -2
- package/funcs/paymentLinksList.js.map +1 -1
- package/funcs/paymentMethodsList.d.ts.map +1 -1
- package/funcs/paymentMethodsList.js +1 -2
- package/funcs/paymentMethodsList.js.map +1 -1
- package/funcs/paymentServiceDefinitionsList.d.ts.map +1 -1
- package/funcs/paymentServiceDefinitionsList.js +1 -2
- package/funcs/paymentServiceDefinitionsList.js.map +1 -1
- package/funcs/paymentServicesList.d.ts.map +1 -1
- package/funcs/paymentServicesList.js +1 -2
- package/funcs/paymentServicesList.js.map +1 -1
- package/funcs/payoutsList.d.ts.map +1 -1
- package/funcs/payoutsList.js +1 -2
- package/funcs/payoutsList.js.map +1 -1
- package/funcs/reportExecutionsList.d.ts.map +1 -1
- package/funcs/reportExecutionsList.js +1 -2
- package/funcs/reportExecutionsList.js.map +1 -1
- package/funcs/reportsExecutionsList.d.ts.map +1 -1
- package/funcs/reportsExecutionsList.js +1 -2
- package/funcs/reportsExecutionsList.js.map +1 -1
- package/funcs/reportsList.d.ts.map +1 -1
- package/funcs/reportsList.js +1 -2
- package/funcs/reportsList.js.map +1 -1
- package/funcs/threeDsScenariosList.d.ts.map +1 -1
- package/funcs/threeDsScenariosList.js +1 -2
- package/funcs/threeDsScenariosList.js.map +1 -1
- package/funcs/transactionsCapturesGet.d.ts +18 -0
- package/funcs/transactionsCapturesGet.d.ts.map +1 -0
- package/funcs/transactionsCapturesGet.js +145 -0
- package/funcs/transactionsCapturesGet.js.map +1 -0
- package/funcs/transactionsCapturesList.d.ts +18 -0
- package/funcs/transactionsCapturesList.d.ts.map +1 -0
- package/funcs/transactionsCapturesList.js +140 -0
- package/funcs/transactionsCapturesList.js.map +1 -0
- package/funcs/transactionsEventsList.d.ts.map +1 -1
- package/funcs/transactionsEventsList.js +1 -2
- package/funcs/transactionsEventsList.js.map +1 -1
- package/funcs/transactionsList.d.ts.map +1 -1
- package/funcs/transactionsList.js +1 -2
- package/funcs/transactionsList.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/encodings.js +12 -12
- package/lib/encodings.js.map +1 -1
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +3 -3
- package/lib/env.js.map +1 -1
- package/lib/matchers.js +3 -3
- package/lib/matchers.js.map +1 -1
- package/lib/primitives.d.ts +1 -0
- package/lib/primitives.d.ts.map +1 -1
- package/lib/primitives.js +18 -0
- package/lib/primitives.js.map +1 -1
- package/models/components/capture.d.ts +84 -0
- package/models/components/capture.d.ts.map +1 -0
- package/models/components/capture.js +86 -0
- package/models/components/capture.js.map +1 -0
- package/models/components/capturecollection.d.ts +26 -0
- package/models/components/capturecollection.d.ts.map +1 -0
- package/models/components/capturecollection.js +60 -0
- package/models/components/capturecollection.js.map +1 -0
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/nuveipseoptions.d.ts +2 -2
- package/models/components/transactioncapturecreate.d.ts +10 -0
- package/models/components/transactioncapturecreate.d.ts.map +1 -1
- package/models/components/transactioncapturecreate.js +3 -0
- package/models/components/transactioncapturecreate.js.map +1 -1
- package/models/operations/gettransactioncapture.d.ts +28 -0
- package/models/operations/gettransactioncapture.d.ts.map +1 -0
- package/models/operations/gettransactioncapture.js +57 -0
- package/models/operations/gettransactioncapture.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listtransactioncaptures.d.ts +23 -0
- package/models/operations/listtransactioncaptures.d.ts.map +1 -0
- package/models/operations/listtransactioncaptures.js +55 -0
- package/models/operations/listtransactioncaptures.js.map +1 -0
- package/package.json +1 -1
- package/sdk/captures.d.ts +19 -0
- package/sdk/captures.d.ts.map +1 -0
- package/sdk/captures.js +32 -0
- package/sdk/captures.js.map +1 -0
- package/sdk/transactions.d.ts +3 -0
- package/sdk/transactions.d.ts.map +1 -1
- package/sdk/transactions.js +4 -0
- package/sdk/transactions.js.map +1 -1
- package/src/funcs/auditLogsList.ts +2 -2
- package/src/funcs/buyersList.ts +2 -2
- package/src/funcs/giftCardsList.ts +2 -2
- package/src/funcs/merchantAccountsList.ts +2 -2
- package/src/funcs/paymentLinksList.ts +2 -2
- package/src/funcs/paymentMethodsList.ts +2 -2
- package/src/funcs/paymentServiceDefinitionsList.ts +2 -2
- package/src/funcs/paymentServicesList.ts +2 -2
- package/src/funcs/payoutsList.ts +2 -2
- package/src/funcs/reportExecutionsList.ts +2 -2
- package/src/funcs/reportsExecutionsList.ts +2 -2
- package/src/funcs/reportsList.ts +2 -2
- package/src/funcs/threeDsScenariosList.ts +2 -2
- package/src/funcs/transactionsCapturesGet.ts +255 -0
- package/src/funcs/transactionsCapturesList.ts +247 -0
- package/src/funcs/transactionsEventsList.ts +2 -2
- package/src/funcs/transactionsList.ts +2 -2
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +1 -1
- package/src/lib/env.ts +7 -3
- package/src/lib/matchers.ts +1 -1
- package/src/lib/primitives.ts +16 -0
- package/src/models/components/capture.ts +142 -0
- package/src/models/components/capturecollection.ts +56 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/nuveipseoptions.ts +2 -2
- package/src/models/components/transactioncapturecreate.ts +13 -0
- package/src/models/operations/gettransactioncapture.ts +58 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listtransactioncaptures.ts +51 -0
- package/src/sdk/captures.ts +51 -0
- package/src/sdk/transactions.ts +6 -0
- package/lib/dlv.d.ts +0 -14
- package/lib/dlv.d.ts.map +0 -1
- package/lib/dlv.js +0 -49
- package/lib/dlv.js.map +0 -1
- package/lib/is-plain-object.d.ts +0 -2
- package/lib/is-plain-object.d.ts.map +0 -1
- package/lib/is-plain-object.js +0 -41
- package/lib/is-plain-object.js.map +0 -1
- package/src/lib/dlv.ts +0 -53
- package/src/lib/is-plain-object.ts +0 -43
|
@@ -60,6 +60,7 @@ export * from "./getreport.js";
|
|
|
60
60
|
export * from "./getreportexecution.js";
|
|
61
61
|
export * from "./getthreedsscenario.js";
|
|
62
62
|
export * from "./gettransaction.js";
|
|
63
|
+
export * from "./gettransactioncapture.js";
|
|
63
64
|
export * from "./gettransactionrefund.js";
|
|
64
65
|
export * from "./gettransactionsettlement.js";
|
|
65
66
|
export * from "./listallreportexecutions.js";
|
|
@@ -85,6 +86,7 @@ export * from "./listreportexecutions.js";
|
|
|
85
86
|
export * from "./listreports.js";
|
|
86
87
|
export * from "./listthreedsconfigurations.js";
|
|
87
88
|
export * from "./listtransactionactions.js";
|
|
89
|
+
export * from "./listtransactioncaptures.js";
|
|
88
90
|
export * from "./listtransactionevents.js";
|
|
89
91
|
export * from "./listtransactionrefunds.js";
|
|
90
92
|
export * from "./listtransactions.js";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type ListTransactionCapturesGlobals = {
|
|
9
|
+
merchantAccountId?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ListTransactionCapturesRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* The unique identifier of the transaction.
|
|
15
|
+
*/
|
|
16
|
+
transactionId: string;
|
|
17
|
+
/**
|
|
18
|
+
* The ID of the merchant account to use for this request.
|
|
19
|
+
*/
|
|
20
|
+
merchantAccountId?: string | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type ListTransactionCapturesRequest$Outbound = {
|
|
25
|
+
transaction_id: string;
|
|
26
|
+
merchantAccountId?: string | null | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const ListTransactionCapturesRequest$outboundSchema: z.ZodType<
|
|
31
|
+
ListTransactionCapturesRequest$Outbound,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
ListTransactionCapturesRequest
|
|
34
|
+
> = z.object({
|
|
35
|
+
transactionId: z.string(),
|
|
36
|
+
merchantAccountId: z.nullable(z.string()).optional(),
|
|
37
|
+
}).transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
transactionId: "transaction_id",
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export function listTransactionCapturesRequestToJSON(
|
|
44
|
+
listTransactionCapturesRequest: ListTransactionCapturesRequest,
|
|
45
|
+
): string {
|
|
46
|
+
return JSON.stringify(
|
|
47
|
+
ListTransactionCapturesRequest$outboundSchema.parse(
|
|
48
|
+
listTransactionCapturesRequest,
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transactionsCapturesGet } from "../funcs/transactionsCapturesGet.js";
|
|
6
|
+
import { transactionsCapturesList } from "../funcs/transactionsCapturesList.js";
|
|
7
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import * as components from "../models/components/index.js";
|
|
9
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
|
|
11
|
+
export class Captures extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* List transaction captures
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* List all captures for a specific transaction.
|
|
17
|
+
*/
|
|
18
|
+
async list(
|
|
19
|
+
transactionId: string,
|
|
20
|
+
merchantAccountId?: string | null | undefined,
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<components.CaptureCollection> {
|
|
23
|
+
return unwrapAsync(transactionsCapturesList(
|
|
24
|
+
this,
|
|
25
|
+
transactionId,
|
|
26
|
+
merchantAccountId,
|
|
27
|
+
options,
|
|
28
|
+
));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get transaction capture
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Retrieve a specific capture for a transaction by its unique identifier.
|
|
36
|
+
*/
|
|
37
|
+
async get(
|
|
38
|
+
transactionId: string,
|
|
39
|
+
captureId: string,
|
|
40
|
+
merchantAccountId?: string | null | undefined,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): Promise<components.Capture> {
|
|
43
|
+
return unwrapAsync(transactionsCapturesGet(
|
|
44
|
+
this,
|
|
45
|
+
transactionId,
|
|
46
|
+
captureId,
|
|
47
|
+
merchantAccountId,
|
|
48
|
+
options,
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/sdk/transactions.ts
CHANGED
|
@@ -16,6 +16,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
16
16
|
import { unwrapAsync } from "../types/fp.js";
|
|
17
17
|
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
18
18
|
import { Actions } from "./actions.js";
|
|
19
|
+
import { Captures } from "./captures.js";
|
|
19
20
|
import { Events } from "./events.js";
|
|
20
21
|
import { Gr4vyRefunds } from "./gr4vyrefunds.js";
|
|
21
22
|
import { Settlements } from "./settlements.js";
|
|
@@ -41,6 +42,11 @@ export class Transactions extends ClientSDK {
|
|
|
41
42
|
return (this._settlements ??= new Settlements(this._options));
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
private _captures?: Captures;
|
|
46
|
+
get captures(): Captures {
|
|
47
|
+
return (this._captures ??= new Captures(this._options));
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
/**
|
|
45
51
|
* List transactions
|
|
46
52
|
*
|
package/lib/dlv.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param obj The object to walk
|
|
3
|
-
* @param key The key path to walk the object with
|
|
4
|
-
* @param def A default value to return if the result is undefined
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* dlv(obj, "a.b.c.d")
|
|
8
|
-
* @example
|
|
9
|
-
* dlv(object, ["a", "b", "c", "d"])
|
|
10
|
-
* @example
|
|
11
|
-
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
12
|
-
*/
|
|
13
|
-
export declare function dlv<T = any>(obj: any, key: string | string[], def?: T, p?: number, undef?: never): T | undefined;
|
|
14
|
-
//# sourceMappingURL=dlv.d.ts.map
|
package/lib/dlv.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dlv.d.ts","sourceRoot":"","sources":["../src/lib/dlv.ts"],"names":[],"mappings":"AA2BA;;;;;;;;;;;GAWG;AACH,wBAAgB,GAAG,CAAC,CAAC,GAAG,GAAG,EACzB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EACtB,GAAG,CAAC,EAAE,CAAC,EACP,CAAC,CAAC,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,KAAK,GACZ,CAAC,GAAG,SAAS,CAOf"}
|
package/lib/dlv.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.dlv = dlv;
|
|
7
|
-
/*
|
|
8
|
-
MIT License
|
|
9
|
-
|
|
10
|
-
Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
|
|
11
|
-
|
|
12
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
13
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
14
|
-
the Software without restriction, including without limitation the rights to
|
|
15
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
16
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
-
subject to the following conditions:
|
|
18
|
-
|
|
19
|
-
The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
copies or substantial portions of the Software.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
24
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
25
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
26
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
27
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @param obj The object to walk
|
|
31
|
-
* @param key The key path to walk the object with
|
|
32
|
-
* @param def A default value to return if the result is undefined
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* dlv(obj, "a.b.c.d")
|
|
36
|
-
* @example
|
|
37
|
-
* dlv(object, ["a", "b", "c", "d"])
|
|
38
|
-
* @example
|
|
39
|
-
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
40
|
-
*/
|
|
41
|
-
function dlv(obj, key, def, p, undef) {
|
|
42
|
-
key = Array.isArray(key) ? key : key.split(".");
|
|
43
|
-
for (p = 0; p < key.length; p++) {
|
|
44
|
-
const k = key[p];
|
|
45
|
-
obj = k != null && obj ? obj[k] : undef;
|
|
46
|
-
}
|
|
47
|
-
return obj === undef ? def : obj;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=dlv.js.map
|
package/lib/dlv.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dlv.js","sourceRoot":"","sources":["../src/lib/dlv.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAqCH,kBAaC;AAhDD;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF;;;;;;;;;;;GAWG;AACH,SAAgB,GAAG,CACjB,GAAQ,EACR,GAAsB,EACtB,GAAO,EACP,CAAU,EACV,KAAa;IAEb,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACjB,GAAG,GAAG,CAAC,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1C,CAAC;IACD,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;AACnC,CAAC"}
|
package/lib/is-plain-object.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-plain-object.d.ts","sourceRoot":"","sources":["../src/lib/is-plain-object.ts"],"names":[],"mappings":"AA6BA,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAa7D"}
|
package/lib/is-plain-object.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isPlainObject = isPlainObject;
|
|
7
|
-
/*
|
|
8
|
-
MIT License
|
|
9
|
-
|
|
10
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
11
|
-
|
|
12
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
13
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
14
|
-
the Software without restriction, including without limitation the rights to
|
|
15
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
16
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
17
|
-
subject to the following conditions:
|
|
18
|
-
|
|
19
|
-
The above copyright notice and this permission notice shall be included in all
|
|
20
|
-
copies or substantial portions of the Software.
|
|
21
|
-
|
|
22
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
24
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
25
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
26
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
27
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
-
*/
|
|
29
|
-
// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js
|
|
30
|
-
function isPlainObject(value) {
|
|
31
|
-
if (typeof value !== "object" || value === null) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
const prototype = Object.getPrototypeOf(value);
|
|
35
|
-
return ((prototype === null ||
|
|
36
|
-
prototype === Object.prototype ||
|
|
37
|
-
Object.getPrototypeOf(prototype) === null) &&
|
|
38
|
-
!(Symbol.toStringTag in value) &&
|
|
39
|
-
!(Symbol.iterator in value));
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=is-plain-object.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-plain-object.js","sourceRoot":"","sources":["../src/lib/is-plain-object.ts"],"names":[],"mappings":";AAAA;;GAEG;;AA2BH,sCAaC;AAtCD;;;;;;;;;;;;;;;;;;;;;EAqBE;AAEF,iHAAiH;AAEjH,SAAgB,aAAa,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/C,OAAO,CACL,CAAC,SAAS,KAAK,IAAI;QACjB,SAAS,KAAK,MAAM,CAAC,SAAS;QAC9B,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;QAC5C,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC;QAC9B,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,CAC5B,CAAC;AACJ,CAAC"}
|
package/src/lib/dlv.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
MIT License
|
|
7
|
-
|
|
8
|
-
Copyright (c) 2024 Jason Miller <jason@developit.ca> (http://jasonformat.com)
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
11
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
12
|
-
the Software without restriction, including without limitation the rights to
|
|
13
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
14
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
-
subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
22
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
23
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
24
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @param obj The object to walk
|
|
30
|
-
* @param key The key path to walk the object with
|
|
31
|
-
* @param def A default value to return if the result is undefined
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* dlv(obj, "a.b.c.d")
|
|
35
|
-
* @example
|
|
36
|
-
* dlv(object, ["a", "b", "c", "d"])
|
|
37
|
-
* @example
|
|
38
|
-
* dlv(object, "foo.bar.baz", "Hello, default value!")
|
|
39
|
-
*/
|
|
40
|
-
export function dlv<T = any>(
|
|
41
|
-
obj: any,
|
|
42
|
-
key: string | string[],
|
|
43
|
-
def?: T,
|
|
44
|
-
p?: number,
|
|
45
|
-
undef?: never,
|
|
46
|
-
): T | undefined {
|
|
47
|
-
key = Array.isArray(key) ? key : key.split(".");
|
|
48
|
-
for (p = 0; p < key.length; p++) {
|
|
49
|
-
const k = key[p];
|
|
50
|
-
obj = k != null && obj ? obj[k] : undef;
|
|
51
|
-
}
|
|
52
|
-
return obj === undef ? def : obj;
|
|
53
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
MIT License
|
|
7
|
-
|
|
8
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
9
|
-
|
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
11
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
12
|
-
the Software without restriction, including without limitation the rights to
|
|
13
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
14
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
15
|
-
subject to the following conditions:
|
|
16
|
-
|
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
|
18
|
-
copies or substantial portions of the Software.
|
|
19
|
-
|
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
22
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
23
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
24
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
25
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js
|
|
29
|
-
|
|
30
|
-
export function isPlainObject(value: unknown): value is object {
|
|
31
|
-
if (typeof value !== "object" || value === null) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const prototype = Object.getPrototypeOf(value);
|
|
36
|
-
return (
|
|
37
|
-
(prototype === null ||
|
|
38
|
-
prototype === Object.prototype ||
|
|
39
|
-
Object.getPrototypeOf(prototype) === null) &&
|
|
40
|
-
!(Symbol.toStringTag in value) &&
|
|
41
|
-
!(Symbol.iterator in value)
|
|
42
|
-
);
|
|
43
|
-
}
|