@superblocksteam/shared 0.9556.12 → 0.9558.0
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/README.md +1 -0
- package/dist/bindings/utils.test.js +4 -3
- package/dist/bindings/utils.test.js.map +1 -1
- package/dist/constants.test.js +22 -21
- package/dist/constants.test.js.map +1 -1
- package/dist/dbfs/hashing.d.ts +1 -1
- package/dist/dbfs/hashing.d.ts.map +1 -1
- package/dist/dbfs/hashing.js.map +1 -1
- package/dist/jwt/verifier.test.js +22 -21
- package/dist/jwt/verifier.test.js.map +1 -1
- package/dist/pageMigrations/migrations/v4to5.test.js +31 -30
- package/dist/pageMigrations/migrations/v4to5.test.js.map +1 -1
- package/dist/pageMigrations/migrations/v5to6.test.js +33 -32
- package/dist/pageMigrations/migrations/v5to6.test.js.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.test.js +18 -17
- package/dist/pageMigrations/migrations/v6to7/adjustModalCanvases.test.js.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.test.js +28 -27
- package/dist/pageMigrations/migrations/v6to7/migrateToDimensions.test.js.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/migrateToSections.test.js +22 -21
- package/dist/pageMigrations/migrations/v6to7/migrateToSections.test.js.map +1 -1
- package/dist/pageMigrations/migrations/v6to7/v6to7.test.js +19 -18
- package/dist/pageMigrations/migrations/v6to7/v6to7.test.js.map +1 -1
- package/dist/pageMigrations/migrations/v7to8.test.js +22 -21
- package/dist/pageMigrations/migrations/v7to8.test.js.map +1 -1
- package/dist/plugins/templates/s3.d.ts.map +1 -1
- package/dist/plugins/templates/s3.js +24 -0
- package/dist/plugins/templates/s3.js.map +1 -1
- package/dist/refactoring/refactor.test.js +35 -34
- package/dist/refactoring/refactor.test.js.map +1 -1
- package/dist/signing/JSON/index.test.js +17 -16
- package/dist/signing/JSON/index.test.js.map +1 -1
- package/dist/signing/hashing.d.ts.map +1 -1
- package/dist/signing/hashing.js.map +1 -1
- package/dist/signing/hashing.test.js +18 -17
- package/dist/signing/hashing.test.js.map +1 -1
- package/dist/signing/index.test.js +22 -21
- package/dist/signing/index.test.js.map +1 -1
- package/dist/tracing/errorSanitizer.test.js +80 -79
- package/dist/tracing/errorSanitizer.test.js.map +1 -1
- package/dist/types/api/action.d.ts +5 -1
- package/dist/types/api/action.d.ts.map +1 -1
- package/dist/types/api/action.js.map +1 -1
- package/dist/types/common/file.test.js +10 -9
- package/dist/types/common/file.test.js.map +1 -1
- package/dist/types/datasource/index.test.js +80 -79
- package/dist/types/datasource/index.test.js.map +1 -1
- package/dist/types/organization/agent.test.js +37 -36
- package/dist/types/organization/agent.test.js.map +1 -1
- package/dist/types/page/Dimension.test.js +82 -81
- package/dist/types/page/Dimension.test.js.map +1 -1
- package/dist/utils/apiv2.test.js +37 -37
- package/dist/utils/apiv2.test.js.map +1 -1
- package/dist/utils/configuration.test.js +10 -9
- package/dist/utils/configuration.test.js.map +1 -1
- package/dist/utils/env.test.js +13 -12
- package/dist/utils/env.test.js.map +1 -1
- package/dist/utils/environment.test.js +16 -15
- package/dist/utils/environment.test.js.map +1 -1
- package/dist/utils/page.test.js +8 -7
- package/dist/utils/page.test.js.map +1 -1
- package/dist/utils/string.test.js +24 -23
- package/dist/utils/string.test.js.map +1 -1
- package/dist/utils/tracedEventEmitter.test.js +8 -7
- package/dist/utils/tracedEventEmitter.test.js.map +1 -1
- package/dist/utils/truncate.test.js +9 -8
- package/dist/utils/truncate.test.js.map +1 -1
- package/dist/utils/url.test.js +52 -51
- package/dist/utils/url.test.js.map +1 -1
- package/dist-esm/bindings/utils.test.js +1 -0
- package/dist-esm/bindings/utils.test.js.map +1 -1
- package/dist-esm/constants.test.js +1 -0
- package/dist-esm/constants.test.js.map +1 -1
- package/dist-esm/dbfs/hashing.d.ts +1 -1
- package/dist-esm/dbfs/hashing.d.ts.map +1 -1
- package/dist-esm/dbfs/hashing.js.map +1 -1
- package/dist-esm/jwt/verifier.test.js +2 -1
- package/dist-esm/jwt/verifier.test.js.map +1 -1
- package/dist-esm/pageMigrations/migrations/v4to5.test.js +1 -0
- package/dist-esm/pageMigrations/migrations/v4to5.test.js.map +1 -1
- package/dist-esm/pageMigrations/migrations/v5to6.test.js +1 -0
- package/dist-esm/pageMigrations/migrations/v5to6.test.js.map +1 -1
- package/dist-esm/pageMigrations/migrations/v6to7/adjustModalCanvases.test.js +1 -0
- package/dist-esm/pageMigrations/migrations/v6to7/adjustModalCanvases.test.js.map +1 -1
- package/dist-esm/pageMigrations/migrations/v6to7/migrateToDimensions.test.js +1 -0
- package/dist-esm/pageMigrations/migrations/v6to7/migrateToDimensions.test.js.map +1 -1
- package/dist-esm/pageMigrations/migrations/v6to7/migrateToSections.test.js +1 -0
- package/dist-esm/pageMigrations/migrations/v6to7/migrateToSections.test.js.map +1 -1
- package/dist-esm/pageMigrations/migrations/v6to7/v6to7.test.js +1 -0
- package/dist-esm/pageMigrations/migrations/v6to7/v6to7.test.js.map +1 -1
- package/dist-esm/pageMigrations/migrations/v7to8.test.js +1 -0
- package/dist-esm/pageMigrations/migrations/v7to8.test.js.map +1 -1
- package/dist-esm/plugins/templates/s3.d.ts.map +1 -1
- package/dist-esm/plugins/templates/s3.js +24 -0
- package/dist-esm/plugins/templates/s3.js.map +1 -1
- package/dist-esm/refactoring/refactor.test.js +1 -0
- package/dist-esm/refactoring/refactor.test.js.map +1 -1
- package/dist-esm/signing/JSON/index.test.js +1 -0
- package/dist-esm/signing/JSON/index.test.js.map +1 -1
- package/dist-esm/signing/hashing.d.ts.map +1 -1
- package/dist-esm/signing/hashing.js.map +1 -1
- package/dist-esm/signing/hashing.test.js +1 -0
- package/dist-esm/signing/hashing.test.js.map +1 -1
- package/dist-esm/signing/index.test.js +1 -0
- package/dist-esm/signing/index.test.js.map +1 -1
- package/dist-esm/tracing/errorSanitizer.test.js +1 -0
- package/dist-esm/tracing/errorSanitizer.test.js.map +1 -1
- package/dist-esm/types/api/action.d.ts +5 -1
- package/dist-esm/types/api/action.d.ts.map +1 -1
- package/dist-esm/types/api/action.js.map +1 -1
- package/dist-esm/types/common/file.test.js +1 -0
- package/dist-esm/types/common/file.test.js.map +1 -1
- package/dist-esm/types/datasource/index.test.js +1 -0
- package/dist-esm/types/datasource/index.test.js.map +1 -1
- package/dist-esm/types/organization/agent.test.js +2 -1
- package/dist-esm/types/organization/agent.test.js.map +1 -1
- package/dist-esm/types/page/Dimension.test.js +1 -0
- package/dist-esm/types/page/Dimension.test.js.map +1 -1
- package/dist-esm/utils/apiv2.test.js +3 -3
- package/dist-esm/utils/apiv2.test.js.map +1 -1
- package/dist-esm/utils/configuration.test.js +1 -0
- package/dist-esm/utils/configuration.test.js.map +1 -1
- package/dist-esm/utils/env.test.js +1 -0
- package/dist-esm/utils/env.test.js.map +1 -1
- package/dist-esm/utils/environment.test.js +1 -0
- package/dist-esm/utils/environment.test.js.map +1 -1
- package/dist-esm/utils/page.test.js +1 -0
- package/dist-esm/utils/page.test.js.map +1 -1
- package/dist-esm/utils/string.test.js +1 -0
- package/dist-esm/utils/string.test.js.map +1 -1
- package/dist-esm/utils/tracedEventEmitter.test.js +2 -1
- package/dist-esm/utils/tracedEventEmitter.test.js.map +1 -1
- package/dist-esm/utils/truncate.test.js +1 -0
- package/dist-esm/utils/truncate.test.js.map +1 -1
- package/dist-esm/utils/url.test.js +1 -0
- package/dist-esm/utils/url.test.js.map +1 -1
- package/package.json +11 -19
- package/src/bindings/utils.test.ts +1 -0
- package/src/constants.test.ts +1 -0
- package/src/dbfs/hashing.ts +1 -1
- package/src/jwt/verifier.test.ts +3 -2
- package/src/pageMigrations/migrations/v4to5.test.ts +1 -0
- package/src/pageMigrations/migrations/v5to6.test.ts +1 -0
- package/src/pageMigrations/migrations/v6to7/__snapshots__/v6to7.test.ts.snap +7 -7
- package/src/pageMigrations/migrations/v6to7/adjustModalCanvases.test.ts +1 -0
- package/src/pageMigrations/migrations/v6to7/migrateToDimensions.test.ts +1 -0
- package/src/pageMigrations/migrations/v6to7/migrateToSections.test.ts +1 -0
- package/src/pageMigrations/migrations/v6to7/v6to7.test.ts +1 -0
- package/src/pageMigrations/migrations/v7to8.test.ts +1 -0
- package/src/plugins/templates/s3.ts +24 -0
- package/src/refactoring/refactor.test.ts +1 -0
- package/src/signing/JSON/index.test.ts +1 -0
- package/src/signing/hashing.test.ts +1 -0
- package/src/signing/hashing.ts +1 -1
- package/src/signing/index.test.ts +1 -0
- package/src/tracing/errorSanitizer.test.ts +1 -0
- package/src/types/api/action.ts +5 -1
- package/src/types/common/file.test.ts +1 -0
- package/src/types/datasource/index.test.ts +1 -0
- package/src/types/organization/agent.test.ts +2 -1
- package/src/types/page/Dimension.test.ts +1 -0
- package/src/utils/__snapshots__/page.test.ts.snap +5 -5
- package/src/utils/apiv2.test.ts +3 -3
- package/src/utils/configuration.test.ts +1 -0
- package/src/utils/env.test.ts +1 -0
- package/src/utils/environment.test.ts +1 -0
- package/src/utils/page.test.ts +1 -0
- package/src/utils/string.test.ts +1 -0
- package/src/utils/tracedEventEmitter.test.ts +3 -2
- package/src/utils/truncate.test.ts +1 -0
- package/src/utils/url.test.ts +1 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tokenize } from 'esprima';
|
|
2
|
+
import { describe, it, expect } from 'vitest';
|
|
2
3
|
import { EvaluationPair, extractJsEvaluationPairsWithTokenizer, LanguagePluginID } from '../types/index.js';
|
|
3
4
|
import { refactorNameInCode, refactorNameInString, refactorNameInValue, refactorNameInStep } from './refactor.js';
|
|
4
5
|
|
package/src/signing/hashing.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Base64 } from 'js-base64';
|
|
2
1
|
import { BufferSource } from 'node:stream/web';
|
|
2
|
+
import { Base64 } from 'js-base64';
|
|
3
3
|
|
|
4
4
|
// This module is used by the FE and the BE, so it must be compatible with both.
|
|
5
5
|
// For both sides, we are using the Web Crypto API. This API is supported by all modern browsers, and
|
package/src/types/api/action.ts
CHANGED
|
@@ -300,7 +300,11 @@ export type S3ActionConfiguration = {
|
|
|
300
300
|
path?: string;
|
|
301
301
|
body?: string;
|
|
302
302
|
fileObjects?: unknown;
|
|
303
|
-
custom?:
|
|
303
|
+
custom?: {
|
|
304
|
+
/** Enum name for presigned URL method */
|
|
305
|
+
presignedMethod?: 'PRESIGNED_METHOD_UNSPECIFIED' | 'PRESIGNED_METHOD_GET' | 'PRESIGNED_METHOD_PUT';
|
|
306
|
+
presignedExpiration?: Property;
|
|
307
|
+
};
|
|
304
308
|
responseType?: ActionResponseType;
|
|
305
309
|
listFilesConfig?: {
|
|
306
310
|
// Limits the response to keys that begin with the specified prefix.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
1
2
|
import { compareSemVer } from './agent.js';
|
|
2
3
|
|
|
3
|
-
describe
|
|
4
|
+
describe('compareSemver', () => {
|
|
4
5
|
it('should throw error is one of the versions is a number', () => {
|
|
5
6
|
// @ts-ignore
|
|
6
7
|
expect(() => compareSemVer('1.2.3', 1)).toThrowError('Invalid semver 1.');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
|
-
exports[`page.ts getDefaultLayout snapshot 5
|
|
3
|
+
exports[`page.ts > getDefaultLayout snapshot 5 > 5 1`] = `
|
|
4
4
|
{
|
|
5
5
|
"backgroundColor": "none",
|
|
6
6
|
"bottomRow": 99,
|
|
@@ -20,7 +20,7 @@ exports[`page.ts getDefaultLayout snapshot 5: 5 1`] = `
|
|
|
20
20
|
}
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
|
-
exports[`page.ts getDefaultLayout snapshot 6
|
|
23
|
+
exports[`page.ts > getDefaultLayout snapshot 6 > 6 1`] = `
|
|
24
24
|
{
|
|
25
25
|
"backgroundColor": "none",
|
|
26
26
|
"bottomRow": 99,
|
|
@@ -40,7 +40,7 @@ exports[`page.ts getDefaultLayout snapshot 6: 6 1`] = `
|
|
|
40
40
|
}
|
|
41
41
|
`;
|
|
42
42
|
|
|
43
|
-
exports[`page.ts getDefaultLayout snapshot 7
|
|
43
|
+
exports[`page.ts > getDefaultLayout snapshot 7 > 7 1`] = `
|
|
44
44
|
{
|
|
45
45
|
"apis": {
|
|
46
46
|
"apiMap": {},
|
|
@@ -167,7 +167,7 @@ exports[`page.ts getDefaultLayout snapshot 7: 7 1`] = `
|
|
|
167
167
|
}
|
|
168
168
|
`;
|
|
169
169
|
|
|
170
|
-
exports[`page.ts getDefaultLayout snapshot 8
|
|
170
|
+
exports[`page.ts > getDefaultLayout snapshot 8 > 8 1`] = `
|
|
171
171
|
{
|
|
172
172
|
"apis": {
|
|
173
173
|
"apiMap": {},
|
package/src/utils/apiv2.test.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JsonValue } from '@bufbuild/protobuf';
|
|
2
2
|
import { Api } from '@superblocksteam/types';
|
|
3
3
|
import { cloneDeep } from 'lodash';
|
|
4
|
+
import { describe, it, expect } from 'vitest';
|
|
4
5
|
import { sanitizeV2RequestBody } from './apiv2.js';
|
|
5
6
|
|
|
6
7
|
describe('sanitizeV2RequestBody', () => {
|
|
@@ -82,7 +83,7 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
82
83
|
expect(sanitizeV2RequestBody(apiBody)).toEqual(sanitizedApiBody);
|
|
83
84
|
});
|
|
84
85
|
|
|
85
|
-
it('is able to sanitize null values in DSL', () => {
|
|
86
|
+
it('is able to sanitize null values in DSL', async () => {
|
|
86
87
|
// api that has some null values.
|
|
87
88
|
// protobuf does not support null values, so we need to convert them to ValuePb.fromJson(null)
|
|
88
89
|
const apiBody = {
|
|
@@ -151,8 +152,7 @@ describe('sanitizeV2RequestBody', () => {
|
|
|
151
152
|
return Api.fromJson(apiBody, { ignoreUnknownFields: true });
|
|
152
153
|
}
|
|
153
154
|
// the initial conversion should fail because of the null values
|
|
154
|
-
|
|
155
|
-
expect(toApiPbIgnoreUnknownFields()).rejects.toThrow(
|
|
155
|
+
await expect(toApiPbIgnoreUnknownFields()).rejects.toThrow(
|
|
156
156
|
'cannot decode field api.v1.Trigger.Workflow.Parameters.body from JSON: map value null'
|
|
157
157
|
);
|
|
158
158
|
const sanitizedApiBody = sanitizeV2RequestBody(apiBody) as JsonValue;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cloneDeep } from 'lodash';
|
|
2
|
+
import { describe, test, expect } from 'vitest';
|
|
2
3
|
import { PostgresPlugin, RestApiIntegrationPlugin } from '../plugins/index.js';
|
|
3
4
|
import { PostgresDatasourceConfiguration, Property, RestApiDatasourceConfiguration } from '../types/index.js';
|
|
4
5
|
import { MASKED_SECRET, maskSecrets, unmaskSecrets } from './configuration.js';
|
package/src/utils/env.test.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { describe, test, expect } from 'vitest';
|
|
1
2
|
import { BadRequestError } from '../errors/index.js';
|
|
2
3
|
import { DatasourceEnvironments, ENVIRONMENT_ALL, ENVIRONMENT_PRODUCTION, ENVIRONMENT_STAGING } from '../types/index.js';
|
|
3
4
|
import { checkEnvironment, getDefaultDatasourceEnvironment, getDefaultEnvironment } from './environment.js';
|
package/src/utils/page.test.ts
CHANGED
package/src/utils/string.test.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { trace, Tracer } from '@opentelemetry/api';
|
|
2
|
+
import { vi, describe, it, expect, beforeEach, type MockInstance } from 'vitest';
|
|
2
3
|
import { TracedEventEmitter } from './tracedEventEmitter.js';
|
|
3
4
|
|
|
4
5
|
type EventMap = {
|
|
@@ -10,7 +11,7 @@ class TestEmitter extends TracedEventEmitter<EventMap> {}
|
|
|
10
11
|
describe('TracedEventEmitter', () => {
|
|
11
12
|
let counter: number;
|
|
12
13
|
let listenerFn: (path: string, content: string, bool: boolean) => void;
|
|
13
|
-
let startActiveSpanSpy:
|
|
14
|
+
let startActiveSpanSpy: MockInstance;
|
|
14
15
|
let tracer: Tracer;
|
|
15
16
|
let calledWith: [path: string, content: string, bool: boolean][];
|
|
16
17
|
|
|
@@ -19,7 +20,7 @@ describe('TracedEventEmitter', () => {
|
|
|
19
20
|
calledWith = [];
|
|
20
21
|
// using the real tracer to ensure that things work in reality
|
|
21
22
|
tracer = trace.getTracer('superblocks-test', 'v0');
|
|
22
|
-
startActiveSpanSpy =
|
|
23
|
+
startActiveSpanSpy = vi.spyOn(tracer, 'startActiveSpan');
|
|
23
24
|
|
|
24
25
|
listenerFn = function (a, b, c) {
|
|
25
26
|
calledWith.push([a, b, c]);
|
package/src/utils/url.test.ts
CHANGED