@ambasada/sdk 0.8.0 → 0.8.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/dist/define.d.ts +1 -1
- package/dist/index.d.ts +56 -56
- package/dist/index.js +28 -2523
- package/dist/platform.js +810 -0
- package/package.json +9 -3
- package/dist/village/client.d.ts +0 -148
- package/dist/village/define.d.ts +0 -44
- package/dist/village/errors.d.ts +0 -19
- package/dist/village/index.d.ts +0 -27
- package/dist/village/receipt.d.ts +0 -50
- package/dist/village/types.d.ts +0 -307
- package/dist/village/webhook.d.ts +0 -30
package/dist/define.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface AppConfig {
|
|
|
13
13
|
product?: {
|
|
14
14
|
url?: string;
|
|
15
15
|
};
|
|
16
|
-
/** Add-ons to load besides the ones found in node_modules (package names, e.g. "
|
|
16
|
+
/** Add-ons to load besides the ones found in node_modules (package names, e.g. "@ambasada/village"). */
|
|
17
17
|
addons?: string[];
|
|
18
18
|
}
|
|
19
19
|
export declare function defineApp<T extends AppConfig>(config: T): T;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,123 +9,123 @@
|
|
|
9
9
|
* Works in Node ≥ 22, Bun, Cloudflare Workers (`createAmbasada({ env })`) and Next.js route handlers.
|
|
10
10
|
* The Hack A Ton economy (TON, checkout, offerings, the agent) is the add-on `@ambasada/village`.
|
|
11
11
|
*/
|
|
12
|
-
import * as V from "
|
|
12
|
+
import * as V from "@ambasada/village";
|
|
13
13
|
export * from "./platform.js";
|
|
14
14
|
export { default } from "./platform.js";
|
|
15
|
-
/** @deprecated Import it from "
|
|
15
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
16
16
|
export declare const village: V.Village;
|
|
17
|
-
/** @deprecated Import it from "
|
|
17
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
18
18
|
export declare const createVillage: typeof V.createVillage;
|
|
19
|
-
/** @deprecated Import it from "
|
|
19
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
20
20
|
export declare const Village: typeof V.Village;
|
|
21
21
|
export type Village = V.Village;
|
|
22
|
-
/** @deprecated Import it from "
|
|
22
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
23
23
|
export declare const VillageError: typeof V.AmbasadaError;
|
|
24
24
|
export type VillageError = V.VillageError;
|
|
25
|
-
/** @deprecated Import it from "
|
|
25
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
26
26
|
export declare const isVillageError: typeof V.isAmbasadaError;
|
|
27
|
-
/** @deprecated Import it from "
|
|
27
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
28
28
|
export declare const ReceiptInvalidError: typeof V.ReceiptInvalidError;
|
|
29
29
|
export type ReceiptInvalidError = V.ReceiptInvalidError;
|
|
30
|
-
/** @deprecated Import it from "
|
|
30
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
31
31
|
export declare const DEFAULT_MODEL = "deepseek-v4.1-flash";
|
|
32
|
-
/** @deprecated Import it from "
|
|
32
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
33
33
|
export declare const verifyWebhookPayload: typeof V.verifyWebhookPayload;
|
|
34
|
-
/** @deprecated Import it from "
|
|
34
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
35
35
|
export declare const webhookHeaders: (secret: string, id: string, timestamp: number, body: string) => Promise<Record<string, string>>;
|
|
36
|
-
/** @deprecated Import it from "
|
|
36
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
37
37
|
export declare const generateWebhookSecret: () => string;
|
|
38
|
-
/** @deprecated Import it from "
|
|
38
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
39
39
|
export declare const WEBHOOK_HEADERS: {
|
|
40
40
|
readonly id: "webhook-id";
|
|
41
41
|
readonly timestamp: "webhook-timestamp";
|
|
42
42
|
readonly signature: "webhook-signature";
|
|
43
43
|
};
|
|
44
|
-
/** @deprecated Import it from "
|
|
44
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
45
45
|
export declare const RECEIPT_HEADER = "x-village-receipt";
|
|
46
|
-
/** @deprecated Import it from "
|
|
46
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
47
47
|
export declare const readIncoming: typeof V.readIncoming;
|
|
48
|
-
/** @deprecated Import it from "
|
|
48
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
49
49
|
export declare const verifyCallReceipt: typeof V.verifyCallReceipt;
|
|
50
|
-
/** @deprecated Import it from "
|
|
50
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
51
51
|
export declare const verifyCheckoutReceiptToken: typeof V.verifyCheckoutReceiptToken;
|
|
52
|
-
/** @deprecated Import it from "
|
|
52
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
53
53
|
export declare const defineCompany: typeof V.defineCompany;
|
|
54
|
-
/** @deprecated Import it from "
|
|
54
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
55
55
|
export declare const offering: typeof V.offering;
|
|
56
|
-
/** @deprecated Import it from "
|
|
56
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
57
57
|
export declare const DEFAULT_VILLAGE_API_URL = "https://hackaton.ambasada.id";
|
|
58
|
-
/** @deprecated Import it from "
|
|
58
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
59
59
|
export type VillageOptions = V.VillageOptions;
|
|
60
|
-
/** @deprecated Import it from "
|
|
60
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
61
61
|
export type VerifyReceiptOptions = V.VerifyReceiptOptions;
|
|
62
|
-
/** @deprecated Import it from "
|
|
62
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
63
63
|
export type SellHandler<Input, Output> = V.SellHandler<Input, Output>;
|
|
64
|
-
/** @deprecated Import it from "
|
|
64
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
65
65
|
export type ReceiptFailure = V.ReceiptFailure;
|
|
66
|
-
/** @deprecated Import it from "
|
|
66
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
67
67
|
export type IncomingRequest = V.IncomingRequest;
|
|
68
|
-
/** @deprecated Import it from "
|
|
68
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
69
69
|
export type CompanyConfig = V.CompanyConfig;
|
|
70
|
-
/** @deprecated Import it from "
|
|
70
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
71
71
|
export type OfferingDef = V.OfferingDef;
|
|
72
|
-
/** @deprecated Import it from "
|
|
72
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
73
73
|
export type ReceiptClaims = V.ReceiptClaims;
|
|
74
|
-
/** @deprecated Import it from "
|
|
74
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
75
75
|
export type PaidCall<Input = any> = V.PaidCall<Input>;
|
|
76
|
-
/** @deprecated Import it from "
|
|
76
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
77
77
|
export type CheckoutReceiptClaims = V.CheckoutReceiptClaims;
|
|
78
|
-
/** @deprecated Import it from "
|
|
78
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
79
79
|
export type CheckoutInput = V.CheckoutInput;
|
|
80
|
-
/** @deprecated Import it from "
|
|
80
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
81
81
|
export type CheckoutSession = V.CheckoutSession;
|
|
82
|
-
/** @deprecated Import it from "
|
|
82
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
83
83
|
export type PaymentLinkInput = V.PaymentLinkInput;
|
|
84
|
-
/** @deprecated Import it from "
|
|
84
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
85
85
|
export type PaymentLink = V.PaymentLink;
|
|
86
|
-
/** @deprecated Import it from "
|
|
86
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
87
87
|
export type WebhookDelivery = V.WebhookDelivery;
|
|
88
|
-
/** @deprecated Import it from "
|
|
88
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
89
89
|
export type WebhookEvent<Data = any> = V.WebhookEvent<Data>;
|
|
90
|
-
/** @deprecated Import it from "
|
|
90
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
91
91
|
export type BuyOptions = V.BuyOptions;
|
|
92
|
-
/** @deprecated Import it from "
|
|
92
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
93
93
|
export type BuyResult<Output = any> = V.BuyResult<Output>;
|
|
94
|
-
/** @deprecated Import it from "
|
|
94
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
95
95
|
export type ChatModel = V.ChatModel;
|
|
96
|
-
/** @deprecated Import it from "
|
|
96
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
97
97
|
export type ChatMessage = V.ChatMessage;
|
|
98
|
-
/** @deprecated Import it from "
|
|
98
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
99
99
|
export type ChatRequest = V.ChatRequest;
|
|
100
|
-
/** @deprecated Import it from "
|
|
100
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
101
101
|
export type ChatResponse = V.ChatResponse;
|
|
102
|
-
/** @deprecated Import it from "
|
|
102
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
103
103
|
export type ImageRequest = V.ImageRequest;
|
|
104
|
-
/** @deprecated Import it from "
|
|
104
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
105
105
|
export type ImageResult = V.ImageResult;
|
|
106
|
-
/** @deprecated Import it from "
|
|
106
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
107
107
|
export type ToolListing = V.ToolListing;
|
|
108
|
-
/** @deprecated Import it from "
|
|
108
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
109
109
|
export type ToolResult<Output = any> = V.ToolResult<Output>;
|
|
110
|
-
/** @deprecated Import it from "
|
|
110
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
111
111
|
export type FieldSchema = V.FieldSchema;
|
|
112
|
-
/** @deprecated Import it from "
|
|
112
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
113
113
|
export type ListingInput = V.ListingInput;
|
|
114
|
-
/** @deprecated Import it from "
|
|
114
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
115
115
|
export type Listing = V.Listing;
|
|
116
|
-
/** @deprecated Import it from "
|
|
116
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
117
117
|
export type Wallet = V.Wallet;
|
|
118
|
-
/** @deprecated Import it from "
|
|
118
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
119
119
|
export type LedgerEntry = V.LedgerEntry;
|
|
120
|
-
/** @deprecated Import it from "
|
|
120
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
121
121
|
export type LedgerPage = V.LedgerPage;
|
|
122
|
-
/** @deprecated Import it from "
|
|
122
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
123
123
|
export type TransferOptions = V.TransferOptions;
|
|
124
|
-
/** @deprecated Import it from "
|
|
124
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
125
125
|
export type AgentSettings = V.AgentSettings;
|
|
126
|
-
/** @deprecated Import it from "
|
|
126
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
127
127
|
export type AgentConfigInput = V.AgentConfigInput;
|
|
128
|
-
/** @deprecated Import it from "
|
|
128
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
129
129
|
export type TranscriptEntry = V.TranscriptEntry;
|
|
130
|
-
/** @deprecated Import it from "
|
|
130
|
+
/** @deprecated Import it from "@ambasada/village" (removed in 2.0). */
|
|
131
131
|
export type MarketOffering = V.MarketOffering;
|