@membranehq/sdk 0.21.0 → 0.22.1
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/bundle.d.ts +14 -0
- package/dist/bundle.js +6 -6
- package/dist/bundle.js.map +1 -1
- package/dist/dts/accessors/connections-accessors.d.ts +1 -1
- package/dist/dts/accessors/connections-accessors.test.d.ts +1 -0
- package/dist/dts/accessors/integrations-accessors.d.ts +1 -0
- package/dist/dts/orgs/types.d.ts +10 -0
- package/dist/dts/workspace-elements/api/action-run-log-records-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/actions-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/app-data-schema-instances-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/app-event-log-records-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/app-event-subscriptions-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/connections-api.d.ts +3 -0
- package/dist/dts/workspace-elements/api/customers-api.d.ts +4 -0
- package/dist/dts/workspace-elements/api/data-link-table-instances-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/data-sources-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/external-api-logs-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/external-event-log-records-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/external-event-pulls-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/external-event-subscriptions-api.d.ts +1 -0
- package/dist/dts/workspace-elements/api/field-mappings-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/flow-runs-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/flows-api.d.ts +2 -0
- package/dist/dts/workspace-elements/api/incoming-webhooks-api.d.ts +1 -0
- package/dist/dts/workspace-elements/base/customers/index.d.ts +1 -0
- package/dist/dts/workspace-elements/base/integrations/index.d.ts +0 -1
- package/dist/index.browser.d.mts +41 -2
- package/dist/index.browser.d.ts +41 -2
- package/dist/index.browser.js +13 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.mjs +13 -8
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.node.d.mts +41 -2
- package/dist/index.node.d.ts +41 -2
- package/dist/index.node.js +13 -8
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.mjs +13 -8
- package/dist/index.node.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.node.js
CHANGED
|
@@ -9943,6 +9943,7 @@ const IntegrationEditableProperties = BaseMembraneInterfaceEditableProperties.ex
|
|
|
9943
9943
|
const IntegrationExportProperties = IntegrationEditableProperties.omit({
|
|
9944
9944
|
connectorId: true,
|
|
9945
9945
|
externalAppId: true,
|
|
9946
|
+
parameters: true,
|
|
9946
9947
|
});
|
|
9947
9948
|
const AppliedToIntegrations = (elementSchema) => z.z.array(z.z.object({
|
|
9948
9949
|
element: elementSchema,
|
|
@@ -10023,6 +10024,7 @@ const BaseCustomer = z.z.object({
|
|
|
10023
10024
|
isTest: z.z.boolean().optional(),
|
|
10024
10025
|
isBillable: z.z.boolean().optional(),
|
|
10025
10026
|
isActive: z.z.boolean().optional(),
|
|
10027
|
+
aiCreditsRolling30DayLimit: z.z.number().min(0).nullable().optional(),
|
|
10026
10028
|
createdAt: z.z.string().optional(),
|
|
10027
10029
|
archivedAt: z.z.string().optional(),
|
|
10028
10030
|
});
|
|
@@ -10877,12 +10879,14 @@ const CreateCustomerRequest = z.z.object({
|
|
|
10877
10879
|
internalId: z.z.string().optional(),
|
|
10878
10880
|
fields: z.z.any().optional(),
|
|
10879
10881
|
credentials: z.z.any().optional(),
|
|
10882
|
+
aiCreditsRolling30DayLimit: z.z.number().min(0).nullable().optional(),
|
|
10880
10883
|
});
|
|
10881
10884
|
const UpdateCustomerRequest = z.z.object({
|
|
10882
10885
|
name: z.z.string().optional(),
|
|
10883
10886
|
internalId: z.z.string().optional(),
|
|
10884
10887
|
fields: z.z.any().optional(),
|
|
10885
10888
|
credentials: z.z.any().optional(),
|
|
10889
|
+
aiCreditsRolling30DayLimit: z.z.number().min(0).nullable().optional(),
|
|
10886
10890
|
});
|
|
10887
10891
|
const FindCustomersQuery = z.z
|
|
10888
10892
|
.object({
|
|
@@ -13389,8 +13393,8 @@ function compareWorkspaceExports(baseExport, targetExport, options = { includeDe
|
|
|
13389
13393
|
changes[change.uuid] = { elementType: subject.type, path };
|
|
13390
13394
|
comparison[change.type].add(change.uuid);
|
|
13391
13395
|
if (options.includeDiff) {
|
|
13392
|
-
const baseYaml = base ? yaml__namespace.dump(base.element) : '';
|
|
13393
|
-
const targetYaml = target ? yaml__namespace.dump(target.element) : '';
|
|
13396
|
+
const baseYaml = base ? yaml__namespace.dump(base.element, { sortKeys: true }) : '';
|
|
13397
|
+
const targetYaml = target ? yaml__namespace.dump(target.element, { sortKeys: true }) : '';
|
|
13394
13398
|
diffs.push(diff.createTwoFilesPatch(`a/${path}`, `b/${path}`, baseYaml, targetYaml));
|
|
13395
13399
|
}
|
|
13396
13400
|
}
|
|
@@ -13534,6 +13538,7 @@ const Org = z.z.object({
|
|
|
13534
13538
|
freeAiCredits: z.z.number().optional(),
|
|
13535
13539
|
paidAiCredits: z.z.number().optional(),
|
|
13536
13540
|
freeAiMonthlyCredits: z.z.number().nullable().optional(),
|
|
13541
|
+
defaultTenantAiCreditsRolling30DayLimit: z.z.number().min(0).nullable().optional(),
|
|
13537
13542
|
stripeCustomerId: z.z.string().optional(),
|
|
13538
13543
|
autoChargeEnabled: z.z.boolean().optional(),
|
|
13539
13544
|
autoChargeThreshold: z.z.number().optional(),
|
|
@@ -13577,6 +13582,7 @@ const OrgWorkspace = z.z.object({
|
|
|
13577
13582
|
trialEndDate: z.z.string().optional(),
|
|
13578
13583
|
featureFlags: z.z.array(z.z.string()).optional(),
|
|
13579
13584
|
logoUri: z.z.string().optional(),
|
|
13585
|
+
defaultTenantAiCreditsRolling30DayLimit: z.z.number().min(0).nullable().optional(),
|
|
13580
13586
|
});
|
|
13581
13587
|
const OrgWorkspaceUser = z.z.object({
|
|
13582
13588
|
id: z.z.string(),
|
|
@@ -13598,6 +13604,7 @@ const CreateOrgRequest = z.z.object({
|
|
|
13598
13604
|
const UpdateOrgRequest = z.z.object({
|
|
13599
13605
|
name: z.z.string().min(1).optional(),
|
|
13600
13606
|
domains: z.z.array(z.z.string()).optional(),
|
|
13607
|
+
defaultTenantAiCreditsRolling30DayLimit: z.z.number().min(0).nullable().optional(),
|
|
13601
13608
|
});
|
|
13602
13609
|
const BaseOrgUser = z.z.object({
|
|
13603
13610
|
id: z.z.string(),
|
|
@@ -14904,7 +14911,6 @@ class ConnectionAccessor {
|
|
|
14904
14911
|
authOptionKey,
|
|
14905
14912
|
connectorParameters,
|
|
14906
14913
|
apiUri: this.client.apiUri,
|
|
14907
|
-
token: await this.client.getToken(),
|
|
14908
14914
|
onPopupClosed,
|
|
14909
14915
|
});
|
|
14910
14916
|
}
|
|
@@ -14994,16 +15000,17 @@ class ConnectionProxy {
|
|
|
14994
15000
|
}
|
|
14995
15001
|
}
|
|
14996
15002
|
async function createOrUpdateConnection(options) {
|
|
14997
|
-
const { connectionId, integrationKey, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectionRequestId, apiUri,
|
|
15003
|
+
const { client, connectionId, integrationKey, integrationId, connectorId, connectorVersion, name, input, connectorParameters, allowMultipleConnections, authOptionKey, connectionRequestId, apiUri, redirectUri, onPopupClosed, } = options !== null && options !== void 0 ? options : {};
|
|
14998
15004
|
let connectionType = await detectConnectionType(options);
|
|
14999
15005
|
if (redirectUri) {
|
|
15000
15006
|
connectionType = ConnectionType.REDIRECT;
|
|
15001
15007
|
}
|
|
15008
|
+
const freshToken = await client.getToken();
|
|
15002
15009
|
const connectPath = 'connect';
|
|
15003
15010
|
return new Promise((resolve, reject) => {
|
|
15004
15011
|
const requestId = simpleUniqueId() + simpleUniqueId();
|
|
15005
15012
|
const payload = {
|
|
15006
|
-
token,
|
|
15013
|
+
token: freshToken,
|
|
15007
15014
|
input,
|
|
15008
15015
|
connectorParameters,
|
|
15009
15016
|
integrationKey,
|
|
@@ -15032,7 +15039,7 @@ async function createOrUpdateConnection(options) {
|
|
|
15032
15039
|
const { stopSSE } = createSSEListener({
|
|
15033
15040
|
apiUri: apiUri,
|
|
15034
15041
|
requestId,
|
|
15035
|
-
token,
|
|
15042
|
+
token: freshToken,
|
|
15036
15043
|
handler: eventHandler,
|
|
15037
15044
|
});
|
|
15038
15045
|
function cleanup() {
|
|
@@ -15336,7 +15343,6 @@ class IntegrationAccessor extends ElementAccessor {
|
|
|
15336
15343
|
authOptionKey,
|
|
15337
15344
|
allowMultipleConnections,
|
|
15338
15345
|
apiUri: this.client.apiUri,
|
|
15339
|
-
token: await this.client.getToken(),
|
|
15340
15346
|
redirectUri: sameWindow ? redirectUri : undefined,
|
|
15341
15347
|
onPopupClosed,
|
|
15342
15348
|
});
|
|
@@ -16191,7 +16197,6 @@ class MembraneClient extends MembraneApiClient {
|
|
|
16191
16197
|
...options,
|
|
16192
16198
|
client: this,
|
|
16193
16199
|
apiUri: this.apiUri,
|
|
16194
|
-
token: await this.getToken(),
|
|
16195
16200
|
redirectUri: options.sameWindow ? options.redirectUri : undefined,
|
|
16196
16201
|
});
|
|
16197
16202
|
}
|