netlify-onegraph-internal
Advanced tools
Comparing version 0.0.42 to 0.0.43
@@ -1,2 +0,2 @@ | ||
export declare const internalOperationsDoc = "\nmutation CreatePersistedQueryMutation(\n $nfToken: String!\n $appId: String!\n $query: String!\n $tags: [String!]!\n $description: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createPersistedQuery(\n input: {\n query: $query\n appId: $appId\n tags: $tags\n description: $description\n }\n ) {\n persistedQuery {\n id\n }\n }\n }\n}\n\nquery ListPersistedQueries(\n $appId: String!\n $first: Int!\n $after: String\n $tags: [String!]!\n) {\n oneGraph {\n app(id: $appId) {\n id\n persistedQueries(\n first: $first\n after: $after\n tags: $tags\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n id\n query\n fixedVariables\n freeVariables\n allowedOperationNames\n tags\n description\n }\n }\n }\n }\n}\n\nsubscription ListPersistedQueriesSubscription(\n $appId: String!\n $first: Int!\n $after: String\n $tags: [String!]!\n) {\n poll(\n onlyTriggerWhenPayloadChanged: true\n schedule: { every: { minutes: 1 } }\n ) {\n query {\n oneGraph {\n app(id: $appId) {\n id\n persistedQueries(\n first: $first\n after: $after\n tags: $tags\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n id\n query\n fixedVariables\n freeVariables\n allowedOperationNames\n tags\n description\n }\n }\n }\n }\n }\n }\n}\n\nquery PersistedQueriesQuery(\n $nfToken: String!\n $appId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n app(id: $appId) {\n persistedQueries {\n nodes {\n id\n query\n allowedOperationNames\n description\n freeVariables\n fixedVariables\n tags\n }\n }\n }\n }\n}\n\nquery PersistedQueryQuery(\n $nfToken: String!\n $appId: String!\n $id: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n persistedQuery(appId: $appId, id: $id) {\n id\n query\n allowedOperationNames\n description\n freeVariables\n fixedVariables\n tags\n }\n }\n}\n\nmutation CreateCLISessionMutation(\n $nfToken: String!\n $appId: String!\n $name: String!\n $metadata: JSON\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createNetlifyCliSession(\n input: { appId: $appId, name: $name, metadata: metadata }\n ) {\n session {\n id\n appId\n netlifyUserId\n name\n }\n }\n }\n}\n\nmutation UpdateCLISessionMetadataMutation(\n $nfToken: String!\n $sessionId: String!\n $metadata: JSON!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n updateNetlifyCliSession(\n input: { id: $sessionId, metadata: $metadata }\n ) {\n session {\n id\n name\n metadata\n }\n }\n }\n}\n\nmutation CreateCLISessionEventMutation(\n $nfToken: String!\n $sessionId: String!\n $payload: JSON!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createNetlifyCliTestEvent(\n input: {\n data: { payload: $payload }\n sessionId: $sessionId\n }\n ) {\n event {\n id\n createdAt\n sessionId\n }\n }\n }\n}\n \nquery CLISessionQuery(\n $nfToken: String!\n $sessionId: String!\n $first: Int!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n __typename\n netlifyCliSession(id: $sessionId) {\n appId\n createdAt\n id\n events(first: $first) {\n __typename\n createdAt\n id\n sessionId\n ... on OneGraphNetlifyCliSessionLogEvent {\n id\n message\n sessionId\n createdAt\n }\n ... on OneGraphNetlifyCliSessionTestEvent {\n id\n createdAt\n payload\n sessionId\n }\n }\n lastEventAt\n metadata\n name\n netlifyUserId\n }\n }\n}\n \nmutation AckCLISessionEventMutation(\n $nfToken: String!\n $sessionId: String!\n $eventIds: [String!]!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n ackNetlifyCliEvents(\n input: { eventIds: $eventIds, sessionId: $sessionId }\n ) {\n events {\n id\n }\n }\n }\n}\n\nquery AppSchemaQuery(\n $nfToken: String!\n $appId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n app(id: $appId) {\n graphQLSchema {\n appId\n createdAt\n id\n services {\n friendlyServiceName\n logoUrl\n service\n slug\n supportsCustomRedirectUri\n supportsCustomServiceAuth\n supportsOauthLogin\n }\n updatedAt\n }\n }\n }\n}\n\nmutation UpsertAppForSiteMutation(\n $nfToken: String!\n $siteId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n upsertAppForNetlifySite(\n input: { netlifySiteId: $siteId }\n ) {\n org {\n id\n name\n }\n app {\n id\n name\n corsOrigins\n customCorsOrigins {\n friendlyServiceName\n displayName\n encodedValue\n }\n }\n }\n }\n}\n\nmutation CreateNewSchemaMutation(\n $nfToken: String!\n $input: OneGraphCreateGraphQLSchemaInput!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createGraphQLSchema(input: $input) {\n app {\n graphQLSchema {\n id\n }\n }\n graphqlSchema {\n id\n services {\n friendlyServiceName\n logoUrl\n service\n slug\n supportsCustomRedirectUri\n supportsCustomServiceAuth\n supportsOauthLogin\n }\n }\n }\n }\n}"; | ||
export declare const internalOperationsDoc = "\nmutation CreatePersistedQueryMutation(\n $nfToken: String!\n $appId: String!\n $query: String!\n $tags: [String!]!\n $description: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createPersistedQuery(\n input: {\n query: $query\n appId: $appId\n tags: $tags\n description: $description\n }\n ) {\n persistedQuery {\n id\n }\n }\n }\n}\n\nquery ListPersistedQueries(\n $appId: String!\n $first: Int!\n $after: String\n $tags: [String!]!\n) {\n oneGraph {\n app(id: $appId) {\n id\n persistedQueries(\n first: $first\n after: $after\n tags: $tags\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n id\n query\n fixedVariables\n freeVariables\n allowedOperationNames\n tags\n description\n }\n }\n }\n }\n}\n\nsubscription ListPersistedQueriesSubscription(\n $appId: String!\n $first: Int!\n $after: String\n $tags: [String!]!\n) {\n poll(\n onlyTriggerWhenPayloadChanged: true\n schedule: { every: { minutes: 1 } }\n ) {\n query {\n oneGraph {\n app(id: $appId) {\n id\n persistedQueries(\n first: $first\n after: $after\n tags: $tags\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n id\n query\n fixedVariables\n freeVariables\n allowedOperationNames\n tags\n description\n }\n }\n }\n }\n }\n }\n}\n\nquery PersistedQueriesQuery(\n $nfToken: String!\n $appId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n app(id: $appId) {\n persistedQueries {\n nodes {\n id\n query\n allowedOperationNames\n description\n freeVariables\n fixedVariables\n tags\n }\n }\n }\n }\n}\n\nquery PersistedQueryQuery(\n $nfToken: String!\n $appId: String!\n $id: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n persistedQuery(appId: $appId, id: $id) {\n id\n query\n allowedOperationNames\n description\n freeVariables\n fixedVariables\n tags\n }\n }\n}\n\nmutation CreateCLISessionMutation(\n $nfToken: String!\n $appId: String!\n $name: String!\n $metadata: JSON\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createNetlifyCliSession(\n input: { appId: $appId, name: $name, metadata: metadata }\n ) {\n session {\n id\n appId\n netlifyUserId\n name\n }\n }\n }\n}\n\nmutation UpdateCLISessionMetadataMutation(\n $nfToken: String!\n $sessionId: String!\n $metadata: JSON!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n updateNetlifyCliSession(\n input: { id: $sessionId, metadata: $metadata }\n ) {\n session {\n id\n name\n metadata\n }\n }\n }\n}\n\nmutation CreateCLISessionEventMutation(\n $nfToken: String!\n $sessionId: String!\n $payload: JSON!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createNetlifyCliTestEvent(\n input: {\n data: { payload: $payload }\n sessionId: $sessionId\n }\n ) {\n event {\n id\n createdAt\n sessionId\n }\n }\n }\n}\n \nquery CLISessionQuery(\n $nfToken: String!\n $sessionId: String!\n $first: Int!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n __typename\n netlifyCliSession(id: $sessionId) {\n appId\n createdAt\n id\n events(first: $first) {\n __typename\n createdAt\n id\n sessionId\n ... on OneGraphNetlifyCliSessionLogEvent {\n id\n message\n sessionId\n createdAt\n }\n ... on OneGraphNetlifyCliSessionTestEvent {\n id\n createdAt\n payload\n sessionId\n }\n }\n lastEventAt\n metadata\n name\n netlifyUserId\n }\n }\n}\n \nmutation AckCLISessionEventMutation(\n $nfToken: String!\n $sessionId: String!\n $eventIds: [String!]!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n ackNetlifyCliEvents(\n input: { eventIds: $eventIds, sessionId: $sessionId }\n ) {\n events {\n id\n }\n }\n }\n}\n\nquery AppSchemaQuery(\n $nfToken: String!\n $appId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n app(id: $appId) {\n graphQLSchema {\n appId\n createdAt\n id\n services {\n friendlyServiceName\n logoUrl\n service\n slug\n supportsCustomRedirectUri\n supportsCustomServiceAuth\n supportsOauthLogin\n }\n updatedAt\n }\n }\n }\n}\n\nmutation UpsertAppForSiteMutation(\n $nfToken: String!\n $siteId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n upsertAppForNetlifySite(\n input: { netlifySiteId: $siteId }\n ) {\n org {\n id\n name\n }\n app {\n id\n name\n corsOrigins\n customCorsOrigins {\n friendlyServiceName\n displayName\n encodedValue\n }\n }\n }\n }\n}\n\nmutation CreateNewSchemaMutation(\n $nfToken: String!\n $input: OneGraphCreateGraphQLSchemaInput!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createGraphQLSchema(input: $input) {\n app {\n graphQLSchema {\n id\n }\n }\n graphqlSchema {\n id\n services {\n friendlyServiceName\n logoUrl\n service\n slug\n supportsCustomRedirectUri\n supportsCustomServiceAuth\n supportsOauthLogin\n }\n }\n }\n }\n}\n\n# Resurrect a session / update heartbeat\nmutation MarkCLISessionActiveHeartbeat(\n $nfToken: String!\n $id: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n updateNetlifyCliSession(\n input: { status: ACTIVE, id: $id }\n ) {\n session {\n id\n status\n createdAt\n updatedAt\n }\n }\n }\n}\n\n# Mutation to mark the session as inactive. Can be called when the CLI exits\nmutation MarkCLISessionInactive(\n $nfToken: String!\n $id: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n updateNetlifyCiSession(\n input: { status: INACTIVE, id: $id }\n ) {\n session {\n id\n status\n createdAt\n updatedAt\n }\n }\n }\n}"; | ||
/** | ||
@@ -169,2 +169,30 @@ * Given an appId and desired services, fetch the schema (in json form) for that app | ||
export declare const fetchEnabledServices: (authToken: string, appId: string) => Promise<any>; | ||
export declare type MiniSession = { | ||
id: string; | ||
status: "ACTIVE" | "INACTIVE"; | ||
createdAt: string; | ||
updatedAt: string; | ||
}; | ||
/** | ||
* Mark a CLI session as active and update the session's heartbeat | ||
* @param {string} authToken The (typically netlify) access token that is used for authentication | ||
* @param {string} appId The app to query against, typically the siteId | ||
* @param {string} sessionId The session id to mark as active / update heartbeat | ||
* @returns {errors: any[], data: MiniSession} | ||
*/ | ||
export declare const executeMarkCliSessionActiveHeartbeat: (authToken: string, appId: string, sessionId: string) => Promise<{ | ||
errors: any; | ||
data: any; | ||
}>; | ||
/** | ||
* Mark a CLI session as inactive | ||
* @param {string} authToken The (typically netlify) access token that is used for authentication | ||
* @param {string} appId The app to query against, typically the siteId | ||
* @param {string} sessionId The session id to mark as inactive | ||
* @returns {errors: any[], data: MiniSession} | ||
*/ | ||
export declare const executeMarkCliSessionInactive: (authToken: string, appId: string, sessionId: string) => Promise<{ | ||
errors: any; | ||
data: any; | ||
}>; | ||
export {}; |
@@ -50,7 +50,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fetchEnabledServices = exports.ensureAppForSite = exports.createNewAppSchema = exports.upsertAppForSite = exports.fetchAppSchema = exports.friendlyEventName = exports.createPersistedQuery = exports.ackCLISessionEvents = exports.updateCLISessionMetadata = exports.createCLISession = exports.fetchCliSessionEvents = exports.fetchCliSession = exports.fetchPersistedQuery = exports.fetchOneGraphSchema = exports.fetchOneGraphSchemaJson = exports.internalOperationsDoc = void 0; | ||
exports.executeMarkCliSessionInactive = exports.executeMarkCliSessionActiveHeartbeat = exports.fetchEnabledServices = exports.ensureAppForSite = exports.createNewAppSchema = exports.upsertAppForSite = exports.fetchAppSchema = exports.friendlyEventName = exports.createPersistedQuery = exports.ackCLISessionEvents = exports.updateCLISessionMetadata = exports.createCLISession = exports.fetchCliSessionEvents = exports.fetchCliSession = exports.fetchPersistedQuery = exports.fetchOneGraphSchema = exports.fetchOneGraphSchemaJson = exports.internalOperationsDoc = void 0; | ||
var graphql_1 = require("graphql"); | ||
var fetch = require("node-fetch"); | ||
var internalConsole_1 = require("./internalConsole"); | ||
exports.internalOperationsDoc = "\nmutation CreatePersistedQueryMutation(\n $nfToken: String!\n $appId: String!\n $query: String!\n $tags: [String!]!\n $description: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createPersistedQuery(\n input: {\n query: $query\n appId: $appId\n tags: $tags\n description: $description\n }\n ) {\n persistedQuery {\n id\n }\n }\n }\n}\n\nquery ListPersistedQueries(\n $appId: String!\n $first: Int!\n $after: String\n $tags: [String!]!\n) {\n oneGraph {\n app(id: $appId) {\n id\n persistedQueries(\n first: $first\n after: $after\n tags: $tags\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n id\n query\n fixedVariables\n freeVariables\n allowedOperationNames\n tags\n description\n }\n }\n }\n }\n}\n\nsubscription ListPersistedQueriesSubscription(\n $appId: String!\n $first: Int!\n $after: String\n $tags: [String!]!\n) {\n poll(\n onlyTriggerWhenPayloadChanged: true\n schedule: { every: { minutes: 1 } }\n ) {\n query {\n oneGraph {\n app(id: $appId) {\n id\n persistedQueries(\n first: $first\n after: $after\n tags: $tags\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n id\n query\n fixedVariables\n freeVariables\n allowedOperationNames\n tags\n description\n }\n }\n }\n }\n }\n }\n}\n\nquery PersistedQueriesQuery(\n $nfToken: String!\n $appId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n app(id: $appId) {\n persistedQueries {\n nodes {\n id\n query\n allowedOperationNames\n description\n freeVariables\n fixedVariables\n tags\n }\n }\n }\n }\n}\n\nquery PersistedQueryQuery(\n $nfToken: String!\n $appId: String!\n $id: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n persistedQuery(appId: $appId, id: $id) {\n id\n query\n allowedOperationNames\n description\n freeVariables\n fixedVariables\n tags\n }\n }\n}\n\nmutation CreateCLISessionMutation(\n $nfToken: String!\n $appId: String!\n $name: String!\n $metadata: JSON\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createNetlifyCliSession(\n input: { appId: $appId, name: $name, metadata: metadata }\n ) {\n session {\n id\n appId\n netlifyUserId\n name\n }\n }\n }\n}\n\nmutation UpdateCLISessionMetadataMutation(\n $nfToken: String!\n $sessionId: String!\n $metadata: JSON!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n updateNetlifyCliSession(\n input: { id: $sessionId, metadata: $metadata }\n ) {\n session {\n id\n name\n metadata\n }\n }\n }\n}\n\nmutation CreateCLISessionEventMutation(\n $nfToken: String!\n $sessionId: String!\n $payload: JSON!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createNetlifyCliTestEvent(\n input: {\n data: { payload: $payload }\n sessionId: $sessionId\n }\n ) {\n event {\n id\n createdAt\n sessionId\n }\n }\n }\n}\n \nquery CLISessionQuery(\n $nfToken: String!\n $sessionId: String!\n $first: Int!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n __typename\n netlifyCliSession(id: $sessionId) {\n appId\n createdAt\n id\n events(first: $first) {\n __typename\n createdAt\n id\n sessionId\n ... on OneGraphNetlifyCliSessionLogEvent {\n id\n message\n sessionId\n createdAt\n }\n ... on OneGraphNetlifyCliSessionTestEvent {\n id\n createdAt\n payload\n sessionId\n }\n }\n lastEventAt\n metadata\n name\n netlifyUserId\n }\n }\n}\n \nmutation AckCLISessionEventMutation(\n $nfToken: String!\n $sessionId: String!\n $eventIds: [String!]!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n ackNetlifyCliEvents(\n input: { eventIds: $eventIds, sessionId: $sessionId }\n ) {\n events {\n id\n }\n }\n }\n}\n\nquery AppSchemaQuery(\n $nfToken: String!\n $appId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n app(id: $appId) {\n graphQLSchema {\n appId\n createdAt\n id\n services {\n friendlyServiceName\n logoUrl\n service\n slug\n supportsCustomRedirectUri\n supportsCustomServiceAuth\n supportsOauthLogin\n }\n updatedAt\n }\n }\n }\n}\n\nmutation UpsertAppForSiteMutation(\n $nfToken: String!\n $siteId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n upsertAppForNetlifySite(\n input: { netlifySiteId: $siteId }\n ) {\n org {\n id\n name\n }\n app {\n id\n name\n corsOrigins\n customCorsOrigins {\n friendlyServiceName\n displayName\n encodedValue\n }\n }\n }\n }\n}\n\nmutation CreateNewSchemaMutation(\n $nfToken: String!\n $input: OneGraphCreateGraphQLSchemaInput!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createGraphQLSchema(input: $input) {\n app {\n graphQLSchema {\n id\n }\n }\n graphqlSchema {\n id\n services {\n friendlyServiceName\n logoUrl\n service\n slug\n supportsCustomRedirectUri\n supportsCustomServiceAuth\n supportsOauthLogin\n }\n }\n }\n }\n}"; | ||
exports.internalOperationsDoc = "\nmutation CreatePersistedQueryMutation(\n $nfToken: String!\n $appId: String!\n $query: String!\n $tags: [String!]!\n $description: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createPersistedQuery(\n input: {\n query: $query\n appId: $appId\n tags: $tags\n description: $description\n }\n ) {\n persistedQuery {\n id\n }\n }\n }\n}\n\nquery ListPersistedQueries(\n $appId: String!\n $first: Int!\n $after: String\n $tags: [String!]!\n) {\n oneGraph {\n app(id: $appId) {\n id\n persistedQueries(\n first: $first\n after: $after\n tags: $tags\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n id\n query\n fixedVariables\n freeVariables\n allowedOperationNames\n tags\n description\n }\n }\n }\n }\n}\n\nsubscription ListPersistedQueriesSubscription(\n $appId: String!\n $first: Int!\n $after: String\n $tags: [String!]!\n) {\n poll(\n onlyTriggerWhenPayloadChanged: true\n schedule: { every: { minutes: 1 } }\n ) {\n query {\n oneGraph {\n app(id: $appId) {\n id\n persistedQueries(\n first: $first\n after: $after\n tags: $tags\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n id\n query\n fixedVariables\n freeVariables\n allowedOperationNames\n tags\n description\n }\n }\n }\n }\n }\n }\n}\n\nquery PersistedQueriesQuery(\n $nfToken: String!\n $appId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n app(id: $appId) {\n persistedQueries {\n nodes {\n id\n query\n allowedOperationNames\n description\n freeVariables\n fixedVariables\n tags\n }\n }\n }\n }\n}\n\nquery PersistedQueryQuery(\n $nfToken: String!\n $appId: String!\n $id: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n persistedQuery(appId: $appId, id: $id) {\n id\n query\n allowedOperationNames\n description\n freeVariables\n fixedVariables\n tags\n }\n }\n}\n\nmutation CreateCLISessionMutation(\n $nfToken: String!\n $appId: String!\n $name: String!\n $metadata: JSON\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createNetlifyCliSession(\n input: { appId: $appId, name: $name, metadata: metadata }\n ) {\n session {\n id\n appId\n netlifyUserId\n name\n }\n }\n }\n}\n\nmutation UpdateCLISessionMetadataMutation(\n $nfToken: String!\n $sessionId: String!\n $metadata: JSON!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n updateNetlifyCliSession(\n input: { id: $sessionId, metadata: $metadata }\n ) {\n session {\n id\n name\n metadata\n }\n }\n }\n}\n\nmutation CreateCLISessionEventMutation(\n $nfToken: String!\n $sessionId: String!\n $payload: JSON!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createNetlifyCliTestEvent(\n input: {\n data: { payload: $payload }\n sessionId: $sessionId\n }\n ) {\n event {\n id\n createdAt\n sessionId\n }\n }\n }\n}\n \nquery CLISessionQuery(\n $nfToken: String!\n $sessionId: String!\n $first: Int!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n __typename\n netlifyCliSession(id: $sessionId) {\n appId\n createdAt\n id\n events(first: $first) {\n __typename\n createdAt\n id\n sessionId\n ... on OneGraphNetlifyCliSessionLogEvent {\n id\n message\n sessionId\n createdAt\n }\n ... on OneGraphNetlifyCliSessionTestEvent {\n id\n createdAt\n payload\n sessionId\n }\n }\n lastEventAt\n metadata\n name\n netlifyUserId\n }\n }\n}\n \nmutation AckCLISessionEventMutation(\n $nfToken: String!\n $sessionId: String!\n $eventIds: [String!]!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n ackNetlifyCliEvents(\n input: { eventIds: $eventIds, sessionId: $sessionId }\n ) {\n events {\n id\n }\n }\n }\n}\n\nquery AppSchemaQuery(\n $nfToken: String!\n $appId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n app(id: $appId) {\n graphQLSchema {\n appId\n createdAt\n id\n services {\n friendlyServiceName\n logoUrl\n service\n slug\n supportsCustomRedirectUri\n supportsCustomServiceAuth\n supportsOauthLogin\n }\n updatedAt\n }\n }\n }\n}\n\nmutation UpsertAppForSiteMutation(\n $nfToken: String!\n $siteId: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n upsertAppForNetlifySite(\n input: { netlifySiteId: $siteId }\n ) {\n org {\n id\n name\n }\n app {\n id\n name\n corsOrigins\n customCorsOrigins {\n friendlyServiceName\n displayName\n encodedValue\n }\n }\n }\n }\n}\n\nmutation CreateNewSchemaMutation(\n $nfToken: String!\n $input: OneGraphCreateGraphQLSchemaInput!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n createGraphQLSchema(input: $input) {\n app {\n graphQLSchema {\n id\n }\n }\n graphqlSchema {\n id\n services {\n friendlyServiceName\n logoUrl\n service\n slug\n supportsCustomRedirectUri\n supportsCustomServiceAuth\n supportsOauthLogin\n }\n }\n }\n }\n}\n\n# Resurrect a session / update heartbeat\nmutation MarkCLISessionActiveHeartbeat(\n $nfToken: String!\n $id: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n updateNetlifyCliSession(\n input: { status: ACTIVE, id: $id }\n ) {\n session {\n id\n status\n createdAt\n updatedAt\n }\n }\n }\n}\n\n# Mutation to mark the session as inactive. Can be called when the CLI exits\nmutation MarkCLISessionInactive(\n $nfToken: String!\n $id: String!\n) {\n oneGraph(\n auths: { netlifyAuth: { oauthToken: $nfToken } }\n ) {\n updateNetlifyCiSession(\n input: { status: INACTIVE, id: $id }\n ) {\n session {\n id\n status\n createdAt\n updatedAt\n }\n }\n }\n}"; | ||
var ONEDASH_APP_ID = "0b066ba6-ed39-4db8-a497-ba0be34d5b2a"; | ||
@@ -249,4 +249,5 @@ var httpOkLow = 200; | ||
var response, persistedQuery; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var _a, _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: return [4 /*yield*/, fetchOneGraph({ | ||
@@ -264,6 +265,4 @@ accessToken: authToken, | ||
case 1: | ||
response = _a.sent(); | ||
persistedQuery = response.data && | ||
response.data.oneGraph && | ||
response.data.oneGraph.persistedQuery; | ||
response = _c.sent(); | ||
persistedQuery = (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.oneGraph) === null || _b === void 0 ? void 0 : _b.persistedQuery; | ||
return [2 /*return*/, persistedQuery]; | ||
@@ -390,4 +389,5 @@ } | ||
var result, session; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var _a, _b, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: return [4 /*yield*/, fetchOneGraph({ | ||
@@ -405,7 +405,4 @@ accessToken: null, | ||
case 1: | ||
result = _a.sent(); | ||
session = result.data && | ||
result.data.oneGraph && | ||
result.data.oneGraph.updateNetlifyCliSession && | ||
result.data.oneGraph.updateNetlifyCliSession.session; | ||
result = _d.sent(); | ||
session = (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.oneGraph) === null || _b === void 0 ? void 0 : _b.updateNetlifyCliSession) === null || _c === void 0 ? void 0 : _c.session; | ||
return [2 /*return*/, session]; | ||
@@ -427,4 +424,5 @@ } | ||
var appId, authToken, eventIds, sessionId, result, events; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var _a, _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
@@ -444,6 +442,4 @@ appId = input.appId, authToken = input.authToken, eventIds = input.eventIds, sessionId = input.sessionId; | ||
case 1: | ||
result = _a.sent(); | ||
events = result.data && | ||
result.data.oneGraph && | ||
result.data.oneGraph.ackNetlifyCliEvents; | ||
result = _c.sent(); | ||
events = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.oneGraph) === null || _b === void 0 ? void 0 : _b.ackNetlifyCliEvents; | ||
return [2 /*return*/, events]; | ||
@@ -468,4 +464,5 @@ } | ||
var result, persistedQuery; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
var _b, _c, _d; | ||
return __generator(this, function (_e) { | ||
switch (_e.label) { | ||
case 0: return [4 /*yield*/, fetchOneGraph({ | ||
@@ -485,7 +482,4 @@ accessToken: null, | ||
case 1: | ||
result = _b.sent(); | ||
persistedQuery = result.data && | ||
result.data.oneGraph && | ||
result.data.oneGraph.createPersistedQuery && | ||
result.data.oneGraph.createPersistedQuery.persistedQuery; | ||
result = _e.sent(); | ||
persistedQuery = (_d = (_c = (_b = result.data) === null || _b === void 0 ? void 0 : _b.oneGraph) === null || _c === void 0 ? void 0 : _c.createPersistedQuery) === null || _d === void 0 ? void 0 : _d.persistedQuery; | ||
return [2 /*return*/, persistedQuery]; | ||
@@ -525,4 +519,5 @@ } | ||
var result; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var _a, _b, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: return [4 /*yield*/, fetchOneGraph({ | ||
@@ -539,7 +534,4 @@ accessToken: authToken, | ||
case 1: | ||
result = _a.sent(); | ||
return [2 /*return*/, (result.data && | ||
result.data.oneGraph && | ||
result.data.oneGraph.app && | ||
result.data.oneGraph.app.graphQLSchema)]; | ||
result = _d.sent(); | ||
return [2 /*return*/, (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.oneGraph) === null || _b === void 0 ? void 0 : _b.app) === null || _c === void 0 ? void 0 : _c.graphQLSchema]; | ||
} | ||
@@ -557,4 +549,5 @@ }); | ||
var result; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var _a, _b, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: return [4 /*yield*/, fetchOneGraph({ | ||
@@ -571,7 +564,4 @@ accessToken: authToken, | ||
case 1: | ||
result = _a.sent(); | ||
return [2 /*return*/, (result.data && | ||
result.data.oneGraph && | ||
result.data.oneGraph.upsertAppForNetlifySite && | ||
result.data.oneGraph.upsertAppForNetlifySite.app)]; | ||
result = _d.sent(); | ||
return [2 /*return*/, (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.oneGraph) === null || _b === void 0 ? void 0 : _b.upsertAppForNetlifySite) === null || _c === void 0 ? void 0 : _c.app]; | ||
} | ||
@@ -589,4 +579,5 @@ }); | ||
var result; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
var _a, _b, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: return [4 /*yield*/, fetchOneGraph({ | ||
@@ -603,7 +594,4 @@ accessToken: null, | ||
case 1: | ||
result = _a.sent(); | ||
return [2 /*return*/, (result.data && | ||
result.data.oneGraph && | ||
result.data.oneGraph.createGraphQLSchema && | ||
result.data.oneGraph.createGraphQLSchema.graphqlSchema)]; | ||
result = _d.sent(); | ||
return [2 /*return*/, (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.oneGraph) === null || _b === void 0 ? void 0 : _b.createGraphQLSchema) === null || _c === void 0 ? void 0 : _c.graphqlSchema]; | ||
} | ||
@@ -657,3 +645,3 @@ }); | ||
appSchema = _a.sent(); | ||
return [2 /*return*/, appSchema && appSchema.services]; | ||
return [2 /*return*/, appSchema === null || appSchema === void 0 ? void 0 : appSchema.services]; | ||
} | ||
@@ -663,2 +651,62 @@ }); | ||
exports.fetchEnabledServices = fetchEnabledServices; | ||
/** | ||
* Mark a CLI session as active and update the session's heartbeat | ||
* @param {string} authToken The (typically netlify) access token that is used for authentication | ||
* @param {string} appId The app to query against, typically the siteId | ||
* @param {string} sessionId The session id to mark as active / update heartbeat | ||
* @returns {errors: any[], data: MiniSession} | ||
*/ | ||
var executeMarkCliSessionActiveHeartbeat = function (authToken, appId, sessionId) { return __awaiter(void 0, void 0, void 0, function () { | ||
var result, session; | ||
var _a, _b, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: return [4 /*yield*/, fetchOneGraph({ | ||
accessToken: null, | ||
appId: appId, | ||
query: exports.internalOperationsDoc, | ||
operationName: "MarkCLISessionActiveHeartbeat", | ||
variables: { | ||
nfToken: authToken, | ||
id: sessionId, | ||
}, | ||
})]; | ||
case 1: | ||
result = _d.sent(); | ||
session = (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.oneGraph) === null || _b === void 0 ? void 0 : _b.updateNetlifyCliSession) === null || _c === void 0 ? void 0 : _c.session; | ||
return [2 /*return*/, { errors: result.errors, data: session }]; | ||
} | ||
}); | ||
}); }; | ||
exports.executeMarkCliSessionActiveHeartbeat = executeMarkCliSessionActiveHeartbeat; | ||
/** | ||
* Mark a CLI session as inactive | ||
* @param {string} authToken The (typically netlify) access token that is used for authentication | ||
* @param {string} appId The app to query against, typically the siteId | ||
* @param {string} sessionId The session id to mark as inactive | ||
* @returns {errors: any[], data: MiniSession} | ||
*/ | ||
var executeMarkCliSessionInactive = function (authToken, appId, sessionId) { return __awaiter(void 0, void 0, void 0, function () { | ||
var result, session; | ||
var _a, _b, _c; | ||
return __generator(this, function (_d) { | ||
switch (_d.label) { | ||
case 0: return [4 /*yield*/, fetchOneGraph({ | ||
accessToken: null, | ||
appId: appId, | ||
query: exports.internalOperationsDoc, | ||
operationName: "MarkCLISessionInactive", | ||
variables: { | ||
nfToken: authToken, | ||
id: sessionId, | ||
}, | ||
})]; | ||
case 1: | ||
result = _d.sent(); | ||
session = (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.oneGraph) === null || _b === void 0 ? void 0 : _b.updateNetlifyCliSession) === null || _c === void 0 ? void 0 : _c.session; | ||
return [2 /*return*/, { errors: result.errors, data: session }]; | ||
} | ||
}); | ||
}); }; | ||
exports.executeMarkCliSessionInactive = executeMarkCliSessionInactive; | ||
//# sourceMappingURL=oneGraphClient.js.map |
{ | ||
"name": "netlify-onegraph-internal", | ||
"version": "0.0.42", | ||
"version": "0.0.43", | ||
"description": "Internal tools for use by Netlify", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
360570
4679