Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/needs-updating/slack/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Definition = {
api.authed_user.id : api.teamId;

return {
identifiers: {externalId, user: userId},
identifiers: {externalId, userId},
details: {name: api.team_name}
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/42matters/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Definition = {
},
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
return {
identifiers: {externalId: md5(api.access_token), user: userId},
identifiers: {externalId: md5(api.access_token), userId},
details: {},
}
},
Expand All @@ -25,7 +25,7 @@ const Definition = {
},
getCredentialDetails: async function (api, userId) {
return {
identifiers: {externalId: md5(api.access_token), user: userId},
identifiers: {externalId: md5(api.access_token), userId},
details: {}
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/asana/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Definition = {
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
const userDetails = await api.getUserDetails();
return {
identifiers: {externalId: userDetails.sub, user: userId},
identifiers: {externalId: userDetails.sub, userId},
details: {name: userDetails.name, email: userDetails.email},
}
},
Expand All @@ -31,7 +31,7 @@ const Definition = {
getCredentialDetails: async function (api, userId) {
const userDetails = await api.getUserDetails();
return {
identifiers: {externalId: userDetails.portalId, user: userId},
identifiers: {externalId: userDetails.sub, userId},
details: {}
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/attio/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Definition = {
}

return {
identifiers: {externalId: tokenInfo.workspace_id, user: userId},
identifiers: {externalId: tokenInfo.workspace_id, userId},
details: {name: tokenInfo.workspace_name || tokenInfo.workspace_slug},
}
},
Expand All @@ -45,7 +45,7 @@ const Definition = {
}

return {
identifiers: {externalId: tokenInfo.workspace_id, user: userId},
identifiers: {externalId: tokenInfo.workspace_id, userId},
details: {}
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/connectwise/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const Definition = {
},
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
return {
identifiers: {externalId: api.company_id, user: userId},
identifiers: {externalId: api.company_id, userId},
details: {},
}
},
Expand All @@ -37,7 +37,7 @@ const Definition = {
},
getCredentialDetails: async function (api, userId) {
return {
identifiers: {externalId: api.company_id, user: userId},
identifiers: {externalId: api.company_id, userId},
details: {}
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/contentful/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Definition = {
name: space.name
}));
return {
identifiers: {externalId: entityDetails.identifier, user: userId},
identifiers: {externalId: entityDetails.identifier, userId},
details: {
name: entityDetails.name,
spaces,
Expand All @@ -39,7 +39,7 @@ const Definition = {
getCredentialDetails: async function (api, userId) {
const userDetails = await api.getTokenIdentity();
return {
identifiers: {externalId: userDetails.identifier, user: userId},
identifiers: {externalId: userDetails.identifier, userId},
details: {}
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/contentstack/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ const Definition = {
const externalId = api.api_key;
const name = roles[0].stack.name;
return {
identifiers: {externalId, user: userId},
identifiers: {externalId, userId},
details: {name}
}
},
getCredentialDetails: async function (api, userId) {
return {
identifiers: {externalId: api.api_key, user: userId},
identifiers: {externalId: api.api_key, userId},
details: {}
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/crossbeam/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Definition = {
) {
const userDetails = await api.getUserDetails();
return {
identifiers: { externalId: userDetails.portalId, user: userId },
identifiers: { externalId: userDetails.portalId, userId },
details: { name: userDetails.hub_domain },
};
},
Expand All @@ -34,7 +34,7 @@ const Definition = {
getCredentialDetails: async function (api, userId) {
const userDetails = await api.getUserDetails();
return {
identifiers: { externalId: userDetails.portalId, user: userId },
identifiers: { externalId: userDetails.portalId, userId },
details: {},
};
},
Expand Down
2 changes: 1 addition & 1 deletion packages/v1-ready/deel/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Definition = {
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
const tokenDetails = await api.getTokenIdentity();
return {
identifiers: {externalId: tokenDetails.id, user: userId},
identifiers: {externalId: tokenDetails.id, userId},
details: {name: tokenDetails.name},
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/frigg-scale-test/src/defintion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const definition: FriggModuleAuthDefinition = {
return {
identifiers: {
externalId: "scale-test-account",
user: userId,
userId,
},
details: {
name: "Scale Test Account",
Expand All @@ -80,7 +80,7 @@ const definition: FriggModuleAuthDefinition = {
return {
identifiers: {
externalId: "scale-test-account",
user: userId,
userId,
},
details: {},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/frontify/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Definition = {
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
const {user: userDetails} = await api.getUser();
return {
identifiers: {externalId: userDetails.id, user: userId},
identifiers: {externalId: userDetails.id, userId},
details: {name: userDetails.name },
}
},
Expand All @@ -59,7 +59,7 @@ const Definition = {
getCredentialDetails: async function (api, userId) {
const {user: userDetails} = await api.getUser();
return {
identifiers: {externalId: userDetails.id, user: userId},
identifiers: {externalId: userDetails.id, userId},
details: {}
};
},
Expand Down
2 changes: 1 addition & 1 deletion packages/v1-ready/google-calendar/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Definition = {
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
const entityDetails = await api.getTokenIdentity();
return {
identifiers: {externalId: entityDetails.identifier, user: userId},
identifiers: {externalId: entityDetails.identifier, userId},
details: {name: entityDetails.name},
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/v1-ready/helpscout/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Definition = {
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
const entityDetails = await api.getTokenIdentity();
return {
identifiers: {externalId: entityDetails.identifier, user: userId},
identifiers: {externalId: entityDetails.identifier, userId},
details: {name: entityDetails.name},
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/hubspot/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Definition = {
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
const userDetails = await api.getUserDetails();
return {
identifiers: {externalId: userDetails.portalId, user: userId},
identifiers: {externalId: userDetails.portalId, userId},
details: {name: userDetails.hub_domain},
}
},
Expand All @@ -31,7 +31,7 @@ const Definition = {
getCredentialDetails: async function (api, userId) {
const userDetails = await api.getUserDetails();
return {
identifiers: {externalId: userDetails.portalId, user: userId},
identifiers: {externalId: userDetails.portalId, userId},
details: {}
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/ironclad/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Definition = {
}
const user = await api.getUserDetails();
return {
identifiers: { externalId: user.id, user: userId },
identifiers: { externalId: user.id, userId },
details: { name: user.displayName, email: user.email },
};
},
Expand All @@ -42,7 +42,7 @@ const Definition = {
}
const userDetails = await api.getUserDetails();
return {
identifiers: { externalId: userDetails.portalId, user: userId },
identifiers: { externalId: userDetails.portalId, userId },
details: {},
};
},
Expand Down
2 changes: 1 addition & 1 deletion packages/v1-ready/linear/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Definition = {
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
const entityDetails = await api.getTokenIdentity();
return {
identifiers: {externalId: entityDetails.identifier, user: userId},
identifiers: {externalId: entityDetails.identifier, userId},
details: {name: entityDetails.name},
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/pipedrive/frigg-core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ declare module '@friggframework/core' {
tokenResponse: any,
userId: string
) => Promise<{
identifiers: { externalId: string; user: string };
identifiers: { externalId: string; userId: string };
details: Record<string, any>;
}>;
getCredentialDetails?: (
api: any,
userId: string
) => Promise<{
identifiers: { externalId: string; user: string };
identifiers: { externalId: string; userId: string };
details: Record<string, any>;
}>;
apiPropertiesToPersist?: {
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/pipedrive/src/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Definition: FriggModuleAuthDefinition = {
return {
identifiers: {
externalId: String(userProfile.data.company_id),
user: userId,
userId,
},
details: {
name: userProfile.data.company_name || "Unknown Company",
Expand Down Expand Up @@ -68,7 +68,7 @@ const Definition: FriggModuleAuthDefinition = {
return {
identifiers: {
externalId: String(userProfile.data.id),
user: userId,
userId,
},
details: {},
};
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/salesforce/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Definition = {
const orgDetails = orgResponse[0];
const { Username: connectedUsername } = await api.getUserInfo();
return {
identifiers: { externalId: orgDetails.Id, user: userId },
identifiers: { externalId: orgDetails.Id, userId },
details: { name: orgDetails.Name, connectedUsername },
};
},
Expand All @@ -48,7 +48,7 @@ const Definition = {
},
getCredentialDetails: async function (api, userId) {
return {
identifiers: { instanceUrl: api.instanceUrl, user: userId },
identifiers: { instanceUrl: api.instanceUrl, userId },
details: {}
};
},
Expand Down
6 changes: 3 additions & 3 deletions packages/v1-ready/salesforce/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ class Manager extends ModuleManager {

const createObj = {
credential: this.credential.id,
user: this.userId,
userId: this.userId,
name,
externalId,
isSandbox,
connectedUsername: sfUserResponse.Username,
};
this.entity = await Entity.findOneAndUpdate(
{
user: this.userId,
userId: this.userId,
externalId,
isSandbox,
},
Expand Down Expand Up @@ -170,7 +170,7 @@ class Manager extends ModuleManager {
};
this.credential = await Credential.findOneAndUpdate(
{
user: this.userId,
userId: this.userId,
instanceUrl: this.api.instanceUrl,
},
updatedToken,
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/stripe/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Definition = {
const accountDetails = await api.getAccountDetails();
if (userId.userId) userId = userId.userId;
return {
identifiers: { externalId: accountDetails.id, user: userId },
identifiers: { externalId: accountDetails.id, userId },
details: {
name: accountDetails.business_profile?.name,
email: accountDetails.email,
Expand All @@ -37,7 +37,7 @@ const Definition = {
const accountDetails = await api.getAccountDetails();
if (userId.userId) userId = userId.userId;
return {
identifiers: { externalId: accountDetails.id, user: userId },
identifiers: { externalId: accountDetails.id, userId },
details: {},
};
},
Expand Down
4 changes: 2 additions & 2 deletions packages/v1-ready/unbabel-projects/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ const Definition = {
getEntityDetails: async function (api, callbackParams, tokenResponse, userId) {
const externalId = api.customer_id;
return {
identifiers: {externalId, user: userId},
identifiers: {externalId, userId},
details: {name: api.username}
}
},
getCredentialDetails: async function (api, userId) {
return {
identifiers: {externalId: api.customer_id, user: userId},
identifiers: {externalId: api.customer_id, userId},
details: {}
};
},
Expand Down
8 changes: 4 additions & 4 deletions packages/v1-ready/unbabel-projects/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ class Manager extends ModuleManager {
const name = get(params, 'name');

const search = await Entity.find({
user: this.userId,
userId: this.userId,
externalId: identifier,
});
if (search.length === 0) {
// validate choices!!!
// create entity
const createObj = {
credential: this.credential.id,
user: this.userId,
userId: this.userId,
name,
externalId: identifier,
};
Expand Down Expand Up @@ -114,7 +114,7 @@ class Manager extends ModuleManager {
async updateOrCreateCredential() {
const userDetails = await this.api.getTokenIdentity();
const updatedToken = {
user: this.userId.toString(),
userId: this.userId.toString(),
auth_is_valid: true,
};
if (this.access_token) {
Expand All @@ -133,7 +133,7 @@ class Manager extends ModuleManager {
if (credentialSearch.length > 1) {
debug(`Multiple credentials found with same identifier: ${userDetails.identifier}`);
this.throwException(`Multiple credentials found with same identifier: ${userDetails.identifier}`);
} else if (credentialSearch === 1 && credentialSearch[0].user !== this.userId) {
} else if (credentialSearch === 1 && credentialSearch[0].userId !== this.userId) {
debug(`A credential already exists with this identifier: ${userDetails.identifier}`);
this.throwException(`A credential already exists with this identifier: ${userDetails.identifier}`);
} else if (credentialSearch === 1) {
Expand Down
Loading
Loading