needle-cloud 3.3.0 → 3.4.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/CHANGELOG.md +4 -0
- package/README.md +3 -2
- package/dist/{cli-51eba1aa.js → cli-2661cdb5.js} +2 -2
- package/dist/cli.esm.js +1 -1
- package/dist/{cli.send-logs.discovery-29fa4e4a.js → cli.send-logs.discovery-98b97e6b.js} +1 -1
- package/dist/index.d.ts +179 -134
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/dist/cli.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node-fetch";import"@web-std/file";import"node:crypto";export{p as program}from"./cli-
|
|
1
|
+
import"node-fetch";import"@web-std/file";import"node:crypto";export{p as program}from"./cli-2661cdb5.js";import"fs";import"dotenv";import"ora";import"commander";import"child_process";import"open";import"path";import"node:fs";import"node:fs/promises";import"node:os";import"node:path";import"util";import"stream";import"http";import"https";import"url";import"crypto";import"net";import"tls";import"assert";import"tty";import"os";import"events";import"http2";import"zlib";import"node:console";import"node:readline/promises";import"node:util";import"@logto/node";import"node:readline";import"node:stream";import"node:zlib";import"express";import"ws";import"node:child_process";import"minimatch";import"node:url";import"node:timers/promises";import"body-parser";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as o,readdirSync as t,statSync as r}from"node:fs";import{dirname as i,join as e}from"node:path";import{g as n}from"./cli-
|
|
1
|
+
import{existsSync as o,readdirSync as t,statSync as r}from"node:fs";import{dirname as i,join as e}from"node:path";import{g as n}from"./cli-2661cdb5.js";import"node-fetch";import"@web-std/file";import"node:crypto";import"commander";import"fs";import"child_process";import"open";import"path";import"ora";import"node:fs/promises";import"node:os";import"util";import"stream";import"http";import"https";import"url";import"crypto";import"net";import"tls";import"assert";import"tty";import"os";import"events";import"http2";import"zlib";import"node:console";import"node:readline/promises";import"node:util";import"dotenv";import"@logto/node";import"node:readline";import"node:stream";import"node:zlib";import"express";import"ws";import"node:child_process";import"minimatch";import"node:url";import"node:timers/promises";import"body-parser";function p(){var p;let m;try{m=n()}catch{return null}const s=null==(p=m)||null==(p=p.entries)?void 0:p[0];if(!s)return null;if(!s.log_location)return null;if("unity"!==s.editor&&"blender"!==s.editor)return null;if(!o(s.log_location))return null;const l=s.log_location,d=function(o,i){const n=new Set([i]);try{for(const i of t(o)){if(!i.toLowerCase().endsWith(".log"))continue;const t=e(o,i);try{if(!r(t).isFile())continue}catch{continue}n.add(t)}}catch{}return[...n]}(i(l),l);return{editor:s.editor,path:l,paths:d}}export{p as findActiveEditorLog};
|
package/dist/index.d.ts
CHANGED
|
@@ -143,6 +143,8 @@ declare type AuthData$1 = {
|
|
|
143
143
|
|
|
144
144
|
/** A bounded part of a diagnostic record, retried with the same ID and content. */
|
|
145
145
|
type ProjectDiagnosticPart$1 = {
|
|
146
|
+
/** Defaults to needle-editor for older clients. Lowercase letters, digits and hyphens; max 64 characters. */
|
|
147
|
+
application?: string;
|
|
146
148
|
id: string;
|
|
147
149
|
session: string;
|
|
148
150
|
revision: number | null;
|
|
@@ -156,6 +158,8 @@ type ProjectDiagnosticPart$1 = {
|
|
|
156
158
|
};
|
|
157
159
|
|
|
158
160
|
type ProjectDiagnosticPolicy$1 = {
|
|
161
|
+
/** Server-verified active Pro/Enterprise team entitlement. Does not multiply retained storage or request rate. */
|
|
162
|
+
uploadQuotaMultiplier?: 1 | 5;
|
|
159
163
|
enabled: boolean;
|
|
160
164
|
canOptOut: boolean;
|
|
161
165
|
limits: {
|
|
@@ -170,6 +174,8 @@ type ProjectDiagnosticPolicy$1 = {
|
|
|
170
174
|
};
|
|
171
175
|
|
|
172
176
|
type ProjectBugReportRequest$1 = {
|
|
177
|
+
/** Defaults to needle-editor for older clients. Lowercase letters, digits and hyphens; max 64 characters. */
|
|
178
|
+
application?: string;
|
|
173
179
|
id: string;
|
|
174
180
|
description: string;
|
|
175
181
|
session: string;
|
|
@@ -389,6 +395,8 @@ type AIChatRequestBody_ElicitationResponse = {
|
|
|
389
395
|
value?: string,
|
|
390
396
|
/** Free-text answer, when the elicitation offered a text field. */
|
|
391
397
|
text?: string,
|
|
398
|
+
/** Answers to a multi-question form, keyed by the offered question IDs. */
|
|
399
|
+
answers?: ElicitationAnswers,
|
|
392
400
|
/** The user dismissed the request without choosing. */
|
|
393
401
|
canceled?: boolean,
|
|
394
402
|
/** Current browser session when answering a local file-edit permission request. */
|
|
@@ -406,7 +414,7 @@ type AIChatRequestBody_ElicitationResponse = {
|
|
|
406
414
|
|
|
407
415
|
|
|
408
416
|
/** Rendering features explicitly supported by this chat consumer. */
|
|
409
|
-
type ChatClientCapabilities$1 = { inlineToolCalls?: boolean };
|
|
417
|
+
type ChatClientCapabilities$1 = { inlineToolCalls?: boolean; questionForms?: boolean };
|
|
410
418
|
/** Update ordered inline parts before applying the event to the message's plain content. */
|
|
411
419
|
declare function updateInlineChatParts(
|
|
412
420
|
current: ChatInlinePart$1[] | undefined,
|
|
@@ -523,6 +531,8 @@ type AIChatGETResponse = {
|
|
|
523
531
|
note?: string,
|
|
524
532
|
options?: ElicitationOption[],
|
|
525
533
|
text_input?: ElicitationField,
|
|
534
|
+
/** A set of questions submitted together by clients supporting questionForms. */
|
|
535
|
+
questions?: ElicitationQuestion[],
|
|
526
536
|
},
|
|
527
537
|
}
|
|
528
538
|
|
|
@@ -659,9 +669,33 @@ type ChatStreamEvent = { /** SSE event id for position tracking. */ id?: number
|
|
|
659
669
|
progress_message?: string,
|
|
660
670
|
options?: ElicitationOption[],
|
|
661
671
|
text_input?: ElicitationField,
|
|
672
|
+
/** A set of questions submitted together by clients supporting questionForms. */
|
|
673
|
+
questions?: ElicitationQuestion[],
|
|
662
674
|
}
|
|
663
675
|
)
|
|
664
676
|
|
|
677
|
+
/** Answers to a question form. Choice values must match the offered options. */
|
|
678
|
+
type ElicitationAnswers = Record<string, string | string[]>;
|
|
679
|
+
|
|
680
|
+
/** A referenced choice. Type is a rendering hint, not an action or access grant. */
|
|
681
|
+
type ElicitationReference = {
|
|
682
|
+
id: string;
|
|
683
|
+
provider?: string;
|
|
684
|
+
type: 'model' | 'material' | 'texture' | 'hdr' | (string & {});
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
/** A question presented as part of a single decision form. */
|
|
688
|
+
type ElicitationQuestion = {
|
|
689
|
+
id: string;
|
|
690
|
+
message: string;
|
|
691
|
+
kind: 'single' | 'multiple' | 'text';
|
|
692
|
+
/** Defaults to true. */
|
|
693
|
+
required?: boolean;
|
|
694
|
+
options?: { value: string; label: string; description?: string;
|
|
695
|
+
/** Optional reference attached to a choice; clients may render a supported preview. */
|
|
696
|
+
reference?: ElicitationReference }[];
|
|
697
|
+
};
|
|
698
|
+
|
|
665
699
|
/** A selectable option in an elicitation request. */
|
|
666
700
|
type ElicitationOption = {
|
|
667
701
|
/** Button label shown to the user. */
|
|
@@ -840,7 +874,7 @@ type ChatSessionHandle$1 = {
|
|
|
840
874
|
*/
|
|
841
875
|
sendMessage(slug: string, message: string, options?: ChatSessionSendOptions$1): AsyncGenerator<ChatStreamEvent>,
|
|
842
876
|
/** Answer or dismiss a pending question and stream the continuation. Awaits ready before sending. */
|
|
843
|
-
sendElicitationResponse(slug: string, response: Pick<AIChatRequestBody_ElicitationResponse, 'action_id' | 'value' | 'text' | 'canceled'>, options?: ChatSessionSendOptions$1): AsyncGenerator<ChatStreamEvent>,
|
|
877
|
+
sendElicitationResponse(slug: string, response: Pick<AIChatRequestBody_ElicitationResponse, 'action_id' | 'value' | 'text' | 'canceled' | 'answers'>, options?: ChatSessionSendOptions$1): AsyncGenerator<ChatStreamEvent>,
|
|
844
878
|
/**
|
|
845
879
|
* Send a message and get a single JSON response (non-streaming).
|
|
846
880
|
* Internally awaits `ready` before sending.
|
|
@@ -953,6 +987,134 @@ type ToolDiscoveryResult$1 = {
|
|
|
953
987
|
};
|
|
954
988
|
declare function discoverTools(catalog: readonly DiscoverableTool$1[], options?: ToolDiscoveryQuery$1): ToolDiscoveryResult$1;
|
|
955
989
|
|
|
990
|
+
/**
|
|
991
|
+
* How the SDK performs an HTTP request. Deliberately the same contract as the
|
|
992
|
+
* global `fetch`, so a caller can route requests through its own transport
|
|
993
|
+
* without the SDK changing how it reads a response (and so a STREAMING response
|
|
994
|
+
* — the AI chat's SSE — still works, which a body-only shape could not carry).
|
|
995
|
+
*
|
|
996
|
+
* Why it exists: a browser extension runs its code inside the INSPECTED page, so
|
|
997
|
+
* a plain `fetch` obeys that page's Content-Security-Policy and a strict
|
|
998
|
+
* `connect-src` blocks it outright. Such a caller passes a function that relays
|
|
999
|
+
* the request through its own service worker instead, where extension
|
|
1000
|
+
* permissions apply rather than the host page's policy.
|
|
1001
|
+
*
|
|
1002
|
+
* Defaults to `globalThis.fetch` everywhere it is accepted.
|
|
1003
|
+
*/
|
|
1004
|
+
type FetchLike = (url: string, init?: RequestInit) => Promise<Response>;
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Display information for a purchasable product — what `getProductInformation()`
|
|
1008
|
+
* returns, straight from `GET /v1/payment/info`. Amounts are already converted to
|
|
1009
|
+
* MAJOR currency units (29 means €29, not 29 cents), so they can be formatted for
|
|
1010
|
+
* display as-is.
|
|
1011
|
+
*/
|
|
1012
|
+
type ProductInformation$1 = {
|
|
1013
|
+
/** the product name that was queried */
|
|
1014
|
+
product: string,
|
|
1015
|
+
/** the price to charge and to show. Already discounted when a sale is running. */
|
|
1016
|
+
amount: number,
|
|
1017
|
+
/** ISO currency code, lower-case (Stripe's spelling) */
|
|
1018
|
+
currency: string,
|
|
1019
|
+
/** the pre-sale price — present ONLY while a discount is active, for a
|
|
1020
|
+
* strikethrough. Its absence means no sale is running. */
|
|
1021
|
+
original?: number,
|
|
1022
|
+
/** name of the running sale ("Launch sale"), when the coupon carries one */
|
|
1023
|
+
label?: string,
|
|
1024
|
+
/** ms epoch the sale ends, when the coupon sets a deadline */
|
|
1025
|
+
expires_at?: number,
|
|
1026
|
+
/** dashboard-managed tag for the BASE price ("Launch price"). Clients hide it
|
|
1027
|
+
* while a sale runs, since `label` takes over. */
|
|
1028
|
+
price_label?: string,
|
|
1029
|
+
/** true for a pay-what-you-want price; `amount` is then the suggested one */
|
|
1030
|
+
customer_chooses?: true,
|
|
1031
|
+
/** lowest acceptable amount for a pay-what-you-want price */
|
|
1032
|
+
minimum?: number,
|
|
1033
|
+
/** AI token credits bundled with the purchase, when any */
|
|
1034
|
+
included_ai_tokens?: number,
|
|
1035
|
+
/** Provider-cost AI allowance bundled with the purchase, in USD. */
|
|
1036
|
+
included_ai_usage_usd?: number,
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
/** Options shared by the product-name payment calls. */
|
|
1040
|
+
type ProductPaymentOptions = {
|
|
1041
|
+
/**
|
|
1042
|
+
* Pin a specific Stripe price by its `lookup_key` instead of letting the
|
|
1043
|
+
* server pick the product's active price. Use the SAME key for the info and
|
|
1044
|
+
* the checkout call — showing one price and charging another is exactly what
|
|
1045
|
+
* this parameter exists to prevent.
|
|
1046
|
+
*/
|
|
1047
|
+
price?: string,
|
|
1048
|
+
/** Route the HTTP request yourself (e.g. a CSP-blocked extension relaying
|
|
1049
|
+
* through its service worker). Defaults to `globalThis.fetch`. */
|
|
1050
|
+
fetch?: FetchLike,
|
|
1051
|
+
/**
|
|
1052
|
+
* Override the API base url (no trailing slash), e.g.
|
|
1053
|
+
* `https://cloud-staging.needle.tools/api`. The bundled default is baked at
|
|
1054
|
+
* BUILD time, so a host that picks its environment at RUNTIME — the browser
|
|
1055
|
+
* extension resolves dev/staging/production from its own build defines —
|
|
1056
|
+
* must pass its own, or a staging build would quietly bill against
|
|
1057
|
+
* production.
|
|
1058
|
+
*/
|
|
1059
|
+
baseUrl?: string,
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
type GetProductInformationOptions$1 = ProductPaymentOptions;
|
|
1063
|
+
|
|
1064
|
+
/** Attribution labels: 1-128 ASCII letters, digits, underscores, dots, colons or hyphens.
|
|
1065
|
+
* Do not include personal information. These labels do not prove payment. */
|
|
1066
|
+
type CheckoutTracking = {
|
|
1067
|
+
/** Stable UI or campaign label, e.g. "export_gltf". */
|
|
1068
|
+
source?: string,
|
|
1069
|
+
/** Caller-generated identifier joining events for one purchase attempt. */
|
|
1070
|
+
attemptId?: string,
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
type CheckoutProductResult = {
|
|
1074
|
+
/** Stripe checkout URL to open for the buyer. */
|
|
1075
|
+
url: string,
|
|
1076
|
+
/** Checkout identifier for correlating purchase events; creation does not confirm payment. */
|
|
1077
|
+
checkoutId: string,
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
type CheckoutProductOptions$1 = ProductPaymentOptions & {
|
|
1081
|
+
/** Referral code supplied by an affiliate. Case-insensitive; works on any host without cookies. Does not change the price. */
|
|
1082
|
+
affiliateCode?: string,
|
|
1083
|
+
/** A Stripe promotion code to apply to the session. */
|
|
1084
|
+
promoCode?: string,
|
|
1085
|
+
/** Optional attribution carried through checkout and payment confirmation. */
|
|
1086
|
+
tracking?: CheckoutTracking,
|
|
1087
|
+
/** Identifies the calling app in the payment logs and return urls. */
|
|
1088
|
+
app?: string,
|
|
1089
|
+
/**
|
|
1090
|
+
* Index into the payment API's `available_modes` — which Stripe checkout mode
|
|
1091
|
+
* to open. `1` is a one-time payment; omitted defaults to the server's `0`.
|
|
1092
|
+
* A product sold outright will look wrong (or fail) in subscription mode, so
|
|
1093
|
+
* pass the one the product is priced for.
|
|
1094
|
+
*/
|
|
1095
|
+
mode?: number,
|
|
1096
|
+
/** Explicit auth token. Without one the SDK asks Auth for an access token;
|
|
1097
|
+
* the checkout email is prefilled and locked from whichever is used. */
|
|
1098
|
+
authToken?: string,
|
|
1099
|
+
org?: string,
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
type StartCheckoutSessionOptions = {
|
|
1103
|
+
/** Optional case-insensitive referral code. */
|
|
1104
|
+
affiliateCode?: string,
|
|
1105
|
+
price_id: string,
|
|
1106
|
+
tracking?: CheckoutTracking,
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1109
|
+
type StartCheckoutSessionResult = {
|
|
1110
|
+
ok: true,
|
|
1111
|
+
status: number,
|
|
1112
|
+
checkoutId: string,
|
|
1113
|
+
} | {
|
|
1114
|
+
ok: false,
|
|
1115
|
+
status: number,
|
|
1116
|
+
};
|
|
1117
|
+
|
|
956
1118
|
type AssetVector3 = [number, number, number];
|
|
957
1119
|
type AssetGeometryMetadata = {
|
|
958
1120
|
meshes: number;
|
|
@@ -1674,6 +1836,10 @@ type GetContentResponse = GetContentDetailResponse | GetProjectContentDetailResp
|
|
|
1674
1836
|
|
|
1675
1837
|
/** Query parameters for GET /v1/content */
|
|
1676
1838
|
type ListContentRequestQuery = ContentMetadataQuery & {
|
|
1839
|
+
/** Sort the full matching library before pagination (default updated_at). */
|
|
1840
|
+
sort_by?: 'name' | 'size' | 'updated_at' | 'created_at';
|
|
1841
|
+
/** Sort direction; defaults to asc for name, desc otherwise. Unknown sizes sort last. */
|
|
1842
|
+
sort_direction?: 'asc' | 'desc';
|
|
1677
1843
|
/** Filter by content type (e.g. "material", "3d-asset") */
|
|
1678
1844
|
content_type?: ContentListType;
|
|
1679
1845
|
/** Include saved web projects alongside uploaded content (default false). */
|
|
@@ -1706,6 +1872,12 @@ type ListContentRequestQuery = ContentMetadataQuery & {
|
|
|
1706
1872
|
* A single item in the GET /v1/content list response.
|
|
1707
1873
|
*/
|
|
1708
1874
|
type ContentListItem = {
|
|
1875
|
+
/** Bytes in the latest primary artifact, including companion files; projects include their current document and attached files. Null when unavailable. */
|
|
1876
|
+
size?: number | null;
|
|
1877
|
+
/** Identity associated with the latest recorded activity, when known. */
|
|
1878
|
+
updated_by?: string | null;
|
|
1879
|
+
/** Display name for that identity, when available. */
|
|
1880
|
+
updated_by_name?: string | null;
|
|
1709
1881
|
technical_metadata?: AssetMetadataSummaryResponse | AssetMetadataDetailResponse | null,
|
|
1710
1882
|
/** Distinguishes saved projects from uploaded content. */
|
|
1711
1883
|
item_type?: ContentItemType;
|
|
@@ -1880,7 +2052,7 @@ type ListPublicContentResponse = {
|
|
|
1880
2052
|
|
|
1881
2053
|
/** Request body for PATCH /v1/content/:identifier */
|
|
1882
2054
|
type UpdateContentRequestBody = {
|
|
1883
|
-
/** Content title (
|
|
2055
|
+
/** Content title (max 255 chars). An empty string clears it. */
|
|
1884
2056
|
title?: string;
|
|
1885
2057
|
/** Content description (max 512 chars) */
|
|
1886
2058
|
description?: string;
|
|
@@ -1888,14 +2060,13 @@ type UpdateContentRequestBody = {
|
|
|
1888
2060
|
password?: string | null;
|
|
1889
2061
|
/** Comma-separated tags (max 512 chars total, each tag < 50 chars, max 40 tags) */
|
|
1890
2062
|
tags?: string | null;
|
|
1891
|
-
/**
|
|
1892
|
-
* via the public discovery API. UI for setting this is currently gated by a frontend
|
|
1893
|
-
* feature flag; the API itself does not enforce additional restrictions. */
|
|
2063
|
+
/** When true, the content is discoverable and readable through the public content API without authentication. */
|
|
1894
2064
|
is_public?: boolean;
|
|
1895
2065
|
/** Viewer presentation settings (lighting, tone mapping, background).
|
|
1896
2066
|
* Pass `null` to clear; omit to leave unchanged. */
|
|
1897
2067
|
presentation?: PresentationV1 | null;
|
|
1898
2068
|
/** Thumbnail upload request — server returns presigned URL in response */
|
|
2069
|
+
remove_thumbnail?: boolean;
|
|
1899
2070
|
upload_thumbnail?: {
|
|
1900
2071
|
name: string;
|
|
1901
2072
|
content_size: number;
|
|
@@ -1959,139 +2130,13 @@ declare type UploadFilesOptions = {
|
|
|
1959
2130
|
verify?: boolean,
|
|
1960
2131
|
abort?: AbortSignal,
|
|
1961
2132
|
loglevel?: LogLevel,
|
|
2133
|
+
/** Called before server finalization; UI should stop offering cancellation at this point. */
|
|
2134
|
+
onFinalize?: () => void,
|
|
1962
2135
|
onStart?: (id: string, content_id: string) => void,
|
|
1963
2136
|
/** The progress event is called for each file being uploaded and may be called multiple times for each file while the file is being uploaded */
|
|
1964
2137
|
progress?: (args: ProgressEventArgs) => void,
|
|
1965
2138
|
}
|
|
1966
2139
|
|
|
1967
|
-
/**
|
|
1968
|
-
* How the SDK performs an HTTP request. Deliberately the same contract as the
|
|
1969
|
-
* global `fetch`, so a caller can route requests through its own transport
|
|
1970
|
-
* without the SDK changing how it reads a response (and so a STREAMING response
|
|
1971
|
-
* — the AI chat's SSE — still works, which a body-only shape could not carry).
|
|
1972
|
-
*
|
|
1973
|
-
* Why it exists: a browser extension runs its code inside the INSPECTED page, so
|
|
1974
|
-
* a plain `fetch` obeys that page's Content-Security-Policy and a strict
|
|
1975
|
-
* `connect-src` blocks it outright. Such a caller passes a function that relays
|
|
1976
|
-
* the request through its own service worker instead, where extension
|
|
1977
|
-
* permissions apply rather than the host page's policy.
|
|
1978
|
-
*
|
|
1979
|
-
* Defaults to `globalThis.fetch` everywhere it is accepted.
|
|
1980
|
-
*/
|
|
1981
|
-
type FetchLike = (url: string, init?: RequestInit) => Promise<Response>;
|
|
1982
|
-
|
|
1983
|
-
/**
|
|
1984
|
-
* Display information for a purchasable product — what `getProductInformation()`
|
|
1985
|
-
* returns, straight from `GET /v1/payment/info`. Amounts are already converted to
|
|
1986
|
-
* MAJOR currency units (29 means €29, not 29 cents), so they can be formatted for
|
|
1987
|
-
* display as-is.
|
|
1988
|
-
*/
|
|
1989
|
-
type ProductInformation$1 = {
|
|
1990
|
-
/** the product name that was queried */
|
|
1991
|
-
product: string,
|
|
1992
|
-
/** the price to charge and to show. Already discounted when a sale is running. */
|
|
1993
|
-
amount: number,
|
|
1994
|
-
/** ISO currency code, lower-case (Stripe's spelling) */
|
|
1995
|
-
currency: string,
|
|
1996
|
-
/** the pre-sale price — present ONLY while a discount is active, for a
|
|
1997
|
-
* strikethrough. Its absence means no sale is running. */
|
|
1998
|
-
original?: number,
|
|
1999
|
-
/** name of the running sale ("Launch sale"), when the coupon carries one */
|
|
2000
|
-
label?: string,
|
|
2001
|
-
/** ms epoch the sale ends, when the coupon sets a deadline */
|
|
2002
|
-
expires_at?: number,
|
|
2003
|
-
/** dashboard-managed tag for the BASE price ("Launch price"). Clients hide it
|
|
2004
|
-
* while a sale runs, since `label` takes over. */
|
|
2005
|
-
price_label?: string,
|
|
2006
|
-
/** true for a pay-what-you-want price; `amount` is then the suggested one */
|
|
2007
|
-
customer_chooses?: true,
|
|
2008
|
-
/** lowest acceptable amount for a pay-what-you-want price */
|
|
2009
|
-
minimum?: number,
|
|
2010
|
-
/** AI token credits bundled with the purchase, when any */
|
|
2011
|
-
included_ai_tokens?: number,
|
|
2012
|
-
/** Provider-cost AI allowance bundled with the purchase, in USD. */
|
|
2013
|
-
included_ai_usage_usd?: number,
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
/** Options shared by the product-name payment calls. */
|
|
2017
|
-
type ProductPaymentOptions = {
|
|
2018
|
-
/**
|
|
2019
|
-
* Pin a specific Stripe price by its `lookup_key` instead of letting the
|
|
2020
|
-
* server pick the product's active price. Use the SAME key for the info and
|
|
2021
|
-
* the checkout call — showing one price and charging another is exactly what
|
|
2022
|
-
* this parameter exists to prevent.
|
|
2023
|
-
*/
|
|
2024
|
-
price?: string,
|
|
2025
|
-
/** Route the HTTP request yourself (e.g. a CSP-blocked extension relaying
|
|
2026
|
-
* through its service worker). Defaults to `globalThis.fetch`. */
|
|
2027
|
-
fetch?: FetchLike,
|
|
2028
|
-
/**
|
|
2029
|
-
* Override the API base url (no trailing slash), e.g.
|
|
2030
|
-
* `https://cloud-staging.needle.tools/api`. The bundled default is baked at
|
|
2031
|
-
* BUILD time, so a host that picks its environment at RUNTIME — the browser
|
|
2032
|
-
* extension resolves dev/staging/production from its own build defines —
|
|
2033
|
-
* must pass its own, or a staging build would quietly bill against
|
|
2034
|
-
* production.
|
|
2035
|
-
*/
|
|
2036
|
-
baseUrl?: string,
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
type GetProductInformationOptions$1 = ProductPaymentOptions;
|
|
2040
|
-
|
|
2041
|
-
/** Attribution labels: 1-128 ASCII letters, digits, underscores, dots, colons or hyphens.
|
|
2042
|
-
* Do not include personal information. These labels do not prove payment. */
|
|
2043
|
-
type CheckoutTracking = {
|
|
2044
|
-
/** Stable UI or campaign label, e.g. "export_gltf". */
|
|
2045
|
-
source?: string,
|
|
2046
|
-
/** Caller-generated identifier joining events for one purchase attempt. */
|
|
2047
|
-
attemptId?: string,
|
|
2048
|
-
}
|
|
2049
|
-
|
|
2050
|
-
type CheckoutProductResult = {
|
|
2051
|
-
/** Stripe checkout URL to open for the buyer. */
|
|
2052
|
-
url: string,
|
|
2053
|
-
/** Checkout identifier for correlating purchase events; creation does not confirm payment. */
|
|
2054
|
-
checkoutId: string,
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
type CheckoutProductOptions$1 = ProductPaymentOptions & {
|
|
2058
|
-
/** Referral code supplied by an affiliate. Case-insensitive; works on any host without cookies. Does not change the price. */
|
|
2059
|
-
affiliateCode?: string,
|
|
2060
|
-
/** A Stripe promotion code to apply to the session. */
|
|
2061
|
-
promoCode?: string,
|
|
2062
|
-
/** Optional attribution carried through checkout and payment confirmation. */
|
|
2063
|
-
tracking?: CheckoutTracking,
|
|
2064
|
-
/** Identifies the calling app in the payment logs and return urls. */
|
|
2065
|
-
app?: string,
|
|
2066
|
-
/**
|
|
2067
|
-
* Index into the payment API's `available_modes` — which Stripe checkout mode
|
|
2068
|
-
* to open. `1` is a one-time payment; omitted defaults to the server's `0`.
|
|
2069
|
-
* A product sold outright will look wrong (or fail) in subscription mode, so
|
|
2070
|
-
* pass the one the product is priced for.
|
|
2071
|
-
*/
|
|
2072
|
-
mode?: number,
|
|
2073
|
-
/** Explicit auth token. Without one the SDK asks Auth for an access token;
|
|
2074
|
-
* the checkout email is prefilled and locked from whichever is used. */
|
|
2075
|
-
authToken?: string,
|
|
2076
|
-
org?: string,
|
|
2077
|
-
}
|
|
2078
|
-
|
|
2079
|
-
type StartCheckoutSessionOptions = {
|
|
2080
|
-
/** Optional case-insensitive referral code. */
|
|
2081
|
-
affiliateCode?: string,
|
|
2082
|
-
price_id: string,
|
|
2083
|
-
tracking?: CheckoutTracking,
|
|
2084
|
-
};
|
|
2085
|
-
|
|
2086
|
-
type StartCheckoutSessionResult = {
|
|
2087
|
-
ok: true,
|
|
2088
|
-
status: number,
|
|
2089
|
-
checkoutId: string,
|
|
2090
|
-
} | {
|
|
2091
|
-
ok: false,
|
|
2092
|
-
status: number,
|
|
2093
|
-
};
|
|
2094
|
-
|
|
2095
2140
|
type TriggerType = "web" | "cli";
|
|
2096
2141
|
|
|
2097
2142
|
/**
|