@liquidmetal-ai/drizzle 0.0.1 → 0.0.3

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.
Files changed (36) hide show
  1. package/.turbo/turbo-lint.log +6 -0
  2. package/dist/appify/index.test.js +1 -1
  3. package/dist/appify/parse.d.ts.map +1 -1
  4. package/dist/appify/parse.js +7 -1
  5. package/dist/appify/parse.test.js +1 -1
  6. package/dist/appify/validate.d.ts.map +1 -1
  7. package/dist/appify/validate.js +15 -4
  8. package/dist/appify/validate.test.js +29 -32
  9. package/dist/codestore.test.js +3 -3
  10. package/dist/liquidmetal/v1alpha1/catalog_connect.d.ts +19 -1
  11. package/dist/liquidmetal/v1alpha1/catalog_connect.d.ts.map +1 -1
  12. package/dist/liquidmetal/v1alpha1/catalog_connect.js +19 -1
  13. package/dist/liquidmetal/v1alpha1/catalog_pb.d.ts +198 -6
  14. package/dist/liquidmetal/v1alpha1/catalog_pb.d.ts.map +1 -1
  15. package/dist/liquidmetal/v1alpha1/catalog_pb.js +320 -10
  16. package/dist/liquidmetal/v1alpha1/rainbow_public_connect.d.ts +26 -0
  17. package/dist/liquidmetal/v1alpha1/rainbow_public_connect.d.ts.map +1 -0
  18. package/dist/liquidmetal/v1alpha1/rainbow_public_connect.js +29 -0
  19. package/dist/liquidmetal/v1alpha1/rainbow_public_pb.d.ts +202 -0
  20. package/dist/liquidmetal/v1alpha1/rainbow_public_pb.d.ts.map +1 -0
  21. package/dist/liquidmetal/v1alpha1/rainbow_public_pb.js +298 -0
  22. package/dist/unsafe/codestore.d.ts.map +1 -1
  23. package/dist/unsafe/codestore.js +12 -2
  24. package/package.json +1 -1
  25. package/src/appify/index.test.ts +1 -1
  26. package/src/appify/parse.test.ts +1 -1
  27. package/src/appify/parse.ts +8 -2
  28. package/src/appify/validate.test.ts +29 -32
  29. package/src/appify/validate.ts +16 -4
  30. package/src/codestore.test.ts +3 -3
  31. package/src/liquidmetal/v1alpha1/catalog_connect.ts +19 -1
  32. package/src/liquidmetal/v1alpha1/catalog_pb.ts +390 -10
  33. package/src/liquidmetal/v1alpha1/rainbow_public_connect.ts +32 -0
  34. package/src/liquidmetal/v1alpha1/rainbow_public_pb.ts +366 -0
  35. package/src/unsafe/codestore.ts +13 -2
  36. package/tsconfig.tsbuildinfo +1 -1
@@ -55,32 +55,32 @@ application "my-app" {
55
55
  ]);
56
56
  });
57
57
 
58
- test('domainValidator', async () => {
59
- const manifest = `
60
- application "my-app" {
61
- service "my-service" {
62
- domain {
63
- fqdn = "not-valid.com_foo"
64
- }
65
- }
66
- }
67
- `;
68
- const tokenizer = new Tokenizer(manifest);
69
- const parser = new Parser(tokenizer);
70
- const parsedManifest = parser.parse();
71
- const [builtApps] = buildManifest(parsedManifest);
72
- const validateErrors = await validate(builtApps, VALIDATORS);
73
- expect(validateErrors).toMatchObject([
74
- {
75
- message: 'domain "not-valid.com_foo" is an invalid domain name',
76
- line: 5,
77
- column: 14,
78
- start: 75,
79
- end: 94,
80
- severity: 'warning',
81
- },
82
- ]);
83
- });
58
+ // test('domainValidator', async () => {
59
+ // const manifest = `
60
+ // application "my-app" {
61
+ // service "my-service" {
62
+ // domain {
63
+ // fqdn = "not-valid.com_foo"
64
+ // }
65
+ // }
66
+ // }
67
+ // `;
68
+ // const tokenizer = new Tokenizer(manifest);
69
+ // const parser = new Parser(tokenizer);
70
+ // const parsedManifest = parser.parse();
71
+ // const [builtApps] = buildManifest(parsedManifest);
72
+ // const validateErrors = await validate(builtApps, VALIDATORS);
73
+ // expect(validateErrors).toMatchObject([
74
+ // {
75
+ // message: 'domain "not-valid.com_foo" is an invalid domain name',
76
+ // line: 5,
77
+ // column: 14,
78
+ // start: 75,
79
+ // end: 94,
80
+ // severity: 'warning',
81
+ // },
82
+ // ]);
83
+ // });
84
84
 
