@singi-labs/sifa-sdk 0.19.106 → 0.19.108

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/index.cjs CHANGED
@@ -3798,6 +3798,106 @@ var presentationLinkSchema = zod.z.object({
3798
3798
  label: zod.z.string().max(640).nullable().optional(),
3799
3799
  type: zod.z.string().max(256).nullable().optional()
3800
3800
  });
3801
+ function maxGraphemes(max) {
3802
+ return (value) => {
3803
+ const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
3804
+ let count = 0;
3805
+ for (const _ of segmenter.segment(value)) {
3806
+ count++;
3807
+ if (count > max) return false;
3808
+ }
3809
+ return true;
3810
+ };
3811
+ }
3812
+ var didSchema = zod.z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, "Invalid DID");
3813
+ var datetimeSchema = zod.z.string().datetime({ offset: true });
3814
+ var partialDateSchema = zod.z.string().regex(/^\d{4}(-\d{2}(-\d{2}(T.+)?)?)?$/, "Expected YYYY, YYYY-MM, YYYY-MM-DD, or a datetime");
3815
+ var atUriSchema = zod.z.string().regex(/^at:\/\/[^\s]+$/, "Invalid AT-URI");
3816
+ var cidSchema = zod.z.string().regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, "Invalid CID");
3817
+ var languageTagSchema = zod.z.string().regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, "Invalid BCP 47 language tag");
3818
+ var uriSchema = zod.z.string().url();
3819
+ var strongRefSchema = zod.z.object({
3820
+ uri: atUriSchema,
3821
+ cid: cidSchema
3822
+ });
3823
+ var skillRefSchema2 = zod.z.object({
3824
+ uri: atUriSchema
3825
+ });
3826
+ var externalRecordRefSchema2 = zod.z.object({
3827
+ uri: atUriSchema,
3828
+ cid: cidSchema.optional()
3829
+ });
3830
+ var agentRefSchema = zod.z.object({
3831
+ name: zod.z.string().min(1).refine(maxGraphemes(256)).max(2560),
3832
+ did: didSchema.optional(),
3833
+ entityRef: uriSchema.optional()
3834
+ }).passthrough();
3835
+ var selfLabelsSchema = zod.z.object({
3836
+ $type: zod.z.literal("com.atproto.label.defs#selfLabels").optional(),
3837
+ values: zod.z.array(zod.z.object({ val: zod.z.string() }))
3838
+ });
3839
+
3840
+ // src/schemas/org-profile.ts
3841
+ var orgAddressSchema = zod.z.object({
3842
+ country: zod.z.string().optional(),
3843
+ postalCode: zod.z.string().optional(),
3844
+ region: zod.z.string().optional(),
3845
+ locality: zod.z.string().optional(),
3846
+ street: zod.z.string().optional(),
3847
+ name: zod.z.string().optional()
3848
+ });
3849
+ var orgLinkSchema = zod.z.object({
3850
+ name: zod.z.string().refine(maxGraphemes(60)).max(600),
3851
+ url: uriSchema.max(2048)
3852
+ });
3853
+ var orgNameField = zod.z.string().min(1).refine(maxGraphemes(200)).max(2e3);
3854
+ var orgDescriptionField = zod.z.string().refine(maxGraphemes(5e3)).max(5e4);
3855
+ var orgAliasField = zod.z.string().refine(maxGraphemes(200)).max(2e3);
3856
+ var OrgProfileRecordSchema = zod.z.object({
3857
+ name: orgNameField,
3858
+ description: orgDescriptionField.optional(),
3859
+ /** Blob ref for the org logo (`image/png` | `image/jpeg`). Not deeply validated client-side. */
3860
+ logo: zod.z.unknown().optional(),
3861
+ website: uriSchema.optional(),
3862
+ entityRefs: zod.z.array(uriSchema).max(20).optional(),
3863
+ /** Contact email. NOT rendered publicly; validated as email at the app layer. */
3864
+ contact: zod.z.string().optional(),
3865
+ /** Physical addresses (headquarters, offices). */
3866
+ addresses: zod.z.array(orgAddressSchema).max(10).optional(),
3867
+ /**
3868
+ * Self-selected headcount range (a declared bucket, never a calculated count).
3869
+ * Open enum (bare-string knownValues in the lexicon): `1-10`, `11-50`,
3870
+ * `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000`, `10001+`. Any
3871
+ * string is accepted so future ranges do not break older records.
3872
+ */
3873
+ companySize: zod.z.string().optional(),
3874
+ companyType: zod.z.string().optional(),
3875
+ /** Featured links or content surfaced on the org profile. */
3876
+ links: zod.z.array(orgLinkSchema).max(10).optional(),
3877
+ /**
3878
+ * Self-declared industry/domain pairs (same shape as the person profile's
3879
+ * `industries`). Registry-sourced classifications are layered separately.
3880
+ */
3881
+ industries: zod.z.array(
3882
+ zod.z.object({
3883
+ industry: zod.z.string().max(100),
3884
+ domain: zod.z.string().max(100).optional()
3885
+ })
3886
+ ).max(10).optional(),
3887
+ /** Self-declared founding date: a year (YYYY), month (YYYY-MM), or full date (YYYY-MM-DD). */
3888
+ founded: zod.z.string().max(10).optional(),
3889
+ /** Self-declared alternative names / acronyms ("also known as"). */
3890
+ aliases: zod.z.array(orgAliasField).max(20).optional(),
3891
+ /**
3892
+ * Whether the account holder's personal profile stays visible alongside this
3893
+ * org profile. For sole traders whose personal domain is also their trade
3894
+ * name: one account, two facets, both pages render. Absent or false means the
3895
+ * account presents solely as an organization.
3896
+ */
3897
+ personalProfileVisible: zod.z.boolean().optional(),
3898
+ labels: selfLabelsSchema.optional(),
3899
+ createdAt: datetimeSchema
3900
+ });
3801
3901
  var PresentationDeliveryWriteSchema = zod.z.object({
3802
3902
  presentationRef: externalRecordRefSchema.optional(),
3803
3903
  /**
@@ -3843,44 +3943,6 @@ var PresentationWriteSchema = zod.z.object({
3843
3943
  writeupRef: externalRecordRefSchema.optional(),
3844
3944
  coverImage: BlobRefSchema.nullable().optional()
3845
3945
  });
3846
- function maxGraphemes(max) {
3847
- return (value) => {
3848
- const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
3849
- let count = 0;
3850
- for (const _ of segmenter.segment(value)) {
3851
- count++;
3852
- if (count > max) return false;
3853
- }
3854
- return true;
3855
- };
3856
- }
3857
- var didSchema = zod.z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, "Invalid DID");
3858
- var datetimeSchema = zod.z.string().datetime({ offset: true });
3859
- var partialDateSchema = zod.z.string().regex(/^\d{4}(-\d{2}(-\d{2}(T.+)?)?)?$/, "Expected YYYY, YYYY-MM, YYYY-MM-DD, or a datetime");
3860
- var atUriSchema = zod.z.string().regex(/^at:\/\/[^\s]+$/, "Invalid AT-URI");
3861
- var cidSchema = zod.z.string().regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, "Invalid CID");
3862
- var languageTagSchema = zod.z.string().regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, "Invalid BCP 47 language tag");
3863
- var uriSchema = zod.z.string().url();
3864
- var strongRefSchema = zod.z.object({
3865
- uri: atUriSchema,
3866
- cid: cidSchema
3867
- });
3868
- var skillRefSchema2 = zod.z.object({
3869
- uri: atUriSchema
3870
- });
3871
- var externalRecordRefSchema2 = zod.z.object({
3872
- uri: atUriSchema,
3873
- cid: cidSchema.optional()
3874
- });
3875
- var agentRefSchema = zod.z.object({
3876
- name: zod.z.string().min(1).refine(maxGraphemes(256)).max(2560),
3877
- did: didSchema.optional(),
3878
- entityRef: uriSchema.optional()
3879
- }).passthrough();
3880
- var selfLabelsSchema = zod.z.object({
3881
- $type: zod.z.literal("com.atproto.label.defs#selfLabels").optional(),
3882
- values: zod.z.array(zod.z.object({ val: zod.z.string() }))
3883
- });
3884
3946
 
3885
3947
  // src/import/talks-import-validation.ts
3886
3948
  var PRESENTATION_URL_COLUMNS = ["slides_url", "recording_url", "writeup_url"];
@@ -4963,7 +5025,8 @@ var streamAuthorSchema = zod.z.object({
4963
5025
  var streamThemeSchema = zod.z.object({
4964
5026
  background: rgbColorSchema,
4965
5027
  foreground: rgbColorSchema,
4966
- accent: rgbColorSchema
5028
+ accent: rgbColorSchema,
5029
+ accentForeground: rgbColorSchema.optional()
4967
5030
  });
4968
5031
  var streamMediaResolvedSchema = zod.z.object({
4969
5032
  url: zod.z.string(),
@@ -5411,9 +5474,14 @@ function resolveSourceUrl(item, record) {
5411
5474
  function readTheme(record) {
5412
5475
  const theme = asRecord(record?.publicationTheme ?? record?.theme);
5413
5476
  if (!theme) return void 0;
5414
- const { background, foreground, accent } = theme;
5477
+ const { background, foreground, accent, accentForeground } = theme;
5415
5478
  if (isValidRgbColor(background) && isValidRgbColor(foreground) && isValidRgbColor(accent)) {
5416
- return { background, foreground, accent };
5479
+ return {
5480
+ background,
5481
+ foreground,
5482
+ accent,
5483
+ ...isValidRgbColor(accentForeground) ? { accentForeground } : {}
5484
+ };
5417
5485
  }
5418
5486
  return void 0;
5419
5487
  }
@@ -7001,63 +7069,6 @@ var EndorsementRecordSchema = zod.z.object({
7001
7069
  comment: zod.z.string().refine(maxGraphemes(300)).max(3e3).optional(),
7002
7070
  createdAt: datetimeSchema
7003
7071
  });
7004
- var orgAddressSchema = zod.z.object({
7005
- country: zod.z.string().optional(),
7006
- postalCode: zod.z.string().optional(),
7007
- region: zod.z.string().optional(),
7008
- locality: zod.z.string().optional(),
7009
- street: zod.z.string().optional(),
7010
- name: zod.z.string().optional()
7011
- });
7012
- var orgLinkSchema = zod.z.object({
7013
- name: zod.z.string().refine(maxGraphemes(60)).max(600),
7014
- url: uriSchema.max(2048)
7015
- });
7016
- var OrgProfileRecordSchema = zod.z.object({
7017
- name: zod.z.string().min(1).refine(maxGraphemes(200)).max(2e3),
7018
- description: zod.z.string().refine(maxGraphemes(5e3)).max(5e4).optional(),
7019
- /** Blob ref for the org logo (`image/png` | `image/jpeg`). Not deeply validated client-side. */
7020
- logo: zod.z.unknown().optional(),
7021
- website: uriSchema.optional(),
7022
- entityRefs: zod.z.array(uriSchema).max(20).optional(),
7023
- /** Contact email. NOT rendered publicly; validated as email at the app layer. */
7024
- contact: zod.z.string().optional(),
7025
- /** Physical addresses (headquarters, offices). */
7026
- addresses: zod.z.array(orgAddressSchema).max(10).optional(),
7027
- /**
7028
- * Self-selected headcount range (a declared bucket, never a calculated count).
7029
- * Open enum (bare-string knownValues in the lexicon): `1-10`, `11-50`,
7030
- * `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000`, `10001+`. Any
7031
- * string is accepted so future ranges do not break older records.
7032
- */
7033
- companySize: zod.z.string().optional(),
7034
- companyType: zod.z.string().optional(),
7035
- /** Featured links or content surfaced on the org profile. */
7036
- links: zod.z.array(orgLinkSchema).max(10).optional(),
7037
- /**
7038
- * Self-declared industry/domain pairs (same shape as the person profile's
7039
- * `industries`). Registry-sourced classifications are layered separately.
7040
- */
7041
- industries: zod.z.array(
7042
- zod.z.object({
7043
- industry: zod.z.string().max(100),
7044
- domain: zod.z.string().max(100).optional()
7045
- })
7046
- ).max(10).optional(),
7047
- /** Self-declared founding date: a year (YYYY), month (YYYY-MM), or full date (YYYY-MM-DD). */
7048
- founded: zod.z.string().max(10).optional(),
7049
- /** Self-declared alternative names / acronyms ("also known as"). */
7050
- aliases: zod.z.array(zod.z.string().refine(maxGraphemes(200)).max(2e3)).max(20).optional(),
7051
- /**
7052
- * Whether the account holder's personal profile stays visible alongside this
7053
- * org profile. For sole traders whose personal domain is also their trade
7054
- * name: one account, two facets, both pages render. Absent or false means the
7055
- * account presents solely as an organization.
7056
- */
7057
- personalProfileVisible: zod.z.boolean().optional(),
7058
- labels: selfLabelsSchema.optional(),
7059
- createdAt: datetimeSchema
7060
- });
7061
7072
  var OrgEmploymentAttestationRecordSchema = zod.z.object({
7062
7073
  subject: didSchema,
7063
7074
  position: strongRefSchema.optional(),
@@ -7844,7 +7855,7 @@ function describeSifaRecord(collection, value) {
7844
7855
  }
7845
7856
 
7846
7857
  // src/index.ts
7847
- var SIFA_SDK_VERSION = "0.19.106";
7858
+ var SIFA_SDK_VERSION = "0.19.108";
7848
7859
 
7849
7860
  exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
7850
7861
  exports.ACTIVITY_VERBS = ACTIVITY_VERBS;