@foxtware/mineral 0.1.8 → 0.1.10
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 +43 -1
- package/AGENTS.md +6 -1
- package/README.md +1 -1
- package/api/bleckmann/.gitkeep +0 -0
- package/api/bleckmann/bleckmann.constants.js +8 -0
- package/api/bleckmann/bleckmann.utils.js +32 -0
- package/api/bleckmann/bleckmannAsnGet.js +52 -0
- package/api/bleckmann/bleckmannAsnsGet.js +65 -0
- package/api/constants.js +2 -1
- package/api/github/github.constants.js +11 -0
- package/api/github/github.utils.js +65 -0
- package/api/github/githubGet.js +144 -0
- package/api/github/githubIssueCreate.js +71 -0
- package/api/github/githubIssueGet.js +65 -0
- package/api/github/githubIssueUpdate.js +71 -0
- package/api/github/githubIssuesGet.js +74 -0
- package/api/github/githubPullRequestCreate.js +74 -0
- package/api/github/githubPullRequestGet.js +65 -0
- package/api/github/githubPullRequestMerge.js +77 -0
- package/api/github/githubPullRequestUpdate.js +72 -0
- package/api/github/githubPullRequestsGet.js +74 -0
- package/api/github/githubRepoCreate.js +80 -0
- package/api/github/githubRepoDelete.js +60 -0
- package/api/github/githubRepoGet.js +61 -0
- package/api/github/githubRepoUpdate.js +68 -0
- package/api/github/githubReposGet.js +69 -0
- package/api/github/githubUserGet.js +64 -0
- package/api/linear/linear.utils.js +9 -14
- package/api/linear/linearIssuesGet.js +9 -9
- package/api/logiwa/logiwa.utils.js +27 -25
- package/api/logiwa/logiwaInventoriesGet.js +5 -3
- package/api/logiwa/logiwaOrderGet.js +4 -2
- package/api/logiwa/logiwaOrdersGet.js +5 -3
- package/api/logiwa/logiwaProductGet.js +4 -2
- package/api/logiwa/logiwaProductsGet.js +5 -3
- package/api/logiwa/logiwaReportGetAvailableToPromise.js +5 -3
- package/api/logiwa/logiwaReportGetInventoryCalculation.js +5 -3
- package/api/logiwa/logiwaReportGetInventorySnapshot.js +5 -3
- package/api/logiwa/logiwaReportGetTotalInventory.js +5 -3
- package/api/logiwa/logiwaWebhookStatusGet.js +4 -2
- package/api/logiwa/logiwaWebhookSubscribe.js +8 -6
- package/api/logiwa/logiwaWebhookUnsubscribe.js +4 -2
- package/api/logiwa/logiwaWebhooksGet.js +4 -2
- package/api/loop/loop.constants.js +7 -0
- package/api/loop/loop.utils.js +37 -0
- package/api/loop/loopAllowlistItemsGet.js +42 -0
- package/api/loop/loopBlocklistItemsGet.js +46 -0
- package/api/loop/loopDestinationsGet.js +42 -0
- package/api/loop/loopGet.js +139 -0
- package/api/loop/loopReturnGet.js +73 -0
- package/api/loop/loopReturnsGet.js +46 -0
- package/api/peoplevox/peoplevox.constants.js +1 -1
- package/api/peoplevox/peoplevox.sessions.js +54 -0
- package/api/peoplevox/peoplevox.utils.js +67 -31
- package/api/peoplevox/peoplevoxGetSingle.js +7 -5
- package/api/peoplevox/peoplevoxOrderEdit.js +7 -5
- package/api/peoplevox/peoplevoxReportGet.js +11 -9
- package/api/pipelineSteps.js +49 -0
- package/api/shopify/shopify.utils.js +18 -24
- package/api/shopify/shopifyBulkMutationDo.js +211 -0
- package/api/shopify/shopifyBulkOperationGet.js +86 -0
- package/api/shopify/shopifyBulkOperationRunMutation.js +83 -0
- package/api/shopify/shopifyCheckoutAndAccountsConfigurationUpdate.js +79 -0
- package/api/shopify/shopifyCollectionGet.js +7 -7
- package/api/shopify/shopifyCustomerGet.js +6 -6
- package/api/shopify/shopifyGet.js +18 -13
- package/api/shopify/shopifyGetSingle.js +9 -9
- package/api/shopify/shopifyMutationDo.js +6 -6
- package/api/shopify/shopifyOrdersGet.js +11 -11
- package/api/shopify/shopifyStagedUploadCreate.js +96 -0
- package/api/shopify/shopifyTagsAdd.js +1 -1
- package/api/shopify/shopifyTagsAddBulk.js +90 -0
- package/api/shopify/shopifyTagsRemove.js +1 -1
- package/api/slack/slack.utils.js +10 -19
- package/api/slack/slackMessagePost.js +11 -11
- package/api/starshipit/starshipit.constants.js +8 -0
- package/api/starshipit/starshipit.utils.js +71 -0
- package/api/starshipit/starshipitAddressCreate.js +77 -0
- package/api/starshipit/starshipitAddressDelete.js +55 -0
- package/api/starshipit/starshipitAddressUpdate.js +69 -0
- package/api/starshipit/starshipitAddressesGet.js +52 -0
- package/api/starshipit/starshipitGet.js +146 -0
- package/api/starshipit/starshipitOrderDelete.js +102 -0
- package/api/starshipit/starshipitOrderGet.js +74 -0
- package/api/starshipit/starshipitOrderUpdate.js +109 -0
- package/api/starshipit/starshipitOrdersListShipped.js +64 -0
- package/api/starshipit/starshipitProductAdd.js +100 -0
- package/api/starshipit/starshipitProductsDelete.js +57 -0
- package/api/starshipit/starshipitProductsGet.js +49 -0
- package/api/starshipit/starshipitTrackingGet.js +69 -0
- package/api/stripe/_example.js +48 -0
- package/api/stripe/stripe.constants.js +5 -0
- package/api/stripe/stripe.utils.js +42 -0
- package/api/stripe/stripeCardCharge.js +98 -0
- package/api/stripe/stripeCardTokenCreate.js +70 -0
- package/api/stripe/stripeChargeCapture.js +63 -0
- package/api/stripe/stripeChargeCreate.js +70 -0
- package/api/stripe/stripeChargeGet.js +51 -0
- package/api/stripe/stripeChargesGet.js +52 -0
- package/api/stripe/stripeRefundCreate.js +64 -0
- package/api/stripe/stripeRefundGet.js +51 -0
- package/api/stripe/stripeRefundsGet.js +52 -0
- package/api/stripe/stripeTokenGet.js +51 -0
- package/api/stylearcade/stylearcade.constants.js +5 -0
- package/api/stylearcade/stylearcade.utils.js +40 -0
- package/api/stylearcade/stylearcadeDataGet.js +62 -0
- package/api/stylearcade/stylearcadeGet.js +133 -0
- package/api/stylearcade/stylearcadeMetadataGet.js +47 -0
- package/api/supabase/supabase.utils.js +52 -0
- package/api/supabase/supabaseRowDelete.js +95 -0
- package/api/supabase/supabaseRowGet.js +58 -0
- package/api/supabase/supabaseRowInsert.js +56 -0
- package/api/supabase/supabaseRowUpdate.js +58 -0
- package/api/supabase/supabaseRpc.js +61 -0
- package/api/supabase/supabaseTableGet.js +44 -0
- package/api/supabase/supabaseTableGetAll.js +86 -0
- package/api/threeclicks/threeclicks.constants.js +8 -0
- package/api/threeclicks/threeclicks.utils.js +119 -0
- package/api/threeclicks/threeclicksCollectionsGet.js +40 -0
- package/api/threeclicks/threeclicksGet.js +138 -0
- package/api/threeclicks/threeclicksKeycodeCreate.js +55 -0
- package/api/threeclicks/threeclicksKeycodeGet.js +47 -0
- package/api/threeclicks/threeclicksPurchaseOrderCreate.js +34 -0
- package/api/threeclicks/threeclicksPurchaseOrderCreateBulk.js +34 -0
- package/api/threeclicks/threeclicksPurchaseOrderGet.js +33 -0
- package/api/threeclicks/threeclicksPurchaseOrderQuantitiesGet.js +33 -0
- package/api/threeclicks/threeclicksPurchaseOrderQuantityCreate.js +34 -0
- package/api/threeclicks/threeclicksPurchaseOrderQuantityCreateBulk.js +34 -0
- package/api/threeclicks/threeclicksPurchaseOrderQuantityUpdate.js +46 -0
- package/api/threeclicks/threeclicksPurchaseOrderQuantityUpdateBulk.js +46 -0
- package/api/threeclicks/threeclicksPurchaseOrderUpdate.js +35 -0
- package/api/threeclicks/threeclicksPurchaseOrdersGet.js +30 -0
- package/api/threeclicks/threeclicksShipmentCreate.js +34 -0
- package/api/threeclicks/threeclicksShipmentGet.js +33 -0
- package/api/threeclicks/threeclicksShipmentOrderAdd.js +38 -0
- package/api/threeclicks/threeclicksShipmentOrderQuantityCreate.js +35 -0
- package/api/threeclicks/threeclicksShipmentQuantityUpdate.js +35 -0
- package/api/threeclicks/threeclicksShipmentStatusUpdate.js +45 -0
- package/api/threeclicks/threeclicksShipmentsGet.js +52 -0
- package/api/threeclicks/threeclicksSignatureCalculate.js +73 -0
- package/api/threeclicks/threeclicksStyleCodesGet.js +46 -0
- package/api/threeclicks/threeclicksStyleColourCreate.js +47 -0
- package/api/threeclicks/threeclicksStyleColourDelete.js +34 -0
- package/api/threeclicks/threeclicksStyleCreate.js +44 -0
- package/api/threeclicks/threeclicksStyleDelete.js +33 -0
- package/api/threeclicks/threeclicksStyleGet.js +43 -0
- package/api/threeclicks/threeclicksStylePriceUpdate.js +70 -0
- package/api/threeclicks/threeclicksStyleUpdate.js +47 -0
- package/api/threeclicks/threeclicksStylesGet.js +45 -0
- package/api/upstash/upstash.utils.js +36 -0
- package/api/upstash/upstashDel.js +46 -0
- package/api/upstash/upstashExists.js +46 -0
- package/api/upstash/upstashGet.js +46 -0
- package/api/upstash/upstashSet.js +64 -0
- package/api/utils.js +90 -76
- package/api/validators.js +1 -1
- package/api/workable/workable.constants.js +3 -0
- package/api/workable/workable.utils.js +41 -0
- package/api/workable/workableGet.js +151 -0
- package/api/workable/workableJobCandidateCreate.js +87 -0
- package/api/workable/workableJobGet.js +52 -0
- package/api/workable/workableJobMembersGet.js +52 -0
- package/api/workable/workableJobStagesGet.js +52 -0
- package/api/workable/workableJobsGet.js +78 -0
- package/api/yotpo/yotpo.utils.js +17 -22
- package/api/yotpo/yotpoCampaignsGet.js +6 -6
- package/api/yotpo/yotpoCustomerActionRecord.js +7 -7
- package/api/yotpo/yotpoCustomerAnniversaryGet.js +7 -7
- package/api/yotpo/yotpoCustomerAnniversarySet.js +7 -7
- package/api/yotpo/yotpoCustomerBirthdaySet.js +7 -7
- package/api/yotpo/yotpoCustomerGet.js +6 -6
- package/api/yotpo/yotpoCustomerPointsAdjust.js +7 -7
- package/api/yotpo/yotpoCustomerUpsert.js +7 -7
- package/api/yotpo/yotpoCustomersRecentGet.js +6 -6
- package/api/yotpo/yotpoRedemptionCreate.js +7 -7
- package/api/yotpo/yotpoRedemptionOptionsGet.js +6 -6
- package/api/yotpo/yotpoVipTiersGet.js +5 -5
- package/api/youtube/youtube.constants.js +5 -0
- package/api/youtube/youtube.utils.js +77 -0
- package/api/youtube/youtubeChannelVideosGet.js +25 -70
- package/hosting/.hosting.yml.sample +9 -11
- package/hosting/copyCredsToEnv.js +58 -2
- package/hosting/deployFromHostingYml.js +9 -2
- package/hosting/hosting.utils.js +3 -2
- package/package.json +3 -1
- package/server.utils.js +1 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// https://developers.google.com/youtube/v3/guides/implementation/videos
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { ArgsWarden } = require('../utils');
|
|
4
4
|
const { credsValidator } = require('../validators');
|
|
5
|
-
|
|
6
|
-
const YOUTUBE_API_BASE = 'https://www.googleapis.com/youtube/v3';
|
|
5
|
+
const { youtubeClient } = require('../youtube/youtube.utils');
|
|
7
6
|
|
|
8
7
|
const parseChannelHandle = (channelHandle) => {
|
|
9
8
|
const trimmed = channelHandle.trim();
|
|
@@ -15,54 +14,6 @@ const parseChannelHandle = (channelHandle) => {
|
|
|
15
14
|
return trimmed;
|
|
16
15
|
};
|
|
17
16
|
|
|
18
|
-
const youtubeClient = new FetchClient({
|
|
19
|
-
requestPreparer: async (requestPayload, context) => {
|
|
20
|
-
const { creds } = context;
|
|
21
|
-
const { API_KEY } = creds;
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
...requestPayload,
|
|
25
|
-
params: {
|
|
26
|
-
key: API_KEY,
|
|
27
|
-
...requestPayload.params,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
responseInterpreter: async (response) => {
|
|
32
|
-
if (!response.ok) {
|
|
33
|
-
const youtubeError = response.error?.details?.error;
|
|
34
|
-
|
|
35
|
-
if (youtubeError) {
|
|
36
|
-
return {
|
|
37
|
-
ok: false,
|
|
38
|
-
error: {
|
|
39
|
-
code: youtubeError.code,
|
|
40
|
-
message: youtubeError.message,
|
|
41
|
-
details: youtubeError,
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return response;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const { data } = response;
|
|
50
|
-
|
|
51
|
-
if (data?.error) {
|
|
52
|
-
return {
|
|
53
|
-
ok: false,
|
|
54
|
-
error: {
|
|
55
|
-
code: data.error.code,
|
|
56
|
-
message: data.error.message,
|
|
57
|
-
details: data.error,
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return response;
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
|
|
66
17
|
const formatVideo = (video) => {
|
|
67
18
|
const {
|
|
68
19
|
id,
|
|
@@ -106,17 +57,17 @@ const youtubeChannelVideosGet = async (
|
|
|
106
57
|
return rejectResponse;
|
|
107
58
|
}
|
|
108
59
|
|
|
109
|
-
const creds = await credsFromPayload(credsPayload);
|
|
110
|
-
const fetchContext = { creds };
|
|
111
60
|
const handle = parseChannelHandle(channelHandle);
|
|
112
61
|
|
|
113
62
|
const channelResponse = await youtubeClient.fetch({
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
63
|
+
requestPayload: {
|
|
64
|
+
url: '/channels',
|
|
65
|
+
params: {
|
|
66
|
+
part: 'contentDetails',
|
|
67
|
+
forHandle: handle,
|
|
68
|
+
},
|
|
118
69
|
},
|
|
119
|
-
context:
|
|
70
|
+
context: { credsPayload },
|
|
120
71
|
inspect,
|
|
121
72
|
});
|
|
122
73
|
|
|
@@ -153,14 +104,16 @@ const youtubeChannelVideosGet = async (
|
|
|
153
104
|
|
|
154
105
|
while (true) {
|
|
155
106
|
const playlistResponse = await youtubeClient.fetch({
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
107
|
+
requestPayload: {
|
|
108
|
+
url: '/playlistItems',
|
|
109
|
+
params: {
|
|
110
|
+
part: 'contentDetails',
|
|
111
|
+
playlistId: uploadsPlaylistId,
|
|
112
|
+
maxResults: 50,
|
|
113
|
+
...(nextPageToken ? { pageToken: nextPageToken } : {}),
|
|
114
|
+
},
|
|
162
115
|
},
|
|
163
|
-
context:
|
|
116
|
+
context: { credsPayload },
|
|
164
117
|
inspect,
|
|
165
118
|
});
|
|
166
119
|
|
|
@@ -202,12 +155,14 @@ const youtubeChannelVideosGet = async (
|
|
|
202
155
|
const batchIds = videoIds.slice(index, index + 50).join(',');
|
|
203
156
|
|
|
204
157
|
const videosResponse = await youtubeClient.fetch({
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
158
|
+
requestPayload: {
|
|
159
|
+
url: '/videos',
|
|
160
|
+
params: {
|
|
161
|
+
part: 'snippet,statistics,contentDetails',
|
|
162
|
+
id: batchIds,
|
|
163
|
+
},
|
|
209
164
|
},
|
|
210
|
-
context:
|
|
165
|
+
context: { credsPayload },
|
|
211
166
|
inspect,
|
|
212
167
|
});
|
|
213
168
|
|
|
@@ -5,19 +5,17 @@ google_cloud_info:
|
|
|
5
5
|
# TODO: consider credsPayload in google_cloud_info instead of workspace .creds.yml
|
|
6
6
|
|
|
7
7
|
functions:
|
|
8
|
-
exampleFunction:
|
|
9
|
-
max_instances: 1
|
|
10
|
-
timeout: 300s
|
|
11
|
-
before_wrappers:
|
|
12
|
-
- allowCrossOriginCallsAndHandleOptions
|
|
13
|
-
- requireHostedApiKey
|
|
14
|
-
# entry_point: otherHandlerName
|
|
15
|
-
|
|
16
8
|
pokemonPokeballThrow:
|
|
9
|
+
entry_point: functionWithDifferentNameIfNeeded
|
|
17
10
|
max_instances: 1
|
|
18
11
|
before_wrappers:
|
|
19
|
-
-
|
|
12
|
+
- checkPokeballInventory
|
|
13
|
+
after_wrappers:
|
|
14
|
+
- rethrowIfNotCaught
|
|
15
|
+
include_creds_paths:
|
|
16
|
+
- nintendo.pokemon
|
|
17
|
+
- platform
|
|
20
18
|
|
|
21
19
|
groups:
|
|
22
|
-
|
|
23
|
-
-
|
|
20
|
+
pokemon:
|
|
21
|
+
- pokemonPokeballThrow
|
|
@@ -1,7 +1,59 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const yaml = require('yaml');
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const getValueAtCredsPath = (creds, pathParts) => {
|
|
5
|
+
let current = creds;
|
|
6
|
+
|
|
7
|
+
for (const pathPart of pathParts) {
|
|
8
|
+
if (current == null || typeof current !== 'object' || !(pathPart in current)) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
current = current[pathPart];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return current;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const setValueAtCredsPath = (target, pathParts, value) => {
|
|
19
|
+
let current = target;
|
|
20
|
+
|
|
21
|
+
for (let index = 0; index < pathParts.length - 1; index++) {
|
|
22
|
+
const pathPart = pathParts[index];
|
|
23
|
+
|
|
24
|
+
if (!(pathPart in current) || typeof current[pathPart] !== 'object' || current[pathPart] === null) {
|
|
25
|
+
current[pathPart] = {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
current = current[pathPart];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
current[pathParts[pathParts.length - 1]] = value;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const filterCredsByPaths = (creds, includeCredsPaths) => {
|
|
35
|
+
const filteredCreds = {};
|
|
36
|
+
|
|
37
|
+
for (const credsPath of includeCredsPaths) {
|
|
38
|
+
if (typeof credsPath !== 'string' || !credsPath.trim()) {
|
|
39
|
+
throw new Error(`Invalid include_creds_paths entry: ${ credsPath }`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const pathParts = credsPath.split('.');
|
|
43
|
+
const value = getValueAtCredsPath(creds, pathParts);
|
|
44
|
+
|
|
45
|
+
if (value === undefined) {
|
|
46
|
+
throw new Error(`Missing creds path "${ credsPath }" in .creds.yml`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
setValueAtCredsPath(filteredCreds, pathParts, value);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return filteredCreds;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const copyCredsToEnv = (workspace, options = {}) => {
|
|
56
|
+
const { includeCredsPaths } = options;
|
|
5
57
|
const normalizedWorkspace = workspace.replace(/\/$/, '');
|
|
6
58
|
const credsPath = `${ normalizedWorkspace }/.creds.yml`;
|
|
7
59
|
const envPath = `${ normalizedWorkspace }/.env`;
|
|
@@ -12,7 +64,10 @@ const copyCredsToEnv = (workspace) => {
|
|
|
12
64
|
|
|
13
65
|
const credsText = fs.readFileSync(credsPath, 'utf8');
|
|
14
66
|
const credsFromYml = yaml.parse(credsText);
|
|
15
|
-
const
|
|
67
|
+
const credsForEnv = includeCredsPaths?.length
|
|
68
|
+
? filterCredsByPaths(credsFromYml, includeCredsPaths)
|
|
69
|
+
: credsFromYml;
|
|
70
|
+
const newCredsLine = `CREDS=${ JSON.stringify(credsForEnv) }`;
|
|
16
71
|
|
|
17
72
|
let envFileContents = '';
|
|
18
73
|
if (fs.existsSync(envPath)) {
|
|
@@ -45,4 +100,5 @@ if (require.main === module) {
|
|
|
45
100
|
|
|
46
101
|
module.exports = {
|
|
47
102
|
copyCredsToEnv,
|
|
103
|
+
filterCredsByPaths,
|
|
48
104
|
};
|
|
@@ -109,6 +109,7 @@ const deployFunction = async ({
|
|
|
109
109
|
groups,
|
|
110
110
|
before_wrappers,
|
|
111
111
|
after_wrappers,
|
|
112
|
+
include_creds_paths,
|
|
112
113
|
source,
|
|
113
114
|
env,
|
|
114
115
|
...gcloudArgs
|
|
@@ -197,7 +198,6 @@ const deployFunction = async ({
|
|
|
197
198
|
const deployFromHostingYml = async (options = {}) => {
|
|
198
199
|
const config = getHostConfig(options);
|
|
199
200
|
setWorkspace(config.workspace);
|
|
200
|
-
ensureWorkspaceEnvForDeploy(config.workspace);
|
|
201
201
|
loadWorkspaceEnv();
|
|
202
202
|
|
|
203
203
|
const hostingConfig = readHostingYml(config.workspace);
|
|
@@ -235,9 +235,16 @@ const deployFromHostingYml = async (options = {}) => {
|
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
const functionConfig = functions[functionName];
|
|
239
|
+
const includeCredsPaths = Array.isArray(functionConfig.include_creds_paths)
|
|
240
|
+
? functionConfig.include_creds_paths
|
|
241
|
+
: undefined;
|
|
242
|
+
|
|
243
|
+
ensureWorkspaceEnvForDeploy(config.workspace, { includeCredsPaths });
|
|
244
|
+
|
|
238
245
|
await deployFunction({
|
|
239
246
|
functionName,
|
|
240
|
-
functionConfig
|
|
247
|
+
functionConfig,
|
|
241
248
|
googleCloudInfo,
|
|
242
249
|
workspace: config.workspace,
|
|
243
250
|
});
|
package/hosting/hosting.utils.js
CHANGED
|
@@ -189,11 +189,12 @@ const readHostingYml = (workspace) => {
|
|
|
189
189
|
return hostingConfig;
|
|
190
190
|
};
|
|
191
191
|
|
|
192
|
-
const ensureWorkspaceEnvForDeploy = (workspace) => {
|
|
192
|
+
const ensureWorkspaceEnvForDeploy = (workspace, options = {}) => {
|
|
193
|
+
const { includeCredsPaths } = options;
|
|
193
194
|
const { copyCredsToEnv } = require('./copyCredsToEnv');
|
|
194
195
|
const envPath = `${ workspace.replace(/\/$/, '') }/.env`;
|
|
195
196
|
|
|
196
|
-
copyCredsToEnv(workspace);
|
|
197
|
+
copyCredsToEnv(workspace, { includeCredsPaths });
|
|
197
198
|
|
|
198
199
|
if (!fs.existsSync(envPath)) {
|
|
199
200
|
throw new Error(`Missing .env in workspace: ${ workspace }`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foxtware/mineral",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"bin": {
|
|
5
5
|
"mineral": "bin/mineral.js"
|
|
6
6
|
},
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
"npm:publish": "node _build_scripts/publish.js"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"@supabase/supabase-js": "^2.55.0",
|
|
23
|
+
"@upstash/redis": "^1.28.4",
|
|
22
24
|
"csvtojson": "^2.0.14",
|
|
23
25
|
"dotenv": "^17.2.0",
|
|
24
26
|
"json-2-csv": "^5.5.9",
|
package/server.utils.js
CHANGED
|
@@ -258,6 +258,7 @@ const funcApi = (func, config = {}) => {
|
|
|
258
258
|
|
|
259
259
|
let callArgs = requestContext.args;
|
|
260
260
|
if (passThroughReq) {
|
|
261
|
+
requestContext.req.body = modifiedBody;
|
|
261
262
|
callArgs = [requestContext.req];
|
|
262
263
|
} else if (passThroughBody) {
|
|
263
264
|
callArgs = [modifiedBody];
|