85
85
  test('visibilityValidator', async () => {
86
86
  const manifest = `
@@ -109,8 +109,8 @@ application "my-app" {
109
109
 
110
110
  test('nameValidator', async () => {
111
111
  const manifest = `
112
- application "MyApp" {
113
- service "my-service" {}
112
+ application "My_App" {
113
+ service "my_service" {}
114
114
  }
115
115
  `;
116
116
  const tokenizer = new Tokenizer(manifest);
@@ -121,10 +121,7 @@ application "MyApp" {
121
121
  expect(validateErrors).toMatchObject([
122
122
  {
123
123
  message: 'name must be lowercase and dash-separated',
124
- line: 2,
125
- column: 13,
126
- start: 13,
127
- end: 20,
124
+ line: 3,
128
125
  severity: 'error',
129
126
  },
130
127
  ]);
@@ -203,7 +203,8 @@ const bindingValueValidator: Validator = {
203
203
  },
204
204
  };
205
205
 
206
- const domainValidator: Validator = {
206
+ // Disabled for now.
207
+ const _domainValidator: Validator = {
207
208
  onDomain: async (app: Application, domain: Domain): Promise<ValidationError[]> => {
208
209
  const errors: ValidationError[] = [];
209
210
  if (domain.fqdn === undefined) {
@@ -325,7 +326,7 @@ const visibilityValidator: Validator = {
325
326
  onBucket: visibilityValidatorFn,
326
327
  };
327
328
 
328
- async function nameValidatorFn(app: Application, obj: { name: TokenString }): Promise<ValidationError[]> {
329
+ async function nameValidatorFn(_app: Application, obj: { name: TokenString }): Promise<ValidationError[]> {
329
330
  const errors: ValidationError[] = [];
330
331
  if (!valueOf(obj.name).match(/^[a-z][a-z0-9-]*$/)) {
331
332
  errors.push({
@@ -337,8 +338,20 @@ async function nameValidatorFn(app: Application, obj: { name: TokenString }): Pr
337
338
  return errors;
338
339
  }
339
340
 
341
+ async function applicationNameValidator(_app: Application, obj: { name: TokenString }): Promise<ValidationError[]> {
342
+ const errors: ValidationError[] = [];
343
+ if (!valueOf(obj.name).match(/^[a-zA-Z][a-zA-Z0-9-_]*$/)) {
344
+ errors.push({
345
+ message: `name must be alphanumeric or _, -, and start with a letter`,
346
+ severity: 'error',
347
+ ...obj.name,
348
+ });
349
+ }
350
+ return errors;
351
+ }
352
+
340
353
  const nameValidator: Validator = {
341
- onApplication: nameValidatorFn,
354
+ onApplication: applicationNameValidator,
342
355
  onService: nameValidatorFn,
343
356
  onObserver: nameValidatorFn,
344
357
  onBucket: nameValidatorFn,
@@ -425,7 +438,6 @@ const duplicateModuleValidator: Validator = {
425
438
  export const VALIDATORS: Validator[] = [
426
439
  bindingNameValidator,
427
440
  bindingValueValidator,
428
- domainValidator,
429
441
  envValidator,
430
442
  observerSourceValidator,
431
443
  visibilityValidator,
@@ -55,14 +55,14 @@ test('read file from bundle', async () => {
55
55
 
56
56
  test('read missing file from bundle', async () => {
57
57
  const bundle = new MemoryBundle();
58
- expect(bundle.read('file1.txt')).rejects.toThrowError('File not found: file1.txt');
58
+ await expect(bundle.read('file1.txt')).rejects.toThrowError('File not found: file1.txt');
59
59
  });
60
60
 
61
61
  test('delete file from bundle', async () => {
62
62
  const bundle = new MemoryBundle();
63
63
  await bundle.write('file1.txt', Buffer.from('hello'));
64
64
  await bundle.delete('file1.txt');
65
- expect(bundle.read('file1.txt')).rejects.toThrowError('File not found: file1.txt');
65
+ await expect(bundle.read('file1.txt')).rejects.toThrowError('File not found: file1.txt');
66
66
  });
67
67
 
68
68
  test('for await of bundle', async () => {
@@ -86,7 +86,7 @@ test('stat file from bundle', async () => {
86
86
 
87
87
  test('stat missing file from bundle', async () => {
88
88
  const bundle = new MemoryBundle();
89
- expect(bundle.stat('file1.txt')).rejects.toThrowError('File not found: file1.txt');
89
+ await expect(bundle.stat('file1.txt')).rejects.toThrowError('File not found: file1.txt');
90
90
  });
91
91
 
92
92
  test('hash bundle', async () => {
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
5
 
6
- import { ApplicationsRequest, ApplicationsResponse, BootstrapRequest, BootstrapResponse, CreateApplicationsRequest, CreateApplicationsResponse, CreateVersionRequest, CreateVersionResponse, DeleteApplicationsRequest, DeleteApplicationsResponse, GetEnvRequest, GetEnvResponse, QueryResourcesRequest, QueryResourcesResponse, SetApplicationActiveStatesRequest, SetApplicationActiveStatesResponse, SetEnvRequest, SetEnvResponse, StatBundleRequest, StatBundleResponse, UploadBundleRequest, UploadBundleResponse, VersionsRequest, VersionsResponse } from "./catalog_pb.js";
6
+ import { ApplicationsRequest, ApplicationsResponse, BootstrapRequest, BootstrapResponse, CreateApplicationsRequest, CreateApplicationsResponse, CreateVersionRequest, CreateVersionResponse, DeleteApplicationsRequest, DeleteApplicationsResponse, GetEnvRequest, GetEnvResponse, QueryResourcesRequest, QueryResourcesResponse, SetApplicationActiveStatesRequest, SetApplicationActiveStatesResponse, SetApplicationManifestsRequest, SetApplicationManifestsResponse, SetEnvRequest, SetEnvResponse, SetVersionSandboxStatesRequest, SetVersionSandboxStatesResponse, StatBundleRequest, StatBundleResponse, UploadBundleRequest, UploadBundleResponse, VersionsRequest, VersionsResponse } from "./catalog_pb.js";
7
7
  import { MethodKind } from "@bufbuild/protobuf";
8
8
 
9
9
  /**
@@ -41,6 +41,15 @@ export const CatalogService = {
41
41
  O: CreateVersionResponse,
42
42
  kind: MethodKind.Unary,
43
43
  },
44
+ /**
45
+ * @generated from rpc liquidmetal.v1alpha1.CatalogService.SetVersionSandboxStates
46
+ */
47
+ setVersionSandboxStates: {
48
+ name: "SetVersionSandboxStates",
49
+ I: SetVersionSandboxStatesRequest,
50
+ O: SetVersionSandboxStatesResponse,
51
+ kind: MethodKind.Unary,
52
+ },
44
53
  /**
45
54
  * Applications fetches a list of applications for an organization.
46
55
  * This list follows best practices for pagination.
@@ -81,6 +90,15 @@ export const CatalogService = {
81
90
  O: DeleteApplicationsResponse,
82
91
  kind: MethodKind.Unary,
83
92
  },
93
+ /**
94
+ * @generated from rpc liquidmetal.v1alpha1.CatalogService.SetApplicationManifests
95
+ */
96
+ setApplicationManifests: {
97
+ name: "SetApplicationManifests",
98
+ I: SetApplicationManifestsRequest,
99
+ O: SetApplicationManifestsResponse,
100
+ kind: MethodKind.Unary,
101
+ },
84
102
  /**
85
103
  * UploadBundle uploads a bundle for a specific application version.
86
104
  *