@foxtware/mineral 0.1.16 → 0.1.18
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/.creds.yml.sample +16 -7
- package/AGENTS.md +3 -0
- package/_build_scripts/publish.js +15 -1
- package/api/backblaze/backblaze.constants.js +11 -0
- package/api/backblaze/backblaze.utils.js +322 -0
- package/api/backblaze/backblazeBucketsGet.js +68 -0
- package/api/backblaze/backblazeFileDelete.js +62 -0
- package/api/backblaze/backblazeFileHide.js +62 -0
- package/api/backblaze/backblazeFileUpload.js +142 -0
- package/api/backblaze/backblazeFilesGet.js +85 -0
- package/api/backblaze/backblazeGet.js +139 -0
- package/api/backblaze/docs.md +6 -0
- package/api/etsy/etsyListingInventoryUpdate.js +11 -11
- package/api/etsy/etsyListingUpdate.js +1 -1
- package/api/gorgias/gorgias.constants.js +8 -0
- package/api/gorgias/gorgias.utils.js +46 -0
- package/api/gorgias/gorgiasAccountGet.js +51 -0
- package/api/gorgias/gorgiasCustomerGet.js +70 -0
- package/api/gorgias/gorgiasCustomersGet.js +56 -0
- package/api/gorgias/gorgiasGet.js +150 -0
- package/api/gorgias/gorgiasGetSingle.js +26 -0
- package/api/gorgias/gorgiasMessagesGet.js +56 -0
- package/api/gorgias/gorgiasTagsGet.js +52 -0
- package/api/gorgias/gorgiasTicketCreate.js +66 -0
- package/api/gorgias/gorgiasTicketGet.js +70 -0
- package/api/gorgias/gorgiasTicketMessageCreate.js +65 -0
- package/api/gorgias/gorgiasTicketMessagesGet.js +66 -0
- package/api/gorgias/gorgiasTicketUpdate.js +62 -0
- package/api/gorgias/gorgiasTicketsGet.js +58 -0
- package/api/gorgias/gorgiasUsersGet.js +52 -0
- package/api/gorgias/gorgiasViewItemsGet.js +57 -0
- package/api/gorgias/gorgiasViewsGet.js +72 -0
- package/api/linear/docs.md +6 -0
- package/api/linear/linear.constants.js +3 -0
- package/api/linear/linear.utils.js +59 -0
- package/api/linear/linearAttachmentCreate.js +77 -0
- package/api/linear/linearAttachmentDelete.js +68 -0
- package/api/linear/linearCommentCreate.js +77 -0
- package/api/linear/linearCommentDelete.js +68 -0
- package/api/linear/linearCommentGet.js +77 -0
- package/api/linear/linearCommentUpdate.js +87 -0
- package/api/linear/linearCommentsGet.js +70 -0
- package/api/linear/linearCyclesGet.js +67 -0
- package/api/linear/linearGet.js +218 -0
- package/api/linear/linearIssueAddLabel.js +77 -0
- package/api/linear/linearIssueArchive.js +74 -0
- package/api/linear/linearIssueCreate.js +94 -0
- package/api/linear/linearIssueDelete.js +74 -0
- package/api/linear/linearIssueGet.js +87 -0
- package/api/linear/linearIssueLabelCreate.js +81 -0
- package/api/linear/linearIssueLabelsGet.js +66 -0
- package/api/linear/linearIssueRemoveLabel.js +77 -0
- package/api/linear/linearIssueUpdate.js +96 -0
- package/api/linear/linearIssuesGet.js +39 -63
- package/api/linear/linearOrganizationGet.js +64 -0
- package/api/linear/linearProjectCreate.js +92 -0
- package/api/linear/linearProjectGet.js +74 -0
- package/api/linear/linearProjectUpdate.js +80 -0
- package/api/linear/linearProjectsGet.js +71 -0
- package/api/linear/linearTeamGet.js +71 -0
- package/api/linear/linearTeamsGet.js +66 -0
- package/api/linear/linearUserGet.js +72 -0
- package/api/linear/linearUsersGet.js +71 -0
- package/api/linear/linearViewerGet.js +65 -0
- package/api/linear/linearWebhookCreate.js +77 -0
- package/api/linear/linearWebhookDelete.js +68 -0
- package/api/linear/linearWebhooksGet.js +67 -0
- package/api/linear/linearWorkflowStatesGet.js +73 -0
- package/api/pipe17/pipe17.utils.js +7 -20
- package/api/pipe17/pipe17ArrivalGet.js +1 -1
- package/api/pipe17/pipe17FulfillmentGet.js +1 -1
- package/api/pipe17/pipe17InventoryItemGet.js +1 -1
- package/api/pipe17/pipe17JobGet.js +11 -24
- package/api/pipe17/pipe17LocationGet.js +1 -1
- package/api/pipe17/pipe17OrderGet.js +1 -1
- package/api/pipe17/pipe17ProductGet.js +1 -1
- package/api/pipe17/pipe17PurchaseGet.js +1 -1
- package/api/pipe17/pipe17ReceiptGet.js +1 -1
- package/api/pipe17/pipe17ReturnGet.js +1 -1
- package/api/shopify/shopifyFileCreate.js +107 -0
- package/api/shopify/shopifyMetafieldDefinitionCreate.js +2 -0
- package/api/shopify/shopifyMetafieldDefinitionGet.js +108 -0
- package/api/shopify/shopifyMetafieldDefinitionPropagate.js +167 -0
- package/api/shopify/shopifyThemeFileGet.js +112 -0
- package/api/shopify/shopifyThemeFilePropagate.js +410 -0
- package/api/shopify/shopifyThemeFilesUpsert.js +88 -0
- package/api/starshipit/starshipit.utils.js +1 -0
- package/api/starshipit/starshipitOrderGet.js +2 -10
- package/api/utils.js +12 -4
- package/hosting/deployFromHostingYml.js +2 -2
- package/hosting/execCommand.js +19 -2
- package/package.json +1 -1
- package/server.utils.js +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// https://linear.app/developers/graphql
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { linearClient } = require('../linear/linear.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['id'],
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
const linearIssueDelete = async (
|
|
13
|
+
credsPayload,
|
|
14
|
+
id,
|
|
15
|
+
{
|
|
16
|
+
permanentlyDelete,
|
|
17
|
+
inspect = false,
|
|
18
|
+
fetchClient = linearClient,
|
|
19
|
+
} = {},
|
|
20
|
+
) => {
|
|
21
|
+
|
|
22
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
23
|
+
credsPayload,
|
|
24
|
+
id,
|
|
25
|
+
});
|
|
26
|
+
if (rejectResponse) {
|
|
27
|
+
return rejectResponse;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return fetchClient.fetch({
|
|
31
|
+
requestPayload: {
|
|
32
|
+
body: {
|
|
33
|
+
query: `
|
|
34
|
+
mutation IssueDelete($id: String!, $permanentlyDelete: Boolean) {
|
|
35
|
+
issueDelete(id: $id, permanentlyDelete: $permanentlyDelete) {
|
|
36
|
+
success
|
|
37
|
+
entity {
|
|
38
|
+
id
|
|
39
|
+
identifier
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`,
|
|
44
|
+
variables: {
|
|
45
|
+
id,
|
|
46
|
+
permanentlyDelete,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
context: {
|
|
51
|
+
credsPayload,
|
|
52
|
+
resultPath: 'data.issueDelete',
|
|
53
|
+
},
|
|
54
|
+
inspect,
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const funcApiConfig = {
|
|
59
|
+
argsWarden,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
module.exports = {
|
|
63
|
+
linearIssueDelete,
|
|
64
|
+
funcApiConfig,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/*
|
|
68
|
+
curl -X POST "http://localhost:8000/linearIssueDelete" \
|
|
69
|
+
-H "Content-Type: application/json" \
|
|
70
|
+
-d '{
|
|
71
|
+
"credsPayload": { "credsPath": "linear" },
|
|
72
|
+
"id": "WHI-267"
|
|
73
|
+
}'
|
|
74
|
+
*/
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// https://linear.app/developers/graphql
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { linearClient } = require('../linear/linear.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['id'],
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
const linearIssueGet = async (
|
|
13
|
+
credsPayload,
|
|
14
|
+
id,
|
|
15
|
+
{
|
|
16
|
+
inspect = false,
|
|
17
|
+
fetchClient = linearClient,
|
|
18
|
+
} = {},
|
|
19
|
+
) => {
|
|
20
|
+
|
|
21
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
22
|
+
credsPayload,
|
|
23
|
+
id,
|
|
24
|
+
});
|
|
25
|
+
if (rejectResponse) {
|
|
26
|
+
return rejectResponse;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return fetchClient.fetch({
|
|
30
|
+
requestPayload: {
|
|
31
|
+
body: {
|
|
32
|
+
query: `
|
|
33
|
+
query IssueGet($id: String!) {
|
|
34
|
+
issue(id: $id) {
|
|
35
|
+
id
|
|
36
|
+
identifier
|
|
37
|
+
title
|
|
38
|
+
description
|
|
39
|
+
url
|
|
40
|
+
priority
|
|
41
|
+
createdAt
|
|
42
|
+
updatedAt
|
|
43
|
+
state {
|
|
44
|
+
id
|
|
45
|
+
name
|
|
46
|
+
}
|
|
47
|
+
team {
|
|
48
|
+
id
|
|
49
|
+
name
|
|
50
|
+
}
|
|
51
|
+
assignee {
|
|
52
|
+
id
|
|
53
|
+
name
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`,
|
|
58
|
+
variables: {
|
|
59
|
+
id,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
context: {
|
|
64
|
+
credsPayload,
|
|
65
|
+
resultPath: 'data.issue',
|
|
66
|
+
},
|
|
67
|
+
inspect,
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const funcApiConfig = {
|
|
72
|
+
argsWarden,
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
module.exports = {
|
|
76
|
+
linearIssueGet,
|
|
77
|
+
funcApiConfig,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/*
|
|
81
|
+
curl -X POST "http://localhost:8000/linearIssueGet" \
|
|
82
|
+
-H "Content-Type: application/json" \
|
|
83
|
+
-d '{
|
|
84
|
+
"credsPayload": { "credsPath": "linear" },
|
|
85
|
+
"id": "WHI-267"
|
|
86
|
+
}'
|
|
87
|
+
*/
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// https://linear.app/developers/graphql
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { linearClient } = require('../linear/linear.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['input', valueProvided],
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
const linearIssueLabelCreate = async (
|
|
13
|
+
credsPayload,
|
|
14
|
+
input,
|
|
15
|
+
{
|
|
16
|
+
replaceTeamLabels,
|
|
17
|
+
inspect = false,
|
|
18
|
+
fetchClient = linearClient,
|
|
19
|
+
} = {},
|
|
20
|
+
) => {
|
|
21
|
+
|
|
22
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
23
|
+
credsPayload,
|
|
24
|
+
input,
|
|
25
|
+
});
|
|
26
|
+
if (rejectResponse) {
|
|
27
|
+
return rejectResponse;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return fetchClient.fetch({
|
|
31
|
+
requestPayload: {
|
|
32
|
+
body: {
|
|
33
|
+
query: `
|
|
34
|
+
mutation IssueLabelCreate(
|
|
35
|
+
$input: IssueLabelCreateInput!
|
|
36
|
+
$replaceTeamLabels: Boolean
|
|
37
|
+
) {
|
|
38
|
+
issueLabelCreate(input: $input, replaceTeamLabels: $replaceTeamLabels) {
|
|
39
|
+
success
|
|
40
|
+
issueLabel {
|
|
41
|
+
id
|
|
42
|
+
name
|
|
43
|
+
color
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
`,
|
|
48
|
+
variables: {
|
|
49
|
+
input,
|
|
50
|
+
replaceTeamLabels,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
context: {
|
|
55
|
+
credsPayload,
|
|
56
|
+
resultPath: 'data.issueLabelCreate',
|
|
57
|
+
},
|
|
58
|
+
inspect,
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const funcApiConfig = {
|
|
63
|
+
argsWarden,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
module.exports = {
|
|
67
|
+
linearIssueLabelCreate,
|
|
68
|
+
funcApiConfig,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/*
|
|
72
|
+
curl -X POST "http://localhost:8000/linearIssueLabelCreate" \
|
|
73
|
+
-H "Content-Type: application/json" \
|
|
74
|
+
-d '{
|
|
75
|
+
"credsPayload": { "credsPath": "linear" },
|
|
76
|
+
"input": {
|
|
77
|
+
"name": "bug",
|
|
78
|
+
"teamId": "f2387dcd-61ac-49aa-8d7a-7f62a0b5cca0"
|
|
79
|
+
}
|
|
80
|
+
}'
|
|
81
|
+
*/
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// https://linear.app/developers/graphql
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { linearGet, linearGetter } = require('./linearGet');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const linearIssueLabelsGet = async (
|
|
12
|
+
returnGetter,
|
|
13
|
+
|
|
14
|
+
credsPayload,
|
|
15
|
+
{
|
|
16
|
+
attrs = `
|
|
17
|
+
id
|
|
18
|
+
name
|
|
19
|
+
color
|
|
20
|
+
description
|
|
21
|
+
`,
|
|
22
|
+
...getterOptions
|
|
23
|
+
} = {},
|
|
24
|
+
) => {
|
|
25
|
+
|
|
26
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
27
|
+
credsPayload,
|
|
28
|
+
});
|
|
29
|
+
if (rejectResponse) {
|
|
30
|
+
return rejectResponse;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const getterArgs = [
|
|
34
|
+
credsPayload,
|
|
35
|
+
'issueLabel',
|
|
36
|
+
{
|
|
37
|
+
attrs,
|
|
38
|
+
...getterOptions,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
return returnGetter
|
|
43
|
+
? linearGetter(...getterArgs)
|
|
44
|
+
: linearGet(...getterArgs);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const funcApiConfig = {
|
|
48
|
+
argsWarden,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
module.exports = {
|
|
52
|
+
linearIssueLabelsGet: linearIssueLabelsGet.bind(null, false),
|
|
53
|
+
linearIssueLabelsGetter: linearIssueLabelsGet.bind(null, true),
|
|
54
|
+
funcApiConfig,
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
curl -X POST "http://localhost:8000/linearIssueLabelsGet" \
|
|
59
|
+
-H "Content-Type: application/json" \
|
|
60
|
+
-d '{
|
|
61
|
+
"credsPayload": { "credsPath": "linear" },
|
|
62
|
+
"options": {
|
|
63
|
+
"limit": 20
|
|
64
|
+
}
|
|
65
|
+
}'
|
|
66
|
+
*/
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// https://linear.app/developers/graphql
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { linearClient } = require('../linear/linear.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['id'],
|
|
10
|
+
['labelId'],
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const linearIssueRemoveLabel = async (
|
|
14
|
+
credsPayload,
|
|
15
|
+
id,
|
|
16
|
+
labelId,
|
|
17
|
+
{
|
|
18
|
+
inspect = false,
|
|
19
|
+
fetchClient = linearClient,
|
|
20
|
+
} = {},
|
|
21
|
+
) => {
|
|
22
|
+
|
|
23
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
24
|
+
credsPayload,
|
|
25
|
+
id,
|
|
26
|
+
labelId,
|
|
27
|
+
});
|
|
28
|
+
if (rejectResponse) {
|
|
29
|
+
return rejectResponse;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return fetchClient.fetch({
|
|
33
|
+
requestPayload: {
|
|
34
|
+
body: {
|
|
35
|
+
query: `
|
|
36
|
+
mutation IssueRemoveLabel($id: String!, $labelId: String!) {
|
|
37
|
+
issueRemoveLabel(id: $id, labelId: $labelId) {
|
|
38
|
+
success
|
|
39
|
+
issue {
|
|
40
|
+
id
|
|
41
|
+
identifier
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
variables: {
|
|
47
|
+
id,
|
|
48
|
+
labelId,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
context: {
|
|
53
|
+
credsPayload,
|
|
54
|
+
resultPath: 'data.issueRemoveLabel',
|
|
55
|
+
},
|
|
56
|
+
inspect,
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const funcApiConfig = {
|
|
61
|
+
argsWarden,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
module.exports = {
|
|
65
|
+
linearIssueRemoveLabel,
|
|
66
|
+
funcApiConfig,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
curl -X POST "http://localhost:8000/linearIssueRemoveLabel" \
|
|
71
|
+
-H "Content-Type: application/json" \
|
|
72
|
+
-d '{
|
|
73
|
+
"credsPayload": { "credsPath": "linear" },
|
|
74
|
+
"id": "WHI-267",
|
|
75
|
+
"labelId": "LABEL_ID"
|
|
76
|
+
}'
|
|
77
|
+
*/
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// https://linear.app/developers/graphql
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden, valueProvided } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { linearClient } = require('../linear/linear.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
['id'],
|
|
10
|
+
['input', valueProvided],
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const linearIssueUpdate = async (
|
|
14
|
+
credsPayload,
|
|
15
|
+
id,
|
|
16
|
+
input,
|
|
17
|
+
{
|
|
18
|
+
inspect = false,
|
|
19
|
+
fetchClient = linearClient,
|
|
20
|
+
} = {},
|
|
21
|
+
) => {
|
|
22
|
+
|
|
23
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
24
|
+
credsPayload,
|
|
25
|
+
id,
|
|
26
|
+
input,
|
|
27
|
+
});
|
|
28
|
+
if (rejectResponse) {
|
|
29
|
+
return rejectResponse;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return fetchClient.fetch({
|
|
33
|
+
requestPayload: {
|
|
34
|
+
body: {
|
|
35
|
+
query: `
|
|
36
|
+
mutation IssueUpdate($id: String!, $input: IssueUpdateInput!) {
|
|
37
|
+
issueUpdate(id: $id, input: $input) {
|
|
38
|
+
success
|
|
39
|
+
issue {
|
|
40
|
+
id
|
|
41
|
+
identifier
|
|
42
|
+
title
|
|
43
|
+
url
|
|
44
|
+
priority
|
|
45
|
+
createdAt
|
|
46
|
+
updatedAt
|
|
47
|
+
state {
|
|
48
|
+
id
|
|
49
|
+
name
|
|
50
|
+
}
|
|
51
|
+
team {
|
|
52
|
+
id
|
|
53
|
+
name
|
|
54
|
+
}
|
|
55
|
+
assignee {
|
|
56
|
+
id
|
|
57
|
+
name
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
variables: {
|
|
64
|
+
id,
|
|
65
|
+
input,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
context: {
|
|
70
|
+
credsPayload,
|
|
71
|
+
resultPath: 'data.issueUpdate',
|
|
72
|
+
},
|
|
73
|
+
inspect,
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const funcApiConfig = {
|
|
78
|
+
argsWarden,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
module.exports = {
|
|
82
|
+
linearIssueUpdate,
|
|
83
|
+
funcApiConfig,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
curl -X POST "http://localhost:8000/linearIssueUpdate" \
|
|
88
|
+
-H "Content-Type: application/json" \
|
|
89
|
+
-d '{
|
|
90
|
+
"credsPayload": { "credsPath": "linear" },
|
|
91
|
+
"id": "WHI-267",
|
|
92
|
+
"input": {
|
|
93
|
+
"title": "Updated title"
|
|
94
|
+
}
|
|
95
|
+
}'
|
|
96
|
+
*/
|
|
@@ -2,18 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
const { ArgsWarden } = require('../utils');
|
|
4
4
|
const { credsValidator } = require('../validators');
|
|
5
|
-
const {
|
|
5
|
+
const { linearGet, linearGetter } = require('./linearGet');
|
|
6
6
|
|
|
7
7
|
const argsWarden = new ArgsWarden([
|
|
8
8
|
['credsPayload', credsValidator],
|
|
9
9
|
]);
|
|
10
10
|
|
|
11
11
|
const linearIssuesGet = async (
|
|
12
|
+
returnGetter,
|
|
13
|
+
|
|
12
14
|
credsPayload,
|
|
13
15
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
attrs = `
|
|
17
|
+
id
|
|
18
|
+
identifier
|
|
19
|
+
title
|
|
20
|
+
priority
|
|
21
|
+
createdAt
|
|
22
|
+
updatedAt
|
|
23
|
+
state {
|
|
24
|
+
id
|
|
25
|
+
name
|
|
26
|
+
}
|
|
27
|
+
team {
|
|
28
|
+
id
|
|
29
|
+
name
|
|
30
|
+
}
|
|
31
|
+
assignee {
|
|
32
|
+
id
|
|
33
|
+
name
|
|
34
|
+
}
|
|
35
|
+
`,
|
|
36
|
+
sortType = true,
|
|
37
|
+
...getterOptions
|
|
17
38
|
} = {},
|
|
18
39
|
) => {
|
|
19
40
|
|
|
@@ -24,59 +45,19 @@ const linearIssuesGet = async (
|
|
|
24
45
|
return rejectResponse;
|
|
25
46
|
}
|
|
26
47
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
query: `
|
|
35
|
-
query IssuesGet($first: Int!, $filter: IssueFilter) {
|
|
36
|
-
issues(first: $first, filter: $filter) {
|
|
37
|
-
nodes {
|
|
38
|
-
id
|
|
39
|
-
identifier
|
|
40
|
-
title
|
|
41
|
-
priority
|
|
42
|
-
createdAt
|
|
43
|
-
updatedAt
|
|
44
|
-
state {
|
|
45
|
-
id
|
|
46
|
-
name
|
|
47
|
-
}
|
|
48
|
-
team {
|
|
49
|
-
id
|
|
50
|
-
name
|
|
51
|
-
}
|
|
52
|
-
assignee {
|
|
53
|
-
id
|
|
54
|
-
name
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`,
|
|
60
|
-
variables: {
|
|
61
|
-
first,
|
|
62
|
-
...(filter && { filter }),
|
|
63
|
-
},
|
|
64
|
-
},
|
|
48
|
+
const getterArgs = [
|
|
49
|
+
credsPayload,
|
|
50
|
+
'issue',
|
|
51
|
+
{
|
|
52
|
+
attrs,
|
|
53
|
+
sortType,
|
|
54
|
+
...getterOptions,
|
|
65
55
|
},
|
|
66
|
-
|
|
67
|
-
inspect,
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
if (!response.ok) {
|
|
71
|
-
return response;
|
|
72
|
-
}
|
|
56
|
+
];
|
|
73
57
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
ok: true,
|
|
78
|
-
data: issues,
|
|
79
|
-
};
|
|
58
|
+
return returnGetter
|
|
59
|
+
? linearGetter(...getterArgs)
|
|
60
|
+
: linearGet(...getterArgs);
|
|
80
61
|
};
|
|
81
62
|
|
|
82
63
|
const funcApiConfig = {
|
|
@@ -84,23 +65,18 @@ const funcApiConfig = {
|
|
|
84
65
|
};
|
|
85
66
|
|
|
86
67
|
module.exports = {
|
|
87
|
-
linearIssuesGet,
|
|
68
|
+
linearIssuesGet: linearIssuesGet.bind(null, false),
|
|
69
|
+
linearIssuesGetter: linearIssuesGet.bind(null, true),
|
|
88
70
|
funcApiConfig,
|
|
89
71
|
};
|
|
90
72
|
|
|
91
73
|
/*
|
|
92
|
-
curl -X POST "http://localhost:8000/linearIssuesGet" \
|
|
93
|
-
-H "Content-Type: application/json" \
|
|
94
|
-
-d '{
|
|
95
|
-
"credsPayload": { "credsPath": "linear" }
|
|
96
|
-
}'
|
|
97
|
-
|
|
98
74
|
curl -X POST "http://localhost:8000/linearIssuesGet" \
|
|
99
75
|
-H "Content-Type: application/json" \
|
|
100
76
|
-d '{
|
|
101
77
|
"credsPayload": { "credsPath": "linear" },
|
|
102
78
|
"options": {
|
|
103
|
-
"
|
|
79
|
+
"limit": 5
|
|
104
80
|
}
|
|
105
81
|
}'
|
|
106
82
|
*/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// https://linear.app/developers/graphql
|
|
2
|
+
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
|
+
const { credsValidator } = require('../validators');
|
|
5
|
+
const { linearClient } = require('../linear/linear.utils');
|
|
6
|
+
|
|
7
|
+
const argsWarden = new ArgsWarden([
|
|
8
|
+
['credsPayload', credsValidator],
|
|
9
|
+
]);
|
|
10
|
+
|
|
11
|
+
const linearOrganizationGet = async (
|
|
12
|
+
credsPayload,
|
|
13
|
+
{
|
|
14
|
+
inspect = false,
|
|
15
|
+
fetchClient = linearClient,
|
|
16
|
+
} = {},
|
|
17
|
+
) => {
|
|
18
|
+
|
|
19
|
+
const rejectResponse = await argsWarden.responseIfRejectingArgs({
|
|
20
|
+
credsPayload,
|
|
21
|
+
});
|
|
22
|
+
if (rejectResponse) {
|
|
23
|
+
return rejectResponse;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return fetchClient.fetch({
|
|
27
|
+
requestPayload: {
|
|
28
|
+
body: {
|
|
29
|
+
query: `
|
|
30
|
+
query OrganizationGet {
|
|
31
|
+
organization {
|
|
32
|
+
id
|
|
33
|
+
name
|
|
34
|
+
urlKey
|
|
35
|
+
createdAt
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
context: {
|
|
42
|
+
credsPayload,
|
|
43
|
+
resultPath: 'data.organization',
|
|
44
|
+
},
|
|
45
|
+
inspect,
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const funcApiConfig = {
|
|
50
|
+
argsWarden,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
module.exports = {
|
|
54
|
+
linearOrganizationGet,
|
|
55
|
+
funcApiConfig,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
curl -X POST "http://localhost:8000/linearOrganizationGet" \
|
|
60
|
+
-H "Content-Type: application/json" \
|
|
61
|
+
-d '{
|
|
62
|
+
"credsPayload": { "credsPath": "linear" }
|
|
63
|
+
}'
|
|
64
|
+
*/
|