@sanity/functions 1.5.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/durables.d.ts +32 -0
- package/dist/{pipelines.js → durables.js} +7 -7
- package/dist/durables.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/invoke.d.ts +22 -0
- package/dist/invoke.js +74 -15
- package/dist/invoke.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +217 -15
- package/package.json +1 -1
- package/src/{pipelines.ts → durables.ts} +20 -23
- package/src/index.ts +1 -1
- package/src/invoke.ts +80 -14
- package/src/types.ts +216 -16
- package/dist/pipelines.d.ts +0 -32
- package/dist/pipelines.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { DurableHandler } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Durables creation function that can be called with or without a config object.
|
|
4
|
+
* @alpha Durables are an experimental feature and may change in the future.
|
|
5
|
+
* @hidden
|
|
6
|
+
* @param handler
|
|
7
|
+
* @returns The handler function, unmodified.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDurable(handler: DurableHandler): DurableHandler & {
|
|
10
|
+
config?: undefined;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Durables creation function that can be called with or without a config object.
|
|
14
|
+
* @alpha Durables are an experimental feature and may change in the future.
|
|
15
|
+
* @hidden
|
|
16
|
+
* @param config
|
|
17
|
+
* @param handler
|
|
18
|
+
* @returns The handler function, unmodified and the provided config object.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createDurable<TConfig extends {
|
|
21
|
+
name: string;
|
|
22
|
+
}>(config: TConfig, handler: DurableHandler): DurableHandler & {
|
|
23
|
+
config: TConfig;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @alpha Durable functions are an experimental feature and may change in the future.
|
|
27
|
+
* @hidden
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
export declare const durable: {
|
|
31
|
+
createDurable: typeof createDurable;
|
|
32
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Determine if `
|
|
2
|
+
* Determine if `createDurable({}, () => {})` or `createDurable(() => {})`.
|
|
3
3
|
* @param configOrHandler
|
|
4
4
|
* @param maybeHandler
|
|
5
5
|
* @returns resolved arguments
|
|
@@ -45,15 +45,15 @@ const validateConfig = (config) => {
|
|
|
45
45
|
return errors;
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @alpha
|
|
48
|
+
* Durables creation function that can be called with or without a config object.
|
|
49
|
+
* @alpha Durable functions are an experimental feature and may change in the future.
|
|
50
50
|
* @hidden
|
|
51
51
|
* @public
|
|
52
52
|
* @param configOrHandler
|
|
53
53
|
* @param maybeHandler
|
|
54
54
|
* @returns The handler function, unmodified and the config object if provided
|
|
55
55
|
*/
|
|
56
|
-
export function
|
|
56
|
+
export function createDurable(configOrHandler, maybeHandler) {
|
|
57
57
|
const { config, handler, hadConfigArg } = resolveFuncArgs(configOrHandler, maybeHandler);
|
|
58
58
|
const errors = [
|
|
59
59
|
...(hadConfigArg ? validateConfig(config) : []),
|
|
@@ -66,9 +66,9 @@ export function createPipeline(configOrHandler, maybeHandler) {
|
|
|
66
66
|
return Object.assign(handler, { config });
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
|
-
* @alpha
|
|
69
|
+
* @alpha Durable functions are an experimental feature and may change in the future.
|
|
70
70
|
* @hidden
|
|
71
71
|
* @public
|
|
72
72
|
*/
|
|
73
|
-
export const
|
|
74
|
-
//# sourceMappingURL=
|
|
73
|
+
export const durable = { createDurable };
|
|
74
|
+
//# sourceMappingURL=durables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durables.js","sourceRoot":"","sources":["../src/durables.ts"],"names":[],"mappings":"AAE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ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/dist/invoke.d.ts
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
import type { FunctionPayload, InvokeOptions } from './types.js';
|
|
2
|
+
/** @internal */
|
|
3
|
+
export declare const MAX_RECURSION_COUNT = 16;
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Generate a short UUID.
|
|
7
|
+
* @param {number} [length] - The length of the UUID to generate.
|
|
8
|
+
* @param {string} [characters] - The characters to use to generate the UUID.
|
|
9
|
+
* @returns {string} The generated UUID.
|
|
10
|
+
*/
|
|
11
|
+
export declare function genID(length?: number, characters?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
* Builds the new lineage token given the existing token.
|
|
15
|
+
* @param {string} name
|
|
16
|
+
* @param {string | undefined} lineage
|
|
17
|
+
* @param {object} options
|
|
18
|
+
* @param {number} options.maxRecursionCount The maximum recursion depth
|
|
19
|
+
* @returns The new lineage token with the count incremented
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildLineageToken(name: string, lineage: string | undefined): string;
|
|
2
22
|
/**
|
|
3
23
|
* Invokes another Sanity Function.
|
|
4
24
|
*
|
|
@@ -6,6 +26,8 @@ import type { FunctionPayload, InvokeOptions } from './types.js';
|
|
|
6
26
|
* event source and nothing is returned. Pass `{sync: true}` to invoke the function and
|
|
7
27
|
* wait for its return value.
|
|
8
28
|
*
|
|
29
|
+
* @alpha Experimental / preview function not ready for use
|
|
30
|
+
* @hidden
|
|
9
31
|
* @param name - Name of the function to invoke
|
|
10
32
|
* @param payload - The `{event, context}` envelope to deliver
|
|
11
33
|
* @param options - Set `sync: true` to wait for and return the function's result
|
package/dist/invoke.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Buffer } from 'node:buffer';
|
|
2
|
+
import crypto from 'node:crypto';
|
|
2
3
|
import { env } from 'node:process';
|
|
3
4
|
let awsPromise;
|
|
4
5
|
const PARTITION_KEY = 'arc-app-res';
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const MAX_RECURSION_COUNT = 16;
|
|
5
8
|
/**
|
|
9
|
+
* @internal
|
|
6
10
|
* lazy load aws-lite
|
|
7
11
|
*/
|
|
8
12
|
function getAwsLite() {
|
|
@@ -20,6 +24,7 @@ function getAwsLite() {
|
|
|
20
24
|
return awsPromise;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
27
|
+
* @internal
|
|
23
28
|
* Gets a specific resource based off of function name
|
|
24
29
|
* @param {string} name
|
|
25
30
|
*/
|
|
@@ -41,33 +46,93 @@ async function getResource(name, aws) {
|
|
|
41
46
|
throw new Error(`Resource record for ${name} is missing resources`);
|
|
42
47
|
return result.Item['resources'];
|
|
43
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
* Generate a short UUID.
|
|
52
|
+
* @param {number} [length] - The length of the UUID to generate.
|
|
53
|
+
* @param {string} [characters] - The characters to use to generate the UUID.
|
|
54
|
+
* @returns {string} The generated UUID.
|
|
55
|
+
*/
|
|
56
|
+
export function genID(length = 32, characters = '23456789abcdefghijklmnopqrstuvwxyz') {
|
|
57
|
+
let result = '';
|
|
58
|
+
const bytes = crypto.randomBytes(length);
|
|
59
|
+
for (let i = 0; i < length; i++) {
|
|
60
|
+
result += characters[bytes[i] % characters.length];
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
* Builds the new lineage token given the existing token.
|
|
67
|
+
* @param {string} name
|
|
68
|
+
* @param {string | undefined} lineage
|
|
69
|
+
* @param {object} options
|
|
70
|
+
* @param {number} options.maxRecursionCount The maximum recursion depth
|
|
71
|
+
* @returns The new lineage token with the count incremented
|
|
72
|
+
*/
|
|
73
|
+
export function buildLineageToken(name, lineage) {
|
|
74
|
+
let recursionCount = 0;
|
|
75
|
+
try {
|
|
76
|
+
if (lineage) {
|
|
77
|
+
// split the token, usually into two parts
|
|
78
|
+
const parts = lineage.trim().split(':');
|
|
79
|
+
if (parts.length > 1) {
|
|
80
|
+
// the current count is in the last part
|
|
81
|
+
const count = parts[parts.length - 1];
|
|
82
|
+
recursionCount = Number.parseInt(count, 10);
|
|
83
|
+
// if parsing didn't work or the value was invalid, reset to 0
|
|
84
|
+
if (Number.isNaN(recursionCount) || recursionCount < 0) {
|
|
85
|
+
recursionCount = 0;
|
|
86
|
+
}
|
|
87
|
+
// this handles whitespace, and also if the first parts of the token contained colons
|
|
88
|
+
lineage = parts.slice(0, -1).join(':');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// ignore
|
|
94
|
+
}
|
|
95
|
+
if (recursionCount >= MAX_RECURSION_COUNT) {
|
|
96
|
+
throw new Error(`Function ${name} exceeded the maximum recursion depth of ${MAX_RECURSION_COUNT}`);
|
|
97
|
+
}
|
|
98
|
+
return `${lineage || genID(32)}:${recursionCount + 1}`;
|
|
99
|
+
}
|
|
44
100
|
export async function invoke(name, payload, options) {
|
|
45
101
|
if (!name)
|
|
46
102
|
throw new Error('Function name was not provided');
|
|
47
103
|
const sync = options?.sync ?? false;
|
|
48
|
-
|
|
104
|
+
// Update lineage or throw error if we exceed the max recursion value
|
|
105
|
+
const outgoingPayload = {
|
|
106
|
+
...payload,
|
|
107
|
+
context: { ...payload.context, lineage: buildLineageToken(name, payload.context?.lineage) },
|
|
108
|
+
};
|
|
109
|
+
const stringPayload = JSON.stringify(outgoingPayload);
|
|
49
110
|
// Check to make sure payload is not over the max we can handle
|
|
50
111
|
checkPayloadSize(stringPayload, sync);
|
|
51
112
|
// Local invoke path for Sanity CLI
|
|
52
|
-
if (
|
|
53
|
-
if (!
|
|
113
|
+
if (outgoingPayload?.context?.local) {
|
|
114
|
+
if (!outgoingPayload?.context?.invoke) {
|
|
54
115
|
throw new Error(`No local invoke handler configured for function: ${name}`);
|
|
55
116
|
}
|
|
56
|
-
return await
|
|
117
|
+
return await outgoingPayload.context.invoke(name, outgoingPayload, options);
|
|
57
118
|
}
|
|
58
119
|
const aws = await getAwsLite();
|
|
59
120
|
if (!aws)
|
|
60
121
|
throw new Error(`Unable to invoke function: ${name}`);
|
|
61
122
|
// Look up the function details
|
|
62
123
|
const resource = await getResource(name, aws);
|
|
124
|
+
const contextResource = payload?.context?.resources?.(name);
|
|
63
125
|
// Synchronous invocation
|
|
64
126
|
if (sync === true) {
|
|
65
|
-
if (!resource.function) {
|
|
127
|
+
if (!resource.function || !contextResource) {
|
|
66
128
|
throw new Error(`Function ${name} cannot be invoked synchronously.`);
|
|
67
129
|
}
|
|
130
|
+
if (contextResource.type !== 'sanity.function.pubsub') {
|
|
131
|
+
throw new Error(`Function ${name} of type ${contextResource.type} cannot be invoked synchronously.`);
|
|
132
|
+
}
|
|
68
133
|
const { Payload, FunctionError } = await aws.Lambda.Invoke({
|
|
69
134
|
FunctionName: resource.function.physicalResourceId,
|
|
70
|
-
Payload:
|
|
135
|
+
Payload: outgoingPayload,
|
|
71
136
|
InvocationType: 'RequestResponse',
|
|
72
137
|
});
|
|
73
138
|
if (FunctionError) {
|
|
@@ -78,30 +143,24 @@ export async function invoke(name, payload, options) {
|
|
|
78
143
|
return Payload;
|
|
79
144
|
}
|
|
80
145
|
// Async invocation by type
|
|
81
|
-
if (resource.topic) {
|
|
146
|
+
if (resource.topic && contextResource?.type === 'sanity.function.pubsub') {
|
|
82
147
|
await aws.SNS.Publish({
|
|
83
148
|
TopicArn: resource.topic.physicalResourceId,
|
|
84
149
|
Message: stringPayload,
|
|
85
150
|
});
|
|
86
151
|
}
|
|
87
|
-
else if (resource.queue) {
|
|
152
|
+
else if (resource.queue && contextResource?.type === 'sanity.function.queue') {
|
|
88
153
|
await aws.SQS.SendMessage({
|
|
89
154
|
MessageBody: stringPayload,
|
|
90
155
|
QueueUrl: resource.queue.physicalResourceId,
|
|
91
156
|
});
|
|
92
157
|
}
|
|
93
|
-
else if (resource.function) {
|
|
94
|
-
await aws.Lambda.Invoke({
|
|
95
|
-
FunctionName: resource.function.physicalResourceId,
|
|
96
|
-
Payload: payload,
|
|
97
|
-
InvocationType: 'Event',
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
158
|
else {
|
|
101
159
|
throw new Error(`No invokeable resource for function: ${name}`);
|
|
102
160
|
}
|
|
103
161
|
return;
|
|
104
162
|
}
|
|
163
|
+
/** @internal */
|
|
105
164
|
function checkPayloadSize(payload, sync) {
|
|
106
165
|
if (sync) {
|
|
107
166
|
if (Buffer.byteLength(payload, 'utf8') > 6 * 1024 * 1024) {
|
package/dist/invoke.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../src/invoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;AAClC,OAAO,EAAC,GAAG,EAAC,MAAM,cAAc,CAAA;AAIhC,IAAI,UAAsD,CAAA;AAE1D,MAAM,aAAa,GAAG,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"invoke.js","sourceRoot":"","sources":["../src/invoke.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;AAClC,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,GAAG,EAAC,MAAM,cAAc,CAAA;AAIhC,IAAI,UAAsD,CAAA;AAE1D,MAAM,aAAa,GAAG,aAAa,CAAA;AACnC,gBAA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