@bubblelab/bubble-core 0.1.49 → 0.1.51
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/bubble-bundle.d.ts +126 -106
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +4 -0
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubbles/service-bubble/agi-inc.d.ts +132 -132
- package/dist/bubbles/service-bubble/ai-agent.d.ts +36 -36
- package/dist/bubbles/service-bubble/airtable.d.ts +230 -230
- package/dist/bubbles/service-bubble/apify/apify.d.ts +38 -38
- package/dist/bubbles/service-bubble/ashby/ashby.d.ts +178 -178
- package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts +57 -57
- package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +98 -98
- package/dist/bubbles/service-bubble/eleven-labs.d.ts +48 -48
- package/dist/bubbles/service-bubble/firecrawl.d.ts +292 -292
- package/dist/bubbles/service-bubble/followupboss.d.ts +302 -302
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.d.ts +28 -28
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.js +8 -4
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.js.map +1 -1
- package/dist/bubbles/service-bubble/github.d.ts +124 -124
- package/dist/bubbles/service-bubble/gmail.d.ts +248 -248
- package/dist/bubbles/service-bubble/google-calendar.d.ts +56 -56
- package/dist/bubbles/service-bubble/google-drive.d.ts +120 -120
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +54 -54
- package/dist/bubbles/service-bubble/hello-world.d.ts +4 -4
- package/dist/bubbles/service-bubble/http.d.ts +12 -12
- package/dist/bubbles/service-bubble/insforge-db.d.ts +16 -16
- package/dist/bubbles/service-bubble/jira/jira.d.ts +59 -59
- package/dist/bubbles/service-bubble/notion/notion.d.ts +212 -212
- package/dist/bubbles/service-bubble/postgresql.d.ts +16 -16
- package/dist/bubbles/service-bubble/resend.d.ts +16 -16
- package/dist/bubbles/service-bubble/slack/slack.d.ts +340 -340
- package/dist/bubbles/service-bubble/storage.d.ts +40 -40
- package/dist/bubbles/service-bubble/stripe/index.d.ts +4 -0
- package/dist/bubbles/service-bubble/stripe/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/stripe/index.js +4 -0
- package/dist/bubbles/service-bubble/stripe/index.js.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.d.ts +1178 -0
- package/dist/bubbles/service-bubble/stripe/stripe.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.js +618 -0
- package/dist/bubbles/service-bubble/stripe/stripe.js.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.schema.d.ts +1326 -0
- package/dist/bubbles/service-bubble/stripe/stripe.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.schema.js +626 -0
- package/dist/bubbles/service-bubble/stripe/stripe.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.utils.d.ts +40 -0
- package/dist/bubbles/service-bubble/stripe/stripe.utils.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.utils.js +111 -0
- package/dist/bubbles/service-bubble/stripe/stripe.utils.js.map +1 -0
- package/dist/bubbles/service-bubble/telegram.d.ts +114 -114
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts +40 -40
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts +6 -6
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/get-trigger-detail-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/linkedin-connection-tool/linkedin-connection-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +324 -324
- package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/people-search-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +12 -12
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +60 -60
- package/dist/bubbles/tool-bubble/tool-template.d.ts +8 -8
- package/dist/bubbles/tool-bubble/twitter-tool.d.ts +132 -132
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +16 -16
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +12 -12
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +12 -12
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +14 -14
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts +28 -28
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +4 -4
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +20 -20
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +8 -8
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +96 -96
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +24 -24
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +4 -4
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +16 -16
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +4 -4
- package/dist/bubbles.json +1806 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/base-bubble-class.d.ts.map +1 -1
- package/dist/types/base-bubble-class.js +12 -0
- package/dist/types/base-bubble-class.js.map +1 -1
- package/dist/utils/schema-comparison.d.ts +10 -0
- package/dist/utils/schema-comparison.d.ts.map +1 -1
- package/dist/utils/schema-comparison.js +215 -0
- package/dist/utils/schema-comparison.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stripe Bubble Utility Functions
|
|
3
|
+
*
|
|
4
|
+
* Helper functions for Stripe API interactions and data formatting.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Format amount from smallest currency unit to display format
|
|
8
|
+
* @param amount Amount in smallest currency unit (e.g., cents)
|
|
9
|
+
* @param currency Three-letter ISO currency code
|
|
10
|
+
* @returns Formatted currency string
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatStripeAmount(amount: number, currency: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Convert display amount to Stripe smallest currency unit
|
|
15
|
+
* @param displayAmount Amount in display format (e.g., 10.99)
|
|
16
|
+
* @param currency Three-letter ISO currency code
|
|
17
|
+
* @returns Amount in smallest currency unit
|
|
18
|
+
*/
|
|
19
|
+
export declare function toStripeAmount(displayAmount: number, currency: string): number;
|
|
20
|
+
/**
|
|
21
|
+
* Format Unix timestamp to human-readable date
|
|
22
|
+
* @param timestamp Unix timestamp in seconds
|
|
23
|
+
* @returns Formatted date string
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatStripeTimestamp(timestamp: number): string;
|
|
26
|
+
/**
|
|
27
|
+
* Validate Stripe ID format
|
|
28
|
+
* @param id Stripe object ID
|
|
29
|
+
* @param prefix Expected prefix (e.g., 'cus', 'prod', 'price')
|
|
30
|
+
* @returns Whether the ID is valid
|
|
31
|
+
*/
|
|
32
|
+
export declare function isValidStripeId(id: string, prefix: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Enhance Stripe API error messages with helpful hints
|
|
35
|
+
* @param error Original error message
|
|
36
|
+
* @param statusCode HTTP status code
|
|
37
|
+
* @returns Enhanced error message
|
|
38
|
+
*/
|
|
39
|
+
export declare function enhanceStripeErrorMessage(error: string, statusCode?: number): string;
|
|
40
|
+
//# sourceMappingURL=stripe.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.utils.d.ts","sourceRoot":"","sources":["../../../../src/bubbles/service-bubble/stripe/stripe.utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA6B3E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,MAAM,GACf,MAAM,CAuBR;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,CAcR"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stripe Bubble Utility Functions
|
|
3
|
+
*
|
|
4
|
+
* Helper functions for Stripe API interactions and data formatting.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Format amount from smallest currency unit to display format
|
|
8
|
+
* @param amount Amount in smallest currency unit (e.g., cents)
|
|
9
|
+
* @param currency Three-letter ISO currency code
|
|
10
|
+
* @returns Formatted currency string
|
|
11
|
+
*/
|
|
12
|
+
export function formatStripeAmount(amount, currency) {
|
|
13
|
+
const formatter = new Intl.NumberFormat('en-US', {
|
|
14
|
+
style: 'currency',
|
|
15
|
+
currency: currency.toUpperCase(),
|
|
16
|
+
});
|
|
17
|
+
// Most currencies use 2 decimal places (divide by 100)
|
|
18
|
+
// Some currencies like JPY use 0 decimal places
|
|
19
|
+
const zeroDecimalCurrencies = [
|
|
20
|
+
'BIF',
|
|
21
|
+
'CLP',
|
|
22
|
+
'DJF',
|
|
23
|
+
'GNF',
|
|
24
|
+
'JPY',
|
|
25
|
+
'KMF',
|
|
26
|
+
'KRW',
|
|
27
|
+
'MGA',
|
|
28
|
+
'PYG',
|
|
29
|
+
'RWF',
|
|
30
|
+
'UGX',
|
|
31
|
+
'VND',
|
|
32
|
+
'VUV',
|
|
33
|
+
'XAF',
|
|
34
|
+
'XOF',
|
|
35
|
+
'XPF',
|
|
36
|
+
];
|
|
37
|
+
const divisor = zeroDecimalCurrencies.includes(currency.toUpperCase())
|
|
38
|
+
? 1
|
|
39
|
+
: 100;
|
|
40
|
+
return formatter.format(amount / divisor);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Convert display amount to Stripe smallest currency unit
|
|
44
|
+
* @param displayAmount Amount in display format (e.g., 10.99)
|
|
45
|
+
* @param currency Three-letter ISO currency code
|
|
46
|
+
* @returns Amount in smallest currency unit
|
|
47
|
+
*/
|
|
48
|
+
export function toStripeAmount(displayAmount, currency) {
|
|
49
|
+
const zeroDecimalCurrencies = [
|
|
50
|
+
'BIF',
|
|
51
|
+
'CLP',
|
|
52
|
+
'DJF',
|
|
53
|
+
'GNF',
|
|
54
|
+
'JPY',
|
|
55
|
+
'KMF',
|
|
56
|
+
'KRW',
|
|
57
|
+
'MGA',
|
|
58
|
+
'PYG',
|
|
59
|
+
'RWF',
|
|
60
|
+
'UGX',
|
|
61
|
+
'VND',
|
|
62
|
+
'VUV',
|
|
63
|
+
'XAF',
|
|
64
|
+
'XOF',
|
|
65
|
+
'XPF',
|
|
66
|
+
];
|
|
67
|
+
const multiplier = zeroDecimalCurrencies.includes(currency.toUpperCase())
|
|
68
|
+
? 1
|
|
69
|
+
: 100;
|
|
70
|
+
return Math.round(displayAmount * multiplier);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Format Unix timestamp to human-readable date
|
|
74
|
+
* @param timestamp Unix timestamp in seconds
|
|
75
|
+
* @returns Formatted date string
|
|
76
|
+
*/
|
|
77
|
+
export function formatStripeTimestamp(timestamp) {
|
|
78
|
+
return new Date(timestamp * 1000).toISOString();
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Validate Stripe ID format
|
|
82
|
+
* @param id Stripe object ID
|
|
83
|
+
* @param prefix Expected prefix (e.g., 'cus', 'prod', 'price')
|
|
84
|
+
* @returns Whether the ID is valid
|
|
85
|
+
*/
|
|
86
|
+
export function isValidStripeId(id, prefix) {
|
|
87
|
+
const pattern = new RegExp(`^${prefix}_[a-zA-Z0-9]+$`);
|
|
88
|
+
return pattern.test(id);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Enhance Stripe API error messages with helpful hints
|
|
92
|
+
* @param error Original error message
|
|
93
|
+
* @param statusCode HTTP status code
|
|
94
|
+
* @returns Enhanced error message
|
|
95
|
+
*/
|
|
96
|
+
export function enhanceStripeErrorMessage(error, statusCode) {
|
|
97
|
+
if (statusCode === 401) {
|
|
98
|
+
return `${error}\n\nHint: Your Stripe API key may be invalid or expired. Please check your credentials.`;
|
|
99
|
+
}
|
|
100
|
+
if (statusCode === 403) {
|
|
101
|
+
return `${error}\n\nHint: Your Stripe API key may not have permission for this operation. Check your key permissions.`;
|
|
102
|
+
}
|
|
103
|
+
if (statusCode === 404) {
|
|
104
|
+
return `${error}\n\nHint: The requested resource was not found. Check that the ID is correct.`;
|
|
105
|
+
}
|
|
106
|
+
if (statusCode === 429) {
|
|
107
|
+
return `${error}\n\nHint: Rate limit exceeded. Please wait a moment before retrying.`;
|
|
108
|
+
}
|
|
109
|
+
return error;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=stripe.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.utils.js","sourceRoot":"","sources":["../../../../src/bubbles/service-bubble/stripe/stripe.utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,QAAgB;IACjE,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;QAC/C,KAAK,EAAE,UAAU;QACjB,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE;KACjC,CAAC,CAAC;IACH,uDAAuD;IACvD,gDAAgD;IAChD,MAAM,qBAAqB,GAAG;QAC5B,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;KACN,CAAC;IACF,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACpE,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,GAAG,CAAC;IACR,OAAO,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,aAAqB,EACrB,QAAgB;IAEhB,MAAM,qBAAqB,GAAG;QAC5B,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;KACN,CAAC;IACF,MAAM,UAAU,GAAG,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACvE,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,GAAG,CAAC;IACR,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,UAAU,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACrD,OAAO,IAAI,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAAU,EAAE,MAAc;IACxD,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,MAAM,gBAAgB,CAAC,CAAC;IACvD,OAAO,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAa,EACb,UAAmB;IAEnB,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACvB,OAAO,GAAG,KAAK,yFAAyF,CAAC;IAC3G,CAAC;IACD,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACvB,OAAO,GAAG,KAAK,uGAAuG,CAAC;IACzH,CAAC;IACD,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACvB,OAAO,GAAG,KAAK,+EAA+E,CAAC;IACjG,CAAC;IACD,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;QACvB,OAAO,GAAG,KAAK,sEAAsE,CAAC;IACxF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